001package jmri.jmrit.blockboss;
002
003import java.awt.event.ActionEvent;
004import javax.swing.AbstractAction;
005import javax.swing.JFrame;
006
007/**
008 * Swing action to create and show a "Simple Signal Logic" GUI panel.
009 *
010 * @author Bob Jacobsen Copyright (C) 2003
011 */
012public class BlockBossAction extends AbstractAction {
013
014    public BlockBossAction(String s) {
015        super(s);
016        // disable ourself if there is no primary Signal Head manager available
017        if (jmri.InstanceManager.getNullableDefault(jmri.SignalHeadManager.class) == null) {
018            setEnabled(false);
019        }
020    }
021
022    public BlockBossAction() {
023        this(Bundle.getMessage("Simple_Signal_Logic"));
024    }
025
026    @Override
027    public void actionPerformed(ActionEvent e) {
028
029        // create the frame
030        JFrame f = new BlockBossFrame();
031        f.setVisible(true);
032    }
033
034}