Search in sources :

Example 1 with RouteEditFrame

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);
    }
}
Also used : RouteEditFrame(jmri.jmrit.operations.routes.RouteEditFrame) Route(jmri.jmrit.operations.routes.Route)

Aggregations

Route (jmri.jmrit.operations.routes.Route)1 RouteEditFrame (jmri.jmrit.operations.routes.RouteEditFrame)1