Index: ChangeLog =================================================================== RCS file: /cvsroot/classpath/classpath/ChangeLog,v retrieving revision 1.2386.2.68 diff -u -3 -p -u -r1.2386.2.68 ChangeLog --- ChangeLog 26 Jan 2005 02:30:46 -0000 1.2386.2.68 +++ ChangeLog 27 Jan 2005 02:28:06 -0000 @@ -1,3 +1,222 @@ +2005-01-27 Andrew John Hughes + + * javax/swing/SwingUtilities.java: + (getAccessibleAt(java.awt.Component, java.awt.Point)): + Implemented and documented. + (getAccessibleChild(java.awt.Component, int)): Likewise. + (getAccessibleChildrenCount(java.awt.Component)): Likewise. + (getAccessibleIndexInParent(java.awt.Component)): Likewise. + (getAccessibleStateSet(java.awt.Component)): Likewise. + +2005-01-27 Michael Koch + + * javax/swing/AbstractAction.java + (ENABLED_PROPERTY): Removed. + (setEnabled): Replaced constant with real string. + * javax/swing/AbstractButton.java + (createActionPropertyChangeListener.propertyChange): Likewise. + * javax/swing/JComboBox.java + (DEFAULT_MAXIMUM_ROW_COUNT): Made private. + (EDITABLE_CHANGED_PROPERTY): Removed. + (MAXIMUM_ROW_COUNT_CHANGED_PROPERTY):Likewise. + (ENABLED_CHANGED_PROPERTY):Likewise. + (RENDERER_CHANGED_PROPERTY):Likewise. + (EDITOR_CHANGED_PROPERTY):Likewise. + (MODEL_CHANGED_PROPERTY):Likewise. + (uiClassID):Likewise. + (getUIClassID): Replaced constant with real string. + (setModel):Likewise. + (setEditable):Likewise. + (setMaximumRowCount):Likewise. + (setRenderer):Likewise. + (setEditor):Likewise. + (setEnabled):Likewise. + * javax/swing/JLabel.java + (DISABLED_ICON_CHANGED_PROPERTY): Removed. + (DISPLAYED_MNEMONIC_CHANGED_PROPERTY): Likewise. + (DISPLAYED_MNEMONIC_INDEX_CHANGED_PROPERTY): Likewise. + (HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY): Likewise. + (HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY): Likewise. + (ICON_CHANGED_PROPERTY): Likewise. + (ICON_TEXT_GAP_CHANGED_PROPERTY): Likewise. + (LABEL_FOR_CHANGED_PROPERTY): Likewise. + (TEXT_CHANGED_PROPERTY): Likewise. + (VERTICAL_ALIGNMENT_CHANGED_PROPERTY): Likewise. + (VERTICAL_TEXT_POSITION_CHANGED_PROPERTY): Likewise. + (setText): Replaced constant with real string. + (setIcon): Likewise. + (setDisabledIcon): Likewise. + (setDisplayedMnemonic): Likewise. + (setIconTextGap): Likewise. + (setVerticalAlignment): Likewise. + (setHorizontalAlignment): Likewise. + (setVerticalTextPosition): Likewise. + (setHorizontalTextPosition): Likewise. + (setLabelFor): Replaced constant with real string. + Fire property change event after property got changed. + * javax/swing/JList.java + (CELL_RENDERER_PROPERTY_CHANGED): Likewise. + (FIXED_CELL_HEIGHT_PROPERTY_CHANGED): Likewise. + (FIXED_CELL_WIDTH_PROPERTY_CHANGED): Likewise. + (LAYOUT_ORIENTATION_PROPERTY_CHANGED): Likewise. + (MODEL_PROPERTY_CHANGED): Likewise. + (PROTOTYPE_CELL_VALUE_PROPERTY_CHANGED): Likewise. + (SELECTION_BACKGROUND_PROPERTY_CHANGED): Likewise. + (SELECTION_FOREGROUND_PROPERTY_CHANGED): Likewise. + (SELECTION_MODEL_PROPERTY_CHANGED): Likewise. + (setFixedCellWidth): Reimplemented. + (setFixedCellHeight): Exit if new value is identical. + Replaced constant with real string. + (setSelectionBackground): Likewise. + (setSelectionForeground): Likewise. + (setPrototypeCellValue): Likewise. + (setCellRenderer): Replaced constant with real string. + (setModel): Likewise. + (setSelectionModel): Likewise. + * javax/swing/JMenuBar.java + (BORDER_PAINTED_CHANGED_PROPERTY): Removed. + (MODEL_CHANGED_PROPERTY): Likewise. + (MARGIN_CHANGED_PROPERTY): Likewise. + (setBorderPainted): Reimplemented. + (setMargin): Likewise. + (setSelectionModel): Replaced constant with real string. + * javax/swing/JPopupMenu.java + (LABEL_CHANGED_PROPERTY): Removed. + (VISIBLE_CHANGED_PROPERTY): Likewise. + (borderPainted): Likewise. + (setLabel): Replaced constant with real string. + (setVisible): Exit if new value is identical. + Replaced constant with real string. + * javax/swing/JProgressBar.java + (BORDER_PAINTED_CHANGED_PROPERTY): Removed. + (ORIENTATION_CHANGED_PROPERTY): Likewise. + (STRING_CHANGED_PROPERTY): Likewise. + (STRING_PAINTED_CHANGED_PROPERTY): Likewise. + (INDETERMINATE_CHANGED_PROPERTY): Likewise. + (setOrientation): Replaced constant with real string. + (setStringPainted): Likewise. + (setString): Likewise. + (setBorderPainted): Likewise. + (setIndeterminate): Likewise. + * javax/swing/JScrollBar.java + (BLOCK_INCREMENT_CHANGED_PROPERTY): Removed. + (MODEL_CHANGED_PROPERTY): Likewise. + (ORIENTATION_CHANGED_PROPERTY): Likewise. + (setOrientation): Replaced constant with real string. + (setModel): Likewise. + (setUnitIncrement): Likewise. + (setBlockIncrement): Likewise. + * javax/swing/JScrollPane.java + (COLUMN_HEADER_CHANGED_PROPERTY): Removed. + (COMPONENT_ORIENTATION_CHANGED_PROPERTY): Likewise. + (HORIZONTAL_SCROLLBAR_CHANGED_PROPERTY): Likewise. + (HORIZONTAL_SCROLLBAR_POLICY_CHANGED_PROPERTY): Likewise. + (LAYOUT_CHANGED_PROPERTY): Likewise. + (ROW_HEADER_CHANGED_PROPERTY): Likewise. + (VERTICAL_SCROLLBAR_CHANGED_PROPERTY): Likewise. + (VERTICAL_SCROLLBAR_POLICY_CHANGED_PROPERTY): Likewise. + (VIEWPORT_CHANGED_PROPERTY): Likewise. + (VIEWPORT_BORDER_CHANGED_PROPERTY): Likewise. + (WHEEL_SCROLLING_ENABLED_CHANGED_PROPERTY): Likewise. + (setComponentOrientation): Replaced constant with real string. + (setColumnHeader): Likewise. + (setHorizontalScrollBar): Likewise. + (setHorizontalScrollBarPolicy): Likewise. + (setRowHeader): Likewise. + (setVerticalScrollBar): Likewise. + (setVerticalScrollBarPolicy): Likewise. + (setWheelScrollingEnabled): Likewise. + (setViewport): Likewise. + (setViewportBorder): Likewise. + * javax/swing/JSlider.java + (INVERTED_CHANGED_PROPERTY): Removed. + (LABEL_TABLE_CHANGED_PROPERTY): Likewise. + (MAJOR_TICK_SPACING_CHANGED_PROPERTY): Likewise. + (MINOR_TICK_SPACING_CHANGED_PROPERTY): Likewise. + (MODEL_CHANGED_PROPERTY): Likewise. + (ORIENTATION_CHANGED_PROPERTY): Likewise. + (PAINT_LABELS_CHANGED_PROPERTY): Likewise. + (PAINT_TICKS_CHANGED_PROPERTY): Likewise. + (setModel): Replaced constant with real string. + (setOrientation): Likewise. + (setLabelTable): Likewise. + (setInverted): Likewise. + (setMajorTickSpacing): Likewise. + (setMinorTickSpacing): Likewise. + (setPaintTicks): Likewise. + (setPaintLabels): Likewise. + * javax/swing/JTabbedPane.java + (MODEL_CHANGED_PROPERTY): Removed. + (TAB_PLACEMENT_CHANGED_PROPERTY): Likewise. + (TAB_LAYOUT_POLICY_CHANGED_PROPERTY): Likewise. + (setModel): Replaced constant with real string. + (setTabPlacement): Likewise. + (setTabLayoutPolicy): Likewise. + * javax/swing/JToolBar.java + (ORIENTATION_CHANGED_PROPERTY): Removed. + (FLOATABLE_CHANGED_PROPERTY): Likewise. + (BORDER_PAINTED_CHANGED_PROPERTY): Likewise. + (MARGIN_CHANGED_PROPERTY): Likewise. + (ROLLOVER_CHANGED_PROPERTY): Likewise. + (setRollover): Replaced constant with real string. + (setMargin): Likewise. + (setBorderPainted): Likewise. + (setFloatable): Likewise. + (setOrientation): Likewise. + * javax/swing/plaf/basic/BasicComboBoxUI.java + (PropertyChangeHandler.propertyChange): Likewise. + * javax/swing/plaf/basic/BasicComboPopup.java + (PropertyChangeHandler.propertyChange): Likewise. + * javax/swing/plaf/basic/BasicMenuBarUI.java + (PropertyChangeHandler.propertyChange): Likewise. + * javax/swing/plaf/basic/BasicProgressBarUI.java + (PropertyChangeHandler.propertyChange): Likewise. + * javax/swing/plaf/basic/BasicScrollBarUI.java + (PropertyChangeHandler.propertyChange): Likewise. + * javax/swing/plaf/basic/BasicSliderUI.java + (PropertyChangeHandler.propertyChange): Likewise. + * javax/swing/plaf/basic/BasicTabbedPaneUI.java + (PropertyChangeHandler.propertyChange): Likewise. + * javax/swing/plaf/basic/BasicToolBarUI.java + (PropertyChangeHandler.propertyChange): Likewise. + +2005-01-26 Michael Koch + + * javax/swing/DefaultButtonModel.java + (changeState): Made private. + * javax/swing/DefaultDesktopManager.java + (setWasIcon): Fixed second argument to be java.lang.Boolean. + * javax/swing/JLayeredPane.java + (layerToRange): Made private. + (incrLayer): Likewise. + (decrLayer): Likewise. + * javax/swing/JTable.java + (dragEnabled): Likewise. + (preferredViewportSize): Renamed from preferredScrollableViewportSize. + * javax/swing/KeyStroke.java + (Keystroke): Made private. + * javax/swing/TransferHandler.java + (COMMAND_COPY): Likewise. + (COMMAND_CUT): Likewise. + (COMMAND_PASTE): Likewise. + +2005-01-26 Michael Koch + + * javax/swing/JTextField.java + (postActionEvent): Use text in field when actionCommand is null. + (getActionCommand): Removed. + +2005-01-26 Michael Koch + + * javax/swing/AbstractSet.java: Removed. + +2005-01-26 Michael Koch + + * java/awt/Window.java + (AccessibleWindow.getAccessibleStateSet): Fixed method name. + * java/awt/dnd/DnDConstants.java + (DnDConstants): New private constructor. + 2005-01-25 Ito Kazumitsu * java/text/SimpleDateFormat.java: Index: java/awt/Window.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/awt/Window.java,v retrieving revision 1.35.2.3 diff -u -3 -p -u -r1.35.2.3 Window.java --- java/awt/Window.java 16 Jan 2005 15:15:11 -0000 1.35.2.3 +++ java/awt/Window.java 27 Jan 2005 02:28:07 -0000 @@ -99,7 +99,7 @@ public class Window extends Container im return AccessibleRole.WINDOW; } - public AccessibleStateSet getAccessibleState() + public AccessibleStateSet getAccessibleStateSet() { AccessibleStateSet states = super.getAccessibleStateSet(); if (isActive()) Index: java/awt/dnd/DnDConstants.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/awt/dnd/DnDConstants.java,v retrieving revision 1.1 diff -u -3 -p -u -r1.1 DnDConstants.java --- java/awt/dnd/DnDConstants.java 8 May 2002 07:53:54 -0000 1.1 +++ java/awt/dnd/DnDConstants.java 27 Jan 2005 02:28:07 -0000 @@ -1,5 +1,5 @@ /* DnDConstants.java -- constants for drag-and-drop operations - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -69,4 +69,9 @@ public final class DnDConstants /** A synonym for address@hidden #ACTION_LINK}. */ public static final int ACTION_REFERENCE = ACTION_LINK; -} // class DnDConstants + + private DnDConstants() + { + // Do nothing here. + } +} Index: javax/swing/AbstractAction.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/AbstractAction.java,v retrieving revision 1.10.2.2 diff -u -3 -p -u -r1.10.2.2 AbstractAction.java --- javax/swing/AbstractAction.java 16 Jan 2005 15:15:13 -0000 1.10.2.2 +++ javax/swing/AbstractAction.java 27 Jan 2005 02:28:07 -0000 @@ -1,5 +1,5 @@ /* AbstractAction.java -- - Copyright (C) 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -62,8 +62,6 @@ public abstract class AbstractAction */ protected boolean enabled = true; - public static final String ENABLED_PROPERTY = "enabled"; - /** * changeSupport */ @@ -193,7 +191,7 @@ public abstract class AbstractAction if (enabled != this.enabled) { this.enabled = enabled; - firePropertyChange(ENABLED_PROPERTY, !this.enabled, this.enabled); + firePropertyChange("enabled", !this.enabled, this.enabled); } } Index: javax/swing/AbstractButton.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/AbstractButton.java,v retrieving revision 1.17.2.4 diff -u -3 -p -u -r1.17.2.4 AbstractButton.java --- javax/swing/AbstractButton.java 26 Jan 2005 02:30:49 -0000 1.17.2.4 +++ javax/swing/AbstractButton.java 27 Jan 2005 02:28:08 -0000 @@ -1509,7 +1509,7 @@ public abstract class AbstractButton ext public void propertyChange(PropertyChangeEvent e) { Action act = (Action) (e.getSource()); - if (e.getPropertyName().equals(AbstractAction.ENABLED_PROPERTY)) + if (e.getPropertyName().equals("enabled")) setEnabled(act.isEnabled()); else if (e.getPropertyName().equals(Action.NAME)) setText((String)(act.getValue(Action.NAME))); Index: javax/swing/DefaultButtonModel.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/DefaultButtonModel.java,v retrieving revision 1.10.2.4 diff -u -3 -p -u -r1.10.2.4 DefaultButtonModel.java --- javax/swing/DefaultButtonModel.java 26 Jan 2005 02:30:49 -0000 1.10.2.4 +++ javax/swing/DefaultButtonModel.java 27 Jan 2005 02:28:08 -0000 @@ -315,7 +315,7 @@ public class DefaultButtonModel implemen * @param stateflag DOCUMENT ME! * @param b DOCUMENT ME! */ - protected void changeState(int stateflag, boolean b) + private void changeState(int stateflag, boolean b) { int oldstate = stateMask; int newstate; Index: javax/swing/DefaultDesktopManager.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/DefaultDesktopManager.java,v retrieving revision 1.6.2.2 diff -u -3 -p -u -r1.6.2.2 DefaultDesktopManager.java --- javax/swing/DefaultDesktopManager.java 16 Jan 2005 15:15:13 -0000 1.6.2.2 +++ javax/swing/DefaultDesktopManager.java 27 Jan 2005 02:28:08 -0000 @@ -1,5 +1,5 @@ /* DefaultDesktopManager.java -- - Copyright (C) 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -35,6 +35,7 @@ this exception to your version of the li obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ + package javax.swing; import java.awt.Component; @@ -90,7 +91,7 @@ public class DefaultDesktopManager imple */ public DefaultDesktopManager() { - } // DefaultDesktopManager() + } /** * This method is not normally called since the user will typically add the @@ -111,7 +112,7 @@ public class DefaultDesktopManager imple c.remove(frame.getDesktopIcon()); c.add(frame); frame.setVisible(true); - } // openFrame() + } /** * This method removes the JInternalFrame and JDesktopIcon (if one is @@ -132,7 +133,7 @@ public class DefaultDesktopManager imple c.remove(frame); c.repaint(); } - } // closeFrame() + } /** * This method resizes the JInternalFrame to match its parent's bounds. @@ -171,7 +172,7 @@ public class DefaultDesktopManager imple // Do nothing. } } - } // maximizeFrame() + } /** * This method restores the JInternalFrame's bounds to what they were @@ -200,7 +201,7 @@ public class DefaultDesktopManager imple setBoundsForFrame(frame, normalBounds.x, normalBounds.y, normalBounds.width, normalBounds.height); - } // minimizeFrame() + } /** * This method removes the JInternalFrame from its parent and adds its @@ -231,7 +232,7 @@ public class DefaultDesktopManager imple { Rectangle r = getBoundsForIconOf(frame); icon.setBounds(r); - setWasIcon(frame, true); + setWasIcon(frame, Boolean.TRUE); } if (c != null) @@ -243,7 +244,7 @@ public class DefaultDesktopManager imple } c.remove(frame); } - } // iconifyFrame() + } /** * This method removes the JInternalFrame's JDesktopIcon representation and @@ -279,7 +280,7 @@ public class DefaultDesktopManager imple } c.invalidate(); - } // deiconifyFrame() + } /** * This method activates the JInternalFrame by moving it to the front and @@ -305,7 +306,7 @@ public class DefaultDesktopManager imple } frame.toFront(); - } // activateFrame() + } /** * This method is called when the JInternalFrame loses focus. @@ -330,7 +331,7 @@ public class DefaultDesktopManager imple { } } - } // deactivateFrame() + } /** * This method is called to indicate that the DesktopManager should prepare @@ -354,7 +355,7 @@ public class DefaultDesktopManager imple currentDragMode = JDesktopPane.LIVE_DRAG_MODE; else currentDragMode = ((JDesktopPane) pane).getDragMode(); - } // beginDraggingFrame() + } /** * This method is called to drag the JInternalFrame to a new location. @@ -378,7 +379,7 @@ public class DefaultDesktopManager imple setBoundsForFrame((JInternalFrame) component, newX, newY, b.width, b.height); } - } // dragFrame() + } /** * This method indicates that the dragging is done. Any state information @@ -396,7 +397,7 @@ public class DefaultDesktopManager imple dragCache = null; } component.repaint(); - } // endDraggingFrame() + } /** * This method is called to indicate that the given JComponent will be @@ -417,7 +418,7 @@ public class DefaultDesktopManager imple currentDragMode = JDesktopPane.LIVE_DRAG_MODE; else currentDragMode = ((JDesktopPane) pane).getDragMode(); - } // beginResizingFrame() + } /** * This method resizes the give JComponent. @@ -440,7 +441,7 @@ public class DefaultDesktopManager imple else setBoundsForFrame(component, dragCache.x, dragCache.y, dragCache.width, dragCache.height); - } // resizeFrame() + } /** * This method is called to indicate that the given JComponent has finished @@ -459,7 +460,7 @@ public class DefaultDesktopManager imple dragCache = null; } component.repaint(); - } // endResizingFrame() + } /** * This method calls setBounds with the given parameters and repaints the @@ -482,7 +483,7 @@ public class DefaultDesktopManager imple component.getParent().repaint(); else component.repaint(); - } // setBoundsForFrame() + } /** * This is a helper method that removes the JDesktopIcon of the given @@ -496,7 +497,7 @@ public class DefaultDesktopManager imple Container c = icon.getParent(); if (c != null && icon != null) c.remove(icon); - } // removeIconFor() + } /** * This method is called by iconifyFrame to determine the bounds of the @@ -570,7 +571,7 @@ public class DefaultDesktopManager imple } return ideal; - } // getBoundsForIconOf() + } /** * This method sets the bounds of the JInternalFrame right before the @@ -582,7 +583,7 @@ public class DefaultDesktopManager imple protected void setPreviousBounds(JInternalFrame frame, Rectangle rect) { frame.setNormalBounds(rect); - } // setPreviousBounds() + } /** * This method returns the normal bounds of the JInternalFrame from before @@ -595,7 +596,7 @@ public class DefaultDesktopManager imple protected Rectangle getPreviousBounds(JInternalFrame frame) { return frame.getNormalBounds(); - } // getPreviousBounds() + } /** * This method sets the value to true if the given JInternalFrame has been @@ -605,10 +606,10 @@ public class DefaultDesktopManager imple * @param value True if the JInternalFrame has been iconized and the bounds * of the JDesktopIcon are valid. */ - protected void setWasIcon(JInternalFrame frame, boolean value) + protected void setWasIcon(JInternalFrame frame, Boolean value) { - frame.setWasIcon(value, WAS_ICON_ONCE_PROPERTY); - } // setWasIcon() + frame.setWasIcon(value.booleanValue(), WAS_ICON_ONCE_PROPERTY); + } /** * This method returns true if the given JInternalFrame has been iconized @@ -622,5 +623,5 @@ public class DefaultDesktopManager imple protected boolean wasIcon(JInternalFrame frame) { return frame.getWasIcon(); - } // wasIcon() -} // DefaultDesktopManager + } +} Index: javax/swing/JComboBox.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/JComboBox.java,v retrieving revision 1.8.2.3 diff -u -3 -p -u -r1.8.2.3 JComboBox.java --- javax/swing/JComboBox.java 16 Jan 2005 15:15:13 -0000 1.8.2.3 +++ javax/swing/JComboBox.java 27 Jan 2005 02:28:08 -0000 @@ -1,5 +1,5 @@ /* JComboBox.java -- - Copyright (C) 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -92,43 +92,7 @@ public class JComboBox extends JComponen * Maximum number of rows that should be visible by default in the * JComboBox's popup */ - public static final int DEFAULT_MAXIMUM_ROW_COUNT = 8; - - /** - * Fired in a PropertyChangeEvent when the 'editable' property changes. - */ - public static final String EDITABLE_CHANGED_PROPERTY = "editable"; - - /** - * Fired in a PropertyChangeEvent when the 'maximumRowCount' property - * changes. - */ - public static final String MAXIMUM_ROW_COUNT_CHANGED_PROPERTY = "maximumRowCount"; - - /** - * Fired in a PropertyChangeEvent when the 'enabled' property changes. - */ - public static final String ENABLED_CHANGED_PROPERTY = "enabled"; - - /** - * Fired in a PropertyChangeEvent when the 'renderer' property changes. - */ - public static final String RENDERER_CHANGED_PROPERTY = "renderer"; - - /** - * Fired in a PropertyChangeEvent when the 'editor' property changes. - */ - public static final String EDITOR_CHANGED_PROPERTY = "editor"; - - /** - * Fired in a PropertyChangeEvent when the 'dataModel' property changes. - */ - public static final String MODEL_CHANGED_PROPERTY = "dataModel"; - - /** - * name for the UI delegate for this combo box. - */ - private static final String uiClassID = "ComboBoxUI"; + private static final int DEFAULT_MAXIMUM_ROW_COUNT = 8; /** * dataModel used by JComboBox to keep track of its list data and currently @@ -298,7 +262,7 @@ public class JComboBox extends JComponen */ public String getUIClassID() { - return uiClassID; + return "ComboBoxUI"; } /** @@ -342,7 +306,7 @@ public class JComboBox extends JComponen dataModel = newDataModel; // Notifies the listeners of the model change. - firePropertyChange(MODEL_CHANGED_PROPERTY, oldDataModel, dataModel); + firePropertyChange("model", oldDataModel, dataModel); } /** @@ -397,7 +361,7 @@ public class JComboBox extends JComponen if (isEditable != editable) { isEditable = editable; - firePropertyChange(EDITABLE_CHANGED_PROPERTY, ! isEditable, isEditable); + firePropertyChange("editable", ! isEditable, isEditable); } } @@ -415,7 +379,7 @@ public class JComboBox extends JComponen { int oldMaximumRowCount = maximumRowCount; maximumRowCount = rowCount; - firePropertyChange(MAXIMUM_ROW_COUNT_CHANGED_PROPERTY, + firePropertyChange("maximumRowCount", oldMaximumRowCount, maximumRowCount); } } @@ -447,7 +411,7 @@ public class JComboBox extends JComponen { ListCellRenderer oldRenderer = renderer; renderer = aRenderer; - firePropertyChange(RENDERER_CHANGED_PROPERTY, oldRenderer, + firePropertyChange("renderer", oldRenderer, renderer); } } @@ -483,7 +447,7 @@ public class JComboBox extends JComponen if (editor != null) editor.addActionListener(this); - firePropertyChange(EDITOR_CHANGED_PROPERTY, oldEditor, editor); + firePropertyChange("editor", oldEditor, editor); } /** @@ -967,8 +931,7 @@ public class JComboBox extends JComponen if (enabled != oldEnabled) { super.setEnabled(enabled); - firePropertyChange(ENABLED_CHANGED_PROPERTY, oldEnabled, - (boolean) enabled); + firePropertyChange("enabled", oldEnabled, enabled); } } Index: javax/swing/JLabel.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/JLabel.java,v retrieving revision 1.12.2.3 diff -u -3 -p -u -r1.12.2.3 JLabel.java --- javax/swing/JLabel.java 16 Jan 2005 15:15:13 -0000 1.12.2.3 +++ javax/swing/JLabel.java 27 Jan 2005 02:28:08 -0000 @@ -1,5 +1,5 @@ /* JLabel.java -- - Copyright (C) 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -92,59 +92,6 @@ public class JLabel extends JComponent i private transient int iconTextGap = 4; /** - * Fired in a PropertyChangeEvent when the "disabledIcon" property changes. - */ - public static final String DISABLED_ICON_CHANGED_PROPERTY = "disabledIcon"; - - /** - * Fired in a PropertyChangeEvent when the "displayedMnemonic" property - * changes. - */ - public static final String DISPLAYED_MNEMONIC_CHANGED_PROPERTY = "displayedMnemonic"; - - /** - * Fired in a PropertyChangeEvent when the "displayedMnemonicIndex" property - * changes. - */ - public static final String DISPLAYED_MNEMONIC_INDEX_CHANGED_PROPERTY = "displayedMnemonicIndex"; - - /** - * Fired in a PropertyChangeEvent when the "horizontalAlignment" property - * changes. - */ - public static final String HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY = "horizontalAlignment"; - - /** - * Fired in a PropertyChangeEvent when the "horizontalTextPosition" property - * changes. - */ - public static final String HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY = "horizontalTextPosition"; - - /** Fired in a PropertyChangeEvent when the "icon" property changes. */ - public static final String ICON_CHANGED_PROPERTY = "icon"; - - /** Fired in a PropertyChangeEvent when the "iconTextGap" property changes. */ - public static final String ICON_TEXT_GAP_CHANGED_PROPERTY = "iconTextGap"; - - /** Fired in a PropertyChangeEvent when the "labelFor" property changes. */ - public static final String LABEL_FOR_CHANGED_PROPERTY = "labelFor"; - - /** Fired in a PropertyChangeEvent when the "text" property changes. */ - public static final String TEXT_CHANGED_PROPERTY = "text"; - - /** - * Fired in a PropertyChangeEvent when the "verticalAlignment" property - * changes. - */ - public static final String VERTICAL_ALIGNMENT_CHANGED_PROPERTY = "verticalAlignment"; - - /** - * Fired in a PropertyChangeEvent when the "verticalTextPosition" property - * changes. - */ - public static final String VERTICAL_TEXT_POSITION_CHANGED_PROPERTY = "verticalTextPosition"; - - /** * Creates a new horizontally and vertically centered JLabel object with no * text and no icon. */ @@ -289,7 +236,7 @@ public class JLabel extends JComponent i { String oldText = text; text = newText; - firePropertyChange(TEXT_CHANGED_PROPERTY, oldText, newText); + firePropertyChange("text", oldText, newText); if (text != null && text.length() <= displayedMnemonicIndex) setDisplayedMnemonicIndex(text.length() - 1); @@ -319,7 +266,7 @@ public class JLabel extends JComponent i { Icon oldIcon = icon; icon = newIcon; - firePropertyChange(ICON_CHANGED_PROPERTY, oldIcon, newIcon); + firePropertyChange("icon", oldIcon, newIcon); } } @@ -352,7 +299,7 @@ public class JLabel extends JComponent i { Icon oldIcon = disabledIcon; disabledIcon = newIcon; - firePropertyChange(DISABLED_ICON_CHANGED_PROPERTY, oldIcon, newIcon); + firePropertyChange("disabledIcon", oldIcon, newIcon); } } @@ -367,7 +314,7 @@ public class JLabel extends JComponent i { if (displayedMnemonic != mnemonic) { - firePropertyChange(DISPLAYED_MNEMONIC_CHANGED_PROPERTY, + firePropertyChange("displayedMnemonic", displayedMnemonic, mnemonic); displayedMnemonic = mnemonic; @@ -424,7 +371,7 @@ public class JLabel extends JComponent i { int oldIndex = displayedMnemonicIndex; displayedMnemonicIndex = newIndex; - firePropertyChange(DISPLAYED_MNEMONIC_INDEX_CHANGED_PROPERTY, + firePropertyChange("displayedMnemonicIndex", oldIndex, newIndex); } } @@ -501,7 +448,7 @@ public class JLabel extends JComponent i { if (iconTextGap != newGap) { - firePropertyChange(ICON_TEXT_GAP_CHANGED_PROPERTY, iconTextGap, newGap); + firePropertyChange("iconTextGap", iconTextGap, newGap); iconTextGap = newGap; } } @@ -531,8 +478,7 @@ public class JLabel extends JComponent i int oldAlignment = verticalAlignment; verticalAlignment = checkVerticalKey(alignment, "verticalAlignment"); - firePropertyChange(VERTICAL_ALIGNMENT_CHANGED_PROPERTY, - oldAlignment, verticalAlignment); + firePropertyChange("verticalAlignment", oldAlignment, verticalAlignment); } /** @@ -558,7 +504,7 @@ public class JLabel extends JComponent i int oldAlignment = horizontalAlignment; horizontalAlignment = checkHorizontalKey(alignment, "horizontalAlignment"); - firePropertyChange(HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, oldAlignment, + firePropertyChange("horizontalAlignment", oldAlignment, horizontalAlignment); } @@ -586,7 +532,7 @@ public class JLabel extends JComponent i int oldPos = verticalTextPosition; verticalTextPosition = checkVerticalKey(textPosition, "verticalTextPosition"); - firePropertyChange(VERTICAL_TEXT_POSITION_CHANGED_PROPERTY, oldPos, + firePropertyChange("verticalTextPosition", oldPos, verticalTextPosition); } } @@ -615,7 +561,7 @@ public class JLabel extends JComponent i int oldPos = horizontalTextPosition; horizontalTextPosition = checkHorizontalKey(textPosition, "horizontalTextPosition"); - firePropertyChange(HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, oldPos, + firePropertyChange("horizontalTextPosition", oldPos, horizontalTextPosition); } } @@ -671,8 +617,9 @@ public class JLabel extends JComponent i { if (c != labelFor) { - firePropertyChange(LABEL_FOR_CHANGED_PROPERTY, labelFor, c); + Component oldLabelFor = labelFor; labelFor = c; + firePropertyChange("labelFor", oldLabelFor, labelFor); } } Index: javax/swing/JLayeredPane.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/JLayeredPane.java,v retrieving revision 1.13.2.3 diff -u -3 -p -u -r1.13.2.3 JLayeredPane.java --- javax/swing/JLayeredPane.java 16 Jan 2005 15:15:13 -0000 1.13.2.3 +++ javax/swing/JLayeredPane.java 27 Jan 2005 02:28:08 -0000 @@ -143,7 +143,7 @@ public class JLayeredPane extends JCompo * @throws IllegalArgumentException if layer does not refer to an active layer * in this container. */ - protected int[] layerToRange (Integer layer) + private int[] layerToRange (Integer layer) { int[] ret = new int[2]; ret[1] = getComponents ().length; @@ -173,7 +173,7 @@ public class JLayeredPane extends JCompo * @param layer the layer number to increment. * @see #incrLayer() */ - protected void incrLayer(Integer layer) + private void incrLayer(Integer layer) { int sz = 1; if (layers.containsKey (layer)) @@ -187,7 +187,7 @@ public class JLayeredPane extends JCompo * @param layer the layer number to decrement. * @see #decrLayer() */ - protected void decrLayer(Integer layer) + private void decrLayer(Integer layer) { int sz = 0; if (layers.containsKey (layer)) Index: javax/swing/JList.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/JList.java,v retrieving revision 1.16.2.4 diff -u -3 -p -u -r1.16.2.4 JList.java --- javax/swing/JList.java 16 Jan 2005 15:15:13 -0000 1.16.2.4 +++ javax/swing/JList.java 27 Jan 2005 02:28:09 -0000 @@ -1,5 +1,5 @@ /* JList.java -- - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -129,34 +129,6 @@ public class JList extends JComponent im */ public static final int HORIZONTAL_WRAP = 2; - /** Fired in a PropertyChangeEvent when the "cellRenderer" property changes. */ - public static final String CELL_RENDERER_PROPERTY_CHANGED = "cellRenderer"; - - /** Fired in a PropertyChangeEvent when the "fixedCellHeight" property changes. */ - public static final String FIXED_CELL_HEIGHT_PROPERTY_CHANGED = "fixedCellHeight"; - - /** Fired in a PropertyChangeEvent when the "fixedCellWidth" property changes. */ - public static final String FIXED_CELL_WIDTH_PROPERTY_CHANGED = "fixedCellWidth"; - - /** Fired in a PropertyChangeEvent when the "layoutOrientation" property changes. */ - public static final String LAYOUT_ORIENTATION_PROPERTY_CHANGED = "layoutOrientation"; - - /** Fired in a PropertyChangeEvent when the "model" property changes. */ - public static final String MODEL_PROPERTY_CHANGED = "model"; - - /** Fired in a PropertyChangeEvent when the "prototypeCellValue" property changes. */ - public static final String PROTOTYPE_CELL_VALUE_PROPERTY_CHANGED = "prototypeCellValue"; - - /** Fired in a PropertyChangeEvent when the "selectionBackground" property changes. */ - public static final String SELECTION_BACKGROUND_PROPERTY_CHANGED = "selectionBackground"; - - /** Fired in a PropertyChangeEvent when the "selectionForeground" property changes. */ - public static final String SELECTION_FOREGROUND_PROPERTY_CHANGED = "selectionForeground"; - - /** Fired in a PropertyChangeEvent when the "selectionModel" property changes. */ - public static final String SELECTION_MODEL_PROPERTY_CHANGED = "selectionModel"; - - /** * This property indicates whether "drag and drop" functions are enabled * on the list. @@ -187,7 +159,6 @@ public class JList extends JComponent im * is one of the integer constants address@hidden #VERTICAL}, address@hidden * #VERTICAL_WRAP}, or address@hidden #HORIZONTAL_WRAP}. */ - int layoutOrientation; /** This property holds the data elements displayed by the list. */ @@ -406,9 +377,12 @@ public class JList extends JComponent im */ public void setFixedCellHeight(int h) { + if (fixedCellHeight == h) + return; + int old = fixedCellHeight; fixedCellHeight = h; - firePropertyChange(FIXED_CELL_WIDTH_PROPERTY_CHANGED, old, h); + firePropertyChange("fixedCellWidth", old, h); } @@ -435,17 +409,19 @@ public class JList extends JComponent im * #prototypeCellValue} property is set, but setting it explicitly * overrides the width computed from address@hidden #prototypeCellValue}. * - * @see #getFixedCellWidth + * @see #getFixedCellHeight * @see #getPrototypeCellValue */ - public void setFixedCellWidth(int h) + public void setFixedCellWidth(int w) { - int old = fixedCellHeight; - fixedCellHeight = h; - firePropertyChange(FIXED_CELL_HEIGHT_PROPERTY_CHANGED, old, h); + if (fixedCellWidth == w) + return; + + int old = fixedCellWidth; + fixedCellWidth = w; + firePropertyChange("fixedCellWidth", old, w); } - /** * Gets the value of the address@hidden #visibleRowCount} property. * @@ -735,9 +711,12 @@ public class JList extends JComponent im */ public void setSelectionBackground(Color c) { + if (selectionBackground == c) + return; + Color old = selectionBackground; selectionBackground = c; - firePropertyChange(SELECTION_BACKGROUND_PROPERTY_CHANGED, old, c); + firePropertyChange("selectionBackground", old, c); repaint(); } @@ -758,9 +737,12 @@ public class JList extends JComponent im */ public void setSelectionForeground(Color c) { + if (selectionForeground == c) + return; + Color old = selectionForeground; selectionForeground = c; - firePropertyChange(SELECTION_FOREGROUND_PROPERTY_CHANGED, old, c); + firePropertyChange("selectionForeground", old, c); } /** @@ -871,7 +853,7 @@ public class JList extends JComponent im ListCellRenderer old = cellRenderer; cellRenderer = renderer; - firePropertyChange(CELL_RENDERER_PROPERTY_CHANGED, old, renderer); + firePropertyChange("cellRenderer", old, renderer); revalidate(); repaint(); } @@ -907,7 +889,7 @@ public class JList extends JComponent im if (this.model != null) this.model.addListDataListener(listListener); - firePropertyChange(MODEL_PROPERTY_CHANGED, old, model); + firePropertyChange("model", old, model); revalidate(); repaint(); } @@ -939,7 +921,7 @@ public class JList extends JComponent im if (selectionModel != null) selectionModel.addListSelectionListener(listListener); - firePropertyChange(SELECTION_MODEL_PROPERTY_CHANGED, old, model); + firePropertyChange("selectionModel", old, model); revalidate(); repaint(); } @@ -1019,6 +1001,9 @@ public class JList extends JComponent im */ public void setPrototypeCellValue(Object obj) { + if (prototypeCellValue == obj) + return; + Object old = prototypeCellValue; Component comp = getCellRenderer() .getListCellRendererComponent(this, obj, 0, false, false); @@ -1026,7 +1011,7 @@ public class JList extends JComponent im fixedCellWidth = d.width; fixedCellHeight = d.height; prototypeCellValue = obj; - firePropertyChange(PROTOTYPE_CELL_VALUE_PROPERTY_CHANGED, old, obj); + firePropertyChange("prototypeCellValue", old, obj); } public AccessibleContext getAccessibleContext() Index: javax/swing/JMenuBar.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/JMenuBar.java,v retrieving revision 1.9.2.1 diff -u -3 -p -u -r1.9.2.1 JMenuBar.java --- javax/swing/JMenuBar.java 15 Jan 2005 17:02:20 -0000 1.9.2.1 +++ javax/swing/JMenuBar.java 27 Jan 2005 02:28:09 -0000 @@ -1,5 +1,5 @@ /* JMenuBar.java -- - Copyright (C) 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -49,7 +49,6 @@ import javax.accessibility.AccessibleCon import javax.swing.plaf.MenuBarUI; /** - *

