1 /******************************************************************************
2 * InvitePopupSubmenu.java - The invite submenu that says how many games to invite for.
3 * $Id$
4 *
5 * BuckoFIBS - Backgammon by BuckoSoft
6 * Copyright© 2009,2010 - Dick Balaska - BuckoSoft, Corp.
7 *
8 * $Log$
9 * Revision 1.4 2011/01/01 06:10:37 dick
10 * Javadoc.
11 *
12 * Revision 1.3 2010/03/03 13:12:21 inim
13 * Replaced (c) sign in comment mangled by CVS default encoding back to UTF-8
14 *
15 * Revision 1.2 2010/03/03 12:19:49 inim
16 * Moved source to UTF8 encoding from CP1252 encoding. To this end all source files' (c) message was updated to "Copyright© 2009,2010 - Dick Balaska - BuckoSoft, Corp.". This replaces the (c) sign to UTF8, and adds the new year 2010.
17 *
18 * Revision 1.1 2010/02/04 05:57:53 inim
19 * Mavenized project folder layout
20 *
21 * Revision 1.4 2010/01/23 06:28:43 dick
22 * whitespace.
23 *
24 * Revision 1.3 2009/02/14 15:46:36 dick
25 * BuckoFIBS is released under the GNU license.
26 *
27 * Revision 1.2 2009/02/02 08:38:53 dick
28 * Variable invitations functional.
29 *
30 * Revision 1.1 2009/02/01 21:27:15 dick
31 * The invite submenu that says how many games to invite for.
32 */
33
34 /*
35 * This program is free software: you can redistribute it and/or modify
36 * it under the terms of the GNU General Public License as published by
37 * the Free Software Foundation, either version 3 of the License, or
38 * (at your option) any later version.
39 *
40 * This program is distributed in the hope that it will be useful,
41 * but WITHOUT ANY WARRANTY; without even the implied warranty of
42 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
43 * GNU General Public License for more details.
44 *
45 * You should have received a copy of the GNU General Public License
46 * along with this program. If not, see <http://www.gnu.org/licenses/>.
47 *
48 * The Original Code is BuckoFIBS, <http://www.buckosoft.com/BuckoFIBS/>.
49 * The Initial Developer of the Original Code is Dick Balaska and BuckoSoft, Corp.
50 *
51 */
52 package com.buckosoft.fibs.BuckoFIBS.gui.playerList;
53
54 import java.awt.Dimension;
55 import java.awt.event.ActionEvent;
56 import java.awt.event.ActionListener;
57
58 import javax.swing.JMenu;
59 import javax.swing.JMenuItem;
60
61 /** The invite submenu that says how many games to invite for.
62 * @author Dick Balaska
63 * @since 2009/02/01
64 * @version $Revision$ <br> $Date$
65 * @see <a href="http://cvs.buckosoft.com/Projects/BuckoFIBS/BuckoFIBS/src/main/java/com/buckosoft/fibs/BuckoFIBS/gui/playerList/InvitePopupSubmenu.java">cvs InvitePopupSubmenu.java</a>
66 */
67 public class InvitePopupSubmenu extends JMenu implements ActionListener {
68 private static final long serialVersionUID = 1L;
69 private ActionListener menuHandler = null; // @jve:decl-index=0:
70
71 private JMenuItem jMenuItemResume = null;
72 private JMenuItem jMenuItem1 = null;
73 private JMenuItem jMenuItem2 = null;
74 private JMenuItem jMenuItem3 = null;
75 private JMenuItem jMenuItem5 = null;
76 private JMenuItem jMenuItem7 = null;
77 private JMenuItem jMenuItem9 = null;
78
79 /**
80 * This method initializes
81 *
82 */
83 public InvitePopupSubmenu() {
84 super();
85 initialize();
86 }
87
88 /** Set our reference to the object that will receive menu events
89 * @param c The ActionListener object
90 */
91 public void setMenuHandler(ActionListener c) {
92 this.menuHandler = c;
93 }
94
95 /* (non-Javadoc)
96 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
97 */
98 public void actionPerformed(ActionEvent e) {
99 menuHandler.actionPerformed(e);
100 }
101
102
103 /**
104 * This method initializes this
105 *
106 */
107 private void initialize() {
108 this.setSize(new Dimension(73, 40));
109 this.setText("Invite");
110 this.add(getJMenuItemResume());
111 this.add(getJMenuItem1());
112 this.add(getJMenuItem2());
113 this.add(getJMenuItem3());
114 this.add(getJMenuItem5());
115 this.add(getJMenuItem7());
116 this.add(getJMenuItem9());
117
118 }
119
120 /**
121 * This method initializes jMenuItemResume
122 *
123 * @return javax.swing.JMenuItem
124 */
125 protected JMenuItem getJMenuItemResume() {
126 if (jMenuItemResume == null) {
127 jMenuItemResume = new JMenuItem();
128 jMenuItemResume.setText("resume");
129 jMenuItemResume.setActionCommand("inv-");
130 jMenuItemResume.setToolTipText("continue a saved game.");
131 jMenuItemResume.addActionListener(this);
132 }
133 return jMenuItemResume;
134 }
135
136 /**
137 * This method initializes jMenuItem1
138 *
139 * @return javax.swing.JMenuItem
140 */
141 private JMenuItem getJMenuItem1() {
142 if (jMenuItem1 == null) {
143 jMenuItem1 = new JMenuItem();
144 jMenuItem1.setText("1");
145 jMenuItem1.setActionCommand("inv-1");
146 jMenuItem1.addActionListener(this);
147 }
148 return jMenuItem1;
149 }
150
151 /**
152 * This method initializes jMenuItem2
153 *
154 * @return javax.swing.JMenuItem
155 */
156 private JMenuItem getJMenuItem2() {
157 if (jMenuItem2 == null) {
158 jMenuItem2 = new JMenuItem();
159 jMenuItem2.setText("2");
160 jMenuItem2.setActionCommand("inv-2");
161 jMenuItem2.addActionListener(this);
162 }
163 return jMenuItem2;
164 }
165
166 /**
167 * This method initializes jMenuItem3
168 *
169 * @return javax.swing.JMenuItem
170 */
171 private JMenuItem getJMenuItem3() {
172 if (jMenuItem3 == null) {
173 jMenuItem3 = new JMenuItem();
174 jMenuItem3.setText("3");
175 jMenuItem3.setActionCommand("inv-3");
176 jMenuItem3.addActionListener(this);
177 }
178 return jMenuItem3;
179 }
180
181 /**
182 * This method initializes jMenuItem5
183 *
184 * @return javax.swing.JMenuItem
185 */
186 private JMenuItem getJMenuItem5() {
187 if (jMenuItem5 == null) {
188 jMenuItem5 = new JMenuItem();
189 jMenuItem5.setText("5");
190 jMenuItem5.setActionCommand("inv-5");
191 jMenuItem5.addActionListener(this);
192 }
193 return jMenuItem5;
194 }
195
196 /**
197 * This method initializes jMenuItem7
198 *
199 * @return javax.swing.JMenuItem
200 */
201 private JMenuItem getJMenuItem7() {
202 if (jMenuItem7 == null) {
203 jMenuItem7 = new JMenuItem();
204 jMenuItem7.setText("7");
205 jMenuItem7.setActionCommand("inv-7");
206 jMenuItem7.addActionListener(this);
207 }
208 return jMenuItem7;
209 }
210
211 /**
212 * This method initializes jMenuItem5
213 *
214 * @return javax.swing.JMenuItem
215 */
216 private JMenuItem getJMenuItem9() {
217 if (jMenuItem9 == null) {
218 jMenuItem9 = new JMenuItem();
219 jMenuItem9.setText("9");
220 jMenuItem9.setActionCommand("inv-9");
221 jMenuItem9.addActionListener(this);
222 }
223 return jMenuItem9;
224 }
225
226 } // @jve:decl-index=0:visual-constraint="10,10"