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 version 2 as 
4    * published by the Free Software Foundation;
5    */
6   
7   package net.curre.prefcount.gui.type;
8   
9   /**
10   * This is enumeration to represent window components
11   * (menu radio buttons and the corresponding menu bar menu items).
12   * <p/>
13   * Created date: Mar 8, 2008
14   *
15   * @author Yevgeny Nyden
16   */
17  public enum WindowComponent implements UIItem {
18  
19    /** Represents the main window leningrad item. */
20    LENINGRAD("pref.scoreboard.prefType.leningrad", null, null, "PREF_TYPE",
21              "pref.scoreboard.prefType.leningrad.tooltip"),
22  
23    /** Represents the main window sochinka item. */
24    SOCHINKA("pref.scoreboard.prefType.sochi", null, null, "PREF_TYPE",
25             "pref.scoreboard.prefType.sochi.tooltip"),
26  
27    /** Represents the main window 3 players item. */
28    MAIN_3_PLAYERS("pref.scoreboard.players3",
29                   "pref.scoreboard.players3.shortcut",
30                   "pref.scoreboard.players3.index",
31                   "PLAYERS_NUMBER",
32                   "pref.scoreboard.players3.tooltip"),
33  
34    /** Represents the main window 4 players item. */
35    MAIN_4_PLAYERS("pref.scoreboard.players4",
36                   "pref.scoreboard.players4.shortcut",
37                   "pref.scoreboard.players4.index",
38                   "PLAYERS_NUMBER",
39                   "pref.scoreboard.players4.tooltip"),
40  
41    /** Represents the main window ignore divisibility item. */
42    DIVISIBLE_IGNORE("pref.scoreboard.divisible.ignore",
43                     null, null, "DIVISIBILITY",
44                     "pref.scoreboard.divisible.ignore.tooltip"),
45  
46    /** Represents the main window divisible by N item. */
47    DIVISIBLE_BY_N("pref.scoreboard.divisible.byN",
48                   null, null, "DIVISIBILITY",
49                   "pref.scoreboard.divisible.byN.tooltip"),
50  
51    /** Represents the dialog window forward item. */
52    DIALOG_FORWARD("pref.dialog.nextButton.label",
53                   "pref.dialog.nextButton.shortcut",
54                   "pref.dialog.nextButton.index",
55                   "DIALOG_FORWARD", null),
56  
57    /** Represents the dialog window back item. */
58    DIALOG_BACK("pref.dialog.backButton.label",
59                "pref.dialog.backButton.shortcut",
60                "pref.dialog.backButton.index",
61                "DIALOG_BACK", null),
62  
63    /** Represents the choose player dialog window forward item. */
64    DIALOG_FORWARD2("pref.dialog.nextButton.label",
65                   "pref.dialog.nextButton.shortcut",
66                   "pref.dialog.nextButton.index",
67                   "DIALOG_FORWARD2", null),
68  
69    /** Represents the save settings action item. */
70    SAVE_SETTINGS_ACTION("pref.mainMenu.settings.save",
71                         "pref.mainMenu.settings.save.shortcut",
72                         null, "SAVE_SETTINGS_ACTION", null),
73  
74    /** Represents the reset settings action item. */
75    RESET_SETTINGS_ACTION("pref.mainMenu.settings.reset",
76                          "pref.mainMenu.settings.reset.shortcut",
77                          null, "RESET_SETTINGS_ACTION", null),
78  
79    /** Represents the print action item. */
80    PRINT_SCORES_ACTION("pref.mainMenu.print.scores",
81                        "pref.mainMenu.print.scores.shortcut",
82                        null, "PRINT_SCORES_ACTION", null),
83  
84    /** Represents the print action item. */
85    PRINT_TEMPLATE3_ACTION("pref.mainMenu.print.template3",
86                           null, null, "PRINT_TEMPLATE3_ACTION", null),
87  
88    /** Represents the print action item. */
89    PRINT_TEMPLATE4_ACTION("pref.mainMenu.print.template4",
90                           null, null, "PRINT_TEMPLATE4_ACTION", null),
91  
92    /** Represents the quit action item. */
93    QUIT_ACTION("pref.mainMenu.quit",
94                "pref.mainMenu.quit.shortcut",
95                null, "QUIT_ACTION", null),
96  
97    /** Represents the count help action item. */
98    HELP_COUNT_ACTION("pref.helpMenu.count",
99                      null, null, "HELP_COUNT_ACTION", null),
100 
101   /**
102    * Represents the count help action item.
103    * We need the second enum for the second menu (when on Mac).
104    */
105   HELP_COUNT_ACTION2("pref.helpMenu.count",
106                      null, null, "HELP_COUNT_ACTION2", null),
107 
108   /** Represents the preferance reference help action item. */
109   HELP_PREF_ACTION("pref.helpMenu.prefRef",
110                    null, null, "HELP_PREF_ACTION", null),
111 
112   /**
113    * Represents the preferance reference help action item.
114    * We need the second enum for the second menu (when on Mac).
115    */
116   HELP_PREF_ACTION2("pref.helpMenu.prefRef",
117                     null, null, "HELP_PREF_ACTION2", null),
118 
119   /** Represents the common rules help action item. */
120   HELP_COMMON_ACTION("pref.countHelp.commonRules",
121                      null, null, "HELP_COMMON_ACTION", null),
122 
123   /**
124    * Represents the common rules help action item.
125    * We need the second enum for the second menu (when on Mac).
126    */
127   HELP_COMMON_ACTION2("pref.countHelp.commonRules",
128                       null, null, "HELP_COMMON_ACTION2", null),
129 
130   /** Represents the about action item. */
131   ABOUT_ACTION("pref.helpMenu.about",
132                null, null, "ABOUT_ACTION", null),
133 
134   /**
135    * Represents the about action item.
136    * We need the second enum for the second menu (when on Mac).
137    */
138   ABOUT_ACTION2("pref.helpMenu.about",
139                 null, null, "ABOUT_ACTION2", null);
140 
141   /** Resource key for the item label. */
142   private final String textKey;
143 
144   /** Resource key for the item shortcut. */
145   private final String shortcutKey;
146 
147   /** Resource key for the item shortcut letter index (for underlining). */
148   private final String shortcutIndexKey;
149 
150   /** Unique identifier for the button group. */
151   public final String groupKey;
152 
153   /** Tooltip resource key for this item. */
154   public final String tooltipKey;
155 
156   /**
157    * Constructor.
158    *
159    * @param textKey          Resource key for the item label.
160    * @param shortcutKey      Resource key for the item shortcut.
161    * @param shortcutIndexKey Resource key for the item shortcut
162    *                         letter index (for underlining).
163    * @param groupKey         Unique identifier for the button group.
164    * @param tooltipKey       Tooltip resource key for this item.
165    */
166   WindowComponent(String textKey, String shortcutKey,
167                   String shortcutIndexKey, String groupKey,
168                   String tooltipKey) {
169     this.textKey = textKey;
170     this.shortcutKey = shortcutKey;
171     this.shortcutIndexKey = shortcutIndexKey;
172     this.groupKey = groupKey;
173     this.tooltipKey = tooltipKey;
174   }
175 
176   /** {@inheritDoc} */
177   public String getTextKey() {
178     return this.textKey;
179   }
180 
181   /** {@inheritDoc} */
182   public String getShortcutKey() {
183     return this.shortcutKey;
184   }
185 
186   /** {@inheritDoc} */
187   public String getShortcutIndexKey() {
188     return this.shortcutIndexKey;
189   }
190 
191 }