* JMenuBar is a container for menu's. For a menu bar to be seen on the * screen, at least one menu should be added to it. Just like adding * components to container, one can use add() to add menu's to the menu bar. @@ -57,18 +56,9 @@ import javax.swing.plaf.MenuBarUI; * The JMenuBar uses selectionModel to keep track of selected menu index. * JMenuBar's selectionModel will fire ChangeEvents to its registered * listeners when the selected index changes. - *

*/ public class JMenuBar extends JComponent implements Accessible, MenuElement { - /** Fired in a PropertyChangeEvent when the "borderPainted" property changes. */ - public static final String BORDER_PAINTED_CHANGED_PROPERTY = "borderPainted"; - - /** Fired in a PropertyChangeEvent when the "model" changes. */ - public static final String MODEL_CHANGED_PROPERTY = "model"; - - /** Fired in a PropertyChangeEvent when the "margin" changes. */ - public static final String MARGIN_CHANGED_PROPERTY = "margin"; private static final long serialVersionUID = -8191026883931977036L; /** JMenuBar's model. It keeps track of selected menu's index */ @@ -374,11 +364,11 @@ public class JMenuBar extends JComponent */ public void setBorderPainted(boolean b) { - boolean old = borderPainted; - borderPainted = b; - if (b != old) + if (b != borderPainted) { - firePropertyChange(BORDER_PAINTED_CHANGED_PROPERTY, old, b); + boolean old = borderPainted; + borderPainted = b; + firePropertyChange("borderPainted", old, b); revalidate(); repaint(); } @@ -404,14 +394,12 @@ public class JMenuBar extends JComponent */ public void setMargin(Insets m) { - if (m.equals(this.margin)) + if (m != margin) { - Insets oldMargin = this.margin; - this.margin = m; - firePropertyChange(MARGIN_CHANGED_PROPERTY, oldMargin, margin); + Insets oldMargin = margin; + margin = m; + firePropertyChange("margin", oldMargin, margin); } - - this.margin = m; } /** @@ -434,15 +422,11 @@ public class JMenuBar extends JComponent */ public void setSelectionModel(SingleSelectionModel model) { - selectionModel = model; if (selectionModel != model) { SingleSelectionModel oldModel = selectionModel; - selectionModel = model; - - firePropertyChange(MODEL_CHANGED_PROPERTY, oldModel, - this.selectionModel); + firePropertyChange("model", oldModel, selectionModel); } } Index: javax/swing/JPopupMenu.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/JPopupMenu.java,v retrieving revision 1.8.2.3 diff -u -3 -p -u -r1.8.2.3 JPopupMenu.java --- javax/swing/JPopupMenu.java 16 Jan 2005 15:15:13 -0000 1.8.2.3 +++ javax/swing/JPopupMenu.java 27 Jan 2005 02:28:09 -0000 @@ -1,5 +1,5 @@ -/* JPopupMenu.java - Copyright (C) 2002, 2004 Free Software Foundation, Inc. +/* JPopupMenu.java -- + Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -95,9 +95,6 @@ public class JPopupMenu extends JCompone /** name for the UI delegate for this menuItem. */ private static final String uiClassID = "PopupMenuUI"; - /** Fire a PropertyChangeEvent when the "borderPainted" property changes. */ - public static final String LABEL_CHANGED_PROPERTY = "label"; - /* indicates if popup's menu border should be painted*/ private boolean borderPainted = true; @@ -142,9 +139,6 @@ public class JPopupMenu extends JCompone /* Field indicating if popup menu is visible or not */ private boolean visible = false; - /* Bound Property indicating visibility of the popup menu*/ - public static final String VISIBLE_CHANGED_PROPERTY = "visible"; - /** * Creates a new JPopupMenu object. */ @@ -291,18 +285,6 @@ public class JPopupMenu extends JCompone } /** - * Paints popup menu's border if borderPainted is true - * - * @param graphics graphics context used to paint this popup's menu border. - */ - protected void borderPainted(Graphics graphics) - { - if (borderPainted) - getBorder().paintBorder(this, graphics, 0, 0, getSize(null).width, - getSize(null).height); - } - - /** * Returns flag indicating if newly created JPopupMenu will use * heavyweight or lightweight container to display its menu items * @@ -449,7 +431,7 @@ public class JPopupMenu extends JCompone /** * Sets label for this popup menu. This method fires PropertyChangeEvent * when the label property is changed. Please note that most - * of the Look & Feel will ignore this property. + * of the Look & Feel will ignore this property. * * @param label label for this popup menu */ @@ -459,7 +441,7 @@ public class JPopupMenu extends JCompone { String oldLabel = this.label; this.label = label; - firePropertyChange(LABEL_CHANGED_PROPERTY, oldLabel, label); + firePropertyChange("label", oldLabel, label); } } @@ -571,11 +553,14 @@ public class JPopupMenu extends JCompone */ public void setVisible(boolean visible) { + if (visible == isVisible()) + return; + boolean old = isVisible(); this.visible = visible; if (old != isVisible()) { - firePropertyChange(VISIBLE_CHANGED_PROPERTY, old, (boolean) isVisible()); + firePropertyChange("visible", old, isVisible()); if (visible) { firePopupMenuWillBecomeVisible(); Index: javax/swing/JProgressBar.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/JProgressBar.java,v retrieving revision 1.7 diff -u -3 -p -u -r1.7 JProgressBar.java --- javax/swing/JProgressBar.java 26 Jun 2004 16:07:01 -0000 1.7 +++ javax/swing/JProgressBar.java 27 Jan 2005 02:28:09 -0000 @@ -1,5 +1,5 @@ /* JProgressBar.java -- - Copyright (C) 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -35,6 +35,7 @@ this exception to your version of the li obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ + package javax.swing; import java.awt.Graphics; @@ -48,14 +49,11 @@ import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import javax.swing.plaf.ProgressBarUI; - /** - *

* The ProgressBar is a widget that displays in two modes. In * determinate mode, it displays fills a percentage of its bar * based on its current value. In indeterminate mode, it creates * box and bounces it between its bounds. - *

* *

* JProgressBars have the following properties: @@ -171,21 +169,6 @@ public class JProgressBar extends JCompo private static final long serialVersionUID = 1980046021813598781L; - /** Fired in a PropertyChangeEvent when the "borderPainted" property changes. */ - public static final String BORDER_PAINTED_CHANGED_PROPERTY = "borderPainted"; - - /** Fired in a PropertyChangeEvent when the "orientation" property changes. */ - public static final String ORIENTATION_CHANGED_PROPERTY = "orientation"; - - /** Fired in a PropertyChangeEvent when the "string" property changes. */ - public static final String STRING_CHANGED_PROPERTY = "string"; - - /** Fired in a PropertyChangeEvent when the "stringPainted" property changes. */ - public static final String STRING_PAINTED_CHANGED_PROPERTY = "stringPainted"; - - /** Fired in a PropertyChangeEvent when the "indeterminate" property changes. */ - public static final String INDETERMINATE_CHANGED_PROPERTY = "indeterminate"; - /** Whether the ProgressBar is determinate. */ private transient boolean indeterminate = false; @@ -331,7 +314,7 @@ public class JProgressBar extends JCompo { int oldOrientation = this.orientation; this.orientation = orientation; - firePropertyChange(ORIENTATION_CHANGED_PROPERTY, oldOrientation, + firePropertyChange("orientation", oldOrientation, this.orientation); } } @@ -357,7 +340,7 @@ public class JProgressBar extends JCompo { boolean oldPainted = paintString; paintString = painted; - firePropertyChange(STRING_PAINTED_CHANGED_PROPERTY, oldPainted, + firePropertyChange("stringPainted", oldPainted, paintString); } } @@ -394,7 +377,7 @@ public class JProgressBar extends JCompo { String oldString = progressString; progressString = string; - firePropertyChange(STRING_CHANGED_PROPERTY, oldString, progressString); + firePropertyChange("string", oldString, progressString); } } @@ -435,7 +418,7 @@ public class JProgressBar extends JCompo { boolean oldPainted = paintBorder; paintBorder = painted; - firePropertyChange(BORDER_PAINTED_CHANGED_PROPERTY, oldPainted, + firePropertyChange("borderPainted", oldPainted, paintBorder); } } @@ -641,7 +624,7 @@ public class JProgressBar extends JCompo { boolean olddeter = indeterminate; indeterminate = newValue; - firePropertyChange(INDETERMINATE_CHANGED_PROPERTY, olddeter, + firePropertyChange("indeterminate", olddeter, indeterminate); } } Index: javax/swing/JScrollBar.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/JScrollBar.java,v retrieving revision 1.8.2.2 diff -u -3 -p -u -r1.8.2.2 JScrollBar.java --- javax/swing/JScrollBar.java 26 Jan 2005 02:30:49 -0000 1.8.2.2 +++ javax/swing/JScrollBar.java 27 Jan 2005 02:28:09 -0000 @@ -152,18 +152,6 @@ public class JScrollBar extends JCompone private static final long serialVersionUID = -8195169869225066566L; - /** Fired in a PropertyChangeEvent when the "blockIncrement" changes. */ - public static final String BLOCK_INCREMENT_CHANGED_PROPERTY = "blockIncrement"; - - /** Fired in a PropertyChangeEvent when the "model" changes. */ - public static final String MODEL_CHANGED_PROPERTY = "model"; - - /** Fired in a PropertyChangeEvent when the "orientation" changes. */ - public static final String ORIENTATION_CHANGED_PROPERTY = "orientation"; - - /** Fired in a PropertyChangeEvent when the "unitIncrement" changes. */ - public static final String UNIT_INCREMENT_CHANGED_PROPERTY = "unitIncrement"; - /** How much the thumb moves when moving in a block. */ protected int blockIncrement = 10; @@ -287,7 +275,7 @@ public class JScrollBar extends JCompone { int oldOrientation = this.orientation; this.orientation = orientation; - firePropertyChange(ORIENTATION_CHANGED_PROPERTY, oldOrientation, + firePropertyChange("orientation", oldOrientation, this.orientation); } } @@ -315,7 +303,7 @@ public class JScrollBar extends JCompone { BoundedRangeModel oldModel = model; model = newModel; - firePropertyChange(MODEL_CHANGED_PROPERTY, oldModel, model); + firePropertyChange("model", oldModel, model); } } @@ -344,7 +332,7 @@ public class JScrollBar extends JCompone { int oldInc = this.unitIncrement; this.unitIncrement = unitIncrement; - firePropertyChange(UNIT_INCREMENT_CHANGED_PROPERTY, oldInc, + firePropertyChange("unitIncrement", oldInc, this.unitIncrement); } } @@ -374,7 +362,7 @@ public class JScrollBar extends JCompone { int oldInc = this.blockIncrement; this.blockIncrement = blockIncrement; - firePropertyChange(BLOCK_INCREMENT_CHANGED_PROPERTY, oldInc, + firePropertyChange("blockIncrement", oldInc, this.blockIncrement); } } Index: javax/swing/JScrollPane.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/JScrollPane.java,v retrieving revision 1.12.2.4 diff -u -3 -p -u -r1.12.2.4 JScrollPane.java --- javax/swing/JScrollPane.java 26 Jan 2005 02:30:49 -0000 1.12.2.4 +++ javax/swing/JScrollPane.java 27 Jan 2005 02:28:09 -0000 @@ -99,18 +99,6 @@ public class JScrollPane boolean wheelScrollingEnabled; ChangeListener scrollListener; - public static final String COLUMN_HEADER_CHANGED_PROPERTY = "columnHeader"; - public static final String COMPONENT_ORIENTATION_CHANGED_PROPERTY = "componentOrientation"; - public static final String HORIZONTAL_SCROLLBAR_CHANGED_PROPERTY = "horizontalScrollBar"; - public static final String HORIZONTAL_SCROLLBAR_POLICY_CHANGED_PROPERTY = "horizontalScrollBarPolicy"; - public static final String LAYOUT_CHANGED_PROPERTY = "layout"; - public static final String ROW_HEADER_CHANGED_PROPERTY = "rowHeader"; - public static final String VERTICAL_SCROLLBAR_CHANGED_PROPERTY = "verticalScrollBar"; - public static final String VERTICAL_SCROLLBAR_POLICY_CHANGED_PROPERTY = "verticalScrollBarPolicy"; - public static final String VIEWPORT_CHANGED_PROPERTY = "viewport"; - public static final String VIEWPORT_BORDER_CHANGED_PROPERTY = "viewportBorder"; - public static final String WHEEL_SCROLLING_ENABLED_CHANGED_PROPERTY = "wheelScrollingEnabled"; - public JViewport getColumnHeader() { return columnHeader; @@ -247,17 +235,20 @@ public class JScrollPane { ComponentOrientation old = super.getComponentOrientation(); super.setComponentOrientation(co); - firePropertyChange(COMPONENT_ORIENTATION_CHANGED_PROPERTY, old, co); + firePropertyChange("componentOrientation", old, co); sync(); } public void setColumnHeader(JViewport h) { + if (columnHeader == h) + return; + JViewport old = columnHeader; removeNonNull(old); columnHeader = h; addNonNull(h); - firePropertyChange(COLUMN_HEADER_CHANGED_PROPERTY, old, h); + firePropertyChange("columnHeader", old, h); sync(); } @@ -327,11 +318,14 @@ public class JScrollPane public void setHorizontalScrollBar(JScrollBar h) { + if (horizontalScrollBar == h) + return; + JScrollBar old = horizontalScrollBar; removeNonNull(old); horizontalScrollBar = h; addNonNull(h); - firePropertyChange(HORIZONTAL_SCROLLBAR_CHANGED_PROPERTY, old, h); + firePropertyChange("horizontalScrollBar", old, h); sync(); if (old != null) @@ -349,14 +343,18 @@ public class JScrollPane } public void setHorizontalScrollBarPolicy(int h) - { + { + if (horizontalScrollBarPolicy == h) + return; + if (h != HORIZONTAL_SCROLLBAR_AS_NEEDED && h != HORIZONTAL_SCROLLBAR_NEVER && h != HORIZONTAL_SCROLLBAR_ALWAYS) throw new IllegalArgumentException("unknown horizontal scrollbar policy"); + int old = horizontalScrollBarPolicy; horizontalScrollBarPolicy = h; - firePropertyChange(HORIZONTAL_SCROLLBAR_POLICY_CHANGED_PROPERTY, old, h); + firePropertyChange("horizontalScrollBarPolicy", old, h); sync(); } @@ -366,17 +364,20 @@ public class JScrollPane ScrollPaneLayout tmp = (ScrollPaneLayout) l; super.setLayout(l); tmp.syncWithScrollPane(this); - firePropertyChange(LAYOUT_CHANGED_PROPERTY, old, l); + firePropertyChange("layout", old, l); sync(); } public void setRowHeader(JViewport v) { + if (rowHeader == v) + return; + JViewport old = rowHeader; removeNonNull(old); rowHeader = v; addNonNull(v); - firePropertyChange(ROW_HEADER_CHANGED_PROPERTY, old, v); + firePropertyChange("rowHeader", old, v); sync(); } @@ -390,11 +391,14 @@ public class JScrollPane public void setVerticalScrollBar(JScrollBar v) { + if (verticalScrollBar == v) + return; + JScrollBar old = verticalScrollBar; removeNonNull(old); verticalScrollBar = v; addNonNull(v); - firePropertyChange(VERTICAL_SCROLLBAR_CHANGED_PROPERTY, old, v); + firePropertyChange("verticalScrollBar", old, v); sync(); if (old != null) @@ -413,26 +417,36 @@ public class JScrollPane public void setVerticalScrollBarPolicy(int v) { + if (verticalScrollBarPolicy == v) + return; + if (v != VERTICAL_SCROLLBAR_AS_NEEDED && v != VERTICAL_SCROLLBAR_NEVER && v != VERTICAL_SCROLLBAR_ALWAYS) throw new IllegalArgumentException("unknown vertical scrollbar policy"); + int old = verticalScrollBarPolicy; verticalScrollBarPolicy = v; - firePropertyChange(VERTICAL_SCROLLBAR_POLICY_CHANGED_PROPERTY, old, v); + firePropertyChange("verticalScrollBarPolicy", old, v); sync(); } public void setWheelScrollingEnabled(boolean b) { + if (wheelScrollingEnabled == b) + return; + boolean old = wheelScrollingEnabled; wheelScrollingEnabled = b; - firePropertyChange(WHEEL_SCROLLING_ENABLED_CHANGED_PROPERTY, old, b); + firePropertyChange("wheelScrollingEnabled", old, b); sync(); } public void setViewport(JViewport v) { + if (viewport == v) + return; + JViewport old = viewport; removeNonNull(old); if (old != null) @@ -443,15 +457,18 @@ public class JScrollPane addNonNull(v); revalidate(); repaint(); - firePropertyChange(VIEWPORT_CHANGED_PROPERTY, old, v); + firePropertyChange("viewport", old, v); sync(); } public void setViewportBorder(Border b) { + if (viewportBorder == b) + return; + Border old = viewportBorder; viewportBorder = b; - firePropertyChange(VIEWPORT_BORDER_CHANGED_PROPERTY, old, b); + firePropertyChange("viewportBorder", old, b); sync(); } Index: javax/swing/JSlider.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/JSlider.java,v retrieving revision 1.10.2.1 diff -u -3 -p -u -r1.10.2.1 JSlider.java --- javax/swing/JSlider.java 16 Jan 2005 15:15:13 -0000 1.10.2.1 +++ javax/swing/JSlider.java 27 Jan 2005 02:28:09 -0000 @@ -1,5 +1,5 @@ /* JSlider.java -- - Copyright (C) 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -35,6 +35,7 @@ this exception to your version of the li obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ + package javax.swing; import java.awt.Dimension; @@ -54,14 +55,11 @@ import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import javax.swing.plaf.SliderUI; - /** - *

* The JSlider is a Swing component that allows selection of a value within a * range by adjusting a thumb in a track. The values for the minimum, * maximum, extent and value are stored in a address@hidden * DefaultBoundedRangeModel}. - *

* *

* JSliders have the following properties: @@ -206,36 +204,6 @@ public class JSlider extends JComponent } } - /** Fired in a PropertyChangeEvent when the "inverted" property changes. */ - public static final String INVERTED_CHANGED_PROPERTY = "inverted"; - - /** Fired in a PropertyChangeEvent when the "labelTable" property changes. */ - public static final String LABEL_TABLE_CHANGED_PROPERTY = "labelTable"; - - /** - * Fired in a PropertyChangeEvent when the "majorTickSpacing" property - * changes. - */ - public static final String MAJOR_TICK_SPACING_CHANGED_PROPERTY = "majorTickSpacing"; - - /** - * Fired in a PropertyChangeEvent when the "minorTickSpacing" property - * changes. - */ - public static final String MINOR_TICK_SPACING_CHANGED_PROPERTY = "minorTickSpacing"; - - /** Fired in a PropertyChangeEvent when the "model" property changes. */ - public static final String MODEL_CHANGED_PROPERTY = "model"; - - /** Fired in a PropertyChangeEvent when the "orientation" property changes. */ - public static final String ORIENTATION_CHANGED_PROPERTY = "orientation"; - - /** Fired in a PropertyChangeEvent when the "paintLabels" property changes. */ - public static final String PAINT_LABELS_CHANGED_PROPERTY = "paintLabels"; - - /** Fired in a PropertyChangeEvent when the "paintTicks" property changes. */ - public static final String PAINT_TICKS_CHANGED_PROPERTY = "paintTicks"; - /** Whether or not this slider paints its ticks. */ private transient boolean paintTicks = false; @@ -515,7 +483,7 @@ public class JSlider extends JComponent sliderModel = model; oldModel.removeChangeListener(changeListener); sliderModel.addChangeListener(changeListener); - firePropertyChange(MODEL_CHANGED_PROPERTY, oldModel, sliderModel); + firePropertyChange("model", oldModel, sliderModel); } } @@ -624,7 +592,7 @@ public class JSlider extends JComponent { int oldOrientation = this.orientation; this.orientation = orientation; - firePropertyChange(ORIENTATION_CHANGED_PROPERTY, oldOrientation, + firePropertyChange("orientation", oldOrientation, this.orientation); } } @@ -650,7 +618,7 @@ public class JSlider extends JComponent { Dictionary oldTable = labelTable; labelTable = table; - firePropertyChange(LABEL_TABLE_CHANGED_PROPERTY, oldTable, labelTable); + firePropertyChange("labelTable", oldTable, labelTable); } } @@ -751,7 +719,7 @@ public class JSlider extends JComponent { boolean oldInverted = isInverted; isInverted = inverted; - firePropertyChange(INVERTED_CHANGED_PROPERTY, oldInverted, isInverted); + firePropertyChange("inverted", oldInverted, isInverted); } } @@ -777,7 +745,7 @@ public class JSlider extends JComponent { int oldSpacing = majorTickSpacing; majorTickSpacing = spacing; - firePropertyChange(MAJOR_TICK_SPACING_CHANGED_PROPERTY, oldSpacing, + firePropertyChange("majorTickSpacing", oldSpacing, majorTickSpacing); } } @@ -804,7 +772,7 @@ public class JSlider extends JComponent { int oldSpacing = minorTickSpacing; minorTickSpacing = spacing; - firePropertyChange(MINOR_TICK_SPACING_CHANGED_PROPERTY, oldSpacing, + firePropertyChange("minorTickSpacing", oldSpacing, minorTickSpacing); } } @@ -864,8 +832,7 @@ public class JSlider extends JComponent { boolean oldPaintTicks = paintTicks; paintTicks = paint; - firePropertyChange(PAINT_TICKS_CHANGED_PROPERTY, oldPaintTicks, - paintTicks); + firePropertyChange("paintTicks", oldPaintTicks, paintTicks); } } @@ -910,8 +877,7 @@ public class JSlider extends JComponent { boolean oldPaintLabels = paintLabels; paintLabels = paint; - firePropertyChange(PAINT_LABELS_CHANGED_PROPERTY, oldPaintLabels, - paintLabels); + firePropertyChange("paintLabels", oldPaintLabels, paintLabels); } } Index: javax/swing/JTabbedPane.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/JTabbedPane.java,v retrieving revision 1.11.2.2 diff -u -3 -p -u -r1.11.2.2 JTabbedPane.java --- javax/swing/JTabbedPane.java 15 Jan 2005 17:02:20 -0000 1.11.2.2 +++ javax/swing/JTabbedPane.java 27 Jan 2005 02:28:10 -0000 @@ -1,5 +1,5 @@ /* JTabbedPane.java -- - Copyright (C) 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -56,10 +56,8 @@ import javax.swing.plaf.TabbedPaneUI; import javax.swing.plaf.UIResource; /** - *

* This is a container for components. One component is displayed at a time. * Users can switch between components by clicking on tabs. - *

* *

* Tabs can be oriented in several ways. They can be above, below, left and @@ -532,20 +530,6 @@ public class JTabbedPane extends JCompon } } - /** Fired in a PropertyChangeEvent when the "model" property changes. */ - public static final String MODEL_CHANGED_PROPERTY = "model"; - - /** - * Fired in a PropertyChangeEvent when the "tabPlacement" property changes. - */ - public static final String TAB_PLACEMENT_CHANGED_PROPERTY = "tabPlacement"; - - /** - * Fired in a PropertyChangeEvent when the "tabLayoutPolicy" property - * changes. - */ - public static final String TAB_LAYOUT_POLICY_CHANGED_PROPERTY = "tabLayoutPolicy"; - /** The changeEvent used to fire changes to listeners. */ protected ChangeEvent changeEvent; @@ -739,7 +723,7 @@ public class JTabbedPane extends JCompon this.model.removeChangeListener(changeListener); this.model = model; this.model.addChangeListener(changeListener); - firePropertyChange(MODEL_CHANGED_PROPERTY, oldModel, this.model); + firePropertyChange("model", oldModel, this.model); } } @@ -770,8 +754,7 @@ public class JTabbedPane extends JCompon { int oldPlacement = this.tabPlacement; this.tabPlacement = tabPlacement; - firePropertyChange(TAB_PLACEMENT_CHANGED_PROPERTY, oldPlacement, - this.tabPlacement); + firePropertyChange("tabPlacement", oldPlacement, this.tabPlacement); } } @@ -802,8 +785,7 @@ public class JTabbedPane extends JCompon { int oldPolicy = layoutPolicy; layoutPolicy = tabLayoutPolicy; - firePropertyChange(TAB_LAYOUT_POLICY_CHANGED_PROPERTY, oldPolicy, - layoutPolicy); + firePropertyChange("tabLayoutPolicy", oldPolicy, layoutPolicy); } } Index: javax/swing/JTable.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/JTable.java,v retrieving revision 1.9.2.6 diff -u -3 -p -u -r1.9.2.6 JTable.java --- javax/swing/JTable.java 25 Jan 2005 12:41:41 -0000 1.9.2.6 +++ javax/swing/JTable.java 27 Jan 2005 02:28:10 -0000 @@ -279,7 +279,7 @@ public class JTable extends JComponent * @see #setDragEnabled() * @see #getDragEnabled() */ - protected boolean dragEnabled; + private boolean dragEnabled; /** * The color to paint the grid lines of the table, when either address@hidden @@ -297,7 +297,7 @@ public class JTable extends JComponent * @see #setPreferredScrollableViewportSize() * @see #getPreferredScrollableViewportSize() */ - protected Dimension preferredScrollableViewportSize; + protected Dimension preferredViewportSize; /** * The color to paint the background of selected cells. Fires a property @@ -438,7 +438,7 @@ public class JTable extends JComponent // this.accessibleContext = new AccessibleJTable(); this.cellEditor = null; this.dragEnabled = false; - this.preferredScrollableViewportSize = new Dimension(450,400); + this.preferredViewportSize = new Dimension(450,400); this.showHorizontalLines = true; this.showVerticalLines = true; this.editingColumn = -1; @@ -1124,13 +1124,13 @@ public class JTable extends JComponent } /** - * Get the value of the address@hidden #preferredScrollableViewportSize} property. + * Get the value of the address@hidden #preferredViewportSize} property. * * @return The current value of the property */ public Dimension getPreferredScrollableViewportSize() { - return preferredScrollableViewportSize; + return preferredViewportSize; } /** @@ -1447,13 +1447,13 @@ public class JTable extends JComponent } /** - * Set the value of the address@hidden #preferredScrollableViewportSize} property. + * Set the value of the address@hidden #preferredViewportSize} property. * - * @param p The new value of the preferredScrollableViewportSize property + * @param p The new value of the preferredViewportSize property */ public void setPreferredScrollableViewportSize(Dimension p) { - preferredScrollableViewportSize = p; + preferredViewportSize = p; revalidate(); repaint(); } Index: javax/swing/JTextField.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/JTextField.java,v retrieving revision 1.11.2.3 diff -u -3 -p -u -r1.11.2.3 JTextField.java --- javax/swing/JTextField.java 21 Jan 2005 02:16:36 -0000 1.11.2.3 +++ javax/swing/JTextField.java 27 Jan 2005 02:28:10 -0000 @@ -1,5 +1,5 @@ /* JTextField.java -- - Copyright (C) 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -322,7 +322,8 @@ public class JTextField extends JTextCom public void postActionEvent() { - ActionEvent event = new ActionEvent(this, 0, actionCommand); + String command = actionCommand != null ? actionCommand : getText(); + ActionEvent event = new ActionEvent(this, 0, command); ActionListener[] listeners = getActionListeners(); for (int index = 0; index < listeners.length; ++index) @@ -369,17 +370,9 @@ public class JTextField extends JTextCom /** * @since 1.3 */ - public String getActionCommand() - { - return actionCommand; - } - - /** - * @since 1.3 - */ public void setActionCommand(String command) { - this.actionCommand = command; + actionCommand = command; } /** Index: javax/swing/JToolBar.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/JToolBar.java,v retrieving revision 1.7.2.1 diff -u -3 -p -u -r1.7.2.1 JToolBar.java --- javax/swing/JToolBar.java 15 Jan 2005 17:02:20 -0000 1.7.2.1 +++ javax/swing/JToolBar.java 27 Jan 2005 02:28:10 -0000 @@ -1,5 +1,5 @@ /* JToolBar.java -- - Copyright (C) 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -378,21 +378,6 @@ public class JToolBar extends JComponent /** The orientation of the JToolBar. */ private int orientation = HORIZONTAL; - /** Fired in a PropertyChangeEvent when the orientation property changes. */ - public static final String ORIENTATION_CHANGED_PROPERTY = "orientation"; - - /** Fired in a PropertyChangeEvent when the floatable property changes. */ - public static final String FLOATABLE_CHANGED_PROPERTY = "floatable"; - - /** Fired in a PropertyChangeEvent when the borderPainted property changes. */ - public static final String BORDER_PAINTED_CHANGED_PROPERTY = "borderPainted"; - - /** Fired in a PropertyChangeEvent when the margin property changes. */ - public static final String MARGIN_CHANGED_PROPERTY = "margin"; - - /** Fired in a PropertyChangeEvent when the rollover property changes. */ - public static final String ROLLOVER_CHANGED_PROPERTY = "rollover"; - /** * This method creates a new JToolBar object with horizontal orientation * and no name. @@ -519,7 +504,7 @@ public class JToolBar extends JComponent if (b != rollover) { rollover = b; - firePropertyChange(ROLLOVER_CHANGED_PROPERTY, ! rollover, rollover); + firePropertyChange("rollover", ! rollover, rollover); revalidate(); repaint(); } @@ -595,7 +580,7 @@ public class JToolBar extends JComponent { Insets oldMargin = this.margin; this.margin = margin; - firePropertyChange(MARGIN_CHANGED_PROPERTY, oldMargin, this.margin); + firePropertyChange("margin", oldMargin, this.margin); revalidate(); repaint(); } @@ -622,7 +607,7 @@ public class JToolBar extends JComponent if (painted != paintBorder) { paintBorder = painted; - firePropertyChange(BORDER_PAINTED_CHANGED_PROPERTY, ! paintBorder, + firePropertyChange("borderPainted", ! paintBorder, paintBorder); repaint(); } @@ -649,7 +634,7 @@ public class JToolBar extends JComponent if (floatable != this.floatable) { this.floatable = floatable; - firePropertyChange(FLOATABLE_CHANGED_PROPERTY, ! floatable, floatable); + firePropertyChange("floatable", ! floatable, floatable); } } // setFloatable() @@ -692,8 +677,7 @@ public class JToolBar extends JComponent { int oldOrientation = this.orientation; this.orientation = orientation; - firePropertyChange(ORIENTATION_CHANGED_PROPERTY, oldOrientation, - this.orientation); + firePropertyChange("orientation", oldOrientation, this.orientation); revalidate(); repaint(); } Index: javax/swing/KeyStroke.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/KeyStroke.java,v retrieving revision 1.9.2.2 diff -u -3 -p -u -r1.9.2.2 KeyStroke.java --- javax/swing/KeyStroke.java 16 Jan 2005 15:15:13 -0000 1.9.2.2 +++ javax/swing/KeyStroke.java 27 Jan 2005 02:28:10 -0000 @@ -1,5 +1,5 @@ /* KeyStroke.java -- - Copyright (C) 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -35,6 +35,7 @@ this exception to your version of the li obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ + package javax.swing; import java.awt.AWTKeyStroke; @@ -47,12 +48,13 @@ public class KeyStroke { private static final long serialVersionUID = -9060180771037902530L; + // Called by java.awt.AWTKeyStroke.registerSubclass via reflection. private KeyStroke() { } - protected KeyStroke(char keyChar, int keyCode, int modifiers, - boolean onKeyRelease) + private KeyStroke(char keyChar, int keyCode, int modifiers, + boolean onKeyRelease) { super(keyChar, keyCode, modifiers, onKeyRelease); } Index: javax/swing/SwingUtilities.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/SwingUtilities.java,v retrieving revision 1.15.2.4 diff -u -3 -p -u -r1.15.2.4 SwingUtilities.java --- javax/swing/SwingUtilities.java 22 Jan 2005 02:20:02 -0000 1.15.2.4 +++ javax/swing/SwingUtilities.java 27 Jan 2005 02:28:11 -0000 @@ -1,5 +1,5 @@ /* SwingUtilities.java -- - Copyright (C) 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -59,6 +59,8 @@ import java.awt.event.KeyEvent; import java.awt.event.MouseEvent; import java.lang.reflect.InvocationTargetException; +import javax.accessibility.Accessible; +import javax.accessibility.AccessibleStateSet; import javax.swing.plaf.ActionMapUIResource; import javax.swing.plaf.InputMapUIResource; @@ -68,8 +70,10 @@ import javax.swing.plaf.InputMapUIResour * regions which need painting. * * @author Graydon Hoare (address@hidden) + * @author Andrew John Hughes (address@hidden) */ -public class SwingUtilities implements SwingConstants +public class SwingUtilities + implements SwingConstants { /** * This frame should be used as parent for JWindow or JDialog @@ -161,6 +165,121 @@ public class SwingUtilities implements S } /** + * Returns the Accessible child of the specified component + * which appears at the supplied Point. If there is no + * child located at that particular pair of co-ordinates, null is returned + * instead. + * + * @param c the component whose children may be found at the specified + * point. + * @param p the point at which to look for the existence of children + * of the specified component. + * @return the Accessible child at the point, p, + * or null if there is no child at this point. + * @see javax.accessibility.AccessibleComponent#getAccessibleAt + */ + public static Accessible getAccessibleAt(Component c, Point p) + { + return c.getAccessibleContext().getAccessibleComponent().getAccessibleAt(p); + } + + /** + *

