use of jmri.jmrit.operations.routes.RouteEditFrame in project JMRI by JMRI.
the class TrainEditFrame method editAddRoute.
private void editAddRoute() {
log.debug("Edit/add route");
// warn user if train is built that they shouldn't edit the train's route
if (_train != null && _train.isBuilt()) {
JOptionPane.showMessageDialog(this, Bundle.getMessage("DoNotModifyRoute"), Bundle.getMessage("BuiltTrain"), JOptionPane.WARNING_MESSAGE);
}
if (ref != null) {
ref.dispose();
}
ref = new RouteEditFrame();
setChildFrame(ref);
Object selected = routeBox.getSelectedItem();
if (selected != null) {
Route route = (Route) selected;
ref.initComponents(route);
} else {
ref.initComponents(null, _train);
}
}
Aggregations