001package jmri.jmrit.operations.trains; 002 003import java.awt.*; 004import java.util.List; 005 006import javax.swing.*; 007 008import org.slf4j.Logger; 009import org.slf4j.LoggerFactory; 010 011import jmri.InstanceManager; 012import jmri.jmrit.operations.*; 013import jmri.jmrit.operations.rollingstock.RollingStockManager; 014import jmri.jmrit.operations.rollingstock.cars.*; 015import jmri.jmrit.operations.rollingstock.engines.EngineManager; 016import jmri.jmrit.operations.setup.Control; 017import jmri.jmrit.operations.setup.Setup; 018 019/** 020 * Frame for user edit of a train's road options 021 * 022 * @author Dan Boudreau Copyright (C) 2013, 2022 023 * 024 */ 025public class TrainRoadOptionsFrame extends OperationsFrame implements java.beans.PropertyChangeListener { 026 027 Train _train = null; 028 029 JPanel pCarRoadControls = new JPanel(); 030 JPanel panelCarRoads = new JPanel(); 031 JScrollPane paneCarRoads = new JScrollPane(panelCarRoads); 032 033 JPanel pCabooseRoadControls = new JPanel(); 034 JPanel panelCabooseRoads = new JPanel(); 035 JScrollPane paneCabooseRoads = new JScrollPane(panelCabooseRoads); 036 037 JPanel pLocoRoadControls = new JPanel(); 038 JPanel panelLocoRoads = new JPanel(); 039 JScrollPane paneLocoRoads = new JScrollPane(panelLocoRoads); 040 041 // labels 042 JLabel trainName = new JLabel(); 043 JLabel trainDescription = new JLabel(); 044 045 // major buttons 046 JButton addCarRoadButton = new JButton(Bundle.getMessage("AddRoad")); 047 JButton deleteCarRoadButton = new JButton(Bundle.getMessage("DeleteRoad")); 048 JButton deleteCarAllRoadsButton = new JButton(Bundle.getMessage("DeleteAll")); 049 050 JButton addCabooseRoadButton = new JButton(Bundle.getMessage("AddRoad")); 051 JButton deleteCabooseRoadButton = new JButton(Bundle.getMessage("DeleteRoad")); 052 JButton deleteCabooseAllRoadsButton = new JButton(Bundle.getMessage("DeleteAll")); 053 054 JButton addLocoRoadButton = new JButton(Bundle.getMessage("AddRoad")); 055 JButton deleteLocoRoadButton = new JButton(Bundle.getMessage("DeleteRoad")); 056 JButton deleteLocoAllRoadsButton = new JButton(Bundle.getMessage("DeleteAll")); 057 058 JButton saveTrainButton = new JButton(Bundle.getMessage("SaveTrain")); 059 060 // radio buttons 061 JRadioButton carRoadNameAll = new JRadioButton(Bundle.getMessage("AcceptAll")); 062 JRadioButton carRoadNameInclude = new JRadioButton(Bundle.getMessage("AcceptOnly")); 063 JRadioButton carRoadNameExclude = new JRadioButton(Bundle.getMessage("Exclude")); 064 065 JRadioButton cabooseRoadNameAll = new JRadioButton(Bundle.getMessage("AcceptAll")); 066 JRadioButton cabooseRoadNameInclude = new JRadioButton(Bundle.getMessage("AcceptOnly")); 067 JRadioButton cabooseRoadNameExclude = new JRadioButton(Bundle.getMessage("Exclude")); 068 069 JRadioButton locoRoadNameAll = new JRadioButton(Bundle.getMessage("AcceptAll")); 070 JRadioButton locoRoadNameInclude = new JRadioButton(Bundle.getMessage("AcceptOnly")); 071 JRadioButton locoRoadNameExclude = new JRadioButton(Bundle.getMessage("Exclude")); 072 073 // combo boxes 074 JComboBox<String> comboBoxCarRoads = InstanceManager.getDefault(CarRoads.class).getComboBox(); 075 JComboBox<String> comboBoxCabooseRoads = new JComboBox<String>(); 076 JComboBox<String> comboBoxLocoRoads = new JComboBox<String>(); 077 078 public static final String DISPOSE = "dispose"; // NOI18N 079 080 public TrainRoadOptionsFrame() { 081 super(Bundle.getMessage("MenuItemRoadOptions")); 082 } 083 084 public void initComponents(TrainEditFrame parent) { 085 086 parent.setChildFrame(this); 087 _train = parent._train; 088 089 getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS)); 090 091 // Layout the panel by rows 092 JPanel p1 = new JPanel(); 093 p1.setLayout(new BoxLayout(p1, BoxLayout.X_AXIS)); 094 p1.setMaximumSize(new Dimension(2000, 250)); 095 096 // Layout the panel by rows 097 // row 1a 098 JPanel pName = new JPanel(); 099 pName.setLayout(new GridBagLayout()); 100 pName.setBorder(BorderFactory.createTitledBorder(Bundle.getMessage("Name"))); 101 addItem(pName, trainName, 0, 0); 102 103 // row 1b 104 JPanel pDesc = new JPanel(); 105 pDesc.setLayout(new GridBagLayout()); 106 pDesc.setBorder(BorderFactory.createTitledBorder(Bundle.getMessage("Description"))); 107 addItem(pDesc, trainDescription, 0, 0); 108 109 p1.add(pName); 110 p1.add(pDesc); 111 112 // row 3 Car Roads 113 JPanel pCarRoad = new JPanel(); 114 pCarRoad.setLayout(new BoxLayout(pCarRoad, BoxLayout.Y_AXIS)); 115 JScrollPane paneCar = new JScrollPane(pCarRoad); 116 paneCar.setBorder(BorderFactory.createTitledBorder(Bundle.getMessage("CarRoadsTrain"))); 117 paneCar.setMaximumSize(new Dimension(2000, 400)); 118 119 JPanel pCarRoadRadioButtons = new JPanel(); 120 pCarRoadRadioButtons.setLayout(new FlowLayout()); 121 122 pCarRoadRadioButtons.add(carRoadNameAll); 123 pCarRoadRadioButtons.add(carRoadNameInclude); 124 pCarRoadRadioButtons.add(carRoadNameExclude); 125 126 pCarRoadControls.setLayout(new FlowLayout()); 127 128 pCarRoadControls.add(comboBoxCarRoads); 129 pCarRoadControls.add(addCarRoadButton); 130 pCarRoadControls.add(deleteCarRoadButton); 131 pCarRoadControls.add(deleteCarAllRoadsButton); 132 133 pCarRoadControls.setVisible(false); 134 135 pCarRoad.add(pCarRoadRadioButtons); 136 pCarRoad.add(pCarRoadControls); 137 138 // row 4 139 panelCarRoads.setLayout(new GridBagLayout()); 140 paneCarRoads.setBorder(BorderFactory.createTitledBorder(Bundle.getMessage("RoadsCar"))); 141 142 ButtonGroup carRoadGroup = new ButtonGroup(); 143 carRoadGroup.add(carRoadNameAll); 144 carRoadGroup.add(carRoadNameInclude); 145 carRoadGroup.add(carRoadNameExclude); 146 147 // row 5 Caboose Roads 148 JPanel pCabooseRoad = new JPanel(); 149 pCabooseRoad.setLayout(new BoxLayout(pCabooseRoad, BoxLayout.Y_AXIS)); 150 JScrollPane paneCaboose = new JScrollPane(pCabooseRoad); 151 paneCaboose.setBorder(BorderFactory.createTitledBorder(Bundle.getMessage("CabooseRoadsTrain"))); 152 paneCaboose.setMaximumSize(new Dimension(2000, 400)); 153 154 JPanel pCabooseRoadRadioButtons = new JPanel(); 155 pCabooseRoadRadioButtons.setLayout(new FlowLayout()); 156 157 pCabooseRoadRadioButtons.add(cabooseRoadNameAll); 158 pCabooseRoadRadioButtons.add(cabooseRoadNameInclude); 159 pCabooseRoadRadioButtons.add(cabooseRoadNameExclude); 160 161 pCabooseRoadControls.setLayout(new FlowLayout()); 162 163 pCabooseRoadControls.add(comboBoxCabooseRoads); 164 pCabooseRoadControls.add(addCabooseRoadButton); 165 pCabooseRoadControls.add(deleteCabooseRoadButton); 166 pCabooseRoadControls.add(deleteCabooseAllRoadsButton); 167 168 pCabooseRoadControls.setVisible(false); 169 170 pCabooseRoad.add(pCabooseRoadRadioButtons); 171 pCabooseRoad.add(pCabooseRoadControls); 172 173 // row 6 174 panelCabooseRoads.setLayout(new GridBagLayout()); 175 paneCabooseRoads.setBorder(BorderFactory.createTitledBorder(Bundle.getMessage("RoadsCaboose"))); 176 177 ButtonGroup cabooseRoadGroup = new ButtonGroup(); 178 cabooseRoadGroup.add(cabooseRoadNameAll); 179 cabooseRoadGroup.add(cabooseRoadNameInclude); 180 cabooseRoadGroup.add(cabooseRoadNameExclude); 181 182 // row 7 Engine Roads 183 JPanel pLocoRoad = new JPanel(); 184 pLocoRoad.setLayout(new BoxLayout(pLocoRoad, BoxLayout.Y_AXIS)); 185 JScrollPane paneLoco = new JScrollPane(pLocoRoad); 186 paneLoco.setBorder(BorderFactory.createTitledBorder(Bundle.getMessage("LocoRoadsTrain"))); 187 paneLoco.setMaximumSize(new Dimension(2000, 400)); 188 189 JPanel pLocoRoadRadioButtons = new JPanel(); 190 pLocoRoadRadioButtons.setLayout(new FlowLayout()); 191 192 pLocoRoadRadioButtons.add(locoRoadNameAll); 193 pLocoRoadRadioButtons.add(locoRoadNameInclude); 194 pLocoRoadRadioButtons.add(locoRoadNameExclude); 195 196 pLocoRoadControls.setLayout(new FlowLayout()); 197 198 pLocoRoadControls.add(comboBoxLocoRoads); 199 pLocoRoadControls.add(addLocoRoadButton); 200 pLocoRoadControls.add(deleteLocoRoadButton); 201 pLocoRoadControls.add(deleteLocoAllRoadsButton); 202 203 pLocoRoadControls.setVisible(false); 204 205 pLocoRoad.add(pLocoRoadRadioButtons); 206 pLocoRoad.add(pLocoRoadControls); 207 208 // row 8 209 panelLocoRoads.setLayout(new GridBagLayout()); 210 paneLocoRoads.setBorder(BorderFactory.createTitledBorder(Bundle.getMessage("RoadsLoco"))); 211 212 ButtonGroup locoRoadGroup = new ButtonGroup(); 213 locoRoadGroup.add(locoRoadNameAll); 214 locoRoadGroup.add(locoRoadNameInclude); 215 locoRoadGroup.add(locoRoadNameExclude); 216 217 // row 12 218 JPanel panelButtons = new JPanel(); 219 panelButtons.setLayout(new GridBagLayout()); 220 panelButtons.setBorder(BorderFactory.createTitledBorder("")); 221 panelButtons.setMaximumSize(new Dimension(2000, 200)); 222 223 // row 13 224 addItem(panelButtons, saveTrainButton, 0, 0); 225 226 getContentPane().add(p1); 227 getContentPane().add(paneCar); 228 getContentPane().add(paneCarRoads); 229 getContentPane().add(paneCaboose); 230 getContentPane().add(paneCabooseRoads); 231 getContentPane().add(paneLoco); 232 getContentPane().add(paneLocoRoads); 233 getContentPane().add(panelButtons); 234 235 // setup buttons 236 addButtonAction(saveTrainButton); 237 238 addButtonAction(deleteCarRoadButton); 239 addButtonAction(deleteCarAllRoadsButton); 240 addButtonAction(addCarRoadButton); 241 242 addRadioButtonAction(carRoadNameAll); 243 addRadioButtonAction(carRoadNameInclude); 244 addRadioButtonAction(carRoadNameExclude); 245 246 addButtonAction(deleteCabooseRoadButton); 247 addButtonAction(deleteCabooseAllRoadsButton); 248 addButtonAction(addCabooseRoadButton); 249 250 addRadioButtonAction(cabooseRoadNameAll); 251 addRadioButtonAction(cabooseRoadNameInclude); 252 addRadioButtonAction(cabooseRoadNameExclude); 253 254 addButtonAction(deleteLocoRoadButton); 255 addButtonAction(deleteLocoAllRoadsButton); 256 addButtonAction(addLocoRoadButton); 257 258 addRadioButtonAction(locoRoadNameAll); 259 addRadioButtonAction(locoRoadNameInclude); 260 addRadioButtonAction(locoRoadNameExclude); 261 262 if (_train != null) { 263 trainName.setText(_train.getName()); 264 trainDescription.setText(_train.getDescription()); 265 updateButtons(true); 266 // listen for train changes 267 _train.addPropertyChangeListener(this); 268 } else { 269 updateButtons(false); 270 } 271 addHelpMenu("package.jmri.jmrit.operations.Operations_TrainRoadOptions", true); // NOI18N 272 updateRoadComboBoxes(); 273 updateCarRoadNames(); 274 updateCabooseRoadNames(); 275 updateLocoRoadNames(); 276 277 // get notified if car types or roads gets modified 278 InstanceManager.getDefault(CarTypes.class).addPropertyChangeListener(this); 279 InstanceManager.getDefault(CarRoads.class).addPropertyChangeListener(this); 280 // get notified if there's a change in the engine roster 281 InstanceManager.getDefault(EngineManager.class).addPropertyChangeListener(this); 282 InstanceManager.getDefault(CarManager.class).addPropertyChangeListener(this); 283 284 initMinimumSize(new Dimension(Control.panelWidth500, Control.panelHeight500)); 285 } 286 287 // Save 288 @Override 289 public void buttonActionPerformed(java.awt.event.ActionEvent ae) { 290 if (_train != null) { 291 if (ae.getSource() == saveTrainButton) { 292 log.debug("train save button activated"); 293 saveTrain(); 294 } 295 if (ae.getSource() == addCarRoadButton) { 296 String roadName = (String) comboBoxCarRoads.getSelectedItem(); 297 if (_train.addCarRoadName(roadName)) { 298 updateCarRoadNames(); 299 } 300 selectNextItemComboBox(comboBoxCarRoads); 301 } 302 if (ae.getSource() == deleteCarRoadButton) { 303 String roadName = (String) comboBoxCarRoads.getSelectedItem(); 304 if (_train.deleteCarRoadName(roadName)) { 305 updateCarRoadNames(); 306 } 307 selectNextItemComboBox(comboBoxCarRoads); 308 } 309 if (ae.getSource() == deleteCarAllRoadsButton) { 310 deleteAllCarRoads(); 311 } 312 // cabooses 313 if (ae.getSource() == addCabooseRoadButton) { 314 String roadName = (String) comboBoxCabooseRoads.getSelectedItem(); 315 if (_train.addCabooseRoadName(roadName)) { 316 updateCabooseRoadNames(); 317 } 318 selectNextItemComboBox(comboBoxCabooseRoads); 319 } 320 if (ae.getSource() == deleteCabooseRoadButton) { 321 String roadName = (String) comboBoxCabooseRoads.getSelectedItem(); 322 if (_train.deleteCabooseRoadName(roadName)) { 323 updateCabooseRoadNames(); 324 } 325 selectNextItemComboBox(comboBoxCabooseRoads); 326 } 327 if (ae.getSource() == deleteCabooseAllRoadsButton) { 328 deleteAllCabooseRoads(); 329 } 330 // locos 331 if (ae.getSource() == addLocoRoadButton) { 332 String roadName = (String) comboBoxLocoRoads.getSelectedItem(); 333 if (_train.addLocoRoadName(roadName)) { 334 updateLocoRoadNames(); 335 } 336 selectNextItemComboBox(comboBoxLocoRoads); 337 } 338 339 if (ae.getSource() == deleteLocoRoadButton) { 340 String roadName = (String) comboBoxLocoRoads.getSelectedItem(); 341 if (_train.deleteLocoRoadName(roadName)) { 342 updateLocoRoadNames(); 343 } 344 selectNextItemComboBox(comboBoxLocoRoads); 345 } 346 if (ae.getSource() == deleteLocoAllRoadsButton) { 347 deleteAllLocoRoads(); 348 } 349 } 350 } 351 352 @Override 353 public void radioButtonActionPerformed(java.awt.event.ActionEvent ae) { 354 log.debug("radio button activated"); 355 if (_train != null) { 356 if (ae.getSource() == carRoadNameAll) { 357 _train.setCarRoadOption(Train.ALL_LOADS); 358 updateCarRoadNames(); 359 } 360 if (ae.getSource() == carRoadNameInclude) { 361 _train.setCarRoadOption(Train.INCLUDE_LOADS); 362 updateCarRoadNames(); 363 } 364 if (ae.getSource() == carRoadNameExclude) { 365 _train.setCarRoadOption(Train.EXCLUDE_LOADS); 366 updateCarRoadNames(); 367 } 368 369 if (ae.getSource() == cabooseRoadNameAll) { 370 _train.setCabooseRoadOption(Train.ALL_LOADS); 371 updateCabooseRoadNames(); 372 } 373 if (ae.getSource() == cabooseRoadNameInclude) { 374 _train.setCabooseRoadOption(Train.INCLUDE_LOADS); 375 updateCabooseRoadNames(); 376 } 377 if (ae.getSource() == cabooseRoadNameExclude) { 378 _train.setCabooseRoadOption(Train.EXCLUDE_LOADS); 379 updateCabooseRoadNames(); 380 } 381 382 if (ae.getSource() == locoRoadNameAll) { 383 _train.setLocoRoadOption(Train.ALL_LOADS); 384 updateLocoRoadNames(); 385 } 386 if (ae.getSource() == locoRoadNameInclude) { 387 _train.setLocoRoadOption(Train.INCLUDE_LOADS); 388 updateLocoRoadNames(); 389 } 390 if (ae.getSource() == locoRoadNameExclude) { 391 _train.setLocoRoadOption(Train.EXCLUDE_LOADS); 392 updateLocoRoadNames(); 393 } 394 } 395 } 396 397 protected void updateButtons(boolean enabled) { 398 saveTrainButton.setEnabled(enabled); 399 400 carRoadNameAll.setEnabled(enabled); 401 carRoadNameInclude.setEnabled(enabled); 402 carRoadNameExclude.setEnabled(enabled); 403 404 locoRoadNameAll.setEnabled(enabled); 405 locoRoadNameInclude.setEnabled(enabled); 406 locoRoadNameExclude.setEnabled(enabled); 407 } 408 409 private static final int NUMBER_ROADS_PER_LINE = 6; 410 411 private void updateCarRoadNames() { 412 log.debug("Update car road names"); 413 panelCarRoads.removeAll(); 414 if (_train != null) { 415 // set radio button 416 carRoadNameAll.setSelected(_train.getCarRoadOption().equals(Train.ALL_LOADS)); 417 carRoadNameInclude.setSelected(_train.getCarRoadOption().equals(Train.INCLUDE_ROADS)); 418 carRoadNameExclude.setSelected(_train.getCarRoadOption().equals(Train.EXCLUDE_ROADS)); 419 420 pCarRoadControls.setVisible(!carRoadNameAll.isSelected()); 421 422 if (!carRoadNameAll.isSelected()) { 423 int x = 0; 424 int y = 0; // vertical position in panel 425 426 for (String roadName : _train.getCarRoadNames()) { 427 JLabel road = new JLabel(); 428 road.setText(roadName); 429 addItemTop(panelCarRoads, road, x++, y); 430 // limit the number of roads per line 431 if (x > NUMBER_ROADS_PER_LINE) { 432 y++; 433 x = 0; 434 } 435 } 436 revalidate(); 437 } 438 } else { 439 carRoadNameAll.setSelected(true); 440 } 441 panelCarRoads.repaint(); 442 panelCarRoads.revalidate(); 443 } 444 445 private void updateCabooseRoadNames() { 446 log.debug("Update caboose road names"); 447 panelCabooseRoads.removeAll(); 448 if (_train != null) { 449 // set radio button 450 cabooseRoadNameAll.setSelected(_train.getCabooseRoadOption().equals(Train.ALL_LOADS)); 451 cabooseRoadNameInclude.setSelected(_train.getCabooseRoadOption().equals(Train.INCLUDE_ROADS)); 452 cabooseRoadNameExclude.setSelected(_train.getCabooseRoadOption().equals(Train.EXCLUDE_ROADS)); 453 454 pCabooseRoadControls.setVisible(!cabooseRoadNameAll.isSelected()); 455 456 if (!cabooseRoadNameAll.isSelected()) { 457 int x = 0; 458 int y = 0; // vertical position in panel 459 460 for (String roadName : _train.getCabooseRoadNames()) { 461 JLabel road = new JLabel(); 462 road.setText(roadName); 463 addItemTop(panelCabooseRoads, road, x++, y); 464 // limit the number of roads per line 465 if (x > NUMBER_ROADS_PER_LINE) { 466 y++; 467 x = 0; 468 } 469 } 470 revalidate(); 471 } 472 } else { 473 cabooseRoadNameAll.setSelected(true); 474 } 475 panelCabooseRoads.repaint(); 476 panelCabooseRoads.revalidate(); 477 } 478 479 private void updateLocoRoadNames() { 480 log.debug("Update loco road names"); 481 panelLocoRoads.removeAll(); 482 if (_train != null) { 483 // set radio button 484 locoRoadNameAll.setSelected(_train.getLocoRoadOption().equals(Train.ALL_LOADS)); 485 locoRoadNameInclude.setSelected(_train.getLocoRoadOption().equals(Train.INCLUDE_ROADS)); 486 locoRoadNameExclude.setSelected(_train.getLocoRoadOption().equals(Train.EXCLUDE_ROADS)); 487 488 pLocoRoadControls.setVisible(!locoRoadNameAll.isSelected()); 489 490 if (!locoRoadNameAll.isSelected()) { 491 int x = 0; 492 int y = 0; // vertical position in panel 493 494 for (String roadName : _train.getLocoRoadNames()) { 495 JLabel road = new JLabel(); 496 road.setText(roadName); 497 addItemTop(panelLocoRoads, road, x++, y); 498 // limit the number of roads per line 499 if (x > NUMBER_ROADS_PER_LINE) { 500 y++; 501 x = 0; 502 } 503 } 504 revalidate(); 505 } 506 } else { 507 locoRoadNameAll.setSelected(true); 508 } 509 panelLocoRoads.repaint(); 510 panelLocoRoads.revalidate(); 511 } 512 513 private void deleteAllCarRoads() { 514 if (_train != null) { 515 for (String road : _train.getCarRoadNames()) { 516 _train.deleteCarRoadName(road); 517 } 518 } 519 updateCarRoadNames(); 520 } 521 522 private void deleteAllCabooseRoads() { 523 if (_train != null) { 524 for (String road : _train.getCabooseRoadNames()) { 525 _train.deleteCabooseRoadName(road); 526 } 527 } 528 updateCabooseRoadNames(); 529 } 530 531 private void deleteAllLocoRoads() { 532 if (_train != null) { 533 for (String road : _train.getLocoRoadNames()) { 534 _train.deleteLocoRoadName(road); 535 } 536 } 537 updateLocoRoadNames(); 538 } 539 540 private void saveTrain() { 541 OperationsXml.save(); 542 if (Setup.isCloseWindowOnSaveEnabled()) { 543 dispose(); 544 } 545 } 546 547 private void updateRoadComboBoxes() { 548 InstanceManager.getDefault(CarRoads.class).updateComboBox(comboBoxCarRoads); 549 updateCabooseRoadComboBox(); 550 InstanceManager.getDefault(EngineManager.class).updateEngineRoadComboBox(NONE, comboBoxLocoRoads); 551 } 552 553 private void updateCabooseRoadComboBox() { 554 comboBoxCabooseRoads.removeAllItems(); 555 List<String> roads = InstanceManager.getDefault(CarManager.class).getCabooseRoadNames(); 556 for (String road : roads) { 557 comboBoxCabooseRoads.addItem(road); 558 } 559 OperationsPanel.padComboBox(comboBoxCabooseRoads); 560 } 561 562 @Override 563 public void dispose() { 564 InstanceManager.getDefault(CarTypes.class).removePropertyChangeListener(this); 565 InstanceManager.getDefault(CarRoads.class).removePropertyChangeListener(this); 566 if (_train != null) { 567 _train.removePropertyChangeListener(this); 568 } 569 super.dispose(); 570 } 571 572 @Override 573 public void propertyChange(java.beans.PropertyChangeEvent e) { 574 if (Control.SHOW_PROPERTY) { 575 log.debug("Property change: ({}) old: ({}) new: ({})", e.getPropertyName(), e.getOldValue(), e 576 .getNewValue()); 577 } 578 if (e.getPropertyName().equals(CarRoads.CARROADS_CHANGED_PROPERTY) 579 || e.getPropertyName().equals(RollingStockManager.LISTLENGTH_CHANGED_PROPERTY)) { 580 updateRoadComboBoxes(); 581 updateCarRoadNames(); 582 updateCabooseRoadNames(); 583 updateLocoRoadNames(); 584 } 585 } 586 587 private final static Logger log = LoggerFactory.getLogger(TrainRoadOptionsFrame.class); 588}