KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > snow > lookandfeel > CustomOceanTheme_Snow


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_Snow extends CustomOceanTheme
16 {
17
18   public CustomOceanTheme_Snow(AppProperties props)
19   {
20     super("Snow Theme", props, new ImageIcon(new SnowIcon(120,120).getIconAsImage()));
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, 10));
29     this.setDefaultFont(this.FONT_System, new FontUIResource("Dialog", Font.PLAIN, 10));
30     this.setDefaultFont(this.FONT_WindowTitle, new FontUIResource("Dialog", Font.BOLD, 11));
31     this.setDefaultFont(this.FONT_UserText, new FontUIResource("SansSerif", Font.PLAIN, 10));
32     this.setDefaultFont(this.FONT_SubText, new FontUIResource("Dialog", Font.PLAIN, 9));
33
34     // Colors
35
//
36
this.setDefaultColor(this.COLOR_White, new ColorUIResource(255, 255, 255 )); // White is white
37
this.setDefaultColor(this.COLOR_BLACK, new ColorUIResource( 0, 0, 0 ));
38
39
40     /*
41     // Title back, ext frame borders
42     this.setDefaultColor(this.COLOR_Primary1, new ColorUIResource( 98, 88, 112 ));
43     // Combobox selections, table, tree selections
44     this.setDefaultColor(this.COLOR_Primary2, new ColorUIResource( 84, 78, 96 ));
45     // border of buttons when mouse over, tree selections
46     this.setDefaultColor(this.COLOR_Primary3, new ColorUIResource( 70, 65, 81 ));
47
48     // all components border
49     this.setDefaultColor(this.COLOR_Secondary1, new ColorUIResource( 53, 58, 73 ));
50     // clicked background, focus checkbox, second button gradient
51     this.setDefaultColor(this.COLOR_Secondary2, new ColorUIResource( 80, 84, 80 ));
52     // panel background
53     this.setDefaultColor(this.COLOR_Secondary3, new ColorUIResource(116, 122, 116 ));
54     */

55
56    // addCustomEntriesToTable(UIManager.getDefaults());
57
}
58
59   /*
60   public void addCustomEntriesToTable(UIDefaults table)
61   {
62
63     super.addCustomEntriesToTable(table);
64
65     java.util.List buttonGradient = Arrays.asList(
66                  new Object[] { new Float(.3f), new Float(0f),
67                    new ColorUIResource(0xDDE8F3),
68                    this.getSecondary3(),
69                    getSecondary2() }); // default: white & secondary2 !!!
70
71     UIManager.put("Button.gradient", buttonGradient);
72     UIManager.put("CheckBox.gradient", buttonGradient);
73     //UIManager.put("CheckBox.foreground", new ColorUIResource(Color.red));
74     //UIManager.put("Tree.rightChildIndent", 15);
75
76   } */

77
78   public static void main(String JavaDoc[] aaa)
79   {
80      ThemesManager.main(aaa);
81   }
82
83
84
85
86 } // CustomOceanTheme_Snow
Popular Tags