KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > snow > lookandfeel > CustomOceanTheme_Forest


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_Forest extends CustomOceanTheme
16 {
17
18   public CustomOceanTheme_Forest(AppProperties props)
19   {
20     super("Forest Theme", props, null); //new SnowIcon(200,200));
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

37     // textfield background
38
this.setDefaultColor(this.COLOR_White, new ColorUIResource( 15, 120, 15)); // dark green
39
this.setDefaultColor(this.COLOR_BLACK, new ColorUIResource( 10, 0, 10 ));
40
41
42     // Title back2, ext frame borders
43
this.setDefaultColor(this.COLOR_Primary1, new ColorUIResource( 84, 103, 83 ));
44     // Combobox selections, table, tree selections
45
this.setDefaultColor(this.COLOR_Primary2, new ColorUIResource( 50, 67, 58 ));
46     // title back, border of buttons when mouse over, tree selections
47
this.setDefaultColor(this.COLOR_Primary3, new ColorUIResource( 3, 165, 33 ));
48
49     // all components border
50
this.setDefaultColor(this.COLOR_Secondary1, new ColorUIResource( 15, 63, 15 ));
51     // clicked background, focus checkbox, second button gradient
52
this.setDefaultColor(this.COLOR_Secondary2, new ColorUIResource( 48, 63, 48 ));
53     // panel background
54
this.setDefaultColor(this.COLOR_Secondary3, new ColorUIResource( 40, 130, 55 ));
55
56     this.setDefaultColor(this.COLOR_DesktopColor, new ColorUIResource(5, 55, 5)); // dark green
57

58     this.setDefaultColor(this.COLOR_ControlText, new ColorUIResource(0, 0, 0)); // black
59

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

80
81
82   public static void main(String JavaDoc[] aaa)
83   {
84      ThemesManager.main(aaa);
85   }
86
87
88
89 } // CustomOceanTheme_Forest
Popular Tags