diff options
Diffstat (limited to 'libjava/classpath/javax/swing/plaf/basic/BasicToolBarUI.java')
-rw-r--r-- | libjava/classpath/javax/swing/plaf/basic/BasicToolBarUI.java | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicToolBarUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicToolBarUI.java index 261db687aa8..80fec6a775a 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicToolBarUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicToolBarUI.java @@ -38,6 +38,8 @@ exception statement from your version. */ package javax.swing.plaf.basic; +import gnu.classpath.NotImplementedException; + import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; @@ -60,6 +62,7 @@ import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.Hashtable; +import javax.swing.AbstractButton; import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JDialog; @@ -72,8 +75,8 @@ import javax.swing.SwingConstants; import javax.swing.SwingUtilities; import javax.swing.UIManager; import javax.swing.border.Border; +import javax.swing.border.EtchedBorder; import javax.swing.event.MouseInputListener; -import javax.swing.plaf.BorderUIResource.EtchedBorderUIResource; import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ToolBarUI; import javax.swing.plaf.UIResource; @@ -307,7 +310,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants */ protected Border createNonRolloverBorder() { - return new EtchedBorderUIResource(); + return new EtchedBorder(); } /** @@ -328,7 +331,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants */ protected Border createRolloverBorder() { - return new EtchedBorderUIResource() + return new EtchedBorder() { public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) @@ -577,6 +580,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants rolloverBorder = createRolloverBorder(); borders = new Hashtable(); + setRolloverBorders(toolBar.isRollover()); fillHashtable(); } @@ -595,7 +599,6 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants floatingBorderColor = UIManager.getColor("ToolBar.floatingForeground"); floatingColor = UIManager.getColor("ToolBar.floatingBackground"); - setRolloverBorders(toolBar.isRollover()); } /** @@ -603,6 +606,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants * by the look and feel. */ protected void installKeyboardActions() + throws NotImplementedException { // FIXME: implement. } @@ -707,9 +711,8 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants if (c instanceof JToolBar) { toolBar = (JToolBar) c; - toolBar.setOpaque(true); - installDefaults(); - installComponents(); + installDefaults(); + installComponents(); installListeners(); installKeyboardActions(); } @@ -754,9 +757,9 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants */ protected void setBorderToNonRollover(Component c) { - if (c instanceof JButton) + if (c instanceof AbstractButton) { - JButton b = (JButton) c; + AbstractButton b = (AbstractButton) c; b.setRolloverEnabled(false); b.setBorder(nonRolloverBorder); } @@ -875,8 +878,6 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants { installNormalBorders(toolBar); borders = null; - rolloverBorder = null; - nonRolloverBorder = null; cachedBounds = null; floatFrame = null; @@ -902,6 +903,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants * This method uninstalls keyboard actions installed by the UI. */ protected void uninstallKeyboardActions() + throws NotImplementedException { // FIXME: implement. } @@ -1231,8 +1233,8 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants public void propertyChange(PropertyChangeEvent e) { // FIXME: need name properties so can change floatFrame title. - if (e.getPropertyName().equals("rollover")) - setRolloverBorders(toolBar.isRollover()); + if (e.getPropertyName().equals("rollover") && toolBar != null) + setRolloverBorders(toolBar.isRollover()); } } |