This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[gui] Patch: javax.swing patch: overall
- From: Michael Koch <konqueror at gmx dot de>
- To: java-patches at gcc dot gnu dot org
- Date: Wed, 7 Jul 2004 21:18:38 +0200
- Subject: [gui] Patch: javax.swing patch: overall
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi list,
I just commited the attached patch to do some fixes all over Swing.
Michael
2004-07-07 Michael Koch <konqueror@gmx.de>
* javax/swing/JCheckBox.java: Reformated.
(JCheckBox): Fixed all constructors.
(isBorderPaintedFlat): New method.
(setBorderPaintedFlat): New method.
* javax/swing/JEditorPane.java
(createEditorKitForContentType): Made public.
(scrollToReference): Likewise.
* javax/swing/JTextArea.java
(setLineWrap): Fire property change.
* javax/swing/JToggleButton.java
(JToggleButton): New constructor.
(JToggleButton): Simplified.
* javax/swing/text/AttributeSet.java
(FontAttribute): Renamed from FontCharacterAttribute.
* javax/swing/text/JTextComponent.java
(KeyBinding): Added javadoc.
(JTextComponent): Likewise.
(getAccessibleContext): Fixed javadoc.
* javax/swing/text/View.java
(View): Added javadoc.
* javax/swing/text/TabableView.java: New file.
* Makefile.am: Added javax/swing/text/TabableView.java.
* Makefile.in: Regenerated.
- --
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFA7EyYWSOgCCdjSDsRAlpaAJ9S8fqx77fEGdmO53PXBFdmPlQfCgCeLo2k
hi0n4u59h/fymkhTmIUVSVg=
=m3Sa
-----END PGP SIGNATURE-----
Index: javax/swing/JCheckBox.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/JCheckBox.java,v
retrieving revision 1.3.2.1
diff -u -b -B -r1.3.2.1 JCheckBox.java
--- javax/swing/JCheckBox.java 7 Jun 2004 12:41:08 -0000 1.3.2.1
+++ javax/swing/JCheckBox.java 7 Jul 2004 19:12:06 -0000
@@ -49,43 +49,62 @@
{
private static final long serialVersionUID = -5246739313864538930L;
+ private boolean borderPaintedFlat;
+
public JCheckBox()
{
- this(null, null);
+ super();
}
- public JCheckBox(Action a)
+
+ public JCheckBox(Action action)
{
- this();
- setAction(a);
+ super(action);
}
public JCheckBox(Icon icon)
{
- this(null, icon);
+ super(icon);
+ }
+
+ public JCheckBox(Icon icon, boolean selected)
+ {
+ super(icon, selected);
}
public JCheckBox(String text)
{
- this(text, null);
+ super(text);
+ }
+
+ public JCheckBox(String text, boolean selected)
+ {
+ super(text, selected);
}
public JCheckBox(String text, Icon icon)
{
super(text, icon);
- paint_border = false;
- content_area_filled = false;
}
+ public JCheckBox(String text, Icon icon, boolean selected)
+ {
+ super(text, icon, selected);
+ }
+ /**
+ * Gets the AccessibleContext associated with this JCheckBox.
+ */
public AccessibleContext getAccessibleContext()
{
- //Gets the AccessibleContext associated with this JCheckBox.
return null;
}
+ /**
+ * Returns a string that specifies the name of the L&F class
+ * that renders this component.
+ */
public String getUIClassID()
{
- //Returns a string that specifies the name of the L&F class that renders this component.
return "CheckBoxUI";
}
@@ -93,4 +112,15 @@
{
return "JCheckBox";
}
+
+ public boolean isBorderPaintedFlat()
+ {
+ return borderPaintedFlat;
+ }
+
+ public void setBorderPaintedFlat(boolean newValue)
+ {
+ firePropertyChange("borderPaintedFlat", borderPaintedFlat, newValue);
+ borderPaintedFlat = newValue;
+ }
}
Index: javax/swing/JEditorPane.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/JEditorPane.java,v
retrieving revision 1.5.2.4
diff -u -b -B -r1.5.2.4 JEditorPane.java
--- javax/swing/JEditorPane.java 29 Jun 2004 07:49:10 -0000 1.5.2.4
+++ javax/swing/JEditorPane.java 7 Jul 2004 19:12:06 -0000
@@ -86,7 +86,7 @@
return new DefaultEditorKit();
}
- protected static EditorKit createEditorKitForContentType(String type)
+ public static EditorKit createEditorKitForContentType(String type)
{
return new DefaultEditorKit();
}
@@ -198,7 +198,8 @@
}
/**
- * Make sure that TAB and Shift-TAB events get consumed, so that awt doesn't attempt focus traversal.
+ * Make sure that TAB and Shift-TAB events get consumed,
+ * so that awt doesn't attempt focus traversal.
*/
protected void processKeyEvent(KeyEvent e)
{
@@ -229,16 +230,18 @@
}
/**
- * Replaces the currently selected content with new content represented by the given string.
+ * Replaces the currently selected content with new content represented
+ * by the given string.
*/
public void replaceSelection(String content)
{
}
/**
- * Scrolls the view to the given reference location (that is, the value returned by the UL.getRef method for the URL being displayed).
+ * Scrolls the view to the given reference location (that is, the value
+ * returned by the UL.getRef method for the URL being displayed).
*/
- protected void scrollToReference(String reference)
+ public void scrollToReference(String reference)
{
}
Index: javax/swing/JTextArea.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/JTextArea.java,v
retrieving revision 1.1.2.1
diff -u -b -B -r1.1.2.1 JTextArea.java
--- javax/swing/JTextArea.java 16 Jun 2004 08:20:15 -0000 1.1.2.1
+++ javax/swing/JTextArea.java 7 Jul 2004 19:12:06 -0000
@@ -224,8 +224,9 @@
*
* @param wrapping true to enable line wrapping, false otherwise
*/
- public void setLineWrap(boolean wrapping)
+ public void setLineWrap(boolean flag)
{
- this.wrapping = wrapping;
+ firePropertyChange("lineWrap", wrapping, flag);
+ wrapping = flag;
}
}
Index: javax/swing/JToggleButton.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/JToggleButton.java,v
retrieving revision 1.4.2.2
diff -u -b -B -r1.4.2.2 JToggleButton.java
--- javax/swing/JToggleButton.java 8 Jun 2004 20:48:45 -0000 1.4.2.2
+++ javax/swing/JToggleButton.java 7 Jul 2004 19:12:06 -0000
@@ -81,6 +81,11 @@
this(null, icon);
}
+ public JToggleButton (Icon icon, boolean selected)
+ {
+ this(null, icon, selected);
+ }
+
public JToggleButton(String text)
{
this(text, null);
@@ -88,8 +93,7 @@
public JToggleButton(String text, boolean selected)
{
- this(text, null);
- setSelected(selected);
+ this(text, null, selected);
}
public JToggleButton(String text, Icon icon)
Index: javax/swing/text/AttributeSet.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/text/AttributeSet.java,v
retrieving revision 1.2.8.1
diff -u -b -B -r1.2.8.1 AttributeSet.java
--- javax/swing/text/AttributeSet.java 28 Jun 2004 11:14:07 -0000 1.2.8.1
+++ javax/swing/text/AttributeSet.java 7 Jul 2004 19:12:06 -0000
@@ -49,7 +49,7 @@
{
}
- static interface FontCharacterAttribute
+ static interface FontAttribute
{
}
Index: javax/swing/text/JTextComponent.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/text/JTextComponent.java,v
retrieving revision 1.4.2.14
diff -u -b -B -r1.4.2.14 JTextComponent.java
--- javax/swing/text/JTextComponent.java 30 Jun 2004 19:48:57 -0000 1.4.2.14
+++ javax/swing/text/JTextComponent.java 7 Jul 2004 19:12:08 -0000
@@ -270,6 +270,12 @@
public KeyStroke key;
public String actionName;
+ /**
+ * Creates a new <code>KeyBinding</code> instance.
+ *
+ * @param key a <code>KeyStroke</code> value
+ * @param actionName a <code>String</code> value
+ */
public KeyBinding(KeyStroke key, String actionName)
{
this.key = key;
@@ -291,6 +297,9 @@
private Color selectionColor;
private boolean editable;
+ /**
+ * Creates a new <code>JTextComponent</code> instance.
+ */
public JTextComponent()
{
enableEvents(AWTEvent.KEY_EVENT_MASK);
@@ -310,7 +319,9 @@
}
/**
- * Get the AccessibleContext of this object
+ * Get the <code>AccessibleContext<code> of this object.
+ *
+ * @return an <code>AccessibleContext</code> object
*/
public AccessibleContext getAccessibleContext()
{
Index: javax/swing/text/View.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/text/View.java,v
retrieving revision 1.2.8.2
diff -u -b -B -r1.2.8.2 View.java
--- javax/swing/text/View.java 28 Jun 2004 11:14:07 -0000 1.2.8.2
+++ javax/swing/text/View.java 7 Jul 2004 19:12:08 -0000
@@ -57,6 +57,11 @@
private Element elt;
private View parent;
+ /**
+ * Creates a new <code>View</code> instance.
+ *
+ * @param elem an <code>Element</code> value
+ */
public View(Element elem)
{
elt = elem;
Index: javax/swing/text/TabableView.java
===================================================================
RCS file: javax/swing/text/TabableView.java
diff -N javax/swing/text/TabableView.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ javax/swing/text/TabableView.java 7 Jul 2004 19:12:08 -0000
@@ -0,0 +1,44 @@
+/* TabableView.java --
+ Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.swing.text;
+
+public interface TabableView
+{
+ float getPartialSpan(int p0, int p1);
+ float getTabbedSpan(float x, TabExpander expander);
+}
Index: Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libjava/Makefile.am,v
retrieving revision 1.361.2.23
diff -u -b -B -r1.361.2.23 Makefile.am
--- Makefile.am 29 Jun 2004 11:30:46 -0000 1.361.2.23
+++ Makefile.am 7 Jul 2004 19:12:10 -0000
@@ -1513,6 +1513,7 @@
javax/swing/text/Position.java \
javax/swing/text/Segment.java \
javax/swing/text/Style.java \
+javax/swing/text/TabableView.java \
javax/swing/text/TabExpander.java \
javax/swing/text/View.java \
javax/swing/text/ViewFactory.java \
Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/libjava/Makefile.in,v
retrieving revision 1.385.2.23
diff -u -b -B -r1.385.2.23 Makefile.in
--- Makefile.in 29 Jun 2004 11:30:47 -0000 1.385.2.23
+++ Makefile.in 7 Jul 2004 19:12:10 -0000
@@ -1191,6 +1191,7 @@
javax/swing/text/Position.java \
javax/swing/text/Segment.java \
javax/swing/text/Style.java \
+javax/swing/text/TabableView.java \
javax/swing/text/TabExpander.java \
javax/swing/text/View.java \
javax/swing/text/ViewFactory.java \
@@ -3254,9 +3255,9 @@
javax/swing/text/LayeredHighlighter.lo \
javax/swing/text/PlainDocument.lo javax/swing/text/PlainView.lo \
javax/swing/text/Position.lo javax/swing/text/Segment.lo \
-javax/swing/text/Style.lo javax/swing/text/TabExpander.lo \
-javax/swing/text/View.lo javax/swing/text/ViewFactory.lo \
-javax/swing/text/MutableAttributeSet.lo \
+javax/swing/text/Style.lo javax/swing/text/TabableView.lo \
+javax/swing/text/TabExpander.lo javax/swing/text/View.lo \
+javax/swing/text/ViewFactory.lo javax/swing/text/MutableAttributeSet.lo \
javax/swing/text/NavigationFilter.lo javax/swing/text/StyledDocument.lo \
javax/swing/text/StyledEditorKit.lo javax/swing/text/TextAction.lo \
javax/swing/text/html/HTML.lo \
@@ -5339,6 +5340,7 @@
.deps/javax/swing/text/StyledDocument.P \
.deps/javax/swing/text/StyledEditorKit.P \
.deps/javax/swing/text/TabExpander.P \
+.deps/javax/swing/text/TabableView.P \
.deps/javax/swing/text/TextAction.P .deps/javax/swing/text/View.P \
.deps/javax/swing/text/ViewFactory.P .deps/javax/swing/text/html/HTML.P \
.deps/javax/swing/text/html/parser/ParserDelegator.P \