001package jmri.jmrit.operations.locations.tools;
002
003import java.awt.event.ActionEvent;
004
005import javax.swing.AbstractAction;
006
007import jmri.jmrit.operations.locations.TrackEditFrame;
008
009/**
010 * Action to allow a user to define how much used track space is to be ignored
011 * by the program when placing new rolling stock to a track.
012 *
013 * @author Daniel Boudreau Copyright (C) 2012
014 * 
015 */
016public class IgnoreUsedTrackAction extends AbstractAction {
017
018    private TrackEditFrame _tef = null;
019    private IgnoreUsedTrackFrame _iutf;
020
021    public IgnoreUsedTrackAction(TrackEditFrame tef) {
022        super(Bundle.getMessage("MenuItemPlannedPickups"));
023        _tef = tef;
024    }
025
026    @Override
027    public void actionPerformed(ActionEvent e) {
028        if (_iutf != null) {
029            _iutf.dispose();
030        }
031        _iutf = new IgnoreUsedTrackFrame(_tef);
032    }
033}