Hi,
I cleaned up javax.swing.plaf.basic a little. For the most part this
replaces all occurances of UIManager.getLookAndFeelDefaults().getXXX()
with UIManager.getXXX(). Not only is this shorter, it also has a
slightly different semantics (or should have, I'll explain this later
when I implement/fix this).
I also took out some caching in BasicToolBarUI, that caused problems with
the jIRCii app that I tried out. I will have to look into this issue in
more detail later.
2005-11-15 Roman Kennke <[EMAIL PROTECTED]>
* javax/swing/plaf/basic/BasicBorders.java
(getButtonBorder): Replaced UIManager.getLookAndFeelDefaults().get()
with UIManager.get().
(getRadioButtonBorder): Replaced
UIManager.getLookAndFeelDefaults().get() with UIManager.get().
(getToggleButtonBorder): Replaced
UIManager.getLookAndFeelDefaults().get() with UIManager.get().
(getMenuBarBorder): Replaced
UIManager.getLookAndFeelDefaults().get() with UIManager.get().
(getSplitPaneBorder): Replaced
UIManager.getLookAndFeelDefaults().get() with UIManager.get().
(getSplitPaneDividerBorder): Replaced
UIManager.getLookAndFeelDefaults().get() with UIManager.get().
(getTextFieldBorder): Replaced
UIManager.getLookAndFeelDefaults().get() with UIManager.get().
(getInternalFrameBorder): Replaced
UIManager.getLookAndFeelDefaults().get() with UIManager.get().
* javax/swing/plaf/basic/BasicButtonUI.java
(paintText): Replaced UIManager.getLookAndFeelDefaults().get()
with UIManager.get().
* javax/swing/plaf/basic/BasicCheckBoxUI.java
(getDefaultIcon): Replaced UIManager.getLookAndFeelDefaults().get()
with UIManager.get().
* javax/swing/plaf/basic/BasicComboBoxUI.java
(paintCurrentValue): Replaced UIManager.getLookAndFeelDefaults().get()
with UIManager.get().
* javax/swing/plaf/basic/BasicFileChooserUI.java
(installStrings): Replaced UIManager.getLookAndFeelDefaults().get()
with UIManager.get().
* javax/swing/plaf/basic/BasicInternalFrameTitlePane.java
(installDefaults): Replaced UIManager.getLookAndFeelDefaults().get()
with UIManager.get().
* javax/swing/plaf/basic/BasicListUI.java
(installKeyboardActions): Replaced
UIManager.getLookAndFeelDefaults().get() with UIManager.get().
* javax/swing/plaf/basic/BasicProgressBarUI.java
(boxRect): Added @since tag to the API comment.
* javax/swing/plaf/basic/BasicRadioButtonUI.java
(getDefaultIcon): Replaced UIManager.getLookAndFeelDefaults().get()
with UIManager.get().
* javax/swing/plaf/basic/BasicScrollBarUI.java
(configureScrollBarColors): Replaced
UIManager.getLookAndFeelDefaults().get() with UIManager.get().
(calculatePreferredSize): Fetch preferred width or height from
UI defaults.
* javax/swing/plaf/basic/BasicTableUI.java
(installKeyboardActions): Replaced
UIManager.getLookAndFeelDefaults().get() with UIManager.get().
* javax/swing/plaf/basic/BasicTextUI.java
(createKeymap): Replaced
UIManager.getLookAndFeelDefaults().get() with UIManager.get().
(getInputMap): Replaced
UIManager.getLookAndFeelDefaults().get() with UIManager.get().
(getActionMap): Replaced
UIManager.getLookAndFeelDefaults().get() with UIManager.get().
* javax/swing/plaf/basic/BasicToolBarUI.java
(dragTo): Don't use cached* fields.
(installComponents): Don't use cached* fields.
* javax/swing/plaf/basic/BasicTreeUI.java
(getHashColor): Replaced
UIManager.getLookAndFeelDefaults().get() with UIManager.get().
(setHashColor): Replaced
UIManager.getLookAndFeelDefaults().get() with UIManager.get().
Added FIXME comment.
(installKeyboardActions): Replaced
UIManager.getLookAndFeelDefaults().get() with UIManager.get().
/Roman
Index: javax/swing/plaf/basic/BasicBorders.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicBorders.java,v
retrieving revision 1.17
diff -u -r1.17 BasicBorders.java
--- javax/swing/plaf/basic/BasicBorders.java 18 Oct 2005 22:10:32 -0000 1.17
+++ javax/swing/plaf/basic/BasicBorders.java 15 Nov 2005 20:30:33 -0000
@@ -51,7 +51,6 @@
import javax.swing.JPopupMenu;
import javax.swing.JSplitPane;
import javax.swing.JToolBar;
-import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.border.AbstractBorder;
import javax.swing.border.BevelBorder;
@@ -95,21 +94,18 @@
*/
public static Border getButtonBorder()
{
- UIDefaults defaults;
Border outer;
- defaults = UIManager.getLookAndFeelDefaults();
-
/* The keys for UIDefaults have been determined by writing a
* test program that dumps the UIDefaults to stdout; that program
* was run on a JDK 1.4.1_01 for GNU/Linux. Note that in the API,
* the key "light" is usually called "highlight", and "highlight"
* is usually called "lightHighlight".
*/
- outer = new ButtonBorder(defaults.getColor("Button.shadow"),
- defaults.getColor("Button.darkShadow"),
- defaults.getColor("Button.light"),
- defaults.getColor("Button.highlight"));
+ outer = new ButtonBorder(UIManager.getColor("Button.shadow"),
+ UIManager.getColor("Button.darkShadow"),
+ UIManager.getColor("Button.light"),
+ UIManager.getColor("Button.highlight"));
/* While the inner border is shared between multiple buttons,
* we do not share the outer border because ButtonBorders store
@@ -145,11 +141,8 @@
*/
public static Border getRadioButtonBorder()
{
- UIDefaults defaults;
Border outer;
- defaults = UIManager.getLookAndFeelDefaults();
-
/* The keys for UIDefaults have been determined by writing a
* test program that dumps the UIDefaults to stdout; that program
* was run on a JDK 1.4.1_01 for GNU/Linux. Note that in the API,
@@ -157,10 +150,10 @@
* is usually called "lightHighlight".
*/
outer = new RadioButtonBorder(
- defaults.getColor("RadioButton.shadow"),
- defaults.getColor("RadioButton.darkShadow"),
- defaults.getColor("RadioButton.light"),
- defaults.getColor("RadioButton.highlight"));
+ UIManager.getColor("RadioButton.shadow"),
+ UIManager.getColor("RadioButton.darkShadow"),
+ UIManager.getColor("RadioButton.light"),
+ UIManager.getColor("RadioButton.highlight"));
/* While the inner border is shared between multiple buttons, we
* do not share the outer border because RadioButtonBorders, being
@@ -197,11 +190,8 @@
*/
public static Border getToggleButtonBorder()
{
- UIDefaults defaults;
Border outer;
- defaults = UIManager.getLookAndFeelDefaults();
-
/* The keys for UIDefaults have been determined by writing a
* test program that dumps the UIDefaults to stdout; that program
* was run on a JDK 1.4.1_01 for GNU/Linux. Note that in the API,
@@ -209,10 +199,10 @@
* is usually called "lightHighlight".
*/
outer = new ToggleButtonBorder(
- defaults.getColor("ToggleButton.shadow"),
- defaults.getColor("ToggleButton.darkShadow"),
- defaults.getColor("ToggleButton.light"),
- defaults.getColor("ToggleButton.highlight"));
+ UIManager.getColor("ToggleButton.shadow"),
+ UIManager.getColor("ToggleButton.darkShadow"),
+ UIManager.getColor("ToggleButton.light"),
+ UIManager.getColor("ToggleButton.highlight"));
/* While the inner border is shared between multiple buttons, we
* do not share the outer border because ToggleButtonBorders, being
@@ -247,12 +237,9 @@
*/
public static Border getMenuBarBorder()
{
- UIDefaults defaults;
-
/* See comment in methods above for why this border is not shared. */
- defaults = UIManager.getLookAndFeelDefaults();
- return new MenuBarBorder(defaults.getColor("MenuBar.shadow"),
- defaults.getColor("MenuBar.highlight"));
+ return new MenuBarBorder(UIManager.getColor("MenuBar.shadow"),
+ UIManager.getColor("MenuBar.highlight"));
}
@@ -279,12 +266,9 @@
*/
public static Border getSplitPaneBorder()
{
- UIDefaults defaults;
-
/* See comment in methods above for why this border is not shared. */
- defaults = UIManager.getLookAndFeelDefaults();
- return new SplitPaneBorder(defaults.getColor("SplitPane.highlight"),
- defaults.getColor("SplitPane.darkShadow"));
+ return new SplitPaneBorder(UIManager.getColor("SplitPane.highlight"),
+ UIManager.getColor("SplitPane.darkShadow"));
}
@@ -314,13 +298,10 @@
*/
public static Border getSplitPaneDividerBorder()
{
- UIDefaults defaults;
-
/* See comment in methods above for why this border is not shared. */
- defaults = UIManager.getLookAndFeelDefaults();
return new SplitPaneDividerBorder(
- defaults.getColor("SplitPane.highlight"),
- defaults.getColor("SplitPane.darkShadow"));
+ UIManager.getColor("SplitPane.highlight"),
+ UIManager.getColor("SplitPane.darkShadow"));
}
@@ -346,15 +327,12 @@
*/
public static Border getTextFieldBorder()
{
- UIDefaults defaults;
-
/* See comment in methods above for why this border is not shared. */
- defaults = UIManager.getLookAndFeelDefaults();
return new FieldBorder(
- defaults.getColor("TextField.shadow"),
- defaults.getColor("TextField.darkShadow"),
- defaults.getColor("TextField.light"),
- defaults.getColor("TextField.highlight"));
+ UIManager.getColor("TextField.shadow"),
+ UIManager.getColor("TextField.darkShadow"),
+ UIManager.getColor("TextField.light"),
+ UIManager.getColor("TextField.highlight"));
}
@@ -394,17 +372,14 @@
*/
public static Border getInternalFrameBorder()
{
- UIDefaults defaults;
Color shadow, darkShadow, highlight, lightHighlight, line;
/* See comment in methods above for why this border is not shared. */
- defaults = UIManager.getLookAndFeelDefaults();
-
- shadow = defaults.getColor("InternalFrame.borderShadow");
- darkShadow = defaults.getColor("InternalFrame.borderDarkShadow");
- highlight = defaults.getColor("InternalFrame.borderLight");
- lightHighlight = defaults.getColor("InternalFrame.borderHighlight");
- line = defaults.getColor("InternalFrame.borderColor");
+ shadow = UIManager.getColor("InternalFrame.borderShadow");
+ darkShadow = UIManager.getColor("InternalFrame.borderDarkShadow");
+ highlight = UIManager.getColor("InternalFrame.borderLight");
+ lightHighlight = UIManager.getColor("InternalFrame.borderHighlight");
+ line = UIManager.getColor("InternalFrame.borderColor");
return new BorderUIResource.CompoundBorderUIResource(
/* outer border */
Index: javax/swing/plaf/basic/BasicButtonUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicButtonUI.java,v
retrieving revision 1.32
diff -u -r1.32 BasicButtonUI.java
--- javax/swing/plaf/basic/BasicButtonUI.java 25 Oct 2005 19:57:04 -0000 1.32
+++ javax/swing/plaf/basic/BasicButtonUI.java 15 Nov 2005 20:30:33 -0000
@@ -52,7 +52,6 @@
import javax.swing.JComponent;
import javax.swing.LookAndFeel;
import javax.swing.SwingUtilities;
-import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.plaf.ButtonUI;
import javax.swing.plaf.ComponentUI;
@@ -444,9 +443,8 @@
}
else
{
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
String prefix = getPropertyPrefix();
- g.setColor(defaults.getColor(prefix + "disabledText"));
+ g.setColor(UIManager.getColor(prefix + "disabledText"));
g.drawString(text, textRect.x, textRect.y + fm.getAscent());
}
}
Index: javax/swing/plaf/basic/BasicCheckBoxUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicCheckBoxUI.java,v
retrieving revision 1.11
diff -u -r1.11 BasicCheckBoxUI.java
--- javax/swing/plaf/basic/BasicCheckBoxUI.java 31 Aug 2005 15:23:10 -0000 1.11
+++ javax/swing/plaf/basic/BasicCheckBoxUI.java 15 Nov 2005 20:30:33 -0000
@@ -40,7 +40,6 @@
import javax.swing.Icon;
import javax.swing.JComponent;
-import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
@@ -53,12 +52,11 @@
public Icon getDefaultIcon()
{
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
- return defaults.getIcon("CheckBox.icon");
+ return UIManager.getIcon("CheckBox.icon");
}
/**
- * Returns the prefix for entries in the [EMAIL PROTECTED] UIDefaults} table.
+ * Returns the prefix for entries in the [EMAIL PROTECTED] UIManager} defaults table.
*
* @return "CheckBox."
*/
Index: javax/swing/plaf/basic/BasicComboBoxUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicComboBoxUI.java,v
retrieving revision 1.28
diff -u -r1.28 BasicComboBoxUI.java
--- javax/swing/plaf/basic/BasicComboBoxUI.java 10 Nov 2005 15:58:35 -0000 1.28
+++ javax/swing/plaf/basic/BasicComboBoxUI.java 15 Nov 2005 20:30:34 -0000
@@ -805,10 +805,10 @@
isPressed, hasFocus);
if (! comboBox.isEnabled())
{
- comp.setBackground(UIManager.getLookAndFeelDefaults().getColor(
- "ComboBox.disabledBackground"));
- comp.setForeground(UIManager.getLookAndFeelDefaults().getColor(
- "ComboBox.disabledForeground"));
+ comp.setBackground(UIManager.getColor(
+ "ComboBox.disabledBackground"));
+ comp.setForeground(UIManager.getColor(
+ "ComboBox.disabledForeground"));
comp.setEnabled(false);
}
comp.setBounds(0, 0, bounds.width, bounds.height);
Index: javax/swing/plaf/basic/BasicFileChooserUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicFileChooserUI.java,v
retrieving revision 1.16
diff -u -r1.16 BasicFileChooserUI.java
--- javax/swing/plaf/basic/BasicFileChooserUI.java 1 Nov 2005 19:07:42 -0000 1.16
+++ javax/swing/plaf/basic/BasicFileChooserUI.java 15 Nov 2005 20:30:36 -0000
@@ -79,7 +79,6 @@
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.Timer;
-import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
@@ -1429,27 +1428,25 @@
*/
protected void installStrings(JFileChooser fc)
{
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
-
- acceptAllFileFilterText = defaults.getString("FileChooser.acceptAllFileFilterText");
- cancelButtonMnemonic = defaults.getInt("FileChooser.cancelButtonMnemonic");
- cancelButtonText = defaults.getString("FileChooser.cancelButtonText");
- cancelButtonToolTipText = defaults.getString("FileChooser.cancelButtonToolTipText");
-
- dirDescText = defaults.getString("FileChooser.directoryDescriptionText");
- fileDescText = defaults.getString("FileChooser.fileDescriptionText");
-
- helpButtonMnemonic = defaults.getInt("FileChooser.helpButtonMnemonic");
- helpButtonText = defaults.getString("FileChooser.helpButtonText");
- helpButtonToolTipText = defaults.getString("FileChooser.helpButtonToolTipText");
-
- openButtonMnemonic = defaults.getInt("FileChooser.openButtonMnemonic");
- openButtonText = defaults.getString("FileChooser.openButtonText");
- openButtonToolTipText = defaults.getString("FileChooser.openButtonToolTipText");
-
- saveButtonMnemonic = defaults.getInt("FileChooser.saveButtonMnemonic");
- saveButtonText = defaults.getString("FileChooser.saveButtonText");
- saveButtonToolTipText = defaults.getString("FileChooser.saveButtonToolTipText");
+ acceptAllFileFilterText = UIManager.getString("FileChooser.acceptAllFileFilterText");
+ cancelButtonMnemonic = UIManager.getInt("FileChooser.cancelButtonMnemonic");
+ cancelButtonText = UIManager.getString("FileChooser.cancelButtonText");
+ cancelButtonToolTipText = UIManager.getString("FileChooser.cancelButtonToolTipText");
+
+ dirDescText = UIManager.getString("FileChooser.directoryDescriptionText");
+ fileDescText = UIManager.getString("FileChooser.fileDescriptionText");
+
+ helpButtonMnemonic = UIManager.getInt("FileChooser.helpButtonMnemonic");
+ helpButtonText = UIManager.getString("FileChooser.helpButtonText");
+ helpButtonToolTipText = UIManager.getString("FileChooser.helpButtonToolTipText");
+
+ openButtonMnemonic = UIManager.getInt("FileChooser.openButtonMnemonic");
+ openButtonText = UIManager.getString("FileChooser.openButtonText");
+ openButtonToolTipText = UIManager.getString("FileChooser.openButtonToolTipText");
+
+ saveButtonMnemonic = UIManager.getInt("FileChooser.saveButtonMnemonic");
+ saveButtonText = UIManager.getString("FileChooser.saveButtonText");
+ saveButtonToolTipText = UIManager.getString("FileChooser.saveButtonToolTipText");
}
/**
Index: javax/swing/plaf/basic/BasicInternalFrameTitlePane.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java,v
retrieving revision 1.17
diff -u -r1.17 BasicInternalFrameTitlePane.java
--- javax/swing/plaf/basic/BasicInternalFrameTitlePane.java 14 Nov 2005 12:39:47 -0000 1.17
+++ javax/swing/plaf/basic/BasicInternalFrameTitlePane.java 15 Nov 2005 20:30:36 -0000
@@ -66,7 +66,6 @@
import javax.swing.JMenuItem;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
-import javax.swing.UIDefaults;
import javax.swing.UIManager;
/**
@@ -718,13 +717,11 @@
*/
protected void installDefaults()
{
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
-
- title.setFont(defaults.getFont("InternalFrame.titleFont"));
- selectedTextColor = defaults.getColor("InternalFrame.activeTitleForeground");
- selectedTitleColor = defaults.getColor("InternalFrame.activeTitleBackground");
- notSelectedTextColor = defaults.getColor("InternalFrame.inactiveTitleForeground");
- notSelectedTitleColor = defaults.getColor("InternalFrame.inactiveTitleBackground");
+ title.setFont(UIManager.getFont("InternalFrame.titleFont"));
+ selectedTextColor = UIManager.getColor("InternalFrame.activeTitleForeground");
+ selectedTitleColor = UIManager.getColor("InternalFrame.activeTitleBackground");
+ notSelectedTextColor = UIManager.getColor("InternalFrame.inactiveTitleForeground");
+ notSelectedTitleColor = UIManager.getColor("InternalFrame.inactiveTitleBackground");
closeIcon = UIManager.getIcon("InternalFrame.closeIcon");
iconIcon = UIManager.getIcon("InternalFrame.iconifyIcon");
Index: javax/swing/plaf/basic/BasicListUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicListUI.java,v
retrieving revision 1.39
diff -u -r1.39 BasicListUI.java
--- javax/swing/plaf/basic/BasicListUI.java 15 Nov 2005 13:24:26 -0000 1.39
+++ javax/swing/plaf/basic/BasicListUI.java 15 Nov 2005 20:30:36 -0000
@@ -992,8 +992,7 @@
*/
protected void installKeyboardActions()
{
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
- InputMap focusInputMap = (InputMap)defaults.get("List.focusInputMap");
+ InputMap focusInputMap = (InputMap) UIManager.get("List.focusInputMap");
InputMapUIResource parentInputMap = new InputMapUIResource();
// FIXME: The JDK uses a LazyActionMap for parentActionMap
ActionMap parentActionMap = new ActionMapUIResource();
Index: javax/swing/plaf/basic/BasicProgressBarUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicProgressBarUI.java,v
retrieving revision 1.14
diff -u -r1.14 BasicProgressBarUI.java
--- javax/swing/plaf/basic/BasicProgressBarUI.java 14 Nov 2005 11:07:35 -0000 1.14
+++ javax/swing/plaf/basic/BasicProgressBarUI.java 15 Nov 2005 20:30:36 -0000
@@ -212,6 +212,8 @@
/**
* Holds the value of the bouncing box that is returned by [EMAIL PROTECTED] #getBox}.
+ *
+ * @since 1.5
*/
protected Rectangle boxRect;
Index: javax/swing/plaf/basic/BasicRadioButtonUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicRadioButtonUI.java,v
retrieving revision 1.14
diff -u -r1.14 BasicRadioButtonUI.java
--- javax/swing/plaf/basic/BasicRadioButtonUI.java 21 Oct 2005 19:09:38 -0000 1.14
+++ javax/swing/plaf/basic/BasicRadioButtonUI.java 15 Nov 2005 20:30:36 -0000
@@ -48,7 +48,6 @@
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.SwingUtilities;
-import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
@@ -122,8 +121,7 @@
*/
public Icon getDefaultIcon()
{
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
- return defaults.getIcon(getPropertyPrefix() + "icon");
+ return UIManager.getIcon(getPropertyPrefix() + "icon");
}
/**
Index: javax/swing/plaf/basic/BasicScrollBarUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicScrollBarUI.java,v
retrieving revision 1.29
diff -u -r1.29 BasicScrollBarUI.java
--- javax/swing/plaf/basic/BasicScrollBarUI.java 27 Oct 2005 12:42:16 -0000 1.29
+++ javax/swing/plaf/basic/BasicScrollBarUI.java 15 Nov 2005 20:30:37 -0000
@@ -62,7 +62,6 @@
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.Timer;
-import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
@@ -501,14 +500,12 @@
*/
protected void configureScrollBarColors()
{
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
-
- trackColor = defaults.getColor("ScrollBar.track");
- trackHighlightColor = defaults.getColor("ScrollBar.trackHighlight");
- thumbColor = defaults.getColor("ScrollBar.thumb");
- thumbHighlightColor = defaults.getColor("ScrollBar.thumbHighlight");
- thumbDarkShadowColor = defaults.getColor("ScrollBar.thumbDarkShadow");
- thumbLightShadowColor = defaults.getColor("ScrollBar.thumbShadow");
+ trackColor = UIManager.getColor("ScrollBar.track");
+ trackHighlightColor = UIManager.getColor("ScrollBar.trackHighlight");
+ thumbColor = UIManager.getColor("ScrollBar.thumb");
+ thumbHighlightColor = UIManager.getColor("ScrollBar.thumbHighlight");
+ thumbDarkShadowColor = UIManager.getColor("ScrollBar.thumbDarkShadow");
+ thumbLightShadowColor = UIManager.getColor("ScrollBar.thumbShadow");
}
/**
@@ -660,11 +657,7 @@
width += decrButton.getPreferredSize().getWidth();
width += (scrollbar.getMaximum() - scrollbar.getMinimum());
-
- height = Math.max(incrButton.getPreferredSize().height,
- decrButton.getPreferredSize().height);
- height = Math.max(getMinimumThumbSize().height, height);
- height = Math.min(getMaximumThumbSize().height, height);
+ height = UIManager.getInt("ScrollBar.width");
}
else
{
@@ -672,11 +665,7 @@
height += decrButton.getPreferredSize().getHeight();
height += (scrollbar.getMaximum() - scrollbar.getMinimum());
-
- width = Math.max(incrButton.getPreferredSize().width,
- decrButton.getPreferredSize().width);
- width = Math.max(getMinimumThumbSize().width, width);
- width = Math.min(getMaximumThumbSize().width, width);
+ width = UIManager.getInt("ScrollBar.width");
}
Insets insets = scrollbar.getInsets();
Index: javax/swing/plaf/basic/BasicTableUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicTableUI.java,v
retrieving revision 1.36
diff -u -r1.36 BasicTableUI.java
--- javax/swing/plaf/basic/BasicTableUI.java 8 Nov 2005 20:35:44 -0000 1.36
+++ javax/swing/plaf/basic/BasicTableUI.java 15 Nov 2005 20:30:37 -0000
@@ -66,7 +66,6 @@
import javax.swing.KeyStroke;
import javax.swing.ListSelectionModel;
import javax.swing.LookAndFeel;
-import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.event.ChangeEvent;
@@ -398,8 +397,7 @@
protected void installKeyboardActions()
{
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
- InputMap ancestorMap = (InputMap)defaults.get("Table.ancestorInputMap");
+ InputMap ancestorMap = (InputMap) UIManager.get("Table.ancestorInputMap");
InputMapUIResource parentInputMap = new InputMapUIResource();
// FIXME: The JDK uses a LazyActionMap for parentActionMap
ActionMap parentActionMap = new ActionMapUIResource();
Index: javax/swing/plaf/basic/BasicTextUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicTextUI.java,v
retrieving revision 1.55
diff -u -r1.55 BasicTextUI.java
--- javax/swing/plaf/basic/BasicTextUI.java 14 Nov 2005 12:10:35 -0000 1.55
+++ javax/swing/plaf/basic/BasicTextUI.java 15 Nov 2005 20:30:38 -0000
@@ -58,7 +58,6 @@
import javax.swing.LookAndFeel;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
-import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
@@ -618,13 +617,14 @@
protected Keymap createKeymap()
{
String prefix = getPropertyPrefix();
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
JTextComponent.KeyBinding[] bindings =
- (JTextComponent.KeyBinding[]) defaults.get(prefix + ".keyBindings");
+ (JTextComponent.KeyBinding[]) UIManager.get(prefix + ".keyBindings");
if (bindings == null)
{
bindings = new JTextComponent.KeyBinding[0];
- defaults.put(prefix + ".keyBindings", bindings);
+ // FIXME: Putting something into the defaults map is certainly wrong.
+ // Must be fixed somehow.
+ UIManager.put(prefix + ".keyBindings", bindings);
}
Keymap km = JTextComponent.addKeymap(getKeymapName(),
@@ -661,17 +661,16 @@
InputMap getInputMap(int condition)
{
String prefix = getPropertyPrefix();
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
switch (condition)
{
case JComponent.WHEN_IN_FOCUSED_WINDOW:
// FIXME: is this the right string? nobody seems to use it.
- return (InputMap) defaults.get(prefix + ".windowInputMap");
+ return (InputMap) UIManager.get(prefix + ".windowInputMap");
case JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT:
- return (InputMap) defaults.get(prefix + ".ancestorInputMap");
+ return (InputMap) UIManager.get(prefix + ".ancestorInputMap");
default:
case JComponent.WHEN_FOCUSED:
- return (InputMap) defaults.get(prefix + ".focusInputMap");
+ return (InputMap) UIManager.get(prefix + ".focusInputMap");
}
}
@@ -685,12 +684,14 @@
ActionMap getActionMap()
{
String prefix = getPropertyPrefix();
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
- ActionMap am = (ActionMap) defaults.get(prefix + ".actionMap");
+ ActionMap am = (ActionMap) UIManager.get(prefix + ".actionMap");
if (am == null)
{
am = createActionMap();
- defaults.put(prefix + ".actionMap", am);
+ // FIXME: Putting something in the UIDefaults map is certainly wrong.
+ // However, the whole method seems wrong and must be replaced by
+ // something that is less wrong.
+ UIManager.put(prefix + ".actionMap", am);
}
return am;
}
Index: javax/swing/plaf/basic/BasicToolBarUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicToolBarUI.java,v
retrieving revision 1.17
diff -u -r1.17 BasicToolBarUI.java
--- javax/swing/plaf/basic/BasicToolBarUI.java 2 Nov 2005 18:23:01 -0000 1.17
+++ javax/swing/plaf/basic/BasicToolBarUI.java 15 Nov 2005 20:30:39 -0000
@@ -404,6 +404,8 @@
boolean tmp = ((loc == SwingConstants.NORTH)
|| (loc == SwingConstants.SOUTH) || (loc == -1));
+ cachedOrientation = toolBar.getOrientation();
+ cachedBounds = toolBar.getSize();
if (((cachedOrientation == SwingConstants.HORIZONTAL) && tmp)
|| ((cachedOrientation == VERTICAL) && ! tmp))
{
@@ -570,9 +572,6 @@
floatFrame = (Window) createFloatingWindow(toolBar);
dragWindow = createDragWindow(toolBar);
-
- cachedBounds = toolBar.getPreferredSize();
- cachedOrientation = toolBar.getOrientation();
nonRolloverBorder = createNonRolloverBorder();
rolloverBorder = createRolloverBorder();
Index: javax/swing/plaf/basic/BasicTreeUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicTreeUI.java,v
retrieving revision 1.111
diff -u -r1.111 BasicTreeUI.java
--- javax/swing/plaf/basic/BasicTreeUI.java 15 Nov 2005 19:53:49 -0000 1.111
+++ javax/swing/plaf/basic/BasicTreeUI.java 15 Nov 2005 20:30:40 -0000
@@ -81,7 +81,6 @@
import javax.swing.LookAndFeel;
import javax.swing.SwingUtilities;
import javax.swing.Timer;
-import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.event.CellEditorListener;
import javax.swing.event.ChangeEvent;
@@ -301,7 +300,7 @@
*/
protected Color getHashColor()
{
- return UIManager.getLookAndFeelDefaults().getColor("Tree.hash");
+ return UIManager.getColor("Tree.hash");
}
/**
@@ -312,8 +311,8 @@
*/
protected void setHashColor(Color color)
{
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
- defaults.put("Tree.hash", color);
+ // FIXME: Putting something in the UIDefaults map is certainly wrong.
+ UIManager.put("Tree.hash", color);
}
/**
@@ -1235,8 +1234,7 @@
*/
protected void installKeyboardActions()
{
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
- InputMap focusInputMap = (InputMap) defaults.get("Tree.focusInputMap");
+ InputMap focusInputMap = (InputMap) UIManager.get("Tree.focusInputMap");
InputMapUIResource parentInputMap = new InputMapUIResource();
ActionMap parentActionMap = new ActionMapUIResource();
action = new TreeAction();
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches