001package jmri.jmrit.operations.trains; 002 003import java.awt.event.ActionEvent; 004 005import javax.swing.AbstractAction; 006 007/** 008 * Swing action to create and register a TrainLoadOptionsFrame. 009 * 010 * @author Bob Jacobsen Copyright (C) 2001 011 * @author Daniel Boudreau Copyright (C) 2013 012 * 013 */ 014public class TrainLoadOptionsAction extends AbstractAction { 015 016 public TrainLoadOptionsAction(TrainEditFrame frame) { 017 super(Bundle.getMessage("MenuItemLoadOptions")); 018 _frame = frame; 019 } 020 021 TrainEditFrame _frame; // the parent frame that is launching the TrainEditBuildOptionsFrame. 022 TrainLoadOptionsFrame f = null; 023 024 @Override 025 public void actionPerformed(ActionEvent e) { 026 // create a train edit option frame 027 if (f != null && f.isVisible()) { 028 f.dispose(); 029 } 030 f = new TrainLoadOptionsFrame(); 031 f.initComponents(_frame); 032 } 033} 034 035