harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r479164 - in /harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing: AbstractButton.java CellRendererPane.java ComponentInputMap.java DebugGraphics.java DefaultBoundedRangeModel.java DefaultButtonModel.java
Date Sat, 25 Nov 2006 18:55:46 GMT
Author: ndbeyer
Date: Sat Nov 25 10:55:45 2006
New Revision: 479164

URL: http://svn.apache.org/viewvc?view=rev&rev=479164
Log:
Cleanup
* add missing annotations
* add serialVersionUID fields and comments
* format code


Modified:
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/AbstractButton.java
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/CellRendererPane.java
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/ComponentInputMap.java
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DebugGraphics.java
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultBoundedRangeModel.java
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultButtonModel.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/AbstractButton.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/AbstractButton.java?view=diff&rev=479164&r1=479163&r2=479164
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/AbstractButton.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/AbstractButton.java Sat Nov 25 10:55:45 2006
@@ -51,13 +51,21 @@
 import org.apache.harmony.x.swing.StringConstants;
 import org.apache.harmony.x.swing.Utilities;
 
-
-public abstract class AbstractButton extends JComponent implements ItemSelectable, SwingConstants {
-
-    protected abstract class AccessibleAbstractButton extends AccessibleJComponent
-                    implements AccessibleAction, AccessibleValue, AccessibleText,
-                    AccessibleExtendedComponent, Serializable {
-
+/**
+ * <p>
+ * <i>AbstractButton</i>
+ * </p>
+ * <h3>Implementation Notes:</h3>
+ * <ul>
+ * <li>The <code>serialVersionUID</code> fields are explicitly declared as a performance
+ * optimization, not as guarantee of serialization compatibility.</li>
+ * </ul>
+ */
+public abstract class AbstractButton extends JComponent implements ItemSelectable,
+        SwingConstants {
+    protected abstract class AccessibleAbstractButton extends AccessibleJComponent implements
+            AccessibleAction, AccessibleValue, AccessibleText, AccessibleExtendedComponent,
+            Serializable {
         @Override
         public AccessibleKeyBinding getAccessibleKeyBinding() {
             return null;
@@ -71,6 +79,7 @@
         public String getToolTipText() {
             return AbstractButton.this.getToolTipText();
         }
+
         @Override
         public AccessibleValue getAccessibleValue() {
             return this;
@@ -102,16 +111,15 @@
             if (isSelected()) {
                 set.add(AccessibleState.CHECKED);
             }
-
             return set;
         }
 
         @Override
         public AccessibleIcon[] getAccessibleIcon() {
             if (icon != null && icon instanceof ImageIcon) {
-                return new AccessibleIcon[] { (AccessibleIcon)((ImageIcon)icon).getAccessibleContext() };
+                return new AccessibleIcon[] { (AccessibleIcon) ((ImageIcon) icon)
+                        .getAccessibleContext() };
             }
-
             return null;
         }
 
@@ -120,19 +128,17 @@
             return this;
         }
 
-        public boolean doAccessibleAction(final int index) {
+        public boolean doAccessibleAction(int index) {
             if (0 <= index && index < getAccessibleActionCount()) {
                 return true;
             }
-
             return false;
         }
 
-        public String getAccessibleActionDescription(final int index) {
+        public String getAccessibleActionDescription(int index) {
             if (0 <= index && index < getAccessibleActionCount()) {
                 return "click";
             }
-
             return null;
         }
 
@@ -148,7 +154,7 @@
             return new Integer(0);
         }
 
-        public boolean setCurrentAccessibleValue(final Number value) {
+        public boolean setCurrentAccessibleValue(Number value) {
             boolean valueSet = (value.intValue() == 0) ? false : true;
             if (valueSet != isSelected()) {
                 setSelected(valueSet);
@@ -160,7 +166,6 @@
                     firePropertyChange("AccessibleValue", new Integer(1), new Integer(0));
                 }
             }
-
             return true;
         }
 
@@ -181,11 +186,11 @@
             return -1;
         }
 
-        public int getIndexAtPoint(final Point point) {
+        public int getIndexAtPoint(Point point) {
             return -1;
         }
 
-        public Rectangle getCharacterBounds(final int arg0) {
+        public Rectangle getCharacterBounds(int arg0) {
             return null;
         }
 
@@ -193,81 +198,111 @@
             return null;
         }
 
-        public String getAfterIndex(final int part, final int index) {
+        public String getAfterIndex(int part, int index) {
             return null;
         }
 
-        public String getAtIndex(final int part, final int index) {
+        public String getAtIndex(int part, int index) {
             return null;
         }
 
-        public String getBeforeIndex(final int part, final int index) {
+        public String getBeforeIndex(int part, int index) {
             return null;
         }
 
-        public AttributeSet getCharacterAttribute(final int index) {
+        public AttributeSet getCharacterAttribute(int index) {
             return null;
         }
     };
 
     protected class ButtonChangeListener implements ChangeListener, Serializable {
+        private static final long serialVersionUID = 1L;
+
         private ButtonChangeListener() {
         }
 
-        public void stateChanged(final ChangeEvent event) {
+        public void stateChanged(ChangeEvent event) {
             int mn = model.getMnemonic();
             updateMnemonic(mn, Utilities.keyCodeToKeyChar(mn));
             fireStateChanged();
         }
     };
 
-    final class ActionAndModelListener implements ItemListener, ActionListener, PropertyChangeListener, Serializable {
-        public void itemStateChanged(final ItemEvent event) {
+    private final class ActionAndModelListener implements ItemListener, ActionListener,
+            PropertyChangeListener, Serializable {
+        private static final long serialVersionUID = 1L;
+
+        public void itemStateChanged(ItemEvent event) {
             fireItemStateChanged(event);
         }
 
-        public void actionPerformed(final ActionEvent event) {
+        public void actionPerformed(ActionEvent event) {
             fireActionPerformed(event);
         }
 
-        public void propertyChange(final PropertyChangeEvent event) {
-            configurePropertyFromAction((Action)event.getSource(), event.getPropertyName());
+        public void propertyChange(PropertyChangeEvent event) {
+            configurePropertyFromAction((Action) event.getSource(), event.getPropertyName());
         }
     };
 
     public static final String MODEL_CHANGED_PROPERTY = "model";
+
     public static final String TEXT_CHANGED_PROPERTY = "text";
+
     public static final String MNEMONIC_CHANGED_PROPERTY = "mnemonic";
+
     public static final String MARGIN_CHANGED_PROPERTY = "margin";
+
     public static final String VERTICAL_ALIGNMENT_CHANGED_PROPERTY = "verticalAlignment";
+
     public static final String HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY = "horizontalAlignment";
+
     public static final String VERTICAL_TEXT_POSITION_CHANGED_PROPERTY = "verticalTextPosition";
+
     public static final String HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY = "horizontalTextPosition";
+
     public static final String BORDER_PAINTED_CHANGED_PROPERTY = "borderPainted";
+
     public static final String FOCUS_PAINTED_CHANGED_PROPERTY = "focusPainted";
+
     public static final String ROLLOVER_ENABLED_CHANGED_PROPERTY = "rolloverEnabled";
+
     public static final String CONTENT_AREA_FILLED_CHANGED_PROPERTY = "contentAreaFilled";
+
     public static final String ICON_CHANGED_PROPERTY = "icon";
+
     public static final String PRESSED_ICON_CHANGED_PROPERTY = "pressedIcon";
+
     public static final String SELECTED_ICON_CHANGED_PROPERTY = "selectedIcon";
+
     public static final String ROLLOVER_ICON_CHANGED_PROPERTY = "rolloverIcon";
+
     public static final String ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY = "rolloverSelectedIcon";
+
     public static final String DISABLED_ICON_CHANGED_PROPERTY = "disabledIcon";
+
     public static final String DISABLED_SELECTED_ICON_CHANGED_PROPERTY = "disabledSelectedIcon";
 
-    private static final Object ALL_ACTION_PROPERTIES = new Object() {  //$NON-LOCK-1$
+    private static final Object ALL_ACTION_PROPERTIES = new Object() { // $NON-LOCK-1$
         @Override
-        public boolean equals(final Object o) {
+        public boolean equals(Object o) {
             return true;
         }
     };
 
     private static final Action CLEAR_ACTION_PROPERTIES = new AbstractAction() {
-        public void actionPerformed(final ActionEvent e) {}
+        private static final long serialVersionUID = 1L;
+
+        public void actionPerformed(ActionEvent e) {
+        }
+
         @Override
-        public void putValue(final String name, final Object value) {}
+        public void putValue(String name, Object value) {
+        }
+
         @Override
-        public void setEnabled(final boolean enabled) {}
+        public void setEnabled(boolean enabled) {
+        }
     };
 
     protected transient ChangeEvent changeEvent = new ChangeEvent(this);
@@ -275,42 +310,64 @@
     protected ButtonModel model;
 
     protected ChangeListener changeListener = createChangeListener();
+
     protected ActionListener actionListener = createActionListener();
+
     protected ItemListener itemListener = createItemListener();
 
     private PropertyChangeListener actionPropertyChangeListener;
+
     private ActionAndModelListener handler;
 
     private String text = "";
+
     private Insets margin;
+
     private Action action;
 
     private Icon icon;
+
     private Icon pressedIcon;
+
     private Icon disabledIcon;
+
     private Icon defaultDisabledIcon;
+
     private Icon selectedIcon;
+
     private Icon disabledSelectedIcon;
+
     private Icon defaultDisabledSelectedIcon;
+
     private Icon rolloverIcon;
+
     private Icon rolloverSelectedIcon;
 
     private boolean borderPainted = true;
+
     private boolean focusPainted = true;
+
     private boolean rolloverEnabled;
+
     private boolean contentAreaFilled = true;
 
     private int verticalAlignment = SwingConstants.CENTER;
+
     private int horizontalAlignment = SwingConstants.CENTER;
+
     private int verticalTextPosition = SwingConstants.CENTER;
+
     private int horizontalTextPosition = SwingConstants.TRAILING;
 
     private int iconTextGap = 4;
+
     private int mnemonic;
+
     private int mnemonicIndex = -1;
+
     private long multiClickThreshhold;
 
-    protected void init(final String text, final Icon icon) {
+    protected void init(String text, Icon icon) {
         if (text != null) {
             setText(text);
         }
@@ -320,23 +377,23 @@
         updateUI();
     }
 
-    protected PropertyChangeListener createActionPropertyChangeListener(final Action action) {
+    protected PropertyChangeListener createActionPropertyChangeListener(Action action) {
         return (handler != null) ? handler : (handler = new ActionAndModelListener());
     }
 
-    public void setUI(final ButtonUI ui) {
+    public void setUI(ButtonUI ui) {
         super.setUI(ui);
     }
 
     public ButtonUI getUI() {
-        return (ButtonUI)ui;
+        return (ButtonUI) ui;
     }
 
-    public void removeChangeListener(final ChangeListener listener) {
+    public void removeChangeListener(ChangeListener listener) {
         listenerList.remove(ChangeListener.class, listener);
     }
 
-    public void addChangeListener(final ChangeListener listener) {
+    public void addChangeListener(ChangeListener listener) {
         listenerList.add(ChangeListener.class, listener);
     }
 
@@ -348,23 +405,24 @@
         return new ButtonChangeListener();
     }
 
-    public void setSelectedIcon(final Icon selectedIcon) {
+    public void setSelectedIcon(Icon selectedIcon) {
         Icon oldValue = this.selectedIcon;
         this.selectedIcon = selectedIcon;
         resetDefaultDisabledIcons();
         firePropertyChange(SELECTED_ICON_CHANGED_PROPERTY, oldValue, selectedIcon);
     }
 
-    public void setRolloverSelectedIcon(final Icon rolloverSelectedIcon) {
+    public void setRolloverSelectedIcon(Icon rolloverSelectedIcon) {
         if (this.rolloverSelectedIcon != rolloverSelectedIcon) {
             Icon oldValue = this.rolloverSelectedIcon;
             this.rolloverSelectedIcon = rolloverSelectedIcon;
-            firePropertyChange(ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, oldValue, rolloverSelectedIcon);
+            firePropertyChange(ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, oldValue,
+                    rolloverSelectedIcon);
             setRolloverEnabled(true);
         }
     }
 
-    public void setRolloverIcon(final Icon rolloverIcon) {
+    public void setRolloverIcon(Icon rolloverIcon) {
         if (this.rolloverIcon != rolloverIcon) {
             Icon oldValue = this.rolloverIcon;
             this.rolloverIcon = rolloverIcon;
@@ -373,7 +431,7 @@
         }
     }
 
-    public void setPressedIcon(final Icon pressedIcon) {
+    public void setPressedIcon(Icon pressedIcon) {
         Icon oldValue = this.pressedIcon;
         this.pressedIcon = pressedIcon;
         firePropertyChange(PRESSED_ICON_CHANGED_PROPERTY, oldValue, pressedIcon);
@@ -384,21 +442,22 @@
         defaultDisabledSelectedIcon = null;
     }
 
-    public void setIcon(final Icon icon) {
+    public void setIcon(Icon icon) {
         Icon oldValue = this.icon;
         this.icon = icon;
         resetDefaultDisabledIcons();
         firePropertyChange(ICON_CHANGED_PROPERTY, oldValue, icon);
     }
 
-    public void setDisabledSelectedIcon(final Icon disabledSelectedIcon) {
+    public void setDisabledSelectedIcon(Icon disabledSelectedIcon) {
         Icon oldValue = this.disabledSelectedIcon;
         this.disabledSelectedIcon = disabledSelectedIcon;
         resetDefaultDisabledIcons();
-        firePropertyChange(DISABLED_SELECTED_ICON_CHANGED_PROPERTY, oldValue, disabledSelectedIcon);
+        firePropertyChange(DISABLED_SELECTED_ICON_CHANGED_PROPERTY, oldValue,
+                disabledSelectedIcon);
     }
 
-    public void setDisabledIcon(final Icon disabledIcon) {
+    public void setDisabledIcon(Icon disabledIcon) {
         Icon oldValue = this.disabledIcon;
         this.disabledIcon = disabledIcon;
         resetDefaultDisabledIcons();
@@ -429,19 +488,22 @@
         if (defaultDisabledSelectedIcon != null) {
             return defaultDisabledSelectedIcon;
         }
-
         if (selectedIcon instanceof ImageIcon) {
-            defaultDisabledIcon = new ImageIcon(GrayFilter.createDisabledImage(((ImageIcon)selectedIcon).getImage()));
+            defaultDisabledIcon = new ImageIcon(GrayFilter
+                    .createDisabledImage(((ImageIcon) selectedIcon).getImage()));
         } else if (disabledIcon instanceof ImageIcon) {
-            defaultDisabledIcon = new ImageIcon(GrayFilter.createDisabledImage(((ImageIcon)disabledIcon).getImage()));
+            defaultDisabledIcon = new ImageIcon(GrayFilter
+                    .createDisabledImage(((ImageIcon) disabledIcon).getImage()));
         } else if (icon instanceof ImageIcon) {
-            defaultDisabledIcon = new ImageIcon(GrayFilter.createDisabledImage(((ImageIcon)icon).getImage()));
+            defaultDisabledIcon = new ImageIcon(GrayFilter
+                    .createDisabledImage(((ImageIcon) icon).getImage()));
         }
         return defaultDisabledIcon;
     }
 
     public Icon getDisabledSelectedIcon() {
-        return (disabledSelectedIcon != null) ? disabledSelectedIcon : createDefaultDisabledSelectedIcon();
+        return (disabledSelectedIcon != null) ? disabledSelectedIcon
+                : createDefaultDisabledSelectedIcon();
     }
 
     private Icon createDefaultDisabledIcon() {
@@ -449,9 +511,9 @@
             return defaultDisabledIcon;
         }
         if (icon instanceof ImageIcon) {
-            defaultDisabledIcon = new ImageIcon(GrayFilter.createDisabledImage(((ImageIcon)icon).getImage()));
+            defaultDisabledIcon = new ImageIcon(GrayFilter
+                    .createDisabledImage(((ImageIcon) icon).getImage()));
         }
-
         return defaultDisabledIcon;
     }
 
@@ -459,10 +521,9 @@
         return (disabledIcon != null) ? disabledIcon : createDefaultDisabledIcon();
     }
 
-    public void setModel(final ButtonModel m) {
+    public void setModel(ButtonModel m) {
         if (model != m) {
             ButtonModel oldValue = model;
-
             if (model != null) {
                 model.removeActionListener(actionListener);
                 model.removeItemListener(itemListener);
@@ -484,7 +545,7 @@
         return model;
     }
 
-    public void setAction(final Action action) {
+    public void setAction(Action action) {
         if (this.action == action && action != null) {
             return;
         }
@@ -497,7 +558,6 @@
                 oldValue.removePropertyChangeListener(actionPropertyChangeListener);
             }
         }
-
         this.action = action;
         if (action != null) {
             if (!hasListener(ActionListener.class, action)) {
@@ -507,37 +567,36 @@
             actionPropertyChangeListener = createActionPropertyChangeListener(action);
             action.addPropertyChangeListener(actionPropertyChangeListener);
         }
-
         firePropertyChange(StringConstants.ACTION_PROPERTY_CHANGED, oldValue, action);
         configurePropertiesFromAction(action);
     }
 
-    void configurePropertyFromAction(final Action action, final Object propertyName) {
+    void configurePropertyFromAction(Action action, Object propertyName) {
         if (propertyName == null) {
             return;
         }
         if (propertyName.equals(Action.MNEMONIC_KEY)) {
             Object actionMnemonic = action.getValue(Action.MNEMONIC_KEY);
-            setMnemonic((actionMnemonic != null) ? ((Integer)actionMnemonic).intValue() : 0);
+            setMnemonic((actionMnemonic != null) ? ((Integer) actionMnemonic).intValue() : 0);
         }
         if (propertyName.equals(Action.SHORT_DESCRIPTION)) {
-            setToolTipText((String)action.getValue(Action.SHORT_DESCRIPTION));
+            setToolTipText((String) action.getValue(Action.SHORT_DESCRIPTION));
         }
         if (propertyName.equals(Action.SMALL_ICON)) {
-            setIcon((Icon)action.getValue(Action.SMALL_ICON));
+            setIcon((Icon) action.getValue(Action.SMALL_ICON));
         }
         if (propertyName.equals(StringConstants.ENABLED_PROPERTY_CHANGED)) {
             setEnabled(action.isEnabled());
         }
         if (propertyName.equals(Action.NAME)) {
-            setText((String)action.getValue(Action.NAME));
+            setText((String) action.getValue(Action.NAME));
         }
         if (propertyName.equals(Action.ACTION_COMMAND_KEY)) {
-            setActionCommand((String)action.getValue(Action.ACTION_COMMAND_KEY));
+            setActionCommand((String) action.getValue(Action.ACTION_COMMAND_KEY));
         }
     }
 
-    protected void configurePropertiesFromAction(final Action action) {
+    protected void configurePropertiesFromAction(Action action) {
         final Action a = (action != null) ? action : CLEAR_ACTION_PROPERTIES;
         configurePropertyFromAction(a, getActionPropertiesFilter());
     }
@@ -546,7 +605,7 @@
         return action;
     }
 
-    public void setText(final String text) {
+    public void setText(String text) {
         if (text != this.text) {
             String oldValue = this.text;
             this.text = text;
@@ -556,19 +615,19 @@
     }
 
     @Deprecated
-    public void setLabel(final String label) {
+    public void setLabel(String label) {
         setText(label);
     }
 
-    public void setActionCommand(final String command) {
+    public void setActionCommand(String command) {
         model.setActionCommand(command);
     }
 
-    protected int checkVerticalKey(final int key, final String exceptionText) {
+    protected int checkVerticalKey(int key, String exceptionText) {
         return Utilities.checkVerticalKey(key, exceptionText);
     }
 
-    protected int checkHorizontalKey(final int key, final String exceptionText) {
+    protected int checkHorizontalKey(int key, String exceptionText) {
         return Utilities.checkHorizontalKey(key, exceptionText);
     }
 
@@ -587,14 +646,14 @@
     }
 
     public Object[] getSelectedObjects() {
-        return model.isSelected() ? new Object[]{ getText() } : null;
+        return model.isSelected() ? new Object[] { getText() } : null;
     }
 
-    public void removeItemListener(final ItemListener listener) {
+    public void removeItemListener(ItemListener listener) {
         listenerList.remove(ItemListener.class, listener);
     }
 
-    public void addItemListener(final ItemListener listener) {
+    public void addItemListener(ItemListener listener) {
         listenerList.add(ItemListener.class, listener);
     }
 
@@ -606,21 +665,22 @@
         return (handler != null) ? handler : (handler = new ActionAndModelListener());
     }
 
-    protected void fireItemStateChanged(final ItemEvent event) {
+    protected void fireItemStateChanged(ItemEvent event) {
         ItemListener[] listeners = getItemListeners();
         if (listeners.length > 0) {
-            ItemEvent itemEvent = new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, this, event.getStateChange());
-            for (int i = 0; i < listeners.length; i++ ){
+            ItemEvent itemEvent = new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, this, event
+                    .getStateChange());
+            for (int i = 0; i < listeners.length; i++) {
                 listeners[i].itemStateChanged(itemEvent);
             }
         }
     }
 
-    public void removeActionListener(final ActionListener listener) {
+    public void removeActionListener(ActionListener listener) {
         listenerList.remove(ActionListener.class, listener);
     }
 
-    public void addActionListener(final ActionListener listener) {
+    public void addActionListener(ActionListener listener) {
         listenerList.add(ActionListener.class, listener);
     }
 
@@ -632,18 +692,20 @@
         return (handler != null) ? handler : (handler = new ActionAndModelListener());
     }
 
-    protected void fireActionPerformed(final ActionEvent event) {
+    protected void fireActionPerformed(ActionEvent event) {
         ActionListener[] listeners = getActionListeners();
         if (listeners.length > 0) {
-            String command = (event.getActionCommand() != null) ? event.getActionCommand() : getText();
-            ActionEvent actionEvent = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, command, event.getModifiers());
-            for (int i = 0; i < listeners.length; i++ ){
+            String command = (event.getActionCommand() != null) ? event.getActionCommand()
+                    : getText();
+            ActionEvent actionEvent = new ActionEvent(this, ActionEvent.ACTION_PERFORMED,
+                    command, event.getModifiers());
+            for (int i = 0; i < listeners.length; i++) {
                 listeners[i].actionPerformed(actionEvent);
             }
         }
     }
 
-    public void setMargin(final Insets margin) {
+    public void setMargin(Insets margin) {
         Insets oldValue = this.margin;
         this.margin = margin;
         firePropertyChange(MARGIN_CHANGED_PROPERTY, oldValue, margin);
@@ -654,122 +716,124 @@
     }
 
     @Override
-    public boolean imageUpdate(final Image img, final int infoflags, final int x, final int y, final int w, final int h) {
+    public boolean imageUpdate(Image img, int infoflags, int x, int y, int w, int h) {
         Icon curIcon = ButtonCommons.getCurrentIcon(this);
-        if ((curIcon == null) ||
-            !(curIcon instanceof ImageIcon) || (((ImageIcon)curIcon).getImage() != img)) {
-
+        if ((curIcon == null) || !(curIcon instanceof ImageIcon)
+                || (((ImageIcon) curIcon).getImage() != img)) {
             return false;
         }
-
         return super.imageUpdate(img, infoflags, x, y, w, h);
     }
 
     @Override
-    protected void paintBorder(final Graphics g) {
+    protected void paintBorder(Graphics g) {
         if (isBorderPainted()) {
             super.paintBorder(g);
         }
     }
 
-    public void doClick(final int pressTime) {
+    public void doClick(int pressTime) {
         final ButtonModel model = getModel();
-
         model.setArmed(true);
         model.setPressed(true);
         if (pressTime > 0) {
             paintImmediately(0, 0, getWidth(), getHeight());
             try {
                 Thread.sleep(pressTime);
-            } catch (InterruptedException e) {}
+            } catch (InterruptedException e) {
+            }
         }
         model.setPressed(false);
         model.setArmed(false);
     }
 
-    /*
-     * The click delay is based on 1.5 release behavior
-     * which can be revealed using the following code:
-     *
-     *  AbstractButton ab = new AbstractButton() {};
-     *  long startTime = System.currentTimeMillis();
-     *  ab.setModel(new DefaultButtonModel());
-     *  for (int i = 0; i < 100; i++) {
-     *      ab.doClick();
-     *  }
-     *  long stopTime = System.currentTimeMillis();
-     *  System.err.println("doClick takes " + (stopTime - startTime) / 100);
+    /**
+     * The click delay is based on 1.5 release behavior which can be revealed using the
+     * following code:
+     * 
+     * <pre>
+     * AbstractButton ab = new AbstractButton() {
+     * };
+     * long startTime = System.currentTimeMillis();
+     * ab.setModel(new DefaultButtonModel());
+     * for (int i = 0; i &lt; 100; i++) {
+     *     ab.doClick();
+     * }
+     * long stopTime = System.currentTimeMillis();
+     * System.err.println(&quot;doClick takes &quot; + (stopTime - startTime) / 100);
+     * </pre>
      */
     public void doClick() {
         doClick(70);
     }
 
-    public void setSelected(final boolean selected) {
+    public void setSelected(boolean selected) {
         model.setSelected(selected);
     }
 
-    public void setRolloverEnabled(final boolean rollover) {
+    public void setRolloverEnabled(boolean rollover) {
         boolean oldValue = rolloverEnabled;
         rolloverEnabled = rollover;
         firePropertyChange(ROLLOVER_ENABLED_CHANGED_PROPERTY, oldValue, rolloverEnabled);
     }
 
-    public void setFocusPainted(final boolean painted) {
+    public void setFocusPainted(boolean painted) {
         boolean oldValue = focusPainted;
         focusPainted = painted;
         firePropertyChange(FOCUS_PAINTED_CHANGED_PROPERTY, oldValue, painted);
     }
 
     @Override
-    public void setEnabled(final boolean enabled) {
+    public void setEnabled(boolean enabled) {
         model.setEnabled(enabled);
         super.setEnabled(enabled);
     }
 
-    public void setContentAreaFilled(final boolean filled) {
+    public void setContentAreaFilled(boolean filled) {
         boolean oldValue = contentAreaFilled;
         contentAreaFilled = filled;
         firePropertyChange(CONTENT_AREA_FILLED_CHANGED_PROPERTY, oldValue, contentAreaFilled);
     }
 
-    public void setBorderPainted(final boolean painted) {
+    public void setBorderPainted(boolean painted) {
         boolean oldValue = borderPainted;
         borderPainted = painted;
         firePropertyChange(BORDER_PAINTED_CHANGED_PROPERTY, oldValue, borderPainted);
     }
 
-    public void setMultiClickThreshhold(final long threshold) {
+    public void setMultiClickThreshhold(long threshold) {
         if (threshold < 0) {
             throw new IllegalArgumentException("threshhold must be >= 0");
         }
         multiClickThreshhold = threshold;
     }
 
-    public void setVerticalTextPosition(final int pos) {
+    public void setVerticalTextPosition(int pos) {
         int oldValue = verticalTextPosition;
         verticalTextPosition = checkVerticalKey(pos, VERTICAL_TEXT_POSITION_CHANGED_PROPERTY);
-        firePropertyChange(VERTICAL_TEXT_POSITION_CHANGED_PROPERTY, oldValue, verticalTextPosition);
+        firePropertyChange(VERTICAL_TEXT_POSITION_CHANGED_PROPERTY, oldValue,
+                verticalTextPosition);
     }
 
-    public void setVerticalAlignment(final int alignment) {
+    public void setVerticalAlignment(int alignment) {
         int oldValue = verticalAlignment;
         verticalAlignment = checkVerticalKey(alignment, VERTICAL_ALIGNMENT_CHANGED_PROPERTY);
         firePropertyChange(VERTICAL_ALIGNMENT_CHANGED_PROPERTY, oldValue, verticalAlignment);
     }
 
-    public void setMnemonic(final char keyChar) {
+    public void setMnemonic(char keyChar) {
         setMnemonic(Utilities.keyCharToKeyCode(keyChar), keyChar);
     }
 
-    public void setMnemonic(final int mnemonicCode) {
+    public void setMnemonic(int mnemonicCode) {
         setMnemonic(mnemonicCode, Utilities.keyCodeToKeyChar(mnemonicCode));
     }
 
-    private void setMnemonic(final int keyCode, final char keyChar) {
+    private void setMnemonic(int keyCode, char keyChar) {
         model.setMnemonic(keyCode);
     }
 
-    private void updateMnemonic(final int keyCode, final char keyChar) {
+    private void updateMnemonic(int keyCode, char keyChar) {
         int oldKeyCode = mnemonic;
         if (oldKeyCode == keyCode) {
             return;
@@ -779,7 +843,7 @@
         updateDisplayedMnemonicsIndex(keyChar);
     }
 
-    private void updateDisplayedMnemonicsIndex(final char keyChar) {
+    private void updateDisplayedMnemonicsIndex(char keyChar) {
         setDisplayedMnemonicIndex(Utilities.getDisplayedMnemonicIndex(text, keyChar));
     }
 
@@ -787,37 +851,40 @@
         return mnemonic;
     }
 
-    public void setDisplayedMnemonicIndex(final int index) throws IllegalArgumentException {
-        if (index < -1 || index >=0 && (text == null || index >= text.length())) {
+    public void setDisplayedMnemonicIndex(int index) throws IllegalArgumentException {
+        if (index < -1 || index >= 0 && (text == null || index >= text.length())) {
             throw new IllegalArgumentException("index == " + index);
         }
-
         int oldValue = mnemonicIndex;
         mnemonicIndex = index;
-        firePropertyChange(StringConstants.MNEMONIC_INDEX_PROPERTY_CHANGED,
-                           oldValue, index);
+        firePropertyChange(StringConstants.MNEMONIC_INDEX_PROPERTY_CHANGED, oldValue, index);
     }
 
     public int getDisplayedMnemonicIndex() {
         return mnemonicIndex;
     }
 
-    public void setIconTextGap(final int gap) {
-        LookAndFeel.markPropertyNotInstallable(this, StringConstants.ICON_TEXT_GAP_PROPERTY_CHANGED);
+    public void setIconTextGap(int gap) {
+        LookAndFeel.markPropertyNotInstallable(this,
+                StringConstants.ICON_TEXT_GAP_PROPERTY_CHANGED);
         int oldValue = iconTextGap;
         iconTextGap = gap;
-        firePropertyChange(StringConstants.ICON_TEXT_GAP_PROPERTY_CHANGED, oldValue, iconTextGap);
+        firePropertyChange(StringConstants.ICON_TEXT_GAP_PROPERTY_CHANGED, oldValue,
+                iconTextGap);
     }
 
-    public void setHorizontalTextPosition(final int pos) {
+    public void setHorizontalTextPosition(int pos) {
         int oldValue = horizontalTextPosition;
-        horizontalTextPosition = checkHorizontalKey(pos, HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY);
-        firePropertyChange(HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, oldValue, horizontalTextPosition);
+        horizontalTextPosition = checkHorizontalKey(pos,
+                HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY);
+        firePropertyChange(HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, oldValue,
+                horizontalTextPosition);
     }
 
-    public void setHorizontalAlignment(final int alignment) {
+    public void setHorizontalAlignment(int alignment) {
         int oldValue = horizontalAlignment;
-        horizontalAlignment = checkHorizontalKey(alignment, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY);
+        horizontalAlignment = checkHorizontalKey(alignment,
+                HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY);
         firePropertyChange(HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, oldValue, horizontalAlignment);
     }
 
@@ -843,7 +910,7 @@
 
     protected void fireStateChanged() {
         ChangeListener[] listeners = getChangeListeners();
-        for (int i = 0; i < listeners.length; i++ ){
+        for (int i = 0; i < listeners.length; i++) {
             listeners[i].stateChanged(changeEvent);
         }
     }
@@ -876,25 +943,24 @@
         return ALL_ACTION_PROPERTIES;
     }
 
-    boolean processMnemonics(final KeyEvent event) {
+    boolean processMnemonics(KeyEvent event) {
         final KeyStroke keyStroke = KeyStroke.getKeyStrokeForEvent(event);
         if (keyStroke.isOnKeyRelease() || getMnemonic() == 0) {
             return false;
         }
-
         if (isMnemonicKeyStroke(keyStroke)) {
             Action action = getActionMap().get(StringConstants.MNEMONIC_ACTION);
             if (action != null) {
-                SwingUtilities.notifyAction(action, keyStroke, event, this, event.getModifiersEx());
+                SwingUtilities.notifyAction(action, keyStroke, event, this, event
+                        .getModifiersEx());
                 return true;
             }
         }
-
         return false;
     }
 
-    boolean isMnemonicKeyStroke(final KeyStroke keyStroke) {
-        return keyStroke.getKeyCode() == getMnemonic() && (keyStroke.getModifiers() & InputEvent.ALT_DOWN_MASK) != 0;
+    boolean isMnemonicKeyStroke(KeyStroke keyStroke) {
+        return keyStroke.getKeyCode() == getMnemonic()
+                && (keyStroke.getModifiers() & InputEvent.ALT_DOWN_MASK) != 0;
     }
 }
-

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/CellRendererPane.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/CellRendererPane.java?view=diff&rev=479164&r1=479163&r2=479164
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/CellRendererPane.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/CellRendererPane.java Sat Nov 25 10:55:45 2006
@@ -15,68 +15,78 @@
  *  limitations under the License.
  */
 
-/**
- * @author Anton Avtamonov
- * @version $Revision$
- */
-
 package javax.swing;
 
 import java.awt.Component;
 import java.awt.Container;
 import java.awt.Graphics;
 import java.awt.Rectangle;
-
 import javax.accessibility.Accessible;
 import javax.accessibility.AccessibleContext;
 import javax.accessibility.AccessibleRole;
 
+/**
+ * <p>
+ * <i>CellRendererPane</i>
+ * </p>
+ * <h3>Implementation Notes:</h3>
+ * <ul>
+ * <li>The <code>serialVersionUID</code> fields are explicitly declared as a performance
+ * optimization, not as guarantee of serialization compatibility.</li>
+ * </ul>
+ */
 public class CellRendererPane extends Container implements Accessible {
+    private static final long serialVersionUID = -7642183829532984273L;
+
     protected AccessibleContext accessibleContext;
 
     protected class AccessibleCellRendererPane extends AccessibleAWTContainer {
+        private static final long serialVersionUID = 1L;
+
+        @Override
         public AccessibleRole getAccessibleRole() {
             return AccessibleRole.PANEL;
         }
     }
 
+    @Override
     public AccessibleContext getAccessibleContext() {
         if (accessibleContext == null) {
             accessibleContext = new AccessibleCellRendererPane();
         }
-
         return accessibleContext;
     }
 
+    @Override
     public void invalidate() {
     }
 
-    public void paint(final Graphics g) {
+    @Override
+    public void paint(Graphics g) {
     }
 
-    public void update(final Graphics g) {
+    @Override
+    public void update(Graphics g) {
     }
 
-    public void paintComponent(final Graphics g, final Component c, final Container p, final int x, final int y, final int w, final int h) {
+    public void paintComponent(Graphics g, Component c, Container p, int x, int y, int w, int h) {
         paintComponent(g, c, p, x, y, w, h, false);
     }
 
-    public void paintComponent(final Graphics g, final Component c, final Container p, final Rectangle r) {
+    public void paintComponent(Graphics g, Component c, Container p, Rectangle r) {
         paintComponent(g, c, p, r.x, r.y, r.width, r.height);
     }
 
-    public void paintComponent(final Graphics g, final Component c, final Container p, final int x, final int y, final int w, final int h, final boolean shouldValidate) {
+    public void paintComponent(Graphics g, Component c, Container p, int x, int y, int w,
+            int h, boolean shouldValidate) {
         add(c);
         c.setBounds(x, y, w, h);
-
         if (shouldValidate) {
             c.validate();
         }
-
         Graphics newGraphics = g.create(x, y, w, h);
         if (c instanceof JComponent) {
-            JComponent jc = (JComponent)c;
-
+            JComponent jc = (JComponent) c;
             boolean isDoubleBuffered = jc.isDoubleBuffered();
             jc.setDoubleBuffered(false);
             jc.paint(jc.getComponentGraphics(newGraphics));
@@ -85,20 +95,17 @@
             c.paint(newGraphics);
         }
         newGraphics.dispose();
-
         c.setBounds(-w, -h, 0, 0);
     }
 
-
-
-    protected void addImpl(final Component c, final Object constraints, final int index) {
+    @Override
+    protected void addImpl(Component c, Object constraints, int index) {
         Component[] components = getComponents();
         for (int i = 0; i < components.length; i++) {
             if (c == components[i]) {
                 return;
             }
         }
-
         super.addImpl(c, constraints, index);
     }
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/ComponentInputMap.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/ComponentInputMap.java?view=diff&rev=479164&r1=479163&r2=479164
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/ComponentInputMap.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/ComponentInputMap.java Sat Nov 25 10:55:45 2006
@@ -14,31 +14,42 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-/**
- * @author Alexander T. Simbirtsev
- * @version $Revision$
- */
+
 package javax.swing;
 
+/**
+ * <p>
+ * <i>ComponentInputMap</i>
+ * </p>
+ * <h3>Implementation Notes:</h3>
+ * <ul>
+ * <li>The <code>serialVersionUID</code> fields are explicitly declared as a performance
+ * optimization, not as guarantee of serialization compatibility.</li>
+ * </ul>
+ */
 public class ComponentInputMap extends InputMap {
+    private static final long serialVersionUID = 1760753505284728053L;
 
-    private JComponent component = null;
+    private JComponent component;
 
-    public ComponentInputMap(final JComponent component) {
+    public ComponentInputMap(JComponent component) {
         if (component == null) {
-            throw new IllegalArgumentException("ComponentInputMaps must be associated with a non-null JComponent");
+            throw new IllegalArgumentException(
+                    "ComponentInputMaps must be associated with a non-null JComponent");
         }
         this.component = component;
     }
 
-    public void put(final KeyStroke keyStroke, final Object key) {
+    @Override
+    public void put(KeyStroke keyStroke, Object key) {
         super.put(keyStroke, key);
         if (component != null) {
             component.componentInputMapChanged(this);
         }
     }
 
-    public void remove(final KeyStroke keyStroke) {
+    @Override
+    public void remove(KeyStroke keyStroke) {
         super.remove(keyStroke);
         component.componentInputMapChanged(this);
     }
@@ -47,10 +58,13 @@
         return component;
     }
 
-    public void setParent(final InputMap parent) {
-        if (parent != null && (!(parent instanceof ComponentInputMap) ||
-                (((ComponentInputMap)parent).getComponent() != component))) {
-            throw new IllegalArgumentException("ComponentInputMap must have a ComponentInputMap parent associated with the same component");
+    @Override
+    public void setParent(InputMap parent) {
+        if (parent != null
+                && (!(parent instanceof ComponentInputMap) || (((ComponentInputMap) parent)
+                        .getComponent() != component))) {
+            throw new IllegalArgumentException(
+                    "ComponentInputMap must have a ComponentInputMap parent associated with the same component");
         }
         super.setParent(parent);
         if (component != null) {
@@ -58,9 +72,9 @@
         }
     }
 
+    @Override
     public void clear() {
         super.clear();
         component.componentInputMapChanged(this);
     }
-
-}
\ No newline at end of file
+}

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DebugGraphics.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DebugGraphics.java?view=diff&rev=479164&r1=479163&r2=479164
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DebugGraphics.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DebugGraphics.java Sat Nov 25 10:55:45 2006
@@ -15,11 +15,6 @@
  *  limitations under the License.
  */
 
-/**
- * @author Anton Avtamonov
- * @version $Revision$
- */
-
 package javax.swing;
 
 import java.awt.Color;
@@ -38,17 +33,27 @@
 import java.io.PrintStream;
 import java.text.AttributedCharacterIterator;
 import java.util.HashMap;
-
+import java.util.Map;
 import org.apache.harmony.x.swing.Utilities;
 
+/**
+ * <p>
+ * <i>DebugGraphics</i>
+ * </p>
+ * <h3>Implementation Notes:</h3>
+ * <ul>
+ * <li>The <code>serialVersionUID</code> fields are explicitly declared as a performance
+ * optimization, not as guarantee of serialization compatibility.</li>
+ * </ul>
+ */
 public class DebugGraphics extends Graphics {
     private abstract static class FlashAction extends AbstractAction {
         private Graphics g;
-        public FlashAction(final Graphics g) {
+        public FlashAction(Graphics g) {
             this.g = g;
         }
         
-        public void actionPerformed(final ActionEvent e) {
+        public void actionPerformed(ActionEvent e) {
             for (int i = 0; i < flashCount; i++) {
                 Color oldColor = g.getColor();
                 paint(g);
@@ -60,22 +65,22 @@
             }
         }        
         
-        private void sleep(final int millis) {
+        private void sleep(int millis) {
             try {
                 Thread.sleep(millis);
             } catch (InterruptedException e) {
                 
             }
         }
-        public abstract void paint(final Graphics g);
+        public abstract void paint(Graphics g);
     }
     
     private abstract class BufferedDrawAction extends AbstractAction {        
-        public void actionPerformed(final ActionEvent e) {
+        public void actionPerformed(ActionEvent e) {
             if (externalFrames == null) {
-                externalFrames = new HashMap();
+                externalFrames = new HashMap<JComponent, Frame>();
             }
-            Frame externalFrame = (Frame)externalFrames.get(component);
+            Frame externalFrame = externalFrames.get(component);
             if (externalFrame == null || !externalFrame.isDisplayable()) {
                 externalFrame = new Frame();
                 externalFrames.put(component, externalFrame);                            
@@ -97,6 +102,9 @@
             
             if (isFlashing()) {
                 new FlashAction(g) {
+                    private static final long serialVersionUID = 1L;
+
+                    @Override
                     public void paint(Graphics g) {
                         BufferedDrawAction.this.paint(g);
                     }                    
@@ -105,7 +113,7 @@
             g.drawRect(0, 0, 40, 40);
             paint(g);
         }                
-        public abstract void paint(final Graphics g);
+        public abstract void paint(Graphics g);
     }
     
     public static final int NONE_OPTION = -1;
@@ -114,7 +122,7 @@
     public static final int BUFFERED_OPTION = 4;
 
     private static int debugGraphicsCount; 
-    private static HashMap externalFrames;
+    private static Map<JComponent, Frame> externalFrames;
     
     private Graphics originalGraphics;
     private JComponent component;
@@ -127,7 +135,7 @@
     private static int flashTime = 100;
     private static PrintStream logStream = System.out;
 
-    public static void setFlashColor(final Color flashColor) {
+    public static void setFlashColor(Color flashColor) {
         DebugGraphics.flashColor = flashColor;
     }
 
@@ -135,7 +143,7 @@
         return flashColor;
     }
 
-    public static void setFlashCount(final int flashCount) {
+    public static void setFlashCount(int flashCount) {
         DebugGraphics.flashCount = flashCount;
     }
 
@@ -143,7 +151,7 @@
         return flashCount;
     }
 
-    public static void setFlashTime(final int flashTime) {
+    public static void setFlashTime(int flashTime) {
         DebugGraphics.flashTime = flashTime;
     }
 
@@ -151,7 +159,7 @@
         return flashTime;
     }
 
-    public static void setLogStream(final PrintStream stream) {
+    public static void setLogStream(PrintStream stream) {
         logStream = stream;
     }
 
@@ -159,13 +167,13 @@
         return logStream;
     }
 
-    public DebugGraphics(final Graphics g, final JComponent c) {
+    public DebugGraphics(Graphics g, JComponent c) {
         originalGraphics = g.create();
         component = c;
         thisNumber = debugGraphicsCount++;
     }
 
-    public DebugGraphics(final Graphics g) {
+    public DebugGraphics(Graphics g) {
         this(g, null);
     }
 
@@ -177,7 +185,7 @@
         return debugOptions;
     }
 
-    public void setDebugOptions(final int options) {
+    public void setDebugOptions(int options) {
         boolean wasLogging = isLogging();
         if (options == NONE_OPTION) {
             debugOptions = 0;
@@ -196,12 +204,16 @@
         return drawingBuffer;
     }
 
+    @Override
     public void clearRect(final int x, final int y, final int width, final int height) {
         if (isLogging()) {
             log("Clearing rect: " + new Rectangle(x, y, width, height));
         }
         if (isFlashing()) {
             new FlashAction(originalGraphics) {
+                private static final long serialVersionUID = 1L;
+
+                @Override
                 public void paint(Graphics g) {
                     g.fillRect(x, y, width, height);    
                 }                
@@ -209,6 +221,9 @@
         }
         if (isBuffered()) {
             new BufferedDrawAction() {
+                private static final long serialVersionUID = 1L;
+                
+                @Override
                 public void paint(Graphics g) {
                     g.fillRect(x, y, width, height);
                 }                
@@ -217,6 +232,7 @@
         originalGraphics.clearRect(x, y, width, height);
     }
 
+    @Override
     public void clipRect(final int x, final int y, final int width, final int height) {
         if (isLogging()) {
             log("Setting clipRect: " + new Rectangle(x, y, width, height));
@@ -228,6 +244,7 @@
         originalGraphics.clipRect(x, y, width, height);
     }
 
+    @Override
     public void copyArea(final int x, final int y, final int width, final int height, final int destX, final int destY) {
         if (isLogging()) {
             log("Copying area from: " + new Rectangle(x, y, width, height) + " to : " + new Point(destX, destY));
@@ -235,6 +252,8 @@
         if (isFlashing()) {
             fillRect(x, y, width, height);
             new FlashAction(originalGraphics) {
+                private static final long serialVersionUID = 1L;
+                @Override
                 public void paint(Graphics g) {
                     g.fillRect(x, y, width, height);    
                 }                
@@ -245,28 +264,34 @@
         originalGraphics.copyArea(x, y, width, height, destX, destY);
     }
 
+    @Override
     public Graphics create() {
         DebugGraphics result = new DebugGraphics(originalGraphics, component);
         result.setDebugOptions(debugOptions);
         return result;
     }
 
+    @Override
     public Graphics create(final int x, final int y, final int width, final int height) {
         DebugGraphics result = new DebugGraphics(originalGraphics.create(x, y, width, height), component);
         result.setDebugOptions(debugOptions);
         return result;
     }
 
+    @Override
     public void dispose() {
         originalGraphics.dispose();
     }
 
+    @Override
     public void draw3DRect(final int x, final int y, final int width, final int height, final boolean raised) {
         if (isLogging()) {
             log("Drawing 3D rect: " + new Rectangle(x, y, width, height) + ", raised bezel: " + raised);
         }
         if (isFlashing()) {
             new FlashAction(originalGraphics) {
+                private static final long serialVersionUID = 1L;
+                @Override
                 public void paint(Graphics g) {
                     g.draw3DRect(x, y, width, height, raised);    
                 }                
@@ -277,12 +302,15 @@
         originalGraphics.draw3DRect(x, y, width, height, raised);
     }
 
+    @Override
     public void drawArc(final int x, final int y, final int width, final int height, final int startAngle, final int arcAngle) {
         if (isLogging()) {
             log("Drawing arc: " + new Rectangle(x, y, width, height) + ", startAngle: " + startAngle + ", arcAngle: " + arcAngle);
         }
         if (isFlashing()) {
             new FlashAction(originalGraphics) {
+                private static final long serialVersionUID = 1L;
+                @Override
                 public void paint(Graphics g) {
                     g.drawArc(x, y, width, height, startAngle, arcAngle);    
                 }                
@@ -293,12 +321,15 @@
         originalGraphics.drawArc(x, y, width, height, startAngle, arcAngle);
     }
 
+    @Override
     public void drawBytes(final byte[] data, final int offset, final int length, final int x, final int y) {
         if (isLogging()) {
             log("Drawing bytes at: " + new Point(x, y));
         }
         if (isFlashing()) {
             new FlashAction(originalGraphics) {
+                private static final long serialVersionUID = 1L;
+                @Override
                 public void paint(Graphics g) {
                     g.drawBytes(data, offset, length, x, y);    
                 }                
@@ -309,12 +340,15 @@
         originalGraphics.drawBytes(data, offset, length, x, y);
     }
 
+    @Override
     public void drawChars(final char[] data, final int offset, final int length, final int x, final int y) {
         if (isLogging()) {
             log("Drawing chars at: " + new Point(x, y));
         }
         if (isFlashing()) {
             new FlashAction(originalGraphics) {
+                private static final long serialVersionUID = 1L;
+                @Override
                 public void paint(Graphics g) {
                     g.drawChars(data, offset, length, x, y);    
                 }                
@@ -325,12 +359,15 @@
         originalGraphics.drawChars(data, offset, length, x, y);
     }
 
+    @Override
     public boolean drawImage(final Image img, final int x, final int y, final Color bgcolor, final ImageObserver observer) {
         if (isLogging()) {
             log("Drawing image: " + img + " at " + new Point(x, y) + ", bgcolor: " + bgcolor);
         }
         if (isFlashing()) {
             new FlashAction(originalGraphics) {
+                private static final long serialVersionUID = 1L;
+                @Override
                 public void paint(Graphics g) {
                     g.fillRect(x, y, img.getHeight(observer), img.getHeight(observer));    
                 }                
@@ -341,12 +378,15 @@
         return originalGraphics.drawImage(img, x, y, bgcolor, observer);
     }
 
+    @Override
     public boolean drawImage(final Image img, final int x, final int y, final ImageObserver observer) {
         if (isLogging()) {
             log("Drawing image: " + img + " at " + new Point(x, y));
         }
         if (isFlashing()) {
             new FlashAction(originalGraphics) {
+                private static final long serialVersionUID = 1L;
+                @Override
                 public void paint(Graphics g) {
                     g.fillRect(x, y, img.getHeight(observer), img.getHeight(observer));    
                 }                
@@ -357,6 +397,7 @@
         return originalGraphics.drawImage(img, x, y, observer);
     }
 
+    @Override
     public boolean drawImage(final Image img, final int x, final int y, final int width, final int height,
                              final Color bgcolor, final ImageObserver observer) {
 
@@ -365,6 +406,8 @@
         }
         if (isFlashing()) {
             new FlashAction(originalGraphics) {
+                private static final long serialVersionUID = 1L;
+                @Override
                 public void paint(Graphics g) {
                     g.fillRect(x, y, img.getHeight(observer), img.getHeight(observer));    
                 }                
@@ -376,6 +419,7 @@
                                           observer);
     }
 
+    @Override
     public boolean drawImage(final Image img, final int x, final int y, final int width, final int height,
                              final ImageObserver observer) {
         if (isLogging()) {
@@ -383,6 +427,8 @@
         }
         if (isFlashing()) {
             new FlashAction(originalGraphics) {
+                private static final long serialVersionUID = 1L;
+                @Override
                 public void paint(Graphics g) {
                     g.fillRect(x, y, img.getHeight(observer), img.getHeight(observer));    
                 }                
@@ -393,6 +439,7 @@
         return originalGraphics.drawImage(img, x, y, width, height, observer);
     }
 
+    @Override
     public boolean drawImage(final Image img, final int dx1, final int dy1, final int dx2, final int dy2, 
                              final int sx1, final int sy1, final int sx2, final int sy2,
                              final Color bgcolor, final ImageObserver observer) {
@@ -402,6 +449,8 @@
         }
         if (isFlashing()) {
             new FlashAction(originalGraphics) {
+                private static final long serialVersionUID = 1L;
+                @Override
                 public void paint(Graphics g) {
                     g.fillRect(dx1, dy1, dx2 - dx1, dy2 - dy1);    
                 }                
@@ -412,6 +461,7 @@
         return originalGraphics.drawImage(img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, bgcolor, observer);
     }
 
+    @Override
     public boolean drawImage(final Image img, final int dx1, final int dy1, final int dx2, final int dy2,
                              final int sx1, final int sy1, final int sx2, final int sy2,
                              final ImageObserver observer) {
@@ -422,6 +472,8 @@
         }
         if (isFlashing()) {
             new FlashAction(originalGraphics) {
+                private static final long serialVersionUID = 1L;
+                @Override
                 public void paint(Graphics g) {
                     g.fillRect(dx1, dy1, dx2 - dx1, dy2 - dy1);    
                 }                
@@ -432,12 +484,15 @@
         return originalGraphics.drawImage(img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, observer);
     }
 
+    @Override
     public void drawLine(final int x1, final int y1, final int x2, final int y2) {
         if (isLogging()) {
             log("Drawing line: from (" + x1 + ", " + y1 + ") to (" + x2 + ", " + y2 + ")");
         }
         if (isFlashing()) {
             new FlashAction(originalGraphics) {
+                private static final long serialVersionUID = 1L;
+                @Override
                 public void paint(Graphics g) {
                     g.drawLine(x1, y1, x2, y2);
                 }                
@@ -445,6 +500,8 @@
         }
         if (isBuffered()) {            
             new BufferedDrawAction() {
+                private static final long serialVersionUID = 1L;
+                @Override
                 public void paint(Graphics g) {
                     g.drawLine(x1, y1, x2, y2);                    
                 }                
@@ -453,12 +510,15 @@
         originalGraphics.drawLine(x1, y1, x2, y2);
     }
 
+    @Override
     public void drawOval(final int x, final int y, final int width, final int height) {
         if (isLogging()) {
             log("Drawing oval: " + new Rectangle(x, y, width, height));
         }
         if (isFlashing()) {
             new FlashAction(originalGraphics) {
+                private static final long serialVersionUID = 1L;
+                @Override
                 public void paint(Graphics g) {
                     g.drawOval(x, y, width, height);
                 }                
@@ -469,12 +529,15 @@
         originalGraphics.drawOval(x, y, width, height);
     }
 
+    @Override
     public void drawPolygon(final int[] xPoints, final int[] yPoints, final int nPoints) {
         if (isLogging()) {
             log("Drawing polygon: " + new Polygon(xPoints, yPoints, nPoints));
         }
         if (isFlashing()) {
             new FlashAction(originalGraphics) {
+                private static final long serialVersionUID = 1L;
+                @Override
                 public void paint(Graphics g) {
                     g.drawPolygon(xPoints, yPoints, nPoints);
                 }                
@@ -485,12 +548,15 @@
         originalGraphics.drawPolygon(xPoints, yPoints, nPoints);
     }
 
+    @Override
     public void drawPolyline(final int[] xPoints, final int[] yPoints, final int nPoints) {
         if (isLogging()) {
             log("Drawing polyline: " + new Polygon(xPoints, yPoints, nPoints));
         }
         if (isFlashing()) {
             new FlashAction(originalGraphics) {
+                private static final long serialVersionUID = 1L;
+                @Override
                 public void paint(Graphics g) {
                     g.drawPolyline(xPoints, yPoints, nPoints);
                 }                
@@ -501,12 +567,15 @@
         originalGraphics.drawPolyline(xPoints, yPoints, nPoints);
     }
 
+    @Override
     public void drawRect(final int x, final int y, final int width, final int height) {
         if (isLogging()) {
             log("Drawing rectangle: " + new Rectangle(x, y, width, height));
         }
         if (isFlashing()) {
             new FlashAction(originalGraphics) {
+                private static final long serialVersionUID = 1L;
+                @Override
                 public void paint(Graphics g) {
                     g.drawRect(x, y, width, height);
                 }                
@@ -517,12 +586,15 @@
         originalGraphics.drawRect(x, y, width, height);
     }
 
+    @Override
     public void drawRoundRect(final int x, final int y, final int width, final int height, final int arcWidth, final int arcHeight) {
         if (isLogging()) {
             log("Drawing round rectangle: " + new Rectangle(x, y, width, height) + ", arcWidth " + arcWidth + ", arcHeight " + arcHeight);
         }
         if (isFlashing()) {
             new FlashAction(originalGraphics) {
+                private static final long serialVersionUID = 1L;
+                @Override
                 public void paint(Graphics g) {
                     g.drawRoundRect(x, y, width, height, arcWidth, arcHeight);
                 }                
@@ -533,12 +605,15 @@
         originalGraphics.drawRoundRect(x, y, width, height, arcWidth, arcHeight);
     }
 
+    @Override
     public void drawString(final AttributedCharacterIterator iterator, final int x, final int y) {
         if (isLogging()) {
             log("Drawing string: " + iterator + " at " + new Point(x, y));
         }
         if (isFlashing()) {
             new FlashAction(originalGraphics) {
+                private static final long serialVersionUID = 1L;
+                @Override
                 public void paint(Graphics g) {
                     g.drawString(iterator, x, y);
                 }                
@@ -549,12 +624,15 @@
         originalGraphics.drawString(iterator, x, y);
     }
 
+    @Override
     public void drawString(final String str, final int x, final int y) {
         if (isLogging()) {
             log("Drawing string: " + str + " at " + new Point(x, y));
         }
         if (isFlashing()) {
             new FlashAction(originalGraphics) {
+                private static final long serialVersionUID = 1L;
+                @Override
                 public void paint(Graphics g) {
                     g.drawString(str, x, y);
                 }                
@@ -565,12 +643,15 @@
         originalGraphics.drawString(str, x, y);
     }
 
+    @Override
     public void fill3DRect(final int x, final int y, final int width, final int height, final boolean raised) {
         if (isLogging()) {
             log("Filling 3D rect: " + new Rectangle(x, y, width, height) + ", raised bezel: " + raised);
         }
         if (isFlashing()) {
             new FlashAction(originalGraphics) {
+                private static final long serialVersionUID = 1L;
+                @Override
                 public void paint(Graphics g) {
                     g.fill3DRect(x, y, width, height, raised);
                 }                
@@ -581,12 +662,15 @@
         originalGraphics.fill3DRect(x, y, width, height, raised);
     }
 
+    @Override
     public void fillArc(final int x, final int y, final int width, final int height, final int startAngle, final int arcAngle) {
         if (isLogging()) {
             log("Filling arc: " + new Rectangle(x, y, width, height) + ", startAngle: " + startAngle + ", arcAngle: " + arcAngle);
         }
         if (isFlashing()) {
             new FlashAction(originalGraphics) {
+                private static final long serialVersionUID = 1L;
+                @Override
                 public void paint(Graphics g) {
                     g.fillArc(x, y, width, height, startAngle, arcAngle);    
                 }                
@@ -597,12 +681,15 @@
         originalGraphics.fillArc(x, y, width, height, startAngle, arcAngle);
     }
 
+    @Override
     public void fillOval(final int x, final int y, final int width, final int height) {
         if (isLogging()) {
             log("Filling oval: " + new Rectangle(x, y, width, height));
         }
         if (isFlashing()) {
             new FlashAction(originalGraphics) {
+                private static final long serialVersionUID = 1L;
+                @Override
                 public void paint(Graphics g) {
                     g.fillOval(x, y, width, height);    
                 }                
@@ -613,12 +700,15 @@
         originalGraphics.fillOval(x, y, width, height);
     }
 
+    @Override
     public void fillPolygon(final int[] xPoints, final int[] yPoints, final int nPoints) {
         if (isLogging()) {
             log("Filling polygon: " + new Polygon(xPoints, yPoints, nPoints));
         }
         if (isFlashing()) {
             new FlashAction(originalGraphics) {
+                private static final long serialVersionUID = 1L;
+                @Override
                 public void paint(Graphics g) {
                     g.fillPolygon(xPoints, yPoints, nPoints);   
                 }                
@@ -629,12 +719,15 @@
         originalGraphics.fillPolygon(xPoints, yPoints, nPoints);
     }
 
+    @Override
     public void fillRect(final int x, final int y, final int width, final int height) {
         if (isLogging()) {
             log("Filling rectangle: " + new Rectangle(x, y, width, height));
         }
         if (isFlashing()) {
             new FlashAction(originalGraphics) {
+                private static final long serialVersionUID = 1L;
+                @Override
                 public void paint(Graphics g) {
                     g.fillRect(x, y, width, height);    
                 }                
@@ -642,6 +735,8 @@
         }
         if (isBuffered()) {
             new BufferedDrawAction() {
+                private static final long serialVersionUID = 1L;
+                @Override
                 public void paint(Graphics g) {
                     g.fillRect(x, y, width, height);
                 }                
@@ -650,12 +745,15 @@
         originalGraphics.fillRect(x, y, width, height);
     }    
 
+    @Override
     public void fillRoundRect(final int x, final int y, final int width, final int height, final int arcWidth,final int arcHeight) {
         if (isLogging()) {
             log("Filling round rectangle: " + new Rectangle(x, y, width, height) + ", arcWidth " + arcWidth + ", arcHeight " + arcHeight);
         }
         if (isFlashing()) {
             new FlashAction(originalGraphics) {
+                private static final long serialVersionUID = 1L;
+                @Override
                 public void paint(Graphics g) {
                     g.fillRoundRect(x, y, width, height, arcWidth, arcHeight);    
                 }                
@@ -666,30 +764,37 @@
         originalGraphics.fillRoundRect(x, y, width, height, arcWidth, arcHeight);
     }
 
+    @Override
     public Shape getClip() {
         return originalGraphics.getClip();
     }
 
+    @Override
     public Rectangle getClipBounds() {
         return originalGraphics.getClipBounds();
     }
 
+    @Override
     public Color getColor() {
         return originalGraphics.getColor();
     }
 
+    @Override
     public Font getFont() {
         return originalGraphics.getFont();
     }
 
+    @Override
     public FontMetrics getFontMetrics() {
         return originalGraphics.getFontMetrics();
     }
 
+    @Override
     public FontMetrics getFontMetrics(final Font f) {
         return originalGraphics.getFontMetrics(f);
     }
 
+    @Override
     public void setClip(final int x, final int y, final int width, final int height) {
         if (isLogging()) {
             log("Setting new clipRect: " + new Rectangle(x, y, width, height));
@@ -701,6 +806,7 @@
         originalGraphics.setClip(x, y, width, height);
     }
 
+    @Override
     public void setClip(final Shape shape) {
         if (isLogging()) {
             log("Setting clip: " + shape);
@@ -712,6 +818,7 @@
         originalGraphics.setClip(shape);
     }
 
+    @Override
     public void setColor(final Color c) {
         if (isLogging()) {
             log("Setting color: " + c);
@@ -723,6 +830,7 @@
         originalGraphics.setColor(c);
     }
 
+    @Override
     public void setFont(final Font font) {
         if (isLogging()) {
             log("Setting font: " + font);
@@ -734,6 +842,7 @@
         originalGraphics.setFont(font);
     }
 
+    @Override
     public void setPaintMode() {
         if (isLogging()) {
             log("Setting paint mode");
@@ -745,6 +854,7 @@
         originalGraphics.setPaintMode();
     }
 
+    @Override
     public void setXORMode(final Color c) {
         if (isLogging()) {
             log("Setting XOR mode, color : " + c);
@@ -756,6 +866,7 @@
         originalGraphics.setXORMode(c);
     }
 
+    @Override
     public void translate(final int x, final int y) {
         if (isLogging()) {
             log("Translating by: " + new Point(x, y));

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultBoundedRangeModel.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultBoundedRangeModel.java?view=diff&rev=479164&r1=479163&r2=479164
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultBoundedRangeModel.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultBoundedRangeModel.java Sat Nov 25 10:55:45 2006
@@ -14,45 +14,48 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-/**
- * @author Evgeniya G. Maenkova
- * @version $Revision$
- */
+
 package javax.swing;
 
 import java.io.Serializable;
-import java.util.EventListener;
-
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 import javax.swing.event.EventListenerList;
 
-public class DefaultBoundedRangeModel extends Object implements
-        BoundedRangeModel, Serializable {
+/**
+ * <p>
+ * <i>DefaultBoundedRangeModel</i>
+ * </p>
+ * <h3>Implementation Notes:</h3>
+ * <ul>
+ * <li>The <code>serialVersionUID</code> fields are explicitly declared as a performance
+ * optimization, not as guarantee of serialization compatibility.</li>
+ * </ul>
+ */
+public class DefaultBoundedRangeModel implements BoundedRangeModel, Serializable {
+    private static final long serialVersionUID = -3186121964369712936L;
+
+    private static final int DEFAULT_MAX = 100;
 
-    protected ChangeEvent       changeEvent;
+    protected ChangeEvent changeEvent;
 
     protected EventListenerList listenerList;
 
-    int max;
+    private int max;
 
-    int min;
+    private int min;
 
-    int extent;
+    private int extent;
 
-    int  value;
+    private int value;
 
-    boolean valueIsAdjusting;
-
-    private static final int DEFAULT_MAX = 100;
+    private boolean valueIsAdjusting;
 
     public DefaultBoundedRangeModel() {
         this(0, 0, 0, DEFAULT_MAX);
     }
 
-    public DefaultBoundedRangeModel(final int value, final int extent,
-                                    final int min, final int max) {
-
+    public DefaultBoundedRangeModel(int value, int extent, int min, int max) {
         if (extent < 0 || min > value || value + extent > max) {
             throw new IllegalArgumentException("invalid range properties");
         }
@@ -65,7 +68,7 @@
         listenerList = new EventListenerList();
     }
 
-    public void addChangeListener(final ChangeListener listener) {
+    public void addChangeListener(ChangeListener listener) {
         listenerList.add(ChangeListener.class, listener);
     }
 
@@ -74,19 +77,17 @@
         for (int i = 0; i < listeners.length; i++) {
             listeners[i].stateChanged(changeEvent);
         }
-
     }
 
     public ChangeListener[] getChangeListeners() {
-        return (ChangeListener[])listenerList
-                .getListeners(ChangeListener.class);
+        return listenerList.getListeners(ChangeListener.class);
     }
 
     public int getExtent() {
         return extent;
     }
 
-    public <T extends java.util.EventListener> T[] getListeners(final Class<T> c) {
+    public <T extends java.util.EventListener> T[] getListeners(Class<T> c) {
         return listenerList.getListeners(c);
     }
 
@@ -106,20 +107,19 @@
         return valueIsAdjusting;
     }
 
-    public void removeChangeListener(final ChangeListener listener) {
+    public void removeChangeListener(ChangeListener listener) {
         listenerList.remove(ChangeListener.class, listener);
     }
 
-    public void setExtent(final int n) {
+    public void setExtent(int n) {
         int newExtent = Math.min(Math.max(n, 0), max - value);
         if (newExtent != extent) {
             extent = newExtent;
             fireStateChanged();
         }
-
     }
 
-    public void setMaximum(final int n) {
+    public void setMaximum(int n) {
         if (max == n) {
             return;
         }
@@ -127,11 +127,10 @@
         min = Math.min(n, min);
         extent = Math.min(max - min, extent);
         value = Math.min(value, max - extent);
-
         fireStateChanged();
     }
 
-    public void setMinimum(final int n) {
+    public void setMinimum(int n) {
         if (n == min) {
             return;
         }
@@ -139,15 +138,13 @@
         max = Math.max(n, max);
         extent = Math.min(max - min, extent);
         value = Math.max(value, min);
-
         fireStateChanged();
     }
 
-    public void setRangeProperties(final int newValue, final int newExtent,
-                                   final int newMin, final int newMax,
-                                   final boolean adjusting) {
-        if (newValue == value && newExtent == extent && newMin == min
-            && newMax == max && adjusting == valueIsAdjusting) {
+    public void setRangeProperties(int newValue, int newExtent, int newMin, int newMax,
+            boolean adjusting) {
+        if (newValue == value && newExtent == extent && newMin == min && newMax == max
+                && adjusting == valueIsAdjusting) {
             return;
         }
         value = newValue;
@@ -158,16 +155,15 @@
         fireStateChanged();
     }
 
-    public void setValue(final int n) {
+    public void setValue(int n) {
         int newValue = Math.min(Math.max(n, min), max - extent);
         if (newValue != value) {
             value = newValue;
             fireStateChanged();
         }
-
     }
 
-    public void setValueIsAdjusting(final boolean b) {
+    public void setValueIsAdjusting(boolean b) {
         if (b != valueIsAdjusting) {
             valueIsAdjusting = b;
             fireStateChanged();
@@ -181,10 +177,9 @@
      *     Object obj = new DefaultBoundedRangeModel();
      *     System.out.println(obj.toString());
      */
+    @Override
     public String toString() {
-
-        return getClass().getName() + "[" + "value=" + value + ", " + "extent="
-               + extent + ", " + "min=" + min + ", " + "max=" + max + ", "
-               + "adj=" + valueIsAdjusting + "]";
+        return getClass().getName() + "[" + "value=" + value + ", " + "extent=" + extent + ", "
+                + "min=" + min + ", " + "max=" + max + ", " + "adj=" + valueIsAdjusting + "]";
     }
-}
\ No newline at end of file
+}

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultButtonModel.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultButtonModel.java?view=diff&rev=479164&r1=479163&r2=479164
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultButtonModel.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/DefaultButtonModel.java Sat Nov 25 10:55:45 2006
@@ -14,10 +14,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-/**
- * @author Alexander T. Simbirtsev
- * @version $Revision$
- */
+
 package javax.swing;
 
 import java.awt.event.ActionEvent;
@@ -30,63 +27,82 @@
 import javax.swing.event.ChangeListener;
 import javax.swing.event.EventListenerList;
 
+/**
+ * <p>
+ * <i>DefaultButtonModel</i>
+ * </p>
+ * <h3>Implementation Notes:</h3>
+ * <ul>
+ * <li>The <code>serialVersionUID</code> fields are explicitly declared as a performance
+ * optimization, not as guarantee of serialization compatibility.</li>
+ * </ul>
+ */
 public class DefaultButtonModel implements ButtonModel, Serializable {
+    private static final long serialVersionUID = -8004185980087291435L;
 
     public static final int ARMED = 1;
+
     public static final int SELECTED = 2;
+
     public static final int PRESSED = 4;
+
     public static final int ENABLED = 8;
+
     public static final int ROLLOVER = 16;
 
     protected int stateMask = ENABLED;
+
     protected String actionCommand;
+
     protected ButtonGroup group;
+
     protected int mnemonic;
+
     protected transient ChangeEvent changeEvent;
-    protected EventListenerList listenerList = new EventListenerList();
 
+    protected EventListenerList listenerList = new EventListenerList();
 
-    public <T extends java.util.EventListener> T[] getListeners(final Class<T> listenersClass) {
+    public <T extends EventListener> T[] getListeners(Class<T> listenersClass) {
         return listenerList.getListeners(listenersClass);
     }
 
-    public void addChangeListener(final ChangeListener listener) {
+    public void addChangeListener(ChangeListener listener) {
         listenerList.add(ChangeListener.class, listener);
     }
 
-    public void removeChangeListener(final ChangeListener listener) {
+    public void removeChangeListener(ChangeListener listener) {
         listenerList.remove(ChangeListener.class, listener);
     }
 
     public ChangeListener[] getChangeListeners() {
-        return (ChangeListener[])listenerList.getListeners(ChangeListener.class);
+        return listenerList.getListeners(ChangeListener.class);
     }
 
-    public void addItemListener(final ItemListener listener) {
+    public void addItemListener(ItemListener listener) {
         listenerList.add(ItemListener.class, listener);
     }
 
-    public void removeItemListener(final ItemListener listener) {
+    public void removeItemListener(ItemListener listener) {
         listenerList.remove(ItemListener.class, listener);
     }
 
     public ItemListener[] getItemListeners() {
-        return (ItemListener[])listenerList.getListeners(ItemListener.class);
+        return listenerList.getListeners(ItemListener.class);
     }
 
-    public void addActionListener(final ActionListener listener) {
+    public void addActionListener(ActionListener listener) {
         listenerList.add(ActionListener.class, listener);
     }
 
-    public void removeActionListener(final ActionListener listener) {
+    public void removeActionListener(ActionListener listener) {
         listenerList.remove(ActionListener.class, listener);
     }
 
     public ActionListener[] getActionListeners() {
-        return (ActionListener[])listenerList.getListeners(ActionListener.class);
+        return listenerList.getListeners(ActionListener.class);
     }
 
-    public void setGroup(final ButtonGroup group) {
+    public void setGroup(ButtonGroup group) {
         this.group = group;
     }
 
@@ -94,7 +110,7 @@
         return group;
     }
 
-    public void setActionCommand(final String command) {
+    public void setActionCommand(String command) {
         actionCommand = command;
     }
 
@@ -106,12 +122,11 @@
         return null;
     }
 
-    public void setSelected(final boolean selected) {
+    public void setSelected(boolean selected) {
         if (isSelected() != selected) {
             toggleState(SELECTED);
             int state = selected ? ItemEvent.SELECTED : ItemEvent.DESELECTED;
-            ItemEvent event = new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED,
-                                            this, state);
+            ItemEvent event = new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, this, state);
             fireItemStateChanged(event);
         }
     }
@@ -120,7 +135,7 @@
         return isStateSet(SELECTED);
     }
 
-    public void setRollover(final boolean rollover) {
+    public void setRollover(boolean rollover) {
         if (isEnabled() && isRollover() != rollover) {
             toggleState(ROLLOVER);
         }
@@ -130,13 +145,12 @@
         return isStateSet(ROLLOVER);
     }
 
-    public void setPressed(final boolean pressed) {
+    public void setPressed(boolean pressed) {
         if (isEnabled() && isPressed() != pressed) {
             toggleState(PRESSED);
             if (!pressed && isArmed()) {
-                fireActionPerformed(new ActionEvent(this,
-                        ActionEvent.ACTION_PERFORMED, actionCommand,
-                        System.currentTimeMillis(), 0));
+                fireActionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED,
+                        actionCommand, System.currentTimeMillis(), 0));
             }
         }
     }
@@ -145,7 +159,7 @@
         return isStateSet(PRESSED);
     }
 
-    public void setEnabled(final boolean enabled) {
+    public void setEnabled(boolean enabled) {
         if (isEnabled() != enabled) {
             stateMask = isSelected() ? SELECTED : 0;
             if (enabled) {
@@ -159,7 +173,7 @@
         return isStateSet(ENABLED);
     }
 
-    public void setArmed(final boolean armed) {
+    public void setArmed(boolean armed) {
         if (isEnabled() && isArmed() != armed) {
             toggleState(ARMED);
         }
@@ -169,7 +183,7 @@
         return isStateSet(ARMED);
     }
 
-    public void setMnemonic(final int mnemonic) {
+    public void setMnemonic(int mnemonic) {
         if (this.mnemonic != mnemonic) {
             this.mnemonic = mnemonic;
             fireStateChanged();
@@ -193,26 +207,26 @@
         }
     }
 
-    protected void fireItemStateChanged(final ItemEvent event) {
+    protected void fireItemStateChanged(ItemEvent event) {
         ItemListener[] listeners = getItemListeners();
         for (int i = 0; i < listeners.length; i++) {
             listeners[i].itemStateChanged(event);
         }
     }
 
-    protected void fireActionPerformed(final ActionEvent event) {
+    protected void fireActionPerformed(ActionEvent event) {
         ActionListener[] listeners = getActionListeners();
         for (int i = 0; i < listeners.length; i++) {
             listeners[i].actionPerformed(event);
         }
     }
 
-    private void toggleState(final int stateFlag) {
+    private void toggleState(int stateFlag) {
         stateMask ^= stateFlag;
         fireStateChanged();
     }
 
-    private boolean isStateSet(final int stateFlag) {
+    private boolean isStateSet(int stateFlag) {
         return (stateMask & stateFlag) != 0;
     }
-}
\ No newline at end of file
+}



Mime
View raw message