001package jmri.jmrit.operations.locations;
002
003import javax.swing.BorderFactory;
004
005import jmri.jmrit.operations.locations.tools.ChangeTrackTypeAction;
006import jmri.jmrit.operations.locations.tools.TrackDestinationEditAction;
007
008/**
009 * Frame for user edit of a classification/interchange track. Adds two panels to
010 * TrackEditFrame for train/route car drops and pulls.
011 *
012 * @author Dan Boudreau Copyright (C) 2008, 2011, 2012
013 */
014public class InterchangeEditFrame extends TrackEditFrame {
015
016    public InterchangeEditFrame() {
017        super(Bundle.getMessage("AddInterchange"));
018    }
019    
020    @Override
021    public void initComponents(Track track) {
022        setTitle(Bundle.getMessage("EditInterchange", track.getLocation().getName()));
023        initComponents(track.getLocation(), track);
024    }
025
026    @Override
027    public void initComponents(Location location, Track track) {
028        _type = Track.INTERCHANGE;
029
030        super.initComponents(location, track);
031
032        _toolMenu.insert(new TrackDestinationEditAction(this), 0);
033        _toolMenu.insert(new ChangeTrackTypeAction(this), TOOL_MENU_OFFSET + 1);
034        addHelpMenu("package.jmri.jmrit.operations.Operations_Interchange", true); // NOI18N
035
036        // override text strings for tracks
037        // panelTrainDir.setBorder(BorderFactory.createTitledBorder(Bundle.getMessage("TrainInterchange")));
038        paneCheckBoxes.setBorder(BorderFactory.createTitledBorder(Bundle.getMessage("TypesInterchange")));
039        deleteTrackButton.setText(Bundle.getMessage("DeleteInterchange"));
040        addTrackButton.setText(Bundle.getMessage("AddInterchange"));
041        saveTrackButton.setText(Bundle.getMessage("SaveInterchange"));
042
043        // finish
044        pack();
045        setVisible(true);
046    }
047
048//    private final static Logger log = LoggerFactory.getLogger(InterchangeEditFrame.class);
049}