01: /**
02: * L2FProd.com Common Components 7.3 License.
03: *
04: * Copyright 2005-2007 L2FProd.com
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */package com.l2fprod.common.swing.plaf;
18:
19: import com.l2fprod.common.swing.JTipOfTheDay;
20: import com.l2fprod.common.swing.plaf.basic.BasicTipOfTheDayUI;
21: import com.l2fprod.common.swing.plaf.windows.WindowsTipOfTheDayUI;
22:
23: import java.awt.Color;
24: import java.awt.Font;
25: import java.util.List;
26:
27: import javax.swing.BorderFactory;
28: import javax.swing.LookAndFeel;
29: import javax.swing.UIManager;
30: import javax.swing.plaf.BorderUIResource;
31: import javax.swing.plaf.ColorUIResource;
32:
33: /**
34: * Addon for <code>JTipOfTheDay</code>.<br>
35: */
36: public class JTipOfTheDayAddon extends AbstractComponentAddon {
37:
38: public JTipOfTheDayAddon() {
39: super ("JTipOfTheDay");
40: }
41:
42: protected void addBasicDefaults(LookAndFeelAddons addon,
43: List defaults) {
44: defaults.add(JTipOfTheDay.uiClassID);
45: defaults.add(BasicTipOfTheDayUI.class.getName());
46:
47: defaults.add("TipOfTheDay.font");
48: defaults.add(UIManager.getFont("TextPane.font"));
49:
50: defaults.add("TipOfTheDay.tipFont");
51: defaults.add(UIManager.getFont("Label.font").deriveFont(
52: Font.BOLD, 13f));
53:
54: defaults.add("TipOfTheDay.background");
55: defaults.add(new ColorUIResource(Color.white));
56:
57: defaults.add("TipOfTheDay.icon");
58: defaults.add(LookAndFeel.makeIcon(BasicTipOfTheDayUI.class,
59: "TipOfTheDay24.gif"));
60:
61: defaults.add("TipOfTheDay.border");
62: defaults.add(new BorderUIResource(BorderFactory
63: .createLineBorder(new Color(117, 117, 117))));
64:
65: addResource(defaults,
66: "com.l2fprod.common.swing.plaf.basic.resources.TipOfTheDay");
67: }
68:
69: protected void addWindowsDefaults(LookAndFeelAddons addon,
70: List defaults) {
71: super .addWindowsDefaults(addon, defaults);
72:
73: defaults.add(JTipOfTheDay.uiClassID);
74: defaults.add(WindowsTipOfTheDayUI.class.getName());
75:
76: defaults.add("TipOfTheDay.background");
77: defaults.add(new ColorUIResource(128, 128, 128));
78:
79: defaults.add("TipOfTheDay.font");
80: defaults.add(UIManager.getFont("Label.font").deriveFont(13f));
81:
82: defaults.add("TipOfTheDay.icon");
83: defaults.add(LookAndFeel.makeIcon(WindowsTipOfTheDayUI.class,
84: "tipoftheday.png"));
85:
86: defaults.add("TipOfTheDay.border");
87: defaults.add(new BorderUIResource(
88: new WindowsTipOfTheDayUI.TipAreaBorder()));
89:
90: addResource(defaults,
91: "com.l2fprod.common.swing.plaf.windows.resources.TipOfTheDay");
92: }
93:
94: }
|