[Patch][gui] javax.swing - modifier cleanup

Michael Koch konqueror@gmx.de
Fri Oct 22 17:45:00 GMT 2004


Hi list,


I just commited the attached patch to cleanup modifier usage in Swing.


Michael


2004-10-22  Michael Koch  <konqueror@gmx.de>

	* javax/swing/JWindow.java
	javax/swing/SpinnerModel.java
	javax/swing/Timer.java
	javax/swing/event/MenuKeyEvent.java
	javax/swing/plaf/basic/BasicButtonUI.java
	javax/swing/plaf/basic/BasicIconFactory.java
	javax/swing/plaf/basic/BasicTabbedPaneUI.java
	javax/swing/text/AttributeSet.java
	javax/swing/text/Highlighter.java
	javax/swing/text/StyleConstants.java
	javax/swing/tree/TreeCellEditor.java:
	Removed redundant and reordered modifiers.

-------------- next part --------------
Index: javax/swing/JWindow.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/JWindow.java,v
retrieving revision 1.3.18.7
diff -u -r1.3.18.7 JWindow.java
--- javax/swing/JWindow.java	30 Jun 2004 20:47:51 -0000	1.3.18.7
+++ javax/swing/JWindow.java	22 Oct 2004 17:43:19 -0000
@@ -62,10 +62,10 @@
 {
   private static final long serialVersionUID = 5420698392125238833L;
   
-    public final static int HIDE_ON_CLOSE        = 0;
-    public final static int EXIT_ON_CLOSE        = 1;
-    public final static int DISPOSE_ON_CLOSE     = 2;
-    public final static int DO_NOTHING_ON_CLOSE  = 3;
+  public static final int HIDE_ON_CLOSE = 0;
+  public static final int EXIT_ON_CLOSE = 1;
+  public static final int DISPOSE_ON_CLOSE = 2;
+  public static final int DO_NOTHING_ON_CLOSE  = 3;
 
     protected  AccessibleContext accessibleContext;
 
Index: javax/swing/SpinnerModel.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/SpinnerModel.java,v
retrieving revision 1.2.14.1
diff -u -r1.2.14.1 SpinnerModel.java
--- javax/swing/SpinnerModel.java	23 Sep 2004 18:29:14 -0000	1.2.14.1
+++ javax/swing/SpinnerModel.java	22 Oct 2004 17:43:19 -0000
@@ -1,5 +1,5 @@
 /* SpinnerModel.java -- 
-   Copyright (C) 2003 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -45,7 +45,6 @@
  */
 public interface SpinnerModel
 {
-
   /**
    * Sets the current value of the model to that specified.
    * Implementations can choose to refuse to accept the value
@@ -68,7 +67,7 @@
    *
    * @return The current value.
    */
-  public Object getValue();
+  Object getValue();
 
   /**
    * Returns the next value from the model.  If the model is bounded,
@@ -78,7 +77,7 @@
    * @return The next value, or null if there are no more values
    *         to retrieve.
    */
-  public Object getNextValue();
+  Object getNextValue();
 
   /**
    * Returns the previous value from the model.  If the model is
@@ -88,7 +87,7 @@
    * @return The previous value, or null if there are no more
    *         values to retrieve.
    */
-  public Object getPreviousValue();
+  Object getPreviousValue();
 
   /**
    * Adds a <code>ChangeListener</code> to the list of registered
Index: javax/swing/Timer.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/Timer.java,v
retrieving revision 1.3.18.11
diff -u -r1.3.18.11 Timer.java
--- javax/swing/Timer.java	22 Oct 2004 12:41:18 -0000	1.3.18.11
+++ javax/swing/Timer.java	22 Oct 2004 17:43:20 -0000
@@ -41,12 +41,7 @@
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.io.Serializable;
-import java.util.Comparator;
 import java.util.EventListener;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.TreeSet;
 
 import javax.swing.event.EventListenerList;
 
Index: javax/swing/event/MenuKeyEvent.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/event/MenuKeyEvent.java,v
retrieving revision 1.1
diff -u -r1.1 MenuKeyEvent.java
--- javax/swing/event/MenuKeyEvent.java	9 Aug 2002 04:26:11 -0000	1.1
+++ javax/swing/event/MenuKeyEvent.java	22 Oct 2004 17:43:20 -0000
@@ -1,5 +1,5 @@
 /* MenuKeyEvent.java --
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -35,11 +35,12 @@
 obligated to do so.  If you do not wish to do so, delete this
 exception statement from your version. */
 
+
 package javax.swing.event;
 
-// Imports
 import java.awt.Component;
 import java.awt.event.KeyEvent;
+
 import javax.swing.MenuElement;
 import javax.swing.MenuSelectionManager;
 
Index: javax/swing/plaf/basic/BasicButtonUI.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/plaf/basic/BasicButtonUI.java,v
retrieving revision 1.6.2.10
diff -u -r1.6.2.10 BasicButtonUI.java
--- javax/swing/plaf/basic/BasicButtonUI.java	22 Oct 2004 12:41:21 -0000	1.6.2.10
+++ javax/swing/plaf/basic/BasicButtonUI.java	22 Oct 2004 17:43:20 -0000
@@ -202,7 +202,7 @@
     return d;
   }
 
-  static private Icon currentIcon(AbstractButton b)
+  private static Icon currentIcon(AbstractButton b)
   {
     Icon i = b.getIcon();
     ButtonModel model = b.getModel();
Index: javax/swing/plaf/basic/BasicIconFactory.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/plaf/basic/BasicIconFactory.java,v
retrieving revision 1.3.2.4
diff -u -r1.3.2.4 BasicIconFactory.java
--- javax/swing/plaf/basic/BasicIconFactory.java	22 Oct 2004 12:41:22 -0000	1.3.2.4
+++ javax/swing/plaf/basic/BasicIconFactory.java	22 Oct 2004 17:43:20 -0000
@@ -56,7 +56,7 @@
 {
   static final long serialVersionUID = 5605588811185324383L;
 
-  static private class DummyIcon 
+  private static class DummyIcon 
     implements Icon
   {    
     public int getIconHeight() { return 10; }
Index: javax/swing/plaf/basic/BasicTabbedPaneUI.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java,v
retrieving revision 1.3.16.13
diff -u -r1.3.16.13 BasicTabbedPaneUI.java
--- javax/swing/plaf/basic/BasicTabbedPaneUI.java	22 Oct 2004 12:41:25 -0000	1.3.16.13
+++ javax/swing/plaf/basic/BasicTabbedPaneUI.java	22 Oct 2004 17:43:20 -0000
@@ -28,7 +28,7 @@
 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 of7 the license of that
+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
Index: javax/swing/text/AttributeSet.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/text/AttributeSet.java,v
retrieving revision 1.2.8.3
diff -u -r1.2.8.3 AttributeSet.java
--- javax/swing/text/AttributeSet.java	10 Aug 2004 23:24:26 -0000	1.2.8.3
+++ javax/swing/text/AttributeSet.java	22 Oct 2004 17:43:20 -0000
@@ -57,8 +57,8 @@
   {
   }
 
-  static Object NameAttribute = StyleConstants.NameAttribute;
-  static Object ResolveAttribute = StyleConstants.ResolveAttribute;
+  Object NameAttribute = StyleConstants.NameAttribute;
+  Object ResolveAttribute = StyleConstants.ResolveAttribute;
 
   boolean containsAttribute(Object name, Object value);
   boolean containsAttributes(AttributeSet attributes);
Index: javax/swing/text/Highlighter.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/text/Highlighter.java,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 Highlighter.java
--- javax/swing/text/Highlighter.java	18 Jun 2004 15:00:37 -0000	1.1.2.1
+++ javax/swing/text/Highlighter.java	22 Oct 2004 17:43:20 -0000
@@ -55,8 +55,7 @@
 
   public interface HighlightPainter
   {
-    public void paint(Graphics g, int p0, int p1, Shape bounds,
-		      JTextComponent c);
+    void paint(Graphics g, int p0, int p1, Shape bounds, JTextComponent c);
   }
   
   void install(JTextComponent c);
Index: javax/swing/text/StyleConstants.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/text/StyleConstants.java,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 StyleConstants.java
--- javax/swing/text/StyleConstants.java	22 Oct 2004 12:41:28 -0000	1.1.2.2
+++ javax/swing/text/StyleConstants.java	22 Oct 2004 17:43:20 -0000
@@ -45,8 +45,45 @@
 
 public class StyleConstants
 {
+  public static final int ALIGN_LEFT = 0;
+  public static final int ALIGN_CENTER = 1;
+  public static final int ALIGN_RIGHT = 2;
+  public static final int ALIGN_JUSTIFIED = 3;
+
+  public static final Object Background = CharacterConstants.Background;
+  public static final Object BidiLevel = CharacterConstants.BidiLevel;
+  public static final Object Bold = CharacterConstants.Bold;
+  public static final Object ComponentAttribute = CharacterConstants.ComponentAttribute;
+  public static final Object FontFamily = CharacterConstants.Family;
+  public static final Object FontSize = CharacterConstants.Size;
+  public static final Object Foreground = CharacterConstants.Foreground;
+  public static final Object IconAttribute = CharacterConstants.IconAttribute;
+  public static final Object Italic = CharacterConstants.Italic;
+  public static final Object StrikeThrough = CharacterConstants.StrikeThrough;
+  public static final Object Subscript = CharacterConstants.Subscript;
+  public static final Object Superscript = CharacterConstants.Superscript;
+  public static final Object Underline = CharacterConstants.Underline;
+
+  public static final Object Alignment = ParagraphConstants.Alignment;
+  public static final Object FirstLineIndent = ParagraphConstants.FirstLineIndent;
+  public static final Object LeftIndent = ParagraphConstants.LeftIndent;
+  public static final Object LineSpacing = ParagraphConstants.LineSpacing;
+  public static final Object Orientation = ParagraphConstants.Orientation;
+  public static final Object RightIndent = ParagraphConstants.RightIndent;
+  public static final Object SpaceAbove = ParagraphConstants.SpaceAbove;
+  public static final Object SpaceBelow = ParagraphConstants.SpaceBelow;
+  public static final Object TabSet = ParagraphConstants.TabSet;
+
+  public static final String ComponentElementName = "component";
+  public static final String IconElementName = "icon";
+
+  public static final Object ComposedTextAttribute = new StyleConstants("composed text");
+  public static final Object ModelAttribute = new StyleConstants("model");
+  public static final Object NameAttribute = new StyleConstants("name");
+  public static final Object ResolveAttribute = new StyleConstants("resolver");
 
   String keyname;
+  
   private StyleConstants(String k) 
   {
     keyname = k;
@@ -57,43 +94,6 @@
     return keyname;
   }
 
-  public static int ALIGN_CENTER;
-  public static int ALIGN_JUSTIFIED;
-  public static int ALIGN_LEFT;
-  public static int ALIGN_RIGHT;
-
-  public static Object Background = CharacterConstants.Background;
-  public static Object BidiLevel = CharacterConstants.BidiLevel;
-  public static Object Bold = CharacterConstants.Bold;
-  public static Object ComponentAttribute = CharacterConstants.ComponentAttribute;
-  public static Object FontFamily = CharacterConstants.Family;
-  public static Object FontSize = CharacterConstants.Size;
-  public static Object Foreground = CharacterConstants.Foreground;
-  public static Object IconAttribute = CharacterConstants.IconAttribute;
-  public static Object Italic = CharacterConstants.Italic;
-  public static Object StrikeThrough = CharacterConstants.StrikeThrough;
-  public static Object Subscript = CharacterConstants.Subscript;
-  public static Object Superscript = CharacterConstants.Superscript;
-  public static Object Underline = CharacterConstants.Underline;
-
-  public static Object Alignment = ParagraphConstants.Alignment;
-  public static Object FirstLineIndent = ParagraphConstants.FirstLineIndent;
-  public static Object LeftIndent = ParagraphConstants.LeftIndent;
-  public static Object LineSpacing = ParagraphConstants.LineSpacing;
-  public static Object Orientation = ParagraphConstants.Orientation;
-  public static Object RightIndent = ParagraphConstants.RightIndent;
-  public static Object SpaceAbove = ParagraphConstants.SpaceAbove;
-  public static Object SpaceBelow = ParagraphConstants.SpaceBelow;
-  public static Object TabSet = ParagraphConstants.TabSet;
-
-  public static String ComponentElementName = new String("component");
-  public static String IconElementName = new String("icon");
-
-  public static Object ComposedTextAttribute = new StyleConstants("composed text");
-  public static Object ModelAttribute = new StyleConstants("model");
-  public static Object NameAttribute = new StyleConstants("name");
-  public static Object ResolveAttribute = new StyleConstants("resolver");
-
   public static int getAlignment(AttributeSet a)
   {
     if (a.isDefined(Alignment))
Index: javax/swing/tree/TreeCellEditor.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/tree/TreeCellEditor.java,v
retrieving revision 1.3
diff -u -r1.3 TreeCellEditor.java
--- javax/swing/tree/TreeCellEditor.java	12 Oct 2003 13:33:32 -0000	1.3
+++ javax/swing/tree/TreeCellEditor.java	22 Oct 2004 17:43:20 -0000
@@ -1,5 +1,5 @@
 /* TreeCellEditor.java --
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -39,6 +39,7 @@
 package javax.swing.tree;
 
 import java.awt.Component;
+
 import javax.swing.JTree;
 
 /**


More information about the Java-patches mailing list