aboutsummaryrefslogtreecommitdiff
path: root/libjava/javax/swing/plaf
diff options
context:
space:
mode:
authorMichael Koch <mkoch@gcc.gnu.org>2005-04-19 09:59:53 +0000
committerMichael Koch <mkoch@gcc.gnu.org>2005-04-19 09:59:53 +0000
commit2330df3bed9c50b1b46030cf674006a9ac8bb955 (patch)
tree5b3008cdd47238bffbcd163cf0951c2ea0a15d37 /libjava/javax/swing/plaf
parentd393cb7237f032cdd01c6a5651389ce81425f2f9 (diff)
downloadgcc-2330df3bed9c50b1b46030cf674006a9ac8bb955.zip
gcc-2330df3bed9c50b1b46030cf674006a9ac8bb955.tar.gz
gcc-2330df3bed9c50b1b46030cf674006a9ac8bb955.tar.bz2
[multiple changes]
2005-04-19 Roman Kennke <roman@kennke.org> * javax/swing/plaf/metal/MetalLookAndFeel.java (initComponentDefaults): Added defaults for Menu, MenuBar MenuEntry fonts. 2005-04-19 Roman Kennke <roman@kennke.org> * javax/swing/plaf/metal/MetalLookAndFeel.java (initComponentDefaults): Added Label.font. (initSystemColorDefaults): Added this method and adjusted the general control color. 2005-04-19 Roman Kennke <roman@kennke.org> * javax/swing/plaf/metal/MetalBorders.java: Added. * javax/swing/plaf/metal/MetalButtonUI.java: (installDefaults): Install button font. * javax/swing/plaf/metal/MetalLookAndFeel.java: (initComponentDefaults): Added button border, font and margin. Changed components background color to the Metal current themes standard color. 2005-04-19 Roman Kennke <roman@kennke.org> * javax/swing/plaf/metal/MetalLookAndFeel.java (initComponentDefaults): Added to set Metal specific component defaults. 2005-04-19 Mark Wielaard <mark@klomp.org> * javax/swing/plaf/metal/MetalLookAndFeel.java (initClassDefaults): Call super.initClassDefaults(). 2005-04-19 Roman Kennke <roman@kennke.org> * javax/swing/plaf/metal/MetalLookAndFeel.java (initClassDefaults): Added to include the *UI classes. 2005-04-19 Roman Kennke <roman@kennke.org> * javax/swing/plaf/metal/MetalComboBoxUI.java: Added. * javax/swing/plaf/metal/MetalDesktopIconUI.java: Added. * javax/swing/plaf/metal/MetalInternalFrameUI.java: Added. * javax/swing/plaf/metal/MetalPopupMenuSeparatorUI.java: Added. * javax/swing/plaf/metal/MetalProgressBarUI.java: Added. * javax/swing/plaf/metal/MetalRootPaneUI.java: Added. * javax/swing/plaf/metal/MetalScrollBarUI.java: Added. * javax/swing/plaf/metal/MetalSeparatorUI.java: Added. * javax/swing/plaf/metal/MetalSliderUI.java: Added. * javax/swing/plaf/metal/MetalSplitPaneUI.java: Added. * javax/swing/plaf/metal/MetalTextFieldUI.java: Added. * javax/swing/plaf/metal/MetalToggleButtonUI.java: 2005-04-19 Roman Kennke <roman@kennke.org> * javax/swing/plaf/metal/MetalButtonUI.java: Added skeleton class. * javax/swing/plaf/metal/MetalCheckBoxUI.java: Added skeleton class. * javax/swing/plaf/metal/MetalLabelUI.java: Added skeleton class. * javax/swing/plaf/metal/MetalRadioButtonUI.java: Added skeleton class. * javax/swing/plaf/metal/MetalScrollPaneUI.java: Added skeleton class. * javax/swing/plaf/metal/MetalTabbedPaneUI.java: Added skeleton class. 2005-04-19 Roman Kennke <roman@kennke.org> * javax/swing/UIDefaults.java: Added API documentation for all methods. 2005-04-19 Roman Kennke <roman@kennke.org> * javax/swing/UIDefaults.java (put): Now uses new checkAndPut method instead of checking directly. (putDefaults): Fixed so that it accepts null-values and treats them like remove(key). (checkAndPut): Added. This checks for null-values and calls put or remove. 2005-04-19 Michael Koch <konqueror@gmx.de> * Makefile.am: Added new files. * Makefile.in: Regenerated. From-SVN: r98396
Diffstat (limited to 'libjava/javax/swing/plaf')
-rw-r--r--libjava/javax/swing/plaf/metal/MetalBorders.java205
-rw-r--r--libjava/javax/swing/plaf/metal/MetalButtonUI.java97
-rw-r--r--libjava/javax/swing/plaf/metal/MetalCheckBoxUI.java74
-rw-r--r--libjava/javax/swing/plaf/metal/MetalComboBoxUI.java74
-rw-r--r--libjava/javax/swing/plaf/metal/MetalDesktopIconUI.java74
-rw-r--r--libjava/javax/swing/plaf/metal/MetalInternalFrameUI.java75
-rw-r--r--libjava/javax/swing/plaf/metal/MetalLabelUI.java74
-rw-r--r--libjava/javax/swing/plaf/metal/MetalLookAndFeel.java195
-rw-r--r--libjava/javax/swing/plaf/metal/MetalPopupMenuSeparatorUI.java73
-rw-r--r--libjava/javax/swing/plaf/metal/MetalProgressBarUI.java74
-rw-r--r--libjava/javax/swing/plaf/metal/MetalRadioButtonUI.java74
-rw-r--r--libjava/javax/swing/plaf/metal/MetalRootPaneUI.java74
-rw-r--r--libjava/javax/swing/plaf/metal/MetalScrollBarUI.java74
-rw-r--r--libjava/javax/swing/plaf/metal/MetalScrollPaneUI.java74
-rw-r--r--libjava/javax/swing/plaf/metal/MetalSeparatorUI.java74
-rw-r--r--libjava/javax/swing/plaf/metal/MetalSliderUI.java74
-rw-r--r--libjava/javax/swing/plaf/metal/MetalSplitPaneUI.java74
-rw-r--r--libjava/javax/swing/plaf/metal/MetalTabbedPaneUI.java86
-rw-r--r--libjava/javax/swing/plaf/metal/MetalTextFieldUI.java74
-rw-r--r--libjava/javax/swing/plaf/metal/MetalToggleButtonUI.java74
-rw-r--r--libjava/javax/swing/plaf/metal/MetalToolBarUI.java74
-rw-r--r--libjava/javax/swing/plaf/metal/MetalToolTipUI.java74
-rw-r--r--libjava/javax/swing/plaf/metal/MetalTreeUI.java74
23 files changed, 1989 insertions, 0 deletions
diff --git a/libjava/javax/swing/plaf/metal/MetalBorders.java b/libjava/javax/swing/plaf/metal/MetalBorders.java
new file mode 100644
index 0000000..edcb888
--- /dev/null
+++ b/libjava/javax/swing/plaf/metal/MetalBorders.java
@@ -0,0 +1,205 @@
+/* MetalBorders.java
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.metal;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.Insets;
+
+import javax.swing.AbstractButton;
+import javax.swing.ButtonModel;
+import javax.swing.JButton;
+import javax.swing.border.AbstractBorder;
+import javax.swing.border.Border;
+import javax.swing.plaf.BorderUIResource;
+import javax.swing.plaf.basic.BasicGraphicsUtils;
+import javax.swing.plaf.basic.BasicBorders;
+
+/**
+ * This factory class creates borders for the different Swing components
+ * UI.
+ *
+ * @author Roman Kennke (roman@kennke.org)
+ */
+public class MetalBorders
+{
+
+ /**
+ * A MarginBorder that gets shared by multiple components.
+ * Created on demand by the private helper function {@link
+ * #getMarginBorder()}.
+ */
+ private static BasicBorders.MarginBorder sharedMarginBorder;
+
+ /**
+ * The border that is drawn around Swing buttons.
+ */
+ public static class MetalButtonBorder
+ extends AbstractBorder
+ {
+ /** The borders insets. */
+ protected static Insets borderInsets = new Insets(2, 2, 2, 2);
+
+ /**
+ * Creates a new instance of ButtonBorder.
+ */
+ public MetalButtonBorder()
+ {
+ }
+
+ /**
+ * Paints the button border.
+ *
+ * @param c the component for which we paint the border
+ * @param g the Graphics context to use
+ * @param x the X coordinate of the upper left corner of c
+ * @param y the Y coordinate of the upper left corner of c
+ * @param w the width of c
+ * @param h the height of c
+ */
+ public void paintBorder(Component c, Graphics g, int x, int y, int w,
+ int h)
+ {
+ ButtonModel bmodel = null;
+
+ if (c instanceof AbstractButton)
+ bmodel = ((AbstractButton) c).getModel();
+
+ Color darkShadow = MetalLookAndFeel.getControlDarkShadow();
+ Color shadow = MetalLookAndFeel.getControlShadow();
+ Color light = MetalLookAndFeel.getWhite();
+ Color middle = MetalLookAndFeel.getControl();
+
+ // draw dark border
+ g.setColor(darkShadow);
+ g.drawRect(x, y, w - 2, h - 2);
+
+ if (!bmodel.isPressed())
+ {
+ // draw light border
+ g.setColor(light);
+ g.drawRect(x + 1, y + 1, w - 2, h - 2);
+
+ // draw crossing pixels of both borders
+ g.setColor(middle);
+ g.drawRect(x + 1, y + h - 2, 0, 0);
+ g.drawRect(x + w - 2, y + 1, 0, 0);
+ }
+ else
+ {
+ // draw light border
+ g.setColor(light);
+ g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1);
+ g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1);
+
+ // draw shadow border
+ g.setColor(middle);
+ g.drawLine(x + 1, y + 1, x + w - 2, y + 1);
+ g.drawLine(x + 1, y + 1, x + 1, y + h - 2);
+
+ // draw crossing pixels of both borders
+ g.setColor(shadow);
+ g.drawRect(x + 1, y + h - 2, 0, 0);
+ g.drawRect(x + w - 2, y + 1, 0, 0);
+ }
+ }
+
+ /**
+ * Returns the insets of the ButtonBorder.
+ *
+ * @param c the component for which the border is used
+ *
+ * @return the insets of the ButtonBorder
+ */
+ public Insets getBorderInsets(Component c)
+ {
+ return getBorderInsets(c, null);
+ }
+
+ /**
+ * Returns the insets of the ButtonBorder in the specified Insets object.
+ *
+ * @param c the component for which the border is used
+ * @param newInsets the insets object where to put the values
+ *
+ * @return the insets of the ButtonBorder
+ */
+ public Insets getBorderInsets(Component c, Insets newInsets)
+ {
+ if (newInsets == null)
+ newInsets = new Insets(0, 0, 0, 0);
+
+ newInsets.bottom = borderInsets.bottom;
+ newInsets.left = borderInsets.left;
+ newInsets.right = borderInsets.right;
+ newInsets.top = borderInsets.top;
+ return newInsets;
+ }
+ }
+
+
+ /**
+ * Returns a border for Swing buttons in the Metal Look &amp; Feel.
+ *
+ * @return a border for Swing buttons in the Metal Look &amp; Feel
+ */
+ public static Border getButtonBorder()
+ {
+ Border outer = new MetalButtonBorder();
+ Border inner = getMarginBorder();
+
+ return new BorderUIResource.CompoundBorderUIResource(outer, inner);
+ }
+
+ /**
+ * Returns a shared MarginBorder.
+ */
+ static Border getMarginBorder() // intentionally not public
+ {
+ /* Swing is not designed to be thread-safe, so there is no
+ * need to synchronize the access to the global variable.
+ */
+ if (sharedMarginBorder == null)
+ sharedMarginBorder = new BasicBorders.MarginBorder();
+
+ return sharedMarginBorder;
+ }
+
+}
diff --git a/libjava/javax/swing/plaf/metal/MetalButtonUI.java b/libjava/javax/swing/plaf/metal/MetalButtonUI.java
new file mode 100644
index 0000000..bfb26aa
--- /dev/null
+++ b/libjava/javax/swing/plaf/metal/MetalButtonUI.java
@@ -0,0 +1,97 @@
+/* MetalButtonUI.java
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.metal;
+
+import javax.swing.AbstractButton;
+import javax.swing.JComponent;
+import javax.swing.UIDefaults;
+import javax.swing.UIManager;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicButtonUI;
+
+/**
+ * The Metal Look &amp; Feel implementation for
+ * {@link javax.swing.AbstractButton}s.
+ *
+ * @author Roman Kennke (roman@kennke.org)
+ */
+public class MetalButtonUI
+ extends BasicButtonUI
+{
+
+ // FIXME: probably substitute with a Map in the future in the case
+ // that this UI becomes stateful
+
+ /** The cached MetalButtonUI instance. */
+ private static MetalButtonUI instance = null;
+
+ /**
+ * Creates a new instance of MetalButtonUI.
+ */
+ public MetalButtonUI()
+ {
+ super();
+ }
+
+ /**
+ * Returns an instance of MetalButtonUI.
+ *
+ * @param component a button for which a UI instance should be returned
+ */
+ public static ComponentUI createUI(JComponent component)
+ {
+ if (instance == null)
+ instance = new MetalButtonUI();
+ return instance;
+ }
+
+ /**
+ * Install the Look &amp; Feel defaults for Buttons.
+ *
+ * @param button the button for which to install the Look &amp; Feel
+ */
+ public void installDefaults(AbstractButton button)
+ {
+ super.installDefaults(button);
+
+ UIDefaults defaults = UIManager.getLookAndFeelDefaults();
+ button.setFont(defaults.getFont("Button.font"));
+ }
+
+}
diff --git a/libjava/javax/swing/plaf/metal/MetalCheckBoxUI.java b/libjava/javax/swing/plaf/metal/MetalCheckBoxUI.java
new file mode 100644
index 0000000..cc5ac73
--- /dev/null
+++ b/libjava/javax/swing/plaf/metal/MetalCheckBoxUI.java
@@ -0,0 +1,74 @@
+/* MetalCheckBoxUI.java
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.metal;
+
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicCheckBoxUI;
+
+public class MetalCheckBoxUI
+ extends BasicCheckBoxUI
+{
+
+ // FIXME: maybe replace by a Map of instances when this becomes stateful
+ /** The shared UI instance for JCheckBoxes. */
+ private static MetalCheckBoxUI instance = null;
+
+ /**
+ * Constructs a new instance of MetalCheckBoxUI.
+ */
+ public MetalCheckBoxUI()
+ {
+ super();
+ }
+
+ /**
+ * Returns an instance of MetalCheckBoxUI.
+ *
+ * @param component the component for which we return an UI instance
+ *
+ * @return an instance of MetalCheckBoxUI
+ */
+ public static ComponentUI createUI(JComponent component)
+ {
+ if (instance == null)
+ instance = new MetalCheckBoxUI();
+ return instance;
+ }
+}
diff --git a/libjava/javax/swing/plaf/metal/MetalComboBoxUI.java b/libjava/javax/swing/plaf/metal/MetalComboBoxUI.java
new file mode 100644
index 0000000..3ba25b6
--- /dev/null
+++ b/libjava/javax/swing/plaf/metal/MetalComboBoxUI.java
@@ -0,0 +1,74 @@
+/* MetalComboBoxUI.java
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.metal;
+
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicComboBoxUI;
+
+public class MetalComboBoxUI
+ extends BasicComboBoxUI
+{
+
+ // FIXME: maybe replace by a Map of instances when this becomes stateful
+ /** The shared UI instance for JComboBoxes. */
+ private static MetalComboBoxUI instance = null;
+
+ /**
+ * Constructs a new instance of MetalComboBoxUI.
+ */
+ public MetalComboBoxUI()
+ {
+ super();
+ }
+
+ /**
+ * Returns an instance of MetalComboBoxUI.
+ *
+ * @param component the component for which we return an UI instance
+ *
+ * @return an instance of MetalComboBoxUI
+ */
+ public static ComponentUI createUI(JComponent component)
+ {
+ if (instance == null)
+ instance = new MetalComboBoxUI();
+ return instance;
+ }
+}
diff --git a/libjava/javax/swing/plaf/metal/MetalDesktopIconUI.java b/libjava/javax/swing/plaf/metal/MetalDesktopIconUI.java
new file mode 100644
index 0000000..6ceedd0d
--- /dev/null
+++ b/libjava/javax/swing/plaf/metal/MetalDesktopIconUI.java
@@ -0,0 +1,74 @@
+/* MetalDesktopIconUI.java
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.metal;
+
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicDesktopIconUI;
+
+public class MetalDesktopIconUI
+ extends BasicDesktopIconUI
+{
+
+ // FIXME: maybe replace by a Map of instances when this becomes stateful
+ /** The shared UI instance for MetalDesktopIcons */
+ private static MetalDesktopIconUI instance = null;
+
+ /**
+ * Constructs a new instance of MetalDesktopIconUI.
+ */
+ public MetalDesktopIconUI()
+ {
+ super();
+ }
+
+ /**
+ * Returns an instance of MetalDesktopIconUI.
+ *
+ * @param component the component for which we return an UI instance
+ *
+ * @return an instance of MetalDesktopIconUI
+ */
+ public static ComponentUI createUI(JComponent component)
+ {
+ if (instance == null)
+ instance = new MetalDesktopIconUI();
+ return instance;
+ }
+}
diff --git a/libjava/javax/swing/plaf/metal/MetalInternalFrameUI.java b/libjava/javax/swing/plaf/metal/MetalInternalFrameUI.java
new file mode 100644
index 0000000..883ec7f
--- /dev/null
+++ b/libjava/javax/swing/plaf/metal/MetalInternalFrameUI.java
@@ -0,0 +1,75 @@
+/* MetalInternalFrameUI.java
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.metal;
+
+import javax.swing.JComponent;
+import javax.swing.JInternalFrame;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicInternalFrameUI;
+
+public class MetalInternalFrameUI
+ extends BasicInternalFrameUI
+{
+
+ // FIXME: maybe replace by a Map of instances when this becomes stateful
+ /** The shared UI instance for JInternalFrames */
+ private static MetalInternalFrameUI instance = null;
+
+ /**
+ * Constructs a new instance of MetalInternalFrameUI.
+ */
+ public MetalInternalFrameUI(JInternalFrame frame)
+ {
+ super(frame);
+ }
+
+ /**
+ * Returns an instance of MetalInternalFrameUI.
+ *
+ * @param component the component for which we return an UI instance
+ *
+ * @return an instance of MetalInternalFrameUI
+ */
+ public static ComponentUI createUI(JComponent component)
+ {
+ if (instance == null)
+ instance = new MetalInternalFrameUI((JInternalFrame) component);
+ return instance;
+ }
+}
diff --git a/libjava/javax/swing/plaf/metal/MetalLabelUI.java b/libjava/javax/swing/plaf/metal/MetalLabelUI.java
new file mode 100644
index 0000000..12aa7b1
--- /dev/null
+++ b/libjava/javax/swing/plaf/metal/MetalLabelUI.java
@@ -0,0 +1,74 @@
+/* MetalLabelUI.java
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.metal;
+
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicLabelUI;
+
+public class MetalLabelUI
+ extends BasicLabelUI
+{
+
+ // FIXME: maybe replace by a Map of instances when this becomes stateful
+ /** The shared UI instance for JLabels. */
+ private static MetalLabelUI instance = null;
+
+ /**
+ * Constructs a new instance of MetalLabelUI.
+ */
+ public MetalLabelUI()
+ {
+ super();
+ }
+
+ /**
+ * Returns an instance of MetalLabelUI.
+ *
+ * @param component the component for which we return an UI instance
+ *
+ * @return an instance of MetalLabelUI
+ */
+ public static ComponentUI createUI(JComponent component)
+ {
+ if (instance == null)
+ instance = new MetalLabelUI();
+ return instance;
+ }
+}
diff --git a/libjava/javax/swing/plaf/metal/MetalLookAndFeel.java b/libjava/javax/swing/plaf/metal/MetalLookAndFeel.java
index b332050..917f6b4 100644
--- a/libjava/javax/swing/plaf/metal/MetalLookAndFeel.java
+++ b/libjava/javax/swing/plaf/metal/MetalLookAndFeel.java
@@ -38,6 +38,9 @@ exception statement from your version. */
package javax.swing.plaf.metal;
+import java.awt.Color;
+import java.awt.Insets;
+
import javax.swing.UIDefaults;
import javax.swing.plaf.ColorUIResource;
import javax.swing.plaf.FontUIResource;
@@ -307,4 +310,196 @@ public class MetalLookAndFeel extends BasicLookAndFeel
{
MetalLookAndFeel.theme = theme;
}
+
+ /**
+ * Sets the ComponentUI classes for all Swing components to the Metal
+ * implementations.
+ *
+ * In particular this sets the following keys:
+ *
+ * <table>
+ * <tr>
+ * <th>Key</th><th>Value</th>
+ * </tr><tr>
+ * <td>ButtonUI</td><td>{@link MetalButtonUI}</td>
+ * </tr><tr>
+ * <td>CheckBoxUI</td><td>{@link MetalCheckBoxUI}</td>
+ * </tr><tr>
+ * <td>ComboBoxUI</td><td>{@link MetalComboBoxUI}</td>
+ * </tr><tr>
+ * <td>DesktopIconUI</td><td>{@link MetalDesktopIconUI}</td>
+ * </tr><tr>
+ * <td>InternalFrameUI</td><td>{@link MetalInternalFrameUI}</td>
+ * </tr><tr>
+ * <td>LabelUI</td><td>{@link MetalLabelUI}</td>
+ * </tr><tr>
+ * <td>PopupMenuSeparatorUI</td><td>{@link MetalPopupMenuSeparatorUI}</td>
+ * </tr><tr>
+ * <td>ProgressBarUI</td><td>{@link MetalProgressBarUI}</td>
+ * </tr><tr>
+ * <td>RadioButtonUI</td><td>{@link MetalRadioButtonUI}</td>
+ * </tr><tr>
+ * <td>RootPaneUI</td><td>{@link MetalRootPaneUI}</td>
+ * </tr><tr>
+ * <td>ScrollBarUI</td><td>{@link MetalScrollBarUI}</td>
+ * </tr><tr>
+ * <td>ScrollPaneUI</td><td>{@link MetalScrollPaneUI}</td>
+ * </tr><tr>
+ * <td>SeparatorUI</td><td>{@link MetalSeparatorUI}</td>
+ * </tr><tr>
+ * <td>SliderUI</td><td>{@link MetalSliderUI}</td>
+ * </tr><tr>
+ * <td>SplitPaneUI</td><td>{@link MetalSplitPaneUI}</td>
+ * </tr><tr>
+ * <td>TabbedPaneUI</td><td>{@link MetalTabbedPaneUI}</td>
+ * </tr><tr>
+ * <td>TextFieldUI</td><td>{@link MetalTextFieldUI}</td>
+ * </tr><tr>
+ * <td>ToggleButtonUI</td><td>{@link MetalToggleButtonUI}</td>
+ * </tr><tr>
+ * <td>ToolBarUI</td><td>{@link MetalToolBarUI}</td>
+ * </tr><tr>
+ * <td>ToolTipUI</td><td>{@link MetalToolTipUI}</td>
+ * </tr><tr>
+ * <td>TreeUI</td><td>{@link MetalTreeUI}</td>
+ * </tr><tr>
+ * </table>
+ *
+ * @param defaults the UIDefaults where the class defaults are added
+ */
+ protected void initClassDefaults(UIDefaults defaults)
+ {
+ super.initClassDefaults(defaults);
+
+ // Variables
+ Object[] uiDefaults;
+ // Initialize Class Defaults
+ uiDefaults = new Object[] {
+ "ButtonUI", "javax.swing.plaf.metal.MetalButtonUI",
+ "CheckBoxUI", "javax.swing.plaf.metal.MetalCheckBoxUI",
+ "ComboBoxUI", "javax.swing.plaf.metal.MetalComboBoxUI",
+ "DesktopIconUI", "javax.swing.plaf.metal.MetalDesktopIconUI",
+ "InternalFrameUI", "javax.swing.plaf.metal.MetalInternalFrameUI",
+ "LabelUI", "javax.swing.plaf.metal.MetalLabelUI",
+ "PopupMenuSeparatorUI",
+ "javax.swing.plaf.metal.MetalPopupMenuSeparatorUI",
+ "ProgressBarUI", "javax.swing.plaf.metal.MetalProgressBarUI",
+ "RadioButtonUI", "javax.swing.plaf.metal.MetalRadioButtonUI",
+ "RootPaneUI", "javax.swing.plaf.metal.MetalRootPaneUI",
+ "ScrollBarUI", "javax.swing.plaf.metal.MetalScrollBarUI",
+ "ScrollPaneUI", "javax.swing.plaf.metal.MetalScrollPaneUI",
+ "SeparatorUI", "javax.swing.plaf.metal.MetalSeparatorUI",
+ "SliderUI", "javax.swing.plaf.metal.MetalSliderUI",
+ "SplitPaneUI", "javax.swing.plaf.metal.MetalSplitPaneUI",
+ "TabbedPaneUI", "javax.swing.plaf.metal.MetalTabbedPaneUI",
+ "TextFieldUI", "javax.swing.plaf.metal.MetalTextFieldUI",
+ "ToggleButtonUI", "javax.swing.plaf.metal.MetalToggleButtonUI",
+ "ToolBarUI", "javax.swing.plaf.metal.MetalToolBarUI",
+ "ToolTipUI", "javax.swing.plaf.metal.MetalToolTipUI",
+ "TreeUI", "javax.swing.plaf.metal.MetalTreeUI",
+ };
+ // Add Class Defaults to UI Defaults table
+ defaults.putDefaults(uiDefaults);
+ }
+
+ /**
+ * Initializes the component defaults for the Metal Look &amp; Feel.
+ *
+ * In particular this sets the following keys (the colors are given
+ * as RGB hex values):
+ *
+ * <table>
+ * <tr>
+ * <th>Key</th><th>Value</th>
+ * </tr><tr>
+ * <td>Button.background</td><td>0xcccccc</td>
+ * </tr><tr>
+ * <td>Button.border</td><td>{@link MetalBorders.ButtonBorder}</td>
+ * </tr><tr>
+ * <td>Button.font</td><td>{@link #getControlTextFont}</td>
+ * </tr><tr>
+ * <td>Button.margin</td><td><code>new java.awt.Insets(2, 14, 2, 14)</code>
+ * </td>
+ * </tr><tr>
+ * <td>CheckBox.background</td><td>0xcccccc</td>
+ * </tr><tr>
+ * <td>CheckBoxMenuItem.background</td><td>0xcccccc</td>
+ * </tr><tr>
+ * <td>ToolBar.background</td><td>0xcccccc</td>
+ * </tr><tr>
+ * <td>Panel.background</td><td>0xcccccc</td>
+ * </tr><tr>
+ * <td>Slider.background</td><td>0xcccccc</td>
+ * </tr><tr>
+ * <td>OptionPane.background</td><td>0xcccccc</td>
+ * </tr><tr>
+ * <td>ProgressBar.background</td><td>0xcccccc</td>
+ * </tr><tr>
+ * <td>TabbedPane.background</td><td>0xcccccc</td>
+ * </tr><tr>
+ * <td>Label.background</td><td>0xcccccc</td>
+ * </tr><tr>
+ * <td>Label.font</td><td>{@link #getControlTextFont}</td>
+ * </tr><tr>
+ * <td>Menu.background</td><td>0xcccccc</td>
+ * </tr><tr>
+ * <td>MenuBar.background</td><td>0xcccccc</td>
+ * </tr><tr>
+ * <td>MenuItem.background</td><td>0xcccccc</td>
+ * </tr><tr>
+ * <td>ScrollBar.background</td><td>0xcccccc</td>
+ * </tr><tr>
+ * </table>
+ *
+ * @param defaults the UIDefaults instance to which the values are added
+ */
+ protected void initComponentDefaults(UIDefaults defaults)
+ {
+ super.initComponentDefaults(defaults);
+ Object[] myDefaults = new Object[] {
+ "Button.background", new ColorUIResource(getControl()),
+ "Button.border", MetalBorders.getButtonBorder(),
+ "Button.font", getControlTextFont(),
+ "Button.margin", new Insets(2, 14, 2, 14),
+ "CheckBox.background", new ColorUIResource(getControl()),
+ "CheckBoxMenuItem.background", new ColorUIResource(getControl()),
+ "ToolBar.background", new ColorUIResource(getControl()),
+ "Panel.background", new ColorUIResource(getControl()),
+ "Slider.background", new ColorUIResource(getControl()),
+ "OptionPane.background", new ColorUIResource(getControl()),
+ "ProgressBar.background", new ColorUIResource(getControl()),
+ "TabbedPane.background", new ColorUIResource(getControl()),
+ "Label.background", new ColorUIResource(getControl()),
+ "Label.font", getControlTextFont(),
+ "Menu.background", new ColorUIResource(getControl()),
+ "MenuBar.background", new ColorUIResource(getControl()),
+ "MenuItem.background", new ColorUIResource(getControl()),
+ "ScrollBar.background", new ColorUIResource(getControl())
+ };
+ defaults.putDefaults(myDefaults);
+ }
+
+ /**
+ * Initializes the system color defaults.
+ *
+ * In particular this sets the following keys:
+ *
+ * <table>
+ * <tr>
+ * <th>Key</th><th>Value</th><th>Description</th>
+ * </tr><tr>
+ * <td>control</td><td>0xcccccc</td><td>The default color for components</td>
+ * </tr>
+ * </table>
+ */
+ protected void initSystemColorDefaults(UIDefaults defaults)
+ {
+ super.initSystemColorDefaults(defaults);
+ Object[] uiDefaults;
+ uiDefaults = new Object[] {
+ "control", new ColorUIResource(getControl())
+ };
+ defaults.putDefaults(uiDefaults);
+ }
+
}
diff --git a/libjava/javax/swing/plaf/metal/MetalPopupMenuSeparatorUI.java b/libjava/javax/swing/plaf/metal/MetalPopupMenuSeparatorUI.java
new file mode 100644
index 0000000..0892c56
--- /dev/null
+++ b/libjava/javax/swing/plaf/metal/MetalPopupMenuSeparatorUI.java
@@ -0,0 +1,73 @@
+/* MetalPopupMenuSeparatorUI.java
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.metal;
+
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
+
+public class MetalPopupMenuSeparatorUI
+ extends MetalSeparatorUI
+{
+
+ // FIXME: maybe replace by a Map of instances when this becomes stateful
+ /** The shared UI instance for MetalPopupMenuSeparatorUIs */
+ private static MetalPopupMenuSeparatorUI instance = null;
+
+ /**
+ * Constructs a new instance of MetalPopupMenuSeparatorUI.
+ */
+ public MetalPopupMenuSeparatorUI()
+ {
+ super();
+ }
+
+ /**
+ * Returns an instance of MetalPopupMenuSeparatorUI.
+ *
+ * @param component the component for which we return an UI instance
+ *
+ * @return an instance of MetalPopupMenuSeparatorUI
+ */
+ public static ComponentUI createUI(JComponent component)
+ {
+ if (instance == null)
+ instance = new MetalPopupMenuSeparatorUI();
+ return instance;
+ }
+}
diff --git a/libjava/javax/swing/plaf/metal/MetalProgressBarUI.java b/libjava/javax/swing/plaf/metal/MetalProgressBarUI.java
new file mode 100644
index 0000000..04ca52f
--- /dev/null
+++ b/libjava/javax/swing/plaf/metal/MetalProgressBarUI.java
@@ -0,0 +1,74 @@
+/* MetalProgressBarUI.java
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.metal;
+
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicProgressBarUI;
+
+public class MetalProgressBarUI
+ extends BasicProgressBarUI
+{
+
+ // FIXME: maybe replace by a Map of instances when this becomes stateful
+ /** The shared UI instance for MetalProgressBarUIs */
+ private static MetalProgressBarUI instance = null;
+
+ /**
+ * Constructs a new instance of MetalProgressBarUI.
+ */
+ public MetalProgressBarUI()
+ {
+ super();
+ }
+
+ /**
+ * Returns an instance of MetalProgressBarUI.
+ *
+ * @param component the component for which we return an UI instance
+ *
+ * @return an instance of MetalProgressBarUI
+ */
+ public static ComponentUI createUI(JComponent component)
+ {
+ if (instance == null)
+ instance = new MetalProgressBarUI();
+ return instance;
+ }
+}
diff --git a/libjava/javax/swing/plaf/metal/MetalRadioButtonUI.java b/libjava/javax/swing/plaf/metal/MetalRadioButtonUI.java
new file mode 100644
index 0000000..b4ff10b
--- /dev/null
+++ b/libjava/javax/swing/plaf/metal/MetalRadioButtonUI.java
@@ -0,0 +1,74 @@
+/* MetalRadioButtonUI.java
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.metal;
+
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicRadioButtonUI;
+
+public class MetalRadioButtonUI
+ extends BasicRadioButtonUI
+{
+
+ // FIXME: maybe replace by a Map of instances when this becomes stateful
+ /** The shared UI instance for JRadioButtons. */
+ private static MetalRadioButtonUI instance = null;
+
+ /**
+ * Constructs a new instance of MetalRadioButtonUI.
+ */
+ public MetalRadioButtonUI()
+ {
+ super();
+ }
+
+ /**
+ * Returns an instance of MetalRadioButtonUI.
+ *
+ * @param component the component for which we return an UI instance
+ *
+ * @return an instance of MetalRadioButtonUI
+ */
+ public static ComponentUI createUI(JComponent component)
+ {
+ if (instance == null)
+ instance = new MetalRadioButtonUI();
+ return instance;
+ }
+}
diff --git a/libjava/javax/swing/plaf/metal/MetalRootPaneUI.java b/libjava/javax/swing/plaf/metal/MetalRootPaneUI.java
new file mode 100644
index 0000000..5306b61
--- /dev/null
+++ b/libjava/javax/swing/plaf/metal/MetalRootPaneUI.java
@@ -0,0 +1,74 @@
+/* MetalRootPaneUI.java
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.metal;
+
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicRootPaneUI;
+
+public class MetalRootPaneUI
+ extends BasicRootPaneUI
+{
+
+ // FIXME: maybe replace by a Map of instances when this becomes stateful
+ /** The shared UI instance for MetalRootPaneUIs */
+ private static MetalRootPaneUI instance = null;
+
+ /**
+ * Constructs a new instance of MetalRootPaneUI.
+ */
+ public MetalRootPaneUI()
+ {
+ super();
+ }
+
+ /**
+ * Returns an instance of MetalRootPaneUI.
+ *
+ * @param component the component for which we return an UI instance
+ *
+ * @return an instance of MetalRootPaneUI
+ */
+ public static ComponentUI createUI(JComponent component)
+ {
+ if (instance == null)
+ instance = new MetalRootPaneUI();
+ return instance;
+ }
+}
diff --git a/libjava/javax/swing/plaf/metal/MetalScrollBarUI.java b/libjava/javax/swing/plaf/metal/MetalScrollBarUI.java
new file mode 100644
index 0000000..6baceb5
--- /dev/null
+++ b/libjava/javax/swing/plaf/metal/MetalScrollBarUI.java
@@ -0,0 +1,74 @@
+/* MetalScrollBarUI.java
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.metal;
+
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicScrollBarUI;
+
+public class MetalScrollBarUI
+ extends BasicScrollBarUI
+{
+
+ // FIXME: maybe replace by a Map of instances when this becomes stateful
+ /** The shared UI instance for JScrollBars. */
+ private static MetalScrollBarUI instance = null;
+
+ /**
+ * Constructs a new instance of MetalScrollBarUI.
+ */
+ public MetalScrollBarUI()
+ {
+ super();
+ }
+
+ /**
+ * Returns an instance of MetalScrollBarUI.
+ *
+ * @param component the component for which we return an UI instance
+ *
+ * @return an instance of MetalScrollBarUI
+ */
+ public static ComponentUI createUI(JComponent component)
+ {
+ if (instance == null)
+ instance = new MetalScrollBarUI();
+ return instance;
+ }
+}
diff --git a/libjava/javax/swing/plaf/metal/MetalScrollPaneUI.java b/libjava/javax/swing/plaf/metal/MetalScrollPaneUI.java
new file mode 100644
index 0000000..6220ea9
--- /dev/null
+++ b/libjava/javax/swing/plaf/metal/MetalScrollPaneUI.java
@@ -0,0 +1,74 @@
+/* MetalScrollPaneUI.java
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.metal;
+
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicScrollPaneUI;
+
+public class MetalScrollPaneUI
+ extends BasicScrollPaneUI
+{
+
+ // FIXME: maybe replace by a Map of instances when this becomes stateful
+ /** The shared UI instance for JScrollPanes. */
+ private static MetalScrollPaneUI instance = null;
+
+ /**
+ * Constructs a new instance of MetalScrollPaneUI.
+ */
+ public MetalScrollPaneUI()
+ {
+ super();
+ }
+
+ /**
+ * Returns an instance of MetalScrollPaneUI.
+ *
+ * @param component the component for which we return an UI instance
+ *
+ * @return an instance of MetalScrollPaneUI
+ */
+ public static ComponentUI createUI(JComponent component)
+ {
+ if (instance == null)
+ instance = new MetalScrollPaneUI();
+ return instance;
+ }
+}
diff --git a/libjava/javax/swing/plaf/metal/MetalSeparatorUI.java b/libjava/javax/swing/plaf/metal/MetalSeparatorUI.java
new file mode 100644
index 0000000..e6c36b4
--- /dev/null
+++ b/libjava/javax/swing/plaf/metal/MetalSeparatorUI.java
@@ -0,0 +1,74 @@
+/* MetalSeparatorUI.java
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.metal;
+
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicSeparatorUI;
+
+public class MetalSeparatorUI
+ extends BasicSeparatorUI
+{
+
+ // FIXME: maybe replace by a Map of instances when this becomes stateful
+ /** The shared UI instance for MetalSeparatorUIs */
+ private static MetalSeparatorUI instance = null;
+
+ /**
+ * Constructs a new instance of MetalSeparatorUI.
+ */
+ public MetalSeparatorUI()
+ {
+ super();
+ }
+
+ /**
+ * Returns an instance of MetalSeparatorUI.
+ *
+ * @param component the component for which we return an UI instance
+ *
+ * @return an instance of MetalSeparatorUI
+ */
+ public static ComponentUI createUI(JComponent component)
+ {
+ if (instance == null)
+ instance = new MetalSeparatorUI();
+ return instance;
+ }
+}
diff --git a/libjava/javax/swing/plaf/metal/MetalSliderUI.java b/libjava/javax/swing/plaf/metal/MetalSliderUI.java
new file mode 100644
index 0000000..f6ca41f
--- /dev/null
+++ b/libjava/javax/swing/plaf/metal/MetalSliderUI.java
@@ -0,0 +1,74 @@
+/* MetalSliderUI.java
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.metal;
+
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicSliderUI;
+
+public class MetalSliderUI
+ extends BasicSliderUI
+{
+
+ // FIXME: maybe replace by a Map of instances when this becomes stateful
+ /** The shared UI instance for MetalSliderUIs */
+ private static MetalSliderUI instance = null;
+
+ /**
+ * Constructs a new instance of MetalSliderUI.
+ */
+ public MetalSliderUI()
+ {
+ super(null);
+ }
+
+ /**
+ * Returns an instance of MetalSliderUI.
+ *
+ * @param component the component for which we return an UI instance
+ *
+ * @return an instance of MetalSliderUI
+ */
+ public static ComponentUI createUI(JComponent component)
+ {
+ if (instance == null)
+ instance = new MetalSliderUI();
+ return instance;
+ }
+}
diff --git a/libjava/javax/swing/plaf/metal/MetalSplitPaneUI.java b/libjava/javax/swing/plaf/metal/MetalSplitPaneUI.java
new file mode 100644
index 0000000..5c2e141
--- /dev/null
+++ b/libjava/javax/swing/plaf/metal/MetalSplitPaneUI.java
@@ -0,0 +1,74 @@
+/* MetalSplitPaneUI.java
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.metal;
+
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicSplitPaneUI;
+
+public class MetalSplitPaneUI
+ extends BasicSplitPaneUI
+{
+
+ // FIXME: maybe replace by a Map of instances when this becomes stateful
+ /** The shared UI instance for MetalSplitPaneUIs */
+ private static MetalSplitPaneUI instance = null;
+
+ /**
+ * Constructs a new instance of MetalSplitPaneUI.
+ */
+ public MetalSplitPaneUI()
+ {
+ super();
+ }
+
+ /**
+ * Returns an instance of MetalSplitPaneUI.
+ *
+ * @param component the component for which we return an UI instance
+ *
+ * @return an instance of MetalSplitPaneUI
+ */
+ public static ComponentUI createUI(JComponent component)
+ {
+ if (instance == null)
+ instance = new MetalSplitPaneUI();
+ return instance;
+ }
+}
diff --git a/libjava/javax/swing/plaf/metal/MetalTabbedPaneUI.java b/libjava/javax/swing/plaf/metal/MetalTabbedPaneUI.java
new file mode 100644
index 0000000..524fc52
--- /dev/null
+++ b/libjava/javax/swing/plaf/metal/MetalTabbedPaneUI.java
@@ -0,0 +1,86 @@
+/* MetalTabbedPaneUI.java
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.metal;
+
+import java.util.HashMap;
+
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicTabbedPaneUI;
+
+public class MetalTabbedPaneUI
+ extends BasicTabbedPaneUI
+{
+
+ /** The shared UI instance for JTabbedPanes. */
+ private static HashMap instances = null;
+
+ /**
+ * Constructs a new instance of MetalTabbedPaneUI.
+ */
+ public MetalTabbedPaneUI()
+ {
+ super();
+ }
+
+ /**
+ * Returns an instance of MetalTabbedPaneUI.
+ *
+ * @param component the component for which we return an UI instance
+ *
+ * @return an instance of MetalTabbedPaneUI
+ */
+ public static ComponentUI createUI(JComponent component)
+ {
+ if (instances == null)
+ instances = new HashMap();
+
+ Object o = instances.get(component);
+ MetalTabbedPaneUI instance;
+ if (o == null)
+ {
+ instance = new MetalTabbedPaneUI();
+ instances.put(component, instance);
+ }
+ else
+ instance = (MetalTabbedPaneUI) o;
+
+ return instance;
+ }
+}
diff --git a/libjava/javax/swing/plaf/metal/MetalTextFieldUI.java b/libjava/javax/swing/plaf/metal/MetalTextFieldUI.java
new file mode 100644
index 0000000..79ae2b0
--- /dev/null
+++ b/libjava/javax/swing/plaf/metal/MetalTextFieldUI.java
@@ -0,0 +1,74 @@
+/* MetalTextFieldUI.java
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.metal;
+
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicTextFieldUI;
+
+public class MetalTextFieldUI
+ extends BasicTextFieldUI
+{
+
+ // FIXME: maybe replace by a Map of instances when this becomes stateful
+ /** The shared UI instance for MetalTextFieldUIs */
+ private static MetalTextFieldUI instance = null;
+
+ /**
+ * Constructs a new instance of MetalTextFieldUI.
+ */
+ public MetalTextFieldUI()
+ {
+ super();
+ }
+
+ /**
+ * Returns an instance of MetalTextFieldUI.
+ *
+ * @param component the component for which we return an UI instance
+ *
+ * @return an instance of MetalTextFieldUI
+ */
+ public static ComponentUI createUI(JComponent component)
+ {
+ if (instance == null)
+ instance = new MetalTextFieldUI();
+ return instance;
+ }
+}
diff --git a/libjava/javax/swing/plaf/metal/MetalToggleButtonUI.java b/libjava/javax/swing/plaf/metal/MetalToggleButtonUI.java
new file mode 100644
index 0000000..84af36a
--- /dev/null
+++ b/libjava/javax/swing/plaf/metal/MetalToggleButtonUI.java
@@ -0,0 +1,74 @@
+/* MetalToggleButtonUI.java
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.metal;
+
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicToggleButtonUI;
+
+public class MetalToggleButtonUI
+ extends BasicToggleButtonUI
+{
+
+ // FIXME: maybe replace by a Map of instances when this becomes stateful
+ /** The shared UI instance for MetalToggleButtonUIs */
+ private static MetalToggleButtonUI instance = null;
+
+ /**
+ * Constructs a new instance of MetalToggleButtonUI.
+ */
+ public MetalToggleButtonUI()
+ {
+ super();
+ }
+
+ /**
+ * Returns an instance of MetalToggleButtonUI.
+ *
+ * @param component the component for which we return an UI instance
+ *
+ * @return an instance of MetalToggleButtonUI
+ */
+ public static ComponentUI createUI(JComponent component)
+ {
+ if (instance == null)
+ instance = new MetalToggleButtonUI();
+ return instance;
+ }
+}
diff --git a/libjava/javax/swing/plaf/metal/MetalToolBarUI.java b/libjava/javax/swing/plaf/metal/MetalToolBarUI.java
new file mode 100644
index 0000000..299a4c0
--- /dev/null
+++ b/libjava/javax/swing/plaf/metal/MetalToolBarUI.java
@@ -0,0 +1,74 @@
+/* MetalToolBarUI.java
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.metal;
+
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicToolBarUI;
+
+public class MetalToolBarUI
+ extends BasicToolBarUI
+{
+
+ // FIXME: maybe replace by a Map of instances when this becomes stateful
+ /** The shared UI instance for MetalToolBarUIs */
+ private static MetalToolBarUI instance = null;
+
+ /**
+ * Constructs a new instance of MetalToolBarUI.
+ */
+ public MetalToolBarUI()
+ {
+ super();
+ }
+
+ /**
+ * Returns an instance of MetalToolBarUI.
+ *
+ * @param component the component for which we return an UI instance
+ *
+ * @return an instance of MetalToolBarUI
+ */
+ public static ComponentUI createUI(JComponent component)
+ {
+ if (instance == null)
+ instance = new MetalToolBarUI();
+ return instance;
+ }
+}
diff --git a/libjava/javax/swing/plaf/metal/MetalToolTipUI.java b/libjava/javax/swing/plaf/metal/MetalToolTipUI.java
new file mode 100644
index 0000000..303b629
--- /dev/null
+++ b/libjava/javax/swing/plaf/metal/MetalToolTipUI.java
@@ -0,0 +1,74 @@
+/* MetalToolTipUI.java
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.metal;
+
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicToolTipUI;
+
+public class MetalToolTipUI
+ extends BasicToolTipUI
+{
+
+ // FIXME: maybe replace by a Map of instances when this becomes stateful
+ /** The shared UI instance for MetalToolTipUIs */
+ private static MetalToolTipUI instance = null;
+
+ /**
+ * Constructs a new instance of MetalToolTipUI.
+ */
+ public MetalToolTipUI()
+ {
+ super();
+ }
+
+ /**
+ * Returns an instance of MetalToolTipUI.
+ *
+ * @param component the component for which we return an UI instance
+ *
+ * @return an instance of MetalToolTipUI
+ */
+ public static ComponentUI createUI(JComponent component)
+ {
+ if (instance == null)
+ instance = new MetalToolTipUI();
+ return instance;
+ }
+}
diff --git a/libjava/javax/swing/plaf/metal/MetalTreeUI.java b/libjava/javax/swing/plaf/metal/MetalTreeUI.java
new file mode 100644
index 0000000..a420204
--- /dev/null
+++ b/libjava/javax/swing/plaf/metal/MetalTreeUI.java
@@ -0,0 +1,74 @@
+/* MetalTreeUI.java
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package javax.swing.plaf.metal;
+
+import javax.swing.JComponent;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.basic.BasicTreeUI;
+
+public class MetalTreeUI
+ extends BasicTreeUI
+{
+
+ // FIXME: maybe replace by a Map of instances when this becomes stateful
+ /** The shared UI instance for MetalTreeUIs */
+ private static MetalTreeUI instance = null;
+
+ /**
+ * Constructs a new instance of MetalTreeUI.
+ */
+ public MetalTreeUI()
+ {
+ super();
+ }
+
+ /**
+ * Returns an instance of MetalTreeUI.
+ *
+ * @param component the component for which we return an UI instance
+ *
+ * @return an instance of MetalTreeUI
+ */
+ public static ComponentUI createUI(JComponent component)
+ {
+ if (instance == null)
+ instance = new MetalTreeUI();
+ return instance;
+ }
+}