Dead
[official-gcc.git] / gomp-20050608-branch / libjava / classpath / javax / swing / plaf / metal / DefaultMetalTheme.java
blob673aec1e418a84ebec97cdc15d915d6e8c9ab791
1 /* DefaultMetalTheme.java --
2 Copyright (C) 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
19 02110-1301 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 java.awt.Font;
43 import javax.swing.plaf.ColorUIResource;
44 import javax.swing.plaf.FontUIResource;
46 /**
47 * The default theme for the {@link MetalLookAndFeel}.
49 * @see MetalLookAndFeel#setCurrentTheme(MetalTheme)
51 public class DefaultMetalTheme extends MetalTheme
53 private static final ColorUIResource PRIMARY1 =
54 new ColorUIResource(102, 102, 153);
55 private static final ColorUIResource PRIMARY2 =
56 new ColorUIResource(153, 153, 204);
57 private static final ColorUIResource PRIMARY3 =
58 new ColorUIResource(204, 204, 255);
59 private static final ColorUIResource SECONDARY1 =
60 new ColorUIResource(102, 102, 102);
61 private static final ColorUIResource SECONDARY2 =
62 new ColorUIResource(153, 153, 153);
63 private static final ColorUIResource SECONDARY3 =
64 new ColorUIResource(204, 204, 204);
66 private static final FontUIResource CONTROL_TEXT_FONT =
67 new FontUIResource("Dialog", Font.BOLD, 12);
68 private static final FontUIResource MENU_TEXT_FONT =
69 new FontUIResource("Dialog", Font.BOLD, 12);
70 private static final FontUIResource SUB_TEXT_FONT =
71 new FontUIResource("Dialog", Font.PLAIN, 10);
72 private static final FontUIResource SYSTEM_TEXT_FONT =
73 new FontUIResource("Dialog", Font.PLAIN, 12);
74 private static final FontUIResource USER_TEXT_FONT =
75 new FontUIResource("Dialog", Font.PLAIN, 12);
76 private static final FontUIResource WINDOW_TITLE_FONT =
77 new FontUIResource("Dialog", Font.BOLD, 12);
79 /**
80 * Creates a new instance of this theme.
82 public DefaultMetalTheme()
84 // Do nothing here.
87 /**
88 * Returns the name of the theme.
90 * @return <code>"Steel"</code>.
92 public String getName()
94 return "Steel";
97 /**
98 * Returns the first primary color for this theme.
100 * @return The first primary color.
102 protected ColorUIResource getPrimary1()
104 return PRIMARY1;
108 * Returns the second primary color for this theme.
110 * @return The second primary color.
112 protected ColorUIResource getPrimary2()
114 return PRIMARY2;
118 * Returns the third primary color for this theme.
120 * @return The third primary color.
122 protected ColorUIResource getPrimary3()
124 return PRIMARY3;
128 * Returns the first secondary color for this theme.
130 * @return The first secondary color.
132 protected ColorUIResource getSecondary1()
134 return SECONDARY1;
138 * Returns the second secondary color for this theme.
140 * @return The second secondary color.
142 protected ColorUIResource getSecondary2()
144 return SECONDARY2;
148 * Returns the third secondary color for this theme.
150 * @return The third secondary color.
152 protected ColorUIResource getSecondary3()
154 return SECONDARY3;
158 * Returns the font used for text on controls. In this case, the font is
159 * <code>FontUIResource("Dialog", Font.BOLD, 12)</code>.
161 * @return The font.
163 public FontUIResource getControlTextFont()
165 return CONTROL_TEXT_FONT;
168 * Returns the font used for text in menus. In this case, the font is
169 * <code>FontUIResource("Dialog", Font.BOLD, 12)</code>.
171 * @return The font used for text in menus.
173 public FontUIResource getMenuTextFont()
175 return MENU_TEXT_FONT;
179 * Returns the font used for sub text. In this case, the font is
180 * <code>FontUIResource("Dialog", Font.PLAIN, 10)</code>.
182 * @return The font used for sub text.
184 public FontUIResource getSubTextFont()
186 return SUB_TEXT_FONT;
190 * Returns the font used for system text. In this case, the font is
191 * <code>FontUIResource("Dialog", Font.PLAIN, 12)</code>.
193 * @return The font used for system text.
195 public FontUIResource getSystemTextFont()
197 return SYSTEM_TEXT_FONT;
201 * Returns the font used for user text. In this case, the font is
202 * <code>FontUIResource("Dialog", Font.PLAIN, 12)</code>.
204 * @return The font used for user text.
206 public FontUIResource getUserTextFont()
208 return USER_TEXT_FONT;
212 * Returns the font used for window titles. In this case, the font is
213 * <code>FontUIResource("Dialog", Font.BOLD, 12)</code>.
215 * @return The font used for window titles.
217 public FontUIResource getWindowTitleFont()
219 return WINDOW_TITLE_FONT;