Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / libjava / javax / swing / plaf / metal / MetalLookAndFeel.java
blobb33205004b0d95ce6cb58a024bfd08d19ec246ff
1 /* MetalLookAndFeel.java
2 Copyright (C) 2002 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307 USA.
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
24 combination.
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
39 package javax.swing.plaf.metal;
41 import javax.swing.UIDefaults;
42 import javax.swing.plaf.ColorUIResource;
43 import javax.swing.plaf.FontUIResource;
44 import javax.swing.plaf.basic.BasicLookAndFeel;
46 public class MetalLookAndFeel extends BasicLookAndFeel
48 private static final long serialVersionUID = 6680646159193457980L;
49 private static MetalTheme theme;
50 private UIDefaults LAF_defaults;
52 public MetalLookAndFeel()
54 createDefaultTheme();
57 protected void createDefaultTheme()
59 setCurrentTheme(new DefaultMetalTheme());
62 public boolean isNativeLookAndFeel()
64 return true;
67 public boolean isSupportedLookAndFeel()
69 return true;
72 public String getDescription()
74 return "Metal look and feel";
77 public String getID()
79 return "MetalLookAndFeel";
82 public String getName()
84 return "MetalLookAndFeel";
87 public UIDefaults getDefaults()
89 if (LAF_defaults == null)
90 LAF_defaults = super.getDefaults();
92 // Returns the default values for this look and feel.
93 return LAF_defaults;
96 public static ColorUIResource getAcceleratorForeground()
98 return theme.getAcceleratorForeground();
101 public static ColorUIResource getAcceleratorSelectedForeground()
103 return theme.getAcceleratorSelectedForeground();
106 public static ColorUIResource getBlack()
108 return theme.getBlack();
111 public static ColorUIResource getControl()
113 return theme.getControl();
116 public static ColorUIResource getControlDarkShadow()
118 return theme.getControlDarkShadow();
121 public static ColorUIResource getControlDisabled()
123 return theme.getControlDisabled();
126 public static ColorUIResource getControlHighlight()
128 return theme.getControlHighlight();
131 public static ColorUIResource getControlInfo()
133 return theme.getControlInfo();
136 public static ColorUIResource getControlShadow()
138 return theme.getControlShadow();
141 public static ColorUIResource getControlTextColor()
143 return theme.getControlTextColor();
146 public static FontUIResource getControlTextFont()
148 return theme.getControlTextFont();
151 public static ColorUIResource getDesktopColor()
153 return theme.getDesktopColor();
156 public static ColorUIResource getFocusColor()
158 return theme.getFocusColor();
161 public static ColorUIResource getHighlightedTextColor()
163 return theme.getHighlightedTextColor();
166 public static ColorUIResource getInactiveControlTextColor()
168 return theme.getInactiveControlTextColor();
171 public static ColorUIResource getInactiveSystemTextColor()
173 return theme.getInactiveSystemTextColor();
176 public static ColorUIResource getMenuBackground()
178 return theme.getMenuBackground();
181 public static ColorUIResource getMenuDisabledForeground()
183 return theme.getMenuDisabledForeground();
186 public static ColorUIResource getMenuForeground()
188 return theme.getMenuForeground();
191 public static ColorUIResource getMenuSelectedBackground()
193 return theme.getMenuSelectedBackground();
196 public static ColorUIResource getMenuSelectedForeground()
198 return theme.getMenuSelectedForeground();
201 public static FontUIResource getMenuTextFont()
203 return theme.getMenuTextFont();
206 public static ColorUIResource getPrimaryControl()
208 return theme.getPrimaryControl();
211 public static ColorUIResource getPrimaryControlDarkShadow()
213 return theme.getPrimaryControlDarkShadow();
216 public static ColorUIResource getPrimaryControlHighlight()
218 return theme.getPrimaryControlHighlight();
221 public static ColorUIResource getPrimaryControlInfo()
223 return theme.getPrimaryControlInfo();
226 public static ColorUIResource getPrimaryControlShadow()
228 return theme.getPrimaryControlShadow();
231 public static ColorUIResource getSeparatorBackground()
233 return theme.getSeparatorBackground();
236 public static ColorUIResource getSeparatorForeground()
238 return theme.getSeparatorForeground();
241 public static FontUIResource getSubTextFont()
243 return theme.getSubTextFont();
246 public static ColorUIResource getSystemTextColor()
248 return theme.getSystemTextColor();
251 public static FontUIResource getSystemTextFont()
253 return theme.getSystemTextFont();
256 public static ColorUIResource getTextHighlightColor()
258 return theme.getTextHighlightColor();
261 public static ColorUIResource getUserTextColor()
263 return theme.getUserTextColor();
266 public static FontUIResource getUserTextFont()
268 return theme.getUserTextFont();
271 public static ColorUIResource getWhite()
273 return theme.getWhite();
276 public static ColorUIResource getWindowBackground()
278 return theme.getWindowBackground();
281 public static ColorUIResource getWindowTitleBackground()
283 return theme.getWindowTitleBackground();
286 public static FontUIResource getWindowTitleFont()
288 return theme.getWindowTitleFont();
291 public static ColorUIResource getWindowTitleForeground()
293 return theme.getWindowTitleForeground();
296 public static ColorUIResource getWindowTitleInactiveBackground()
298 return theme.getWindowTitleInactiveBackground();
301 public static ColorUIResource getWindowTitleInactiveForeground()
303 return theme.getWindowTitleInactiveForeground();
306 public static void setCurrentTheme(MetalTheme theme)
308 MetalLookAndFeel.theme = theme;