+ * Returns the Accessible child of the specified component + * that has the supplied index within the parent component. The indexing + * of the children is zero-based, making the first child have an index of + * 0. + *

+ *

+ * Caution is advised when using this method, as its operation relies + * on the behaviour of varying implementations of an abstract method. + * For greater surety, direct use of the AWT component implementation + * of this method is advised. + *

+ * + * @param c the component whose child should be returned. + * @param i the index of the child within the parent component. + * @return the Accessible child at index i + * in the component, c. + * @see javax.accessibility.AccessibleContext#getAccessibleChild + * @see java.awt.Component.AccessibleAWTComponent#getAccessibleChild + */ + public static Accessible getAccessibleChild(Component c, int i) + { + return c.getAccessibleContext().getAccessibleChild(i); + } + + /** + *

+ * Returns the number of Accessible children within + * the supplied component. + *

+ *

+ * Caution is advised when using this method, as its operation relies + * on the behaviour of varying implementations of an abstract method. + * For greater surety, direct use of the AWT component implementation + * of this method is advised. + *

+ * + * @param c the component whose children should be counted. + * @return the number of children belonging to the component, + * c. + * @see javax.accessibility.AccessibleContext#getAccessibleChildrenCount + * @see java.awt.Component.AccessibleAWTComponent#getAccessibleChildrenCount + */ + public static int getAccessibleChildrenCount(Component c) + { + return c.getAccessibleContext().getAccessibleChildrenCount(); + } + + /** + *

