package ringdb.ui.menu;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.PropertyVetoException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JMenuItem;
import ringdb.database.Database;
import ringdb.ui.MainWindow;
import ringdb.ui.TowersScreen;
public class ViewTowersMenuItem extends JMenuItem implements ActionListener {
/** Version ID */
private static final long serialVersionUID = -3954513406715680472L;
/** Logger */
private static Logger s_Logger = Logger.getLogger(Database.class.getPackage().getName());
private MainWindow m_MainWindow;
public ViewTowersMenuItem(final MainWindow pr_MainWindow) {
super("Towers");
addActionListener(this);
// setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R, ActionEvent.CTRL_MASK));
m_MainWindow = pr_MainWindow;
}
@Override
public void actionPerformed(final ActionEvent pr_Event) {
TowersScreen screen = new TowersScreen(m_MainWindow);
screen.setVisible(true);
try {
screen.setSelected(true);
} catch (PropertyVetoException e) {
s_Logger.log(Level.SEVERE, "Unable to open Towers screen.", e);
}
m_MainWindow.addFrame(screen);
}
}