View Javadoc
1   /******************************************************************************
2    * RepBotPopupSubmenu.java - The repbot submenu that says whether to vouch or complain about a player.
3    * $Id$
4    * 
5    * BuckoFIBS - Backgammon by BuckoSoft
6    * Copyright© 2009,2010 - Dick Balaska - BuckoSoft, Corp.
7    * 
8    * $Log$
9    * Revision 1.2  2010/03/03 12:19:49  inim
10   * 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.
11   *
12   * Revision 1.1  2010/02/04 05:57:53  inim
13   * Mavenized project folder layout
14   *
15   * Revision 1.1  2010/01/23 06:28:27  dick
16   * The repbot submenu that says whether to vouch or complain about a player.
17   *
18   */
19  
20  /* 
21   * This program is free software: you can redistribute it and/or modify
22   * it under the terms of the GNU General Public License as published by
23   * the Free Software Foundation, either version 3 of the License, or
24   * (at your option) any later version.
25   *
26   * This program is distributed in the hope that it will be useful,
27   * but WITHOUT ANY WARRANTY; without even the implied warranty of
28   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
29   * GNU General Public License for more details.
30   *
31   * You should have received a copy of the GNU General Public License
32   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
33   *
34   * The Original Code is BuckoFIBS, <http://www.buckosoft.com/BuckoFIBS/>.
35   * The Initial Developer of the Original Code is Dick Balaska and BuckoSoft, Corp.
36   * 
37   */
38  package com.buckosoft.fibs.BuckoFIBS.gui.playerList;
39  
40  import java.awt.Dimension;
41  import java.awt.event.ActionEvent;
42  import java.awt.event.ActionListener;
43  
44  import javax.swing.JMenu;
45  import javax.swing.JMenuItem;
46  
47  /** The repbot submenu that says whether to vouch or complain about a player.
48   * @author Dick Balaska
49   * @since 2009/12/01
50   * @version $Revision$ <br> $Date$
51   * @see <a href="http://cvs.buckosoft.com/Projects/BuckoFIBS/BuckoFIBS/src/com/buckosoft/fibs/BuckoFIBS/gui/playerList/RepBotPopupSubmenu.java">cvs RepBotPopupSubmenu.java</a>
52   */
53  public class RepBotPopupSubmenu extends JMenu implements ActionListener {
54  	private static final long serialVersionUID = 1L;
55  	private	ActionListener	menuHandler = null;  //  @jve:decl-index=0:
56  
57  	private JMenuItem jMenuItemVouch = null;
58  	private JMenuItem jMenuItemComplain = null;
59  
60  	/**
61  	 * This method initializes 
62  	 * 
63  	 */
64  	public RepBotPopupSubmenu() {
65  		super();
66  		initialize();
67  	}
68  
69  	/** Set our reference to the object that will receive menu events
70  	 * @param c The ActionListener object
71  	 */ 
72  	public	void setMenuHandler(ActionListener c) {
73  		this.menuHandler = c;
74  	}
75  
76  	/* (non-Javadoc)
77  	 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
78  	 */
79  	public void actionPerformed(ActionEvent e) {
80  		menuHandler.actionPerformed(e);
81  	}
82  
83  	
84  	/**
85  	 * This method initializes this
86  	 * 
87  	 */
88  	private void initialize() {
89          this.setSize(new Dimension(73, 40));
90          this.setText("RepBot");
91          this.add(getJMenuItemVouch());
92          this.add(getJMenuItemComplain());
93  	}
94  
95  	/**
96  	 * This method initializes jMenuItemResume	
97  	 * 	
98  	 * @return javax.swing.JMenuItem	
99  	 */
100 	protected JMenuItem getJMenuItemVouch() {
101 		if (jMenuItemVouch == null) {
102 			jMenuItemVouch = new JMenuItem();
103 			jMenuItemVouch.setText("Vouch");
104 			jMenuItemVouch.setActionCommand("repVouch");
105 			jMenuItemVouch.setToolTipText("Vouch for a player.");
106 			jMenuItemVouch.addActionListener(this);
107 		}
108 		return jMenuItemVouch;
109 	}
110 
111 	/**
112 	 * This method initializes jMenuItem1	
113 	 * 	
114 	 * @return javax.swing.JMenuItem	
115 	 */
116 	private JMenuItem getJMenuItemComplain() {
117 		if (jMenuItemComplain == null) {
118 			jMenuItemComplain = new JMenuItem();
119 			jMenuItemComplain.setText("Complain");
120 			jMenuItemComplain.setActionCommand("repComplain");
121 			jMenuItemComplain.setToolTipText("Complain to Repbot about a player.");
122 			jMenuItemComplain.addActionListener(this);
123 		}
124 		return jMenuItemComplain;
125 	}
126 
127 	/**
128 	 * This method initializes jMenuItem3	
129 	 * 	
130 	 * @return javax.swing.JMenuItem	
131 	 */
132 
133 }  //  @jve:decl-index=0:visual-constraint="10,10"