+ * Returns the zero-based index of the specified component + * within its parent. If the component doesn't have a parent, + * -1 is returned. + *

+ *

+ * Caution is advised when using this method, as its operation relies + * on the behaviour of varying implementations of an abstract method. + * For greater surety, direct use of the AWT component implementation + * of this method is advised. + *

+ * + * @param c the component whose parental index should be found. + * @return the index of the component within its parent, or -1 + * if the component doesn't have a parent. + * @see javax.accessibility.AccessibleContext#getAccessibleIndexInParent + * @see java.awt.Component.AccessibleAWTComponent#getAccessibleIndexInParent + */ + public static int getAccessibleIndexInParent(Component c) + { + return c.getAccessibleContext().getAccessibleIndexInParent(); + } + + /** + *

+ * Returns a set of AccessibleStates, which represent + * the state of the supplied component. + *

+ *

+ * Caution is advised when using this method, as its operation relies + * on the behaviour of varying implementations of an abstract method. + * For greater surety, direct use of the AWT component implementation + * of this method is advised. + *

+ * + * @param c the component whose accessible state should be retrieved. + * @return a set of AccessibleState objects, which represent + * the state of the supplied component. + * @see javax.accessibility.AccessibleContext#getAccessibleStateSet + * @see java.awt.Component.AccessibleAWTComponent#getAccessibleStateSet + */ + public static AccessibleStateSet getAccessibleStateSet(Component c) + { + return c.getAccessibleContext().getAccessibleStateSet(); + } + + /** * Calculates the bounds of a component in the component's own coordinate * space. The result has the same height and width as the component's * bounds, but its location is set to (0,0). Index: javax/swing/TransferHandler.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/TransferHandler.java,v retrieving revision 1.5.2.3 diff -u -3 -p -u -r1.5.2.3 TransferHandler.java --- javax/swing/TransferHandler.java 16 Jan 2005 15:15:13 -0000 1.5.2.3 +++ javax/swing/TransferHandler.java 27 Jan 2005 02:28:11 -0000 @@ -104,9 +104,9 @@ public class TransferHandler implements private static final long serialVersionUID = -7908749299918704233L; - public static final String COMMAND_COPY = "copy"; - public static final String COMMAND_CUT = "cut"; - public static final String COMMAND_PASTE = "paste"; + private static final String COMMAND_COPY = "copy"; + private static final String COMMAND_CUT = "cut"; + private static final String COMMAND_PASTE = "paste"; public static final int NONE = 0; public static final int COPY = 1; Index: javax/swing/plaf/basic/BasicComboBoxUI.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicComboBoxUI.java,v retrieving revision 1.5.2.3 diff -u -3 -p -u -r1.5.2.3 BasicComboBoxUI.java --- javax/swing/plaf/basic/BasicComboBoxUI.java 16 Jan 2005 15:15:13 -0000 1.5.2.3 +++ javax/swing/plaf/basic/BasicComboBoxUI.java 27 Jan 2005 02:28:11 -0000 @@ -1,5 +1,5 @@ /* BasicComboBoxUI.java -- - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -1146,7 +1146,7 @@ public class BasicComboBoxUI extends Com */ public void propertyChange(PropertyChangeEvent e) { - if (e.getPropertyName().equals(JComboBox.ENABLED_CHANGED_PROPERTY)) + if (e.getPropertyName().equals("enabled")) { arrowButton.setEnabled(comboBox.isEnabled()); @@ -1154,7 +1154,7 @@ public class BasicComboBoxUI extends Com comboBox.getEditor().getEditorComponent().setEnabled(comboBox .isEnabled()); } - else if (e.getPropertyName().equals(JComboBox.EDITABLE_CHANGED_PROPERTY)) + else if (e.getPropertyName().equals("editable")) { if (comboBox.isEditable()) { @@ -1170,7 +1170,7 @@ public class BasicComboBoxUI extends Com comboBox.revalidate(); comboBox.repaint(); } - else if (e.getPropertyName().equals(JComboBox.MODEL_CHANGED_PROPERTY)) + else if (e.getPropertyName().equals("dataModel")) { // remove ListDataListener from old model and add it to new model ComboBoxModel oldModel = (ComboBoxModel) e.getOldValue(); Index: javax/swing/plaf/basic/BasicComboPopup.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicComboPopup.java,v retrieving revision 1.5.2.2 diff -u -3 -p -u -r1.5.2.2 BasicComboPopup.java --- javax/swing/plaf/basic/BasicComboPopup.java 15 Jan 2005 17:02:21 -0000 1.5.2.2 +++ javax/swing/plaf/basic/BasicComboPopup.java 27 Jan 2005 02:28:11 -0000 @@ -1,5 +1,5 @@ /* BasicComboPopup.java -- - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -938,13 +938,13 @@ public class BasicComboPopup extends JPo public void propertyChange(PropertyChangeEvent e) { - if (e.getPropertyName().equals(JComboBox.RENDERER_CHANGED_PROPERTY)) + if (e.getPropertyName().equals("renderer")) { list.setCellRenderer((ListCellRenderer) e.getNewValue()); revalidate(); repaint(); } - if (e.getPropertyName().equals(JComboBox.MODEL_CHANGED_PROPERTY)) + if (e.getPropertyName().equals("dataModel")) { list.setModel((ComboBoxModel) e.getNewValue()); revalidate(); Index: javax/swing/plaf/basic/BasicMenuBarUI.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicMenuBarUI.java,v retrieving revision 1.4.2.1 diff -u -3 -p -u -r1.4.2.1 BasicMenuBarUI.java --- javax/swing/plaf/basic/BasicMenuBarUI.java 15 Jan 2005 17:02:21 -0000 1.4.2.1 +++ javax/swing/plaf/basic/BasicMenuBarUI.java 27 Jan 2005 02:28:11 -0000 @@ -1,5 +1,5 @@ /* BasicMenuBarUI.java -- - Copyright (C) 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -294,9 +294,9 @@ public class BasicMenuBarUI extends Menu */ public void propertyChange(PropertyChangeEvent e) { - if (e.getPropertyName().equals(JMenuBar.BORDER_PAINTED_CHANGED_PROPERTY)) + if (e.getPropertyName().equals("borderPainted")) menuBar.repaint(); - if (e.getPropertyName().equals(JMenuBar.MARGIN_CHANGED_PROPERTY)) + if (e.getPropertyName().equals("margin")) menuBar.repaint(); } } Index: javax/swing/plaf/basic/BasicProgressBarUI.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicProgressBarUI.java,v retrieving revision 1.5.2.2 diff -u -3 -p -u -r1.5.2.2 BasicProgressBarUI.java --- javax/swing/plaf/basic/BasicProgressBarUI.java 26 Jan 2005 02:30:49 -0000 1.5.2.2 +++ javax/swing/plaf/basic/BasicProgressBarUI.java 27 Jan 2005 02:28:11 -0000 @@ -103,7 +103,7 @@ public class BasicProgressBarUI extends { // Only need to listen for indeterminate changes. // All other things are done on a repaint. - if (e.getPropertyName().equals(JProgressBar.INDETERMINATE_CHANGED_PROPERTY)) + if (e.getPropertyName().equals("inderterminate")) if (((Boolean) e.getNewValue()).booleanValue()) startAnimationTimer(); else Index: javax/swing/plaf/basic/BasicScrollBarUI.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicScrollBarUI.java,v retrieving revision 1.7.2.2 diff -u -3 -p -u -r1.7.2.2 BasicScrollBarUI.java --- javax/swing/plaf/basic/BasicScrollBarUI.java 15 Jan 2005 17:02:21 -0000 1.7.2.2 +++ javax/swing/plaf/basic/BasicScrollBarUI.java 27 Jan 2005 02:28:11 -0000 @@ -1,5 +1,5 @@ /* BasicScrollBarUI.java -- - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -142,13 +142,13 @@ public class BasicScrollBarUI extends Sc */ public void propertyChange(PropertyChangeEvent e) { - if (e.getPropertyName().equals(JScrollBar.MODEL_CHANGED_PROPERTY)) + if (e.getPropertyName().equals("model")) { ((BoundedRangeModel) e.getOldValue()).removeChangeListener(modelListener); scrollbar.getModel().addChangeListener(modelListener); getThumbBounds(); } - else if (e.getPropertyName().equals(JScrollBar.ORIENTATION_CHANGED_PROPERTY)) + else if (e.getPropertyName().equals("orientation")) { incrButton.removeMouseListener(buttonListener); decrButton.removeMouseListener(buttonListener); Index: javax/swing/plaf/basic/BasicSliderUI.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicSliderUI.java,v retrieving revision 1.6.2.3 diff -u -3 -p -u -r1.6.2.3 BasicSliderUI.java --- javax/swing/plaf/basic/BasicSliderUI.java 16 Jan 2005 15:15:13 -0000 1.6.2.3 +++ javax/swing/plaf/basic/BasicSliderUI.java 27 Jan 2005 02:28:12 -0000 @@ -1,5 +1,5 @@ /* BasicSliderUI.java -- - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -222,9 +222,9 @@ public class BasicSliderUI extends Slide public void propertyChange(PropertyChangeEvent e) { // Check for orientation changes. - if (e.getPropertyName().equals(JSlider.ORIENTATION_CHANGED_PROPERTY)) + if (e.getPropertyName().equals("orientation")) recalculateIfOrientationChanged(); - else if (e.getPropertyName().equals(JSlider.MODEL_CHANGED_PROPERTY)) + else if (e.getPropertyName().equals("model")) { BoundedRangeModel oldModel = (BoundedRangeModel) e.getOldValue(); oldModel.removeChangeListener(changeListener); Index: javax/swing/plaf/basic/BasicTabbedPaneUI.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicTabbedPaneUI.java,v retrieving revision 1.10.2.4 diff -u -3 -p -u -r1.10.2.4 BasicTabbedPaneUI.java --- javax/swing/plaf/basic/BasicTabbedPaneUI.java 26 Jan 2005 02:30:49 -0000 1.10.2.4 +++ javax/swing/plaf/basic/BasicTabbedPaneUI.java 27 Jan 2005 02:28:13 -0000 @@ -184,13 +184,13 @@ public class BasicTabbedPaneUI extends T */ public void propertyChange(PropertyChangeEvent e) { - if (e.getPropertyName().equals(JTabbedPane.TAB_LAYOUT_POLICY_CHANGED_PROPERTY)) + if (e.getPropertyName().equals("tabLayoutPolicy")) { layoutManager = createLayoutManager(); tabPane.setLayout(layoutManager); } - else if (e.getPropertyName().equals(JTabbedPane.TAB_PLACEMENT_CHANGED_PROPERTY) + else if (e.getPropertyName().equals("tabPlacement") && tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { incrButton = createIncreaseButton(); Index: javax/swing/plaf/basic/BasicToolBarUI.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicToolBarUI.java,v retrieving revision 1.3.2.3 diff -u -3 -p -u -r1.3.2.3 BasicToolBarUI.java --- javax/swing/plaf/basic/BasicToolBarUI.java 16 Jan 2005 15:15:13 -0000 1.3.2.3 +++ javax/swing/plaf/basic/BasicToolBarUI.java 27 Jan 2005 02:28:13 -0000 @@ -1,5 +1,5 @@ /* BasicToolBarUI.java -- - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -1218,7 +1218,7 @@ public class BasicToolBarUI extends Tool public void propertyChange(PropertyChangeEvent e) { // FIXME: need name properties so can change floatFrame title. - if (e.getPropertyName().equals(JToolBar.ROLLOVER_CHANGED_PROPERTY)) + if (e.getPropertyName().equals("rollover")) setRolloverBorders(toolBar.isRollover()); } }