KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > snow > lookandfeel > CustomOceanTheme_SnowEFCNSmall


1 package snow.lookandfeel;
2
3 import snow.utils.storage.AppProperties;
4 import snow.utils.gui.*;
5
6 import java.io.*;
7 import javax.swing.*;
8 import javax.swing.event.*;
9 import javax.swing.plaf.metal.*;
10 import javax.swing.plaf.*;
11 import java.awt.*;
12 import java.awt.event.*;
13 import java.util.*;
14
15 public final class CustomOceanTheme_SnowEFCNSmall extends CustomOceanTheme
16 {
17
18   public CustomOceanTheme_SnowEFCNSmall(AppProperties props)
19   {
20     super("EFCNBlack Theme", props, null);
21     writeDefaults();
22   }
23
24   /** writes the defaults in the inifile
25   */

26   public void writeDefaults()
27   {
28     this.setDefaultFont(this.FONT_ControlText, new FontUIResource("Dialog", Font.PLAIN, 11));
29     this.setDefaultFont(this.FONT_System, new FontUIResource("Dialog", Font.PLAIN, 11));
30     this.setDefaultFont(this.FONT_WindowTitle, new FontUIResource("Dialog", Font.BOLD, 12));
31     this.setDefaultFont(this.FONT_UserText, new FontUIResource("SansSerif", Font.PLAIN, 11));
32     this.setDefaultFont(this.FONT_SubText, new FontUIResource("Dialog", Font.PLAIN, 10));
33
34     // Colors
35
//
36
// menufont
37
this.setDefaultColor(this.COLOR_BLACK, new ColorUIResource(220, 220, 220 )); // black is white
38
this.setDefaultColor(this.COLOR_White, new ColorUIResource( 20, 20, 20 )); // and white is black, no ?
39

40     // Title back, ext frame borders
41
this.setDefaultColor(this.COLOR_Primary1, new ColorUIResource( 98, 88, 112 ));
42     // Combobox selections, table, tree selections
43
this.setDefaultColor(this.COLOR_Primary2, new ColorUIResource( 84, 78, 96 ));
44     // border of buttons when mouse over, table, tree selections, text highlight
45
this.setDefaultColor(this.COLOR_Primary3, new ColorUIResource( 80, 75, 91 )); // too dark
46

47     // all components border
48
this.setDefaultColor(this.COLOR_Secondary1, new ColorUIResource( 53, 58, 73 ));
49     // clicked background, focus checkbox, second button gradient
50
this.setDefaultColor(this.COLOR_Secondary2, new ColorUIResource( 80, 84, 80 ));
51     // panel background
52
this.setDefaultColor(this.COLOR_Secondary3, new ColorUIResource( 40, 40, 40));
53        // too light new ColorUIResource(116, 122, 116 ));
54

55     this.setDefaultColor(this.COLOR_Green, new ColorUIResource(30, 120, 30));
56     this.setDefaultColor(this.COLOR_Red, new ColorUIResource(120, 30, 30));
57
58     this.setDefaultColor(this.COLOR_DesktopColor, new ColorUIResource(55, 55, 55)); // drak gray
59

60     // table text
61
this.setDefaultColor(this.COLOR_ControlText, new ColorUIResource(220, 220, 220));
62
63
64     //addCustomEntriesToTable(UIManager.getDefaults());
65
}
66
67
68   public void addCustomEntriesToTable(UIDefaults table)
69   {
70
71     super.addCustomEntriesToTable(table);
72
73     //if(true) return;
74

75     /*Original
76     java.util.List buttonGradient = Arrays.asList(
77                  new Object[] {new Float(.3f), new Float(0f),
78                  new ColorUIResource(0xDDE8F3), getWhite(), getSecondary2() }); */

79
80     java.util.List JavaDoc buttonGradient = Arrays.asList(
81                  new Object JavaDoc[] {new Float JavaDoc(0.3f), new Float JavaDoc(0.45f),
82                  getBlack(), getWhite(), getBlack() });
83
84
85     UIManager.put("Button.gradient", buttonGradient);
86     UIManager.put("CheckBox.gradient", buttonGradient);
87     UIManager.put("InternalFrame.activeTitleGradient", buttonGradient);
88
89 /*DEF java.util.List menubGradient = Arrays.asList(new Object[] {
90                      new Float(1f), new Float(0f),
91                      getWhite(), dadada,
92                      new ColorUIResource(dadada) });*/

93
94     Color dadada = new ColorUIResource(0xDADADA);
95     java.util.List JavaDoc menubGradient = Arrays.asList(new Object JavaDoc[] {
96                      new Float JavaDoc(2f), new Float JavaDoc(0f),
97                      getWhite(), dadada,
98                      new ColorUIResource(dadada) });
99
100     UIManager.put("MenuBar.gradient", menubGradient);
101   }
102
103   public static void main(String JavaDoc[] aaa)
104   {
105      ThemesManager.main(aaa);
106   }
107
108
109 } // CustomOceanTheme_SnowEFCNSmall
Popular Tags