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 change the type of track. Track types are Spurs, Yards,
011 * Interchanges and Staging.
012 *
013 * @author Daniel Boudreau Copyright (C) 2010
014 */
015public class ChangeTrackTypeAction extends AbstractAction {
016
017    private TrackEditFrame _tef;
018    private ChangeTrackFrame _ctf;
019
020    public ChangeTrackTypeAction(TrackEditFrame tef) {
021        super(Bundle.getMessage("MenuItemChangeTrackType"));
022        _tef = tef;
023    }
024
025    @Override
026    public void actionPerformed(ActionEvent e) {
027        if (_ctf != null) {
028            _ctf.dispose();
029        }
030        _ctf = new ChangeTrackFrame(_tef);
031    }
032
033}