Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: novaworx/gui/SoftBlueTheme.java


1   /*
2   Novaworx Development Environment
3   Copyright (C) 2000-2003 Mark Soderquist
4   
5   This program is free software; you can redistribute it and/or modify
6   it under the terms of the GNU General Public License as published by
7   the Free Software Foundation; either version 2 of the License, or
8   (at your option) any later version.
9   
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  GNU General Public License for more details.
14  
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to:
17  
18  Free Software Foundation, Inc.
19  59 Temple Place, Suite 330
20  Boston, MA 02111-1307 USA
21  */
22  
23  package novaworx.gui;
24  
25  import java.awt.Color;
26  import java.awt.Font;
27  import javax.swing.plaf.ColorUIResource;
28  import javax.swing.plaf.FontUIResource;
29  import javax.swing.plaf.metal.DefaultMetalTheme;
30  
31  /**
32  <p>Color scheme for the Swing Look & Feel.</p>
33  
34  <p>The colors are as follows:
35    <table border="1">
36      <tr><td>Primary 1</td><td style="background: #4060A0;">&nbsp;&nbsp;&nbsp;&nbsp;</td></tr>
37      <tr><td>Primary 2</td><td style="background: #6080C0;">&nbsp;&nbsp;&nbsp;&nbsp;</td></tr>
38      <tr><td>Primary 3</td><td style="background: #80A0E0;">&nbsp;&nbsp;&nbsp;&nbsp;</td></tr>
39      <tr><td>Primary 4</td><td style="background: #D8E0FF;">&nbsp;&nbsp;&nbsp;&nbsp;</td></tr>
40      <tr><td>Secondary 1</td><td style="background: #A0A0A0;">&nbsp;&nbsp;&nbsp;&nbsp;</td></tr>
41      <tr><td>Secondary 2</td><td style="background: #C0C0C0;">&nbsp;&nbsp;&nbsp;&nbsp;</td></tr>
42      <tr><td>Secondary 3</td><td style="background: #E0E0E0;">&nbsp;&nbsp;&nbsp;&nbsp;</td></tr>
43    </table>
44  </p>
45  */
46  public class SoftBlueTheme extends DefaultMetalTheme {
47  
48    private final ColorUIResource moPrimaryColor1 = new ColorUIResource( Color.decode( "#4060A0" ) );
49  
50    private final ColorUIResource moPrimaryColor2 = new ColorUIResource( Color.decode( "#6080C0" ) );
51  
52    private final ColorUIResource moPrimaryColor3 = new ColorUIResource( Color.decode( "#80A0E0" ) );
53  
54    private final ColorUIResource moPrimaryColor4 = new ColorUIResource( Color.decode( "#D8E0FF" ) );
55  
56    private final ColorUIResource moSecondaryColor1 = new ColorUIResource( Color.decode( "#A0A0A0" ) );
57  
58    private final ColorUIResource moSecondaryColor2 = new ColorUIResource( Color.decode( "#C0C0C0" ) );
59  
60    private final ColorUIResource moSecondaryColor3 = new ColorUIResource( Color.decode( "#E0E0E0" ) );
61  
62    private FontUIResource moControlFont = new FontUIResource( "Dialog", Font.PLAIN, 12 );
63  
64    public SoftBlueTheme() {}
65  
66    public String getName() { return "Deep Blue"; }
67  
68    protected ColorUIResource getPrimary1() { return moPrimaryColor1; }
69  
70    protected ColorUIResource getPrimary2() { return moPrimaryColor2; }
71  
72    protected ColorUIResource getPrimary3() { return moPrimaryColor3; }
73  
74    protected ColorUIResource getPrimary4() { return moPrimaryColor4; }
75  
76    protected ColorUIResource getSecondary1() { return moSecondaryColor1; }
77  
78    protected ColorUIResource getSecondary2() { return moSecondaryColor2; }
79  
80    protected ColorUIResource getSecondary3() { return moSecondaryColor3; }
81  
82    public ColorUIResource getAcceleratorSelectedForeground() { return getPrimary4(); }
83  
84    public ColorUIResource getMenuSelectedForeground() { return getWhite(); }
85  
86    public ColorUIResource getWindowTitleBackground() { return getPrimary2(); }
87  
88    public ColorUIResource getWindowTitleForeground() { return getWhite(); }
89  
90    public FontUIResource getControlTextFont() { return moControlFont; }
91  
92    public FontUIResource getMenuTextFont() { return moControlFont; }
93  
94    public FontUIResource getWindowTitleFont() { return moControlFont; }
95  }