View Javadoc

1   /**
2    * This program is free software: you can redistribute it and/or modify
3    * it under the terms of the GNU General Public License as published by
4    * the Free Software Foundation, version 3.
5    *
6    * This program is distributed in the hope that it will be useful,
7    * but WITHOUT ANY WARRANTY; without even the implied warranty of
8    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9    * GNU General Public License for more details.
10   *
11   * You should have received a copy of the GNU General Public License
12   * along with this program. If not, see <http://www.gnu.org/licenses/>.
13   */
14  
15  package net.curre.prefcount.gui.theme.skin;
16  
17  import java.awt.BasicStroke;
18  import java.awt.Color;
19  import java.awt.Font;
20  import java.awt.GradientPaint;
21  import java.awt.Paint;
22  import java.awt.Stroke;
23  
24  import net.curre.prefcount.util.Utilities;
25  
26  /**
27   * An object of this class represents the prefcount GreenMagicSkin skin -
28   * the Substance's <code>org.jvnet.substance.skin.GreenMagicSkin</code>.
29   * <p/>
30   * Created date: Jun 14, 2007
31   *
32   * @author Yevgeny Nyden
33   */
34  public class GreenMagicSkin implements PrefSkin {
35  
36    /** Resource key for the skin name and the skins unique ID. */
37    public static final String NAME_KEY = "pref.skinMenu.greenMagic";
38  
39    /** Main background color. */
40    public static final Color COLOR_BACKGROUND_MAIN = new Color(188, 232, 177);
41  
42    /** Board background paint. */
43    public static final Color PAINT_BACKGROUND_BOARD = new Color(205, 243, 184);
44  
45    /** Color for players names. */
46    private static final Color COLOR_PLAYER_NAME = new Color(0, 0, 0);
47  
48    /** Font for players names. */
49    private static final Font FONT_PLAYER_NAME = new Font("Arial Black", Font.BOLD, 16);
50  
51    /** Stroke for players names. */
52    private static final Stroke STROKE_PLAYER_NAME = new BasicStroke(2);
53  
54    /** Color for players scores. */
55    private static final Color COLOR_PLAYER_SCORE = new Color(0, 0, 0);
56  
57    /** Font for players scores. */
58    private static final Font FONT_PLAYER_SCORE = new Font("Arial Black", Font.ITALIC, 15);
59  
60    /** Stroke for players scores. */
61    private static final Stroke STROKE_PLAYER_SCORE = new BasicStroke(2);
62  
63    /** Color for players totals (scores). */
64    private static final Color COLOR_PLAYER_TOTALS = new Color(0, 0, 0);
65  
66    /** Font for players totals (scores). */
67    private static final Font FONT_PLAYER_TOTALS = new Font("Arial Black", Font.BOLD, 16);
68  
69    /** Stroke for players totals (scores). */
70    private static final Stroke STROKE_PLAYER_TOTALS = new BasicStroke(2);
71  
72    /** Color for the board lines. */
73    private static final Color COLOR_BOARD_LINES = new Color(35, 67, 28);
74  
75    /** Color for the board lines. */
76    private static final Stroke STROKE_BOARD_LINES = new BasicStroke(1);
77  
78    /** Paint to heighlight final score polygon. */
79    private static final Paint PAINT_FINAL_SCORE_BACKGROUND = new Color(35, 67, 28, 50);
80  
81    /** Paint for the main player section division lines. */
82    private static final Paint PAINT_MAIN_SECTION_LINES = new Color(0, 0, 0);
83  
84    /** {@inheritDoc} */
85    public String getSubstanceSkinClassName() {
86      return org.jvnet.substance.skin.GreenMagicSkin.class.getName();
87    }
88  
89    /** {@inheritDoc} */
90    public String getNameResourceKey() {
91      return NAME_KEY;
92    }
93  
94    /** {@inheritDoc} */
95    public Color getMainBackgroundColor() {
96      return COLOR_BACKGROUND_MAIN;
97    }
98  
99    /** {@inheritDoc} */
100   public Paint getBoardBackgroundPaint() {
101     return new GradientPaint(200f, 200f, PAINT_BACKGROUND_BOARD,
102                              500f, 500f, Utilities.createDarkerColor(PAINT_BACKGROUND_BOARD, 50));
103   }
104 
105   /** {@inheritDoc} */
106   public Color getPlayerNameColor() {
107     return COLOR_PLAYER_NAME;
108   }
109 
110   /** {@inheritDoc} */
111   public Font getPlayerNameFont() {
112     return FONT_PLAYER_NAME;
113   }
114 
115   /** {@inheritDoc} */
116   public Stroke getPlayerNameStroke() {
117     return STROKE_PLAYER_NAME;
118   }
119 
120   /** {@inheritDoc} */
121   public Color getPlayerScoreColor() {
122     return COLOR_PLAYER_SCORE;
123   }
124 
125   /** {@inheritDoc} */
126   public Font getPlayerScoreFont() {
127     return FONT_PLAYER_SCORE;
128   }
129 
130   /** {@inheritDoc} */
131   public Stroke getPlayerScoreStroke() {
132     return STROKE_PLAYER_SCORE;
133   }
134 
135   /** {@inheritDoc} */
136   public Color getPlayerTotalsColor() {
137     return COLOR_PLAYER_TOTALS;
138   }
139 
140   /** {@inheritDoc} */
141   public Font getPlayerTotalsFont() {
142     return FONT_PLAYER_TOTALS;
143   }
144 
145   /** {@inheritDoc} */
146   public Stroke getPlayerTotalsStroke() {
147     return STROKE_PLAYER_TOTALS;
148   }
149 
150   /** {@inheritDoc} */
151   public Color getBoardLineColor() {
152     return COLOR_BOARD_LINES;
153   }
154 
155   /** {@inheritDoc} */
156   public Stroke getBoardLineStroke() {
157     return STROKE_BOARD_LINES;
158   }
159 
160   /** {@inheritDoc} */
161   public Paint getFinalScoreBackgroundPaint() {
162     return PAINT_FINAL_SCORE_BACKGROUND;
163   }
164 
165   /** {@inheritDoc} */
166   public Paint getMainSectionLinesPain() {
167     return PAINT_MAIN_SECTION_LINES;
168   }
169 
170 }