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