Commit 2330df3b by Michael Koch

[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
parent d393cb72
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.
2005-04-19 Mark Wielaard <mark@klomp.org> 2005-04-19 Mark Wielaard <mark@klomp.org>
* java/lang/natRuntime.cc (insertSystemProperties): Set * java/lang/natRuntime.cc (insertSystemProperties): Set
......
...@@ -1670,6 +1670,28 @@ javax/swing/plaf/basic/BasicLookAndFeel.java \ ...@@ -1670,6 +1670,28 @@ javax/swing/plaf/basic/BasicLookAndFeel.java \
javax/swing/plaf/basic/BasicBorders.java \ javax/swing/plaf/basic/BasicBorders.java \
javax/swing/plaf/basic/BasicIconFactory.java \ javax/swing/plaf/basic/BasicIconFactory.java \
javax/swing/plaf/basic/ComboPopup.java \ javax/swing/plaf/basic/ComboPopup.java \
javax/swing/plaf/metal/MetalBorders.java \
javax/swing/plaf/metal/MetalButtonUI.java \
javax/swing/plaf/metal/MetalCheckBoxUI.java \
javax/swing/plaf/metal/MetalComboBoxUI.java \
javax/swing/plaf/metal/MetalDesktopIconUI.java \
javax/swing/plaf/metal/MetalInternalFrameUI.java \
javax/swing/plaf/metal/MetalLabelUI.java \
javax/swing/plaf/metal/MetalPopupMenuSeparatorUI.java \
javax/swing/plaf/metal/MetalProgressBarUI.java \
javax/swing/plaf/metal/MetalRadioButtonUI.java \
javax/swing/plaf/metal/MetalRootPaneUI.java \
javax/swing/plaf/metal/MetalScrollBarUI.java \
javax/swing/plaf/metal/MetalScrollPaneUI.java \
javax/swing/plaf/metal/MetalSeparatorUI.java \
javax/swing/plaf/metal/MetalSliderUI.java \
javax/swing/plaf/metal/MetalSplitPaneUI.java \
javax/swing/plaf/metal/MetalTabbedPaneUI.java \
javax/swing/plaf/metal/MetalTextFieldUI.java \
javax/swing/plaf/metal/MetalToggleButtonUI.java \
javax/swing/plaf/metal/MetalToolBarUI.java \
javax/swing/plaf/metal/MetalToolTipUI.java \
javax/swing/plaf/metal/MetalTreeUI.java \
javax/swing/plaf/BorderUIResource.java \ javax/swing/plaf/BorderUIResource.java \
javax/swing/plaf/UIResource.java \ javax/swing/plaf/UIResource.java \
javax/swing/plaf/ButtonUI.java \ javax/swing/plaf/ButtonUI.java \
......
/* 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;
}
}
/* 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"));
}
}
/* 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;
}
}
/* 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;
}
}
/* 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;
}
}
/* 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;
}
}
/* 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;
}
}
...@@ -38,6 +38,9 @@ exception statement from your version. */ ...@@ -38,6 +38,9 @@ exception statement from your version. */
package javax.swing.plaf.metal; package javax.swing.plaf.metal;
import java.awt.Color;
import java.awt.Insets;
import javax.swing.UIDefaults; import javax.swing.UIDefaults;
import javax.swing.plaf.ColorUIResource; import javax.swing.plaf.ColorUIResource;
import javax.swing.plaf.FontUIResource; import javax.swing.plaf.FontUIResource;
...@@ -307,4 +310,196 @@ public class MetalLookAndFeel extends BasicLookAndFeel ...@@ -307,4 +310,196 @@ public class MetalLookAndFeel extends BasicLookAndFeel
{ {
MetalLookAndFeel.theme = theme; 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);
}
} }
/* 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;
}
}
/* 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;
}
}
/* 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;
}
}
/* 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;
}
}
/* 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;
}
}
/* 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;
}
}
/* 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;
}
}
/* 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;
}
}
/* 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;
}
}
/* 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;
}
}
/* 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;
}
}
/* 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;
}
}
/* 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;
}
}
/* 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;
}
}
/* 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;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment