001package jmri.jmrit.operations.locations.tools;
002
003import java.awt.event.ActionEvent;
004import javax.swing.AbstractAction;
005
006import jmri.jmrit.operations.locations.gui.TrackEditFrame;
007
008/**
009 * Action to create the TrackLoadEditFrame.
010 *
011 * @author Daniel Boudreau Copyright (C) 2013
012 * 
013 */
014public class TrackLoadEditAction extends AbstractAction {
015
016    private TrackEditFrame _frame;
017    private TrackLoadEditFrame tlef = null;
018
019    public TrackLoadEditAction(TrackEditFrame frame) {
020        super(Bundle.getMessage("MenuItemLoadOptions"));
021        _frame = frame;
022    }
023
024    @Override
025    public void actionPerformed(ActionEvent e) {
026        if (tlef != null) {
027            tlef.dispose();
028        }
029        tlef = new TrackLoadEditFrame();
030        tlef.initComponents(_frame._location, _frame._track);
031    }
032}