001package jmri.jmrit.operations.trains.tools;
002
003import java.awt.Frame;
004import java.awt.event.ActionEvent;
005
006import javax.swing.AbstractAction;
007
008import jmri.jmrit.operations.trains.TrainEditFrame;
009
010/**
011 * Swing action to load the train manifest options frame.
012 *
013 * @author Bob Jacobsen Copyright (C) 2001
014 * @author Daniel Boudreau Copyright (C) 2010
015 */
016public class TrainManifestOptionAction extends AbstractAction {
017
018    TrainEditFrame frame = null;
019
020    public TrainManifestOptionAction(TrainEditFrame frame) {
021        super(Bundle.getMessage("MenuItemOptions"));
022        this.frame = frame;
023    }
024
025    TrainManifestOptionFrame f = null;
026
027    @Override
028    public void actionPerformed(ActionEvent e) {
029        // create a settings frame
030        if (f == null || !f.isVisible()) {
031            f = new TrainManifestOptionFrame();
032            f.initComponents(frame);
033        }
034        f.setExtendedState(Frame.NORMAL);
035        f.setVisible(true); // this also brings the frame into focus
036    }
037
038//    private final static Logger log = LoggerFactory.getLogger(TrainManifestOptionAction.class);
039}
040
041