[Patch][gui] swing constant cleanup
Michael Koch
konqueror@gmx.de
Wed Jan 26 23:36:00 GMT 2005
Hi list,
I commited the attached patch to remove some public constants that were
never in the public API of SUNs JDK.
Michael
2005-01-27 Michael Koch <konqueror@gmx.de>
* 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.
-------------- next part --------------
Index: javax/swing/AbstractAction.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/AbstractAction.java,v
retrieving revision 1.12
diff -u -r1.12 AbstractAction.java
--- javax/swing/AbstractAction.java 27 Dec 2004 11:24:47 -0000 1.12
+++ javax/swing/AbstractAction.java 26 Jan 2005 23:07:46 -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 @@
*/
protected boolean enabled = true;
- public static final String ENABLED_PROPERTY = "enabled";
-
/**
* changeSupport
*/
@@ -193,7 +191,7 @@
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.25
diff -u -r1.25 AbstractButton.java
--- javax/swing/AbstractButton.java 25 Jan 2005 07:07:25 -0000 1.25
+++ javax/swing/AbstractButton.java 26 Jan 2005 23:07:46 -0000
@@ -1509,7 +1509,7 @@
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/JComboBox.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JComboBox.java,v
retrieving revision 1.12
diff -u -r1.12 JComboBox.java
--- javax/swing/JComboBox.java 19 Dec 2004 22:34:31 -0000 1.12
+++ javax/swing/JComboBox.java 26 Jan 2005 23:07:46 -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 @@
* 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 String getUIClassID()
{
- return uiClassID;
+ return "ComboBoxUI";
}
/**
@@ -342,7 +306,7 @@
dataModel = newDataModel;
// Notifies the listeners of the model change.
- firePropertyChange(MODEL_CHANGED_PROPERTY, oldDataModel, dataModel);
+ firePropertyChange("model", oldDataModel, dataModel);
}
/**
@@ -397,7 +361,7 @@
if (isEditable != editable)
{
isEditable = editable;
- firePropertyChange(EDITABLE_CHANGED_PROPERTY, ! isEditable, isEditable);
+ firePropertyChange("editable", ! isEditable, isEditable);
}
}
@@ -415,7 +379,7 @@
{
int oldMaximumRowCount = maximumRowCount;
maximumRowCount = rowCount;
- firePropertyChange(MAXIMUM_ROW_COUNT_CHANGED_PROPERTY,
+ firePropertyChange("maximumRowCount",
oldMaximumRowCount, maximumRowCount);
}
}
@@ -447,7 +411,7 @@
{
ListCellRenderer oldRenderer = renderer;
renderer = aRenderer;
- firePropertyChange(RENDERER_CHANGED_PROPERTY, oldRenderer,
+ firePropertyChange("renderer", oldRenderer,
renderer);
}
}
@@ -483,7 +447,7 @@
if (editor != null)
editor.addActionListener(this);
- firePropertyChange(EDITOR_CHANGED_PROPERTY, oldEditor, editor);
+ firePropertyChange("editor", oldEditor, editor);
}
/**
@@ -967,8 +931,7 @@
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.19
diff -u -r1.19 JLabel.java
--- javax/swing/JLabel.java 21 Dec 2004 22:39:03 -0000 1.19
+++ javax/swing/JLabel.java 26 Jan 2005 23:07:47 -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 @@
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 @@
{
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 @@
{
Icon oldIcon = icon;
icon = newIcon;
- firePropertyChange(ICON_CHANGED_PROPERTY, oldIcon, newIcon);
+ firePropertyChange("icon", oldIcon, newIcon);
}
}
@@ -352,7 +299,7 @@
{
Icon oldIcon = disabledIcon;
disabledIcon = newIcon;
- firePropertyChange(DISABLED_ICON_CHANGED_PROPERTY, oldIcon, newIcon);
+ firePropertyChange("disabledIcon", oldIcon, newIcon);
}
}
@@ -367,7 +314,7 @@
{
if (displayedMnemonic != mnemonic)
{
- firePropertyChange(DISPLAYED_MNEMONIC_CHANGED_PROPERTY,
+ firePropertyChange("displayedMnemonic",
displayedMnemonic, mnemonic);
displayedMnemonic = mnemonic;
@@ -424,7 +371,7 @@
{
int oldIndex = displayedMnemonicIndex;
displayedMnemonicIndex = newIndex;
- firePropertyChange(DISPLAYED_MNEMONIC_INDEX_CHANGED_PROPERTY,
+ firePropertyChange("displayedMnemonicIndex",
oldIndex, newIndex);
}
}
@@ -501,7 +448,7 @@
{
if (iconTextGap != newGap)
{
- firePropertyChange(ICON_TEXT_GAP_CHANGED_PROPERTY, iconTextGap, newGap);
+ firePropertyChange("iconTextGap", iconTextGap, newGap);
iconTextGap = newGap;
}
}
@@ -531,8 +478,7 @@
int oldAlignment = verticalAlignment;
verticalAlignment = checkVerticalKey(alignment, "verticalAlignment");
- firePropertyChange(VERTICAL_ALIGNMENT_CHANGED_PROPERTY,
- oldAlignment, verticalAlignment);
+ firePropertyChange("verticalAlignment", oldAlignment, verticalAlignment);
}
/**
@@ -558,7 +504,7 @@
int oldAlignment = horizontalAlignment;
horizontalAlignment = checkHorizontalKey(alignment, "horizontalAlignment");
- firePropertyChange(HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, oldAlignment,
+ firePropertyChange("horizontalAlignment", oldAlignment,
horizontalAlignment);
}
@@ -586,7 +532,7 @@
int oldPos = verticalTextPosition;
verticalTextPosition = checkVerticalKey(textPosition,
"verticalTextPosition");
- firePropertyChange(VERTICAL_TEXT_POSITION_CHANGED_PROPERTY, oldPos,
+ firePropertyChange("verticalTextPosition", oldPos,
verticalTextPosition);
}
}
@@ -615,7 +561,7 @@
int oldPos = horizontalTextPosition;
horizontalTextPosition = checkHorizontalKey(textPosition,
"horizontalTextPosition");
- firePropertyChange(HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, oldPos,
+ firePropertyChange("horizontalTextPosition", oldPos,
horizontalTextPosition);
}
}
@@ -671,8 +617,9 @@
{
if (c != labelFor)
{
- firePropertyChange(LABEL_FOR_CHANGED_PROPERTY, labelFor, c);
+ Component oldLabelFor = labelFor;
labelFor = c;
+ firePropertyChange("labelFor", oldLabelFor, labelFor);
}
}
Index: javax/swing/JList.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JList.java,v
retrieving revision 1.22
diff -u -r1.22 JList.java
--- javax/swing/JList.java 6 Dec 2004 17:01:55 -0000 1.22
+++ javax/swing/JList.java 26 Jan 2005 23:07:48 -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 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 @@
* is one of the integer constants {@link #VERTICAL}, {@link
* #VERTICAL_WRAP}, or {@link #HORIZONTAL_WRAP}.
*/
-
int layoutOrientation;
/** This property holds the data elements displayed by the list. */
@@ -406,9 +377,12 @@
*/
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 @@
* #prototypeCellValue} property is set, but setting it explicitly
* overrides the width computed from {@link #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 {@link #visibleRowCount} property.
*
@@ -735,9 +711,12 @@
*/
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 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 @@
ListCellRenderer old = cellRenderer;
cellRenderer = renderer;
- firePropertyChange(CELL_RENDERER_PROPERTY_CHANGED, old, renderer);
+ firePropertyChange("cellRenderer", old, renderer);
revalidate();
repaint();
}
@@ -907,7 +889,7 @@
if (this.model != null)
this.model.addListDataListener(listListener);
- firePropertyChange(MODEL_PROPERTY_CHANGED, old, model);
+ firePropertyChange("model", old, model);
revalidate();
repaint();
}
@@ -939,7 +921,7 @@
if (selectionModel != null)
selectionModel.addListSelectionListener(listListener);
- firePropertyChange(SELECTION_MODEL_PROPERTY_CHANGED, old, model);
+ firePropertyChange("selectionModel", old, model);
revalidate();
repaint();
}
@@ -1019,6 +1001,9 @@
*/
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 @@
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.11
diff -u -r1.11 JMenuBar.java
--- javax/swing/JMenuBar.java 25 Oct 2004 15:43:40 -0000 1.11
+++ javax/swing/JMenuBar.java 26 Jan 2005 23:07:48 -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.swing.plaf.MenuBarUI;
/**
- * <p>
* 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 @@
* 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.
- * </p>
*/
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 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 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 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.11
diff -u -r1.11 JPopupMenu.java
--- javax/swing/JPopupMenu.java 1 Dec 2004 21:23:00 -0000 1.11
+++ javax/swing/JPopupMenu.java 26 Jan 2005 23:07:48 -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 @@
/** 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 @@
/* 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 @@
}
/**
- * 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 @@
/**
* 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 @@
{
String oldLabel = this.label;
this.label = label;
- firePropertyChange(LABEL_CHANGED_PROPERTY, oldLabel, label);
+ firePropertyChange("label", oldLabel, label);
}
}
@@ -571,11 +553,14 @@
*/
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 -r1.7 JProgressBar.java
--- javax/swing/JProgressBar.java 26 Jun 2004 16:07:01 -0000 1.7
+++ javax/swing/JProgressBar.java 26 Jan 2005 23:07:48 -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 @@
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.ChangeListener;
import javax.swing.plaf.ProgressBarUI;
-
/**
- * <p>
* 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.
- * </p>
*
* <p>
* JProgressBars have the following properties:
@@ -171,21 +169,6 @@
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 @@
{
int oldOrientation = this.orientation;
this.orientation = orientation;
- firePropertyChange(ORIENTATION_CHANGED_PROPERTY, oldOrientation,
+ firePropertyChange("orientation", oldOrientation,
this.orientation);
}
}
@@ -357,7 +340,7 @@
{
boolean oldPainted = paintString;
paintString = painted;
- firePropertyChange(STRING_PAINTED_CHANGED_PROPERTY, oldPainted,
+ firePropertyChange("stringPainted", oldPainted,
paintString);
}
}
@@ -394,7 +377,7 @@
{
String oldString = progressString;
progressString = string;
- firePropertyChange(STRING_CHANGED_PROPERTY, oldString, progressString);
+ firePropertyChange("string", oldString, progressString);
}
}
@@ -435,7 +418,7 @@
{
boolean oldPainted = paintBorder;
paintBorder = painted;
- firePropertyChange(BORDER_PAINTED_CHANGED_PROPERTY, oldPainted,
+ firePropertyChange("borderPainted", oldPainted,
paintBorder);
}
}
@@ -641,7 +624,7 @@
{
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.10
diff -u -r1.10 JScrollBar.java
--- javax/swing/JScrollBar.java 25 Jan 2005 07:07:25 -0000 1.10
+++ javax/swing/JScrollBar.java 26 Jan 2005 23:07:48 -0000
@@ -152,18 +152,6 @@
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 @@
{
int oldOrientation = this.orientation;
this.orientation = orientation;
- firePropertyChange(ORIENTATION_CHANGED_PROPERTY, oldOrientation,
+ firePropertyChange("orientation", oldOrientation,
this.orientation);
}
}
@@ -315,7 +303,7 @@
{
BoundedRangeModel oldModel = model;
model = newModel;
- firePropertyChange(MODEL_CHANGED_PROPERTY, oldModel, model);
+ firePropertyChange("model", oldModel, model);
}
}
@@ -344,7 +332,7 @@
{
int oldInc = this.unitIncrement;
this.unitIncrement = unitIncrement;
- firePropertyChange(UNIT_INCREMENT_CHANGED_PROPERTY, oldInc,
+ firePropertyChange("unitIncrement", oldInc,
this.unitIncrement);
}
}
@@ -374,7 +362,7 @@
{
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.17
diff -u -r1.17 JScrollPane.java
--- javax/swing/JScrollPane.java 25 Jan 2005 07:07:25 -0000 1.17
+++ javax/swing/JScrollPane.java 26 Jan 2005 23:07:48 -0000
@@ -99,18 +99,6 @@
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 @@
{
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 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 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 @@
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 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 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 @@
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.11
diff -u -r1.11 JSlider.java
--- javax/swing/JSlider.java 27 Dec 2004 11:24:47 -0000 1.11
+++ javax/swing/JSlider.java 26 Jan 2005 23:07:48 -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 @@
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.ChangeListener;
import javax.swing.plaf.SliderUI;
-
/**
- * <p>
* 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 {@link
* DefaultBoundedRangeModel}.
- * </p>
*
* <p>
* JSliders have the following properties:
@@ -206,36 +204,6 @@
}
}
- /** 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 @@
sliderModel = model;
oldModel.removeChangeListener(changeListener);
sliderModel.addChangeListener(changeListener);
- firePropertyChange(MODEL_CHANGED_PROPERTY, oldModel, sliderModel);
+ firePropertyChange("model", oldModel, sliderModel);
}
}
@@ -624,7 +592,7 @@
{
int oldOrientation = this.orientation;
this.orientation = orientation;
- firePropertyChange(ORIENTATION_CHANGED_PROPERTY, oldOrientation,
+ firePropertyChange("orientation", oldOrientation,
this.orientation);
}
}
@@ -650,7 +618,7 @@
{
Dictionary oldTable = labelTable;
labelTable = table;
- firePropertyChange(LABEL_TABLE_CHANGED_PROPERTY, oldTable, labelTable);
+ firePropertyChange("labelTable", oldTable, labelTable);
}
}
@@ -751,7 +719,7 @@
{
boolean oldInverted = isInverted;
isInverted = inverted;
- firePropertyChange(INVERTED_CHANGED_PROPERTY, oldInverted, isInverted);
+ firePropertyChange("inverted", oldInverted, isInverted);
}
}
@@ -777,7 +745,7 @@
{
int oldSpacing = majorTickSpacing;
majorTickSpacing = spacing;
- firePropertyChange(MAJOR_TICK_SPACING_CHANGED_PROPERTY, oldSpacing,
+ firePropertyChange("majorTickSpacing", oldSpacing,
majorTickSpacing);
}
}
@@ -804,7 +772,7 @@
{
int oldSpacing = minorTickSpacing;
minorTickSpacing = spacing;
- firePropertyChange(MINOR_TICK_SPACING_CHANGED_PROPERTY, oldSpacing,
+ firePropertyChange("minorTickSpacing", oldSpacing,
minorTickSpacing);
}
}
@@ -864,8 +832,7 @@
{
boolean oldPaintTicks = paintTicks;
paintTicks = paint;
- firePropertyChange(PAINT_TICKS_CHANGED_PROPERTY, oldPaintTicks,
- paintTicks);
+ firePropertyChange("paintTicks", oldPaintTicks, paintTicks);
}
}
@@ -910,8 +877,7 @@
{
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.13
diff -u -r1.13 JTabbedPane.java
--- javax/swing/JTabbedPane.java 22 Oct 2004 12:43:59 -0000 1.13
+++ javax/swing/JTabbedPane.java 26 Jan 2005 23:07:48 -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.UIResource;
/**
- * <p>
* This is a container for components. One component is displayed at a time.
* Users can switch between components by clicking on tabs.
- * </p>
*
* <p>
* Tabs can be oriented in several ways. They can be above, below, left and
@@ -532,20 +530,6 @@
}
}
- /** 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 @@
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 @@
{
int oldPlacement = this.tabPlacement;
this.tabPlacement = tabPlacement;
- firePropertyChange(TAB_PLACEMENT_CHANGED_PROPERTY, oldPlacement,
- this.tabPlacement);
+ firePropertyChange("tabPlacement", oldPlacement, this.tabPlacement);
}
}
@@ -802,8 +785,7 @@
{
int oldPolicy = layoutPolicy;
layoutPolicy = tabLayoutPolicy;
- firePropertyChange(TAB_LAYOUT_POLICY_CHANGED_PROPERTY, oldPolicy,
- layoutPolicy);
+ firePropertyChange("tabLayoutPolicy", oldPolicy, layoutPolicy);
}
}
Index: javax/swing/JToolBar.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JToolBar.java,v
retrieving revision 1.8
diff -u -r1.8 JToolBar.java
--- javax/swing/JToolBar.java 22 Oct 2004 12:43:59 -0000 1.8
+++ javax/swing/JToolBar.java 26 Jan 2005 23:07:48 -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 @@
/** 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 @@
if (b != rollover)
{
rollover = b;
- firePropertyChange(ROLLOVER_CHANGED_PROPERTY, ! rollover, rollover);
+ firePropertyChange("rollover", ! rollover, rollover);
revalidate();
repaint();
}
@@ -595,7 +580,7 @@
{
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 @@
if (painted != paintBorder)
{
paintBorder = painted;
- firePropertyChange(BORDER_PAINTED_CHANGED_PROPERTY, ! paintBorder,
+ firePropertyChange("borderPainted", ! paintBorder,
paintBorder);
repaint();
}
@@ -649,7 +634,7 @@
if (floatable != this.floatable)
{
this.floatable = floatable;
- firePropertyChange(FLOATABLE_CHANGED_PROPERTY, ! floatable, floatable);
+ firePropertyChange("floatable", ! floatable, floatable);
}
} // setFloatable()
@@ -692,8 +677,7 @@
{
int oldOrientation = this.orientation;
this.orientation = orientation;
- firePropertyChange(ORIENTATION_CHANGED_PROPERTY, oldOrientation,
- this.orientation);
+ firePropertyChange("orientation", oldOrientation, this.orientation);
revalidate();
repaint();
}
Index: javax/swing/plaf/basic/BasicComboBoxUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicComboBoxUI.java,v
retrieving revision 1.5
diff -u -r1.5 BasicComboBoxUI.java
--- javax/swing/plaf/basic/BasicComboBoxUI.java 18 Dec 2004 19:54:53 -0000 1.5
+++ javax/swing/plaf/basic/BasicComboBoxUI.java 26 Jan 2005 23:07:49 -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 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 @@
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 @@
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
diff -u -r1.5 BasicComboPopup.java
--- javax/swing/plaf/basic/BasicComboPopup.java 22 Oct 2004 12:44:00 -0000 1.5
+++ javax/swing/plaf/basic/BasicComboPopup.java 26 Jan 2005 23:07:49 -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 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.5
diff -u -r1.5 BasicMenuBarUI.java
--- javax/swing/plaf/basic/BasicMenuBarUI.java 22 Oct 2004 12:44:00 -0000 1.5
+++ javax/swing/plaf/basic/BasicMenuBarUI.java 26 Jan 2005 23:07:49 -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 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.7
diff -u -r1.7 BasicProgressBarUI.java
--- javax/swing/plaf/basic/BasicProgressBarUI.java 25 Jan 2005 07:07:25 -0000 1.7
+++ javax/swing/plaf/basic/BasicProgressBarUI.java 26 Jan 2005 23:07:49 -0000
@@ -103,7 +103,7 @@
{
// 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.12
diff -u -r1.12 BasicScrollBarUI.java
--- javax/swing/plaf/basic/BasicScrollBarUI.java 23 Oct 2004 20:55:04 -0000 1.12
+++ javax/swing/plaf/basic/BasicScrollBarUI.java 26 Jan 2005 23:07:49 -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 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.11
diff -u -r1.11 BasicSliderUI.java
--- javax/swing/plaf/basic/BasicSliderUI.java 24 Dec 2004 09:53:03 -0000 1.11
+++ javax/swing/plaf/basic/BasicSliderUI.java 26 Jan 2005 23:07:50 -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 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.17
diff -u -r1.17 BasicTabbedPaneUI.java
--- javax/swing/plaf/basic/BasicTabbedPaneUI.java 25 Jan 2005 07:07:25 -0000 1.17
+++ javax/swing/plaf/basic/BasicTabbedPaneUI.java 26 Jan 2005 23:07:51 -0000
@@ -184,13 +184,13 @@
*/
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.7
diff -u -r1.7 BasicToolBarUI.java
--- javax/swing/plaf/basic/BasicToolBarUI.java 24 Dec 2004 09:53:03 -0000 1.7
+++ javax/swing/plaf/basic/BasicToolBarUI.java 26 Jan 2005 23:07:51 -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 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());
}
}
More information about the Java-patches
mailing list