001package jmri.jmrit.operations.locations.tools;
002
003import java.awt.event.ActionEvent;
004
005import javax.swing.AbstractAction;
006
007import jmri.jmrit.operations.locations.gui.TrackEditFrame;
008
009/**
010 * Action to launch selection of alternate track.
011 *
012 * @author Daniel Boudreau Copyright (C) 2011
013 */
014public class AlternateTrackAction extends AbstractAction {
015
016    private AlternateTrackFrame _atf;
017    private TrackEditFrame _tef;
018
019    public AlternateTrackAction(TrackEditFrame tef) {
020        super(Bundle.getMessage("AlternateTrack"));
021        _tef = tef;
022    }
023
024    @Override
025    public void actionPerformed(ActionEvent e) {
026        if (_atf != null) {
027            _atf.dispose();
028        }
029        _atf = new AlternateTrackFrame(_tef);
030    }
031
032}