001package jmri.jmrit.operations.locations.tools; 002 003import java.awt.*; 004 005import javax.swing.*; 006 007import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 008import jmri.InstanceManager; 009import jmri.jmrit.operations.OperationsFrame; 010import jmri.jmrit.operations.OperationsXml; 011import jmri.jmrit.operations.locations.Location; 012import jmri.jmrit.operations.locations.Track; 013import jmri.jmrit.operations.rollingstock.cars.*; 014import jmri.jmrit.operations.setup.Control; 015import jmri.jmrit.operations.setup.Setup; 016import jmri.util.swing.JmriJOptionPane; 017 018/** 019 * Frame for user edit of track loads 020 * 021 * @author Dan Boudreau Copyright (C) 2013, 2014, 2015, 2023 022 * 023 */ 024public class TrackLoadEditFrame extends OperationsFrame implements java.beans.PropertyChangeListener { 025 026 private static boolean loadAndType = false; 027 private static boolean shipLoadAndType = false; 028 029 Location _location = null; 030 Track _track = null; 031 String _type = ""; 032 JMenu _toolMenu = null; 033 034 // panels 035 JPanel pLoadControls = new JPanel(); 036 JPanel panelLoads = new JPanel(); 037 JScrollPane paneLoads = new JScrollPane(panelLoads); 038 039 JPanel pShipLoadControls = new JPanel(); 040 JPanel panelShipLoads = new JPanel(); 041 JScrollPane paneShipLoadControls; 042 JScrollPane paneShipLoads = new JScrollPane(panelShipLoads); 043 044 // major buttons 045 JButton saveButton = new JButton(Bundle.getMessage("ButtonSave")); 046 047 JButton addLoadButton = new JButton(Bundle.getMessage("AddLoad")); 048 JButton deleteLoadButton = new JButton(Bundle.getMessage("DeleteLoad")); 049 JButton deleteAllLoadsButton = new JButton(Bundle.getMessage("DeleteAll")); 050 051 JButton addShipLoadButton = new JButton(Bundle.getMessage("AddLoad")); 052 JButton deleteShipLoadButton = new JButton(Bundle.getMessage("DeleteLoad")); 053 JButton deleteAllShipLoadsButton = new JButton(Bundle.getMessage("DeleteAll")); 054 055 // check boxes 056 JCheckBox loadAndTypeCheckBox = new JCheckBox(Bundle.getMessage("TypeAndLoad")); 057 JCheckBox shipLoadAndTypeCheckBox = new JCheckBox(Bundle.getMessage("TypeAndLoad")); 058 JCheckBox holdCars = new JCheckBox(Bundle.getMessage("HoldCarsWithCustomLoads")); 059 JCheckBox disableloadChange = new JCheckBox(Bundle.getMessage("DisableLoadChange")); 060 061 // radio buttons 062 JRadioButton loadNameAll = new JRadioButton(Bundle.getMessage("AcceptAll")); 063 JRadioButton loadNameInclude = new JRadioButton(Bundle.getMessage("AcceptOnly")); 064 JRadioButton loadNameExclude = new JRadioButton(Bundle.getMessage("Exclude")); 065 066 JRadioButton shipLoadNameAll = new JRadioButton(Bundle.getMessage("ShipsAllLoads")); 067 JRadioButton shipLoadNameInclude = new JRadioButton(Bundle.getMessage("ShipOnly")); 068 JRadioButton shipLoadNameExclude = new JRadioButton(Bundle.getMessage("Exclude")); 069 070 // combo box 071 JComboBox<String> comboBoxLoads = InstanceManager.getDefault(CarLoads.class).getComboBox(null); 072 JComboBox<String> comboBoxShipLoads = InstanceManager.getDefault(CarLoads.class).getComboBox(null); 073 JComboBox<String> comboBoxTypes = InstanceManager.getDefault(CarTypes.class).getComboBox(); 074 JComboBox<String> comboBoxShipTypes = InstanceManager.getDefault(CarTypes.class).getComboBox(); 075 076 // labels 077 JLabel trackName = new JLabel(); 078 079 public static final String DISPOSE = "dispose"; // NOI18N 080 public static final int MAX_NAME_LENGTH = Control.max_len_string_track_name; 081 082 public TrackLoadEditFrame() { 083 super(Bundle.getMessage("TitleEditTrackLoads")); 084 } 085 086 public void initComponents(Location location, Track track) { 087 _location = location; 088 _track = track; 089 090 // property changes 091 _location.addPropertyChangeListener(this); 092 // listen for car load name and type changes 093 InstanceManager.getDefault(CarLoads.class).addPropertyChangeListener(this); 094 InstanceManager.getDefault(CarTypes.class).addPropertyChangeListener(this); 095 096 // the following code sets the frame's initial state 097 getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS)); 098 099 // Set up the panels 100 // Layout the panel by rows 101 // row 1 102 JPanel p1 = new JPanel(); 103 p1.setLayout(new BoxLayout(p1, BoxLayout.X_AXIS)); 104 p1.setMaximumSize(new Dimension(2000, 250)); 105 106 // row 1a 107 JPanel pTrackName = new JPanel(); 108 pTrackName.setLayout(new GridBagLayout()); 109 pTrackName.setBorder(BorderFactory.createTitledBorder(Bundle.getMessage("Track"))); 110 addItem(pTrackName, trackName, 0, 0); 111 112 // row 1b 113 JPanel pLocationName = new JPanel(); 114 pLocationName.setLayout(new GridBagLayout()); 115 pLocationName.setBorder(BorderFactory.createTitledBorder(Bundle.getMessage("Location"))); 116 addItem(pLocationName, new JLabel(_location.getName()), 0, 0); 117 118 p1.add(pTrackName); 119 p1.add(pLocationName); 120 121 // row 3 122 JPanel p3 = new JPanel(); 123 p3.setLayout(new BoxLayout(p3, BoxLayout.Y_AXIS)); 124 JScrollPane pane3 = new JScrollPane(p3); 125 pane3.setBorder(BorderFactory.createTitledBorder(Bundle.getMessage("LoadsTrack"))); 126 pane3.setMaximumSize(new Dimension(2000, 400)); 127 128 JPanel pLoadRadioButtons = new JPanel(); 129 pLoadRadioButtons.setLayout(new FlowLayout()); 130 131 pLoadRadioButtons.add(loadNameAll); 132 pLoadRadioButtons.add(loadNameInclude); 133 pLoadRadioButtons.add(loadNameExclude); 134 pLoadRadioButtons.add(loadAndTypeCheckBox); 135 136 pLoadControls.setLayout(new FlowLayout()); 137 138 pLoadControls.add(comboBoxTypes); 139 pLoadControls.add(comboBoxLoads); 140 pLoadControls.add(addLoadButton); 141 pLoadControls.add(deleteLoadButton); 142 pLoadControls.add(deleteAllLoadsButton); 143 144 pLoadControls.setVisible(false); 145 146 p3.add(pLoadRadioButtons); 147 p3.add(pLoadControls); 148 149 // row 4 150 panelLoads.setLayout(new GridBagLayout()); 151 paneLoads.setBorder(BorderFactory.createTitledBorder(Bundle.getMessage("Loads"))); 152 153 ButtonGroup loadGroup = new ButtonGroup(); 154 loadGroup.add(loadNameAll); 155 loadGroup.add(loadNameInclude); 156 loadGroup.add(loadNameExclude); 157 158 // row 6 159 JPanel p6 = new JPanel(); 160 p6.setLayout(new BoxLayout(p6, BoxLayout.Y_AXIS)); 161 paneShipLoadControls = new JScrollPane(p6); 162 paneShipLoadControls.setBorder(BorderFactory.createTitledBorder(Bundle.getMessage("ShipLoadsTrack"))); 163 paneShipLoadControls.setMaximumSize(new Dimension(2000, 400)); 164 165 JPanel pShipLoadRadioButtons = new JPanel(); 166 pShipLoadRadioButtons.setLayout(new FlowLayout()); 167 168 pShipLoadRadioButtons.add(shipLoadNameAll); 169 pShipLoadRadioButtons.add(shipLoadNameInclude); 170 pShipLoadRadioButtons.add(shipLoadNameExclude); 171 pShipLoadRadioButtons.add(shipLoadAndTypeCheckBox); 172 173 pShipLoadControls.setLayout(new FlowLayout()); 174 175 pShipLoadControls.add(comboBoxShipTypes); 176 pShipLoadControls.add(comboBoxShipLoads); 177 pShipLoadControls.add(addShipLoadButton); 178 pShipLoadControls.add(deleteShipLoadButton); 179 pShipLoadControls.add(deleteAllShipLoadsButton); 180 181 pShipLoadControls.setVisible(false); 182 183 p6.add(pShipLoadRadioButtons); 184 p6.add(pShipLoadControls); 185 186 // row 7 187 panelShipLoads.setLayout(new GridBagLayout()); 188 paneShipLoads.setBorder(BorderFactory.createTitledBorder(Bundle.getMessage("Loads"))); 189 190 ButtonGroup shipLoadGroup = new ButtonGroup(); 191 shipLoadGroup.add(shipLoadNameAll); 192 shipLoadGroup.add(shipLoadNameInclude); 193 shipLoadGroup.add(shipLoadNameExclude); 194 195 JPanel pOptions = new JPanel(); 196 pOptions.setLayout(new GridBagLayout()); 197 pOptions.setBorder(BorderFactory.createTitledBorder(Bundle.getMessage("Options"))); 198 pOptions.setMaximumSize(new Dimension(2000, 400)); 199 addItem(pOptions, holdCars, 0, 0); 200 addItem(pOptions, disableloadChange, 1, 0); 201 holdCars.setToolTipText(Bundle.getMessage("HoldCarsWithCustomLoadsTip")); 202 disableloadChange.setToolTipText(Bundle.getMessage("DisableLoadChangeTip")); 203 204 // row 12 205 JPanel panelButtons = new JPanel(); 206 panelButtons.setLayout(new GridBagLayout()); 207 panelButtons.setBorder(BorderFactory.createTitledBorder("")); 208 panelButtons.setMaximumSize(new Dimension(2000, 200)); 209 210 // row 13 211 addItem(panelButtons, saveButton, 0, 0); 212 213 getContentPane().add(p1); 214 getContentPane().add(pane3); 215 getContentPane().add(paneLoads); 216 getContentPane().add(paneShipLoadControls); 217 getContentPane().add(paneShipLoads); 218 getContentPane().add(pOptions); 219 getContentPane().add(panelButtons); 220 221 // setup buttons 222 addButtonAction(saveButton); 223 224 addButtonAction(deleteLoadButton); 225 addButtonAction(deleteAllLoadsButton); 226 addButtonAction(addLoadButton); 227 228 addButtonAction(deleteShipLoadButton); 229 addButtonAction(deleteAllShipLoadsButton); 230 addButtonAction(addShipLoadButton); 231 232 addRadioButtonAction(loadNameAll); 233 addRadioButtonAction(loadNameInclude); 234 addRadioButtonAction(loadNameExclude); 235 236 addRadioButtonAction(shipLoadNameAll); 237 addRadioButtonAction(shipLoadNameInclude); 238 addRadioButtonAction(shipLoadNameExclude); 239 240 addComboBoxAction(comboBoxTypes); 241 addComboBoxAction(comboBoxShipTypes); 242 243 paneShipLoadControls.setVisible(false); 244 paneShipLoads.setVisible(false); 245 pOptions.setVisible(false); 246 247 // load fields and enable buttons 248 if (_track != null) { 249 _track.addPropertyChangeListener(this); 250 trackName.setText(_track.getName()); 251 // only show ship loads for staging tracks 252 paneShipLoadControls.setVisible(_track.isStaging()); 253 paneShipLoads.setVisible(_track.isStaging()); 254 pOptions.setVisible(_track.isSpur()); 255 holdCars.setEnabled(_track.getSchedule() != null && _track.getAlternateTrack() != null); 256 holdCars.setSelected(_track.isHoldCarsWithCustomLoadsEnabled()); 257 disableloadChange.setSelected(_track.isDisableLoadChangeEnabled()); 258 updateButtons(true); 259 } else { 260 updateButtons(false); 261 } 262 263 updateTypeComboBoxes(); 264 updateLoadComboBoxes(); 265 updateLoadNames(); 266 updateShipLoadNames(); 267 268 loadAndTypeCheckBox.setSelected(loadAndType); 269 shipLoadAndTypeCheckBox.setSelected(shipLoadAndType); 270 271 // add help menu to window 272 addHelpMenu("package.jmri.jmrit.operations.Operations_LoadOptions", true); // NOI18N 273 274 initMinimumSize(new Dimension(Control.panelWidth600, Control.panelHeight400)); 275 } 276 277 // Save, Delete, Add 278 @Override 279 public void buttonActionPerformed(java.awt.event.ActionEvent ae) { 280 if (_track == null) { 281 return; 282 } 283 if (ae.getSource() == saveButton) { 284 log.debug("track save button activated"); 285 save(); 286 if (Setup.isCloseWindowOnSaveEnabled()) { 287 dispose(); 288 } 289 } 290 if (ae.getSource() == addLoadButton) { 291 String loadName = (String) comboBoxLoads.getSelectedItem(); 292 if (loadAndTypeCheckBox.isSelected()) { 293 loadName = comboBoxTypes.getSelectedItem() + CarLoad.SPLIT_CHAR + loadName; 294 } 295 _track.addLoadName(loadName); 296 selectNextItemComboBox(comboBoxLoads); 297 } 298 if (ae.getSource() == deleteLoadButton) { 299 String loadName = (String) comboBoxLoads.getSelectedItem(); 300 if (loadAndTypeCheckBox.isSelected()) { 301 loadName = comboBoxTypes.getSelectedItem() + CarLoad.SPLIT_CHAR + loadName; 302 } 303 _track.deleteLoadName(loadName); 304 selectNextItemComboBox(comboBoxLoads); 305 } 306 if (ae.getSource() == deleteAllLoadsButton) { 307 deleteAllLoads(); 308 } 309 if (ae.getSource() == addShipLoadButton) { 310 String loadName = (String) comboBoxShipLoads.getSelectedItem(); 311 if (shipLoadAndTypeCheckBox.isSelected()) { 312 loadName = comboBoxShipTypes.getSelectedItem() + CarLoad.SPLIT_CHAR + loadName; 313 } 314 _track.addShipLoadName(loadName); 315 selectNextItemComboBox(comboBoxShipLoads); 316 } 317 if (ae.getSource() == deleteShipLoadButton) { 318 String loadName = (String) comboBoxShipLoads.getSelectedItem(); 319 if (shipLoadAndTypeCheckBox.isSelected()) { 320 loadName = comboBoxShipTypes.getSelectedItem() + CarLoad.SPLIT_CHAR + loadName; 321 } 322 _track.deleteShipLoadName(loadName); 323 selectNextItemComboBox(comboBoxShipLoads); 324 } 325 if (ae.getSource() == deleteAllShipLoadsButton) { 326 deleteAllShipLoads(); 327 } 328 } 329 330 @SuppressFBWarnings(value = "ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD", justification = "GUI ease of use") 331 protected void save() { 332 checkForErrors(); 333 _track.setHoldCarsWithCustomLoadsEnabled(holdCars.isSelected()); 334 _track.setDisableLoadChangeEnabled(disableloadChange.isSelected()); 335 // save the last state of the "Use car type and load" checkbox 336 loadAndType = loadAndTypeCheckBox.isSelected(); 337 shipLoadAndType = shipLoadAndTypeCheckBox.isSelected(); 338 // save location file 339 OperationsXml.save(); 340 } 341 342 protected void updateButtons(boolean enabled) { 343 saveButton.setEnabled(enabled); 344 345 loadNameAll.setEnabled(enabled); 346 loadNameInclude.setEnabled(enabled); 347 loadNameExclude.setEnabled(enabled); 348 loadAndTypeCheckBox.setEnabled(enabled); 349 350 // enable ship options if any of the three generate loads from staging is selected 351 // or if there are any ship load restrictions for this track 352 boolean en = enabled 353 && (_track.isAddCustomLoadsAnyStagingTrackEnabled() || _track.isAddCustomLoadsAnySpurEnabled() || _track 354 .isAddCustomLoadsEnabled() || !_track.getShipLoadOption().equals(Track.ALL_LOADS)); 355 356 shipLoadNameAll.setEnabled(en); 357 shipLoadNameInclude.setEnabled(en); 358 shipLoadNameExclude.setEnabled(en); 359 shipLoadAndTypeCheckBox.setEnabled(en); 360 361 addShipLoadButton.setEnabled(en); 362 deleteShipLoadButton.setEnabled(en); 363 deleteAllShipLoadsButton.setEnabled(en); 364 365 comboBoxShipLoads.setEnabled(en); 366 comboBoxShipTypes.setEnabled(en); 367 } 368 369 @Override 370 public void radioButtonActionPerformed(java.awt.event.ActionEvent ae) { 371 log.debug("radio button activated"); 372 if (ae.getSource() == loadNameAll) { 373 _track.setLoadOption(Track.ALL_LOADS); 374 } 375 if (ae.getSource() == loadNameInclude) { 376 _track.setLoadOption(Track.INCLUDE_LOADS); 377 } 378 if (ae.getSource() == loadNameExclude) { 379 _track.setLoadOption(Track.EXCLUDE_LOADS); 380 } 381 if (ae.getSource() == shipLoadNameAll) { 382 _track.setShipLoadOption(Track.ALL_LOADS); 383 } 384 if (ae.getSource() == shipLoadNameInclude) { 385 _track.setShipLoadOption(Track.INCLUDE_LOADS); 386 } 387 if (ae.getSource() == shipLoadNameExclude) { 388 _track.setShipLoadOption(Track.EXCLUDE_LOADS); 389 } 390 } 391 392 // Car type combo box has been changed, show loads associated with this car type 393 @Override 394 public void comboBoxActionPerformed(java.awt.event.ActionEvent ae) { 395 updateLoadComboBoxes(); 396 } 397 398 private void updateLoadComboBoxes() { 399 String carType = (String) comboBoxTypes.getSelectedItem(); 400 InstanceManager.getDefault(CarLoads.class).updateComboBox(carType, comboBoxLoads); 401 carType = (String) comboBoxShipTypes.getSelectedItem(); 402 InstanceManager.getDefault(CarLoads.class).updateComboBox(carType, comboBoxShipLoads); 403 } 404 405 private void updateLoadNames() { 406 log.debug("Update load names"); 407 panelLoads.removeAll(); 408 if (_track != null) { 409 // set radio button 410 loadNameAll.setSelected(_track.getLoadOption().equals(Track.ALL_LOADS)); 411 loadNameInclude.setSelected(_track.getLoadOption().equals(Track.INCLUDE_LOADS)); 412 loadNameExclude.setSelected(_track.getLoadOption().equals(Track.EXCLUDE_LOADS)); 413 414 pLoadControls.setVisible(!loadNameAll.isSelected()); 415 416 if (!loadNameAll.isSelected()) { 417 int x = 0; 418 int y = 0; // vertical position in panel 419 420 int numberOfLoads = getNumberOfCheckboxesPerLine() / 2 + 1; 421 for (String loadName : _track.getLoadNames()) { 422 JLabel load = new JLabel(); 423 load.setText(loadName); 424 addItemTop(panelLoads, load, x++, y); 425 // limit the number of loads per line 426 if (x > numberOfLoads) { 427 y++; 428 x = 0; 429 } 430 } 431 revalidate(); 432 } 433 } else { 434 loadNameAll.setSelected(true); 435 } 436 panelLoads.repaint(); 437 panelLoads.revalidate(); 438 } 439 440 private void updateShipLoadNames() { 441 log.debug("Update ship load names"); 442 panelShipLoads.removeAll(); 443 if (_track != null) { 444 // set radio button 445 shipLoadNameAll.setSelected(_track.getShipLoadOption().equals(Track.ALL_LOADS)); 446 shipLoadNameInclude.setSelected(_track.getShipLoadOption().equals(Track.INCLUDE_LOADS)); 447 shipLoadNameExclude.setSelected(_track.getShipLoadOption().equals(Track.EXCLUDE_LOADS)); 448 449 pShipLoadControls.setVisible(!shipLoadNameAll.isSelected()); 450 451 if (!shipLoadNameAll.isSelected()) { 452 int x = 0; 453 int y = 0; // vertical position in panel 454 455 int numberOfLoads = getNumberOfCheckboxesPerLine() / 2 + 1; 456 for (String loadName : _track.getShipLoadNames()) { 457 JLabel load = new JLabel(); 458 load.setText(loadName); 459 addItemTop(panelShipLoads, load, x++, y); 460 // limit the number of loads per line 461 if (x > numberOfLoads) { 462 y++; 463 x = 0; 464 } 465 } 466 revalidate(); 467 } 468 } else { 469 shipLoadNameAll.setSelected(true); 470 } 471 panelShipLoads.repaint(); 472 panelShipLoads.revalidate(); 473 } 474 475 private void deleteAllLoads() { 476 if (_track != null) { 477 for (String loadName : _track.getLoadNames()) { 478 _track.deleteLoadName(loadName); 479 } 480 } 481 } 482 483 private void deleteAllShipLoads() { 484 if (_track != null) { 485 for (String loadName : _track.getShipLoadNames()) { 486 _track.deleteShipLoadName(loadName); 487 } 488 } 489 } 490 491 private void updateTypeComboBoxes() { 492 InstanceManager.getDefault(CarTypes.class).updateComboBox(comboBoxTypes); 493 // remove car types not serviced by this location and track 494 for (int i = comboBoxTypes.getItemCount() - 1; i >= 0; i--) { 495 String type = comboBoxTypes.getItemAt(i); 496 if (_track != null && !_track.isTypeNameAccepted(type)) { 497 comboBoxTypes.removeItem(type); 498 } 499 } 500 InstanceManager.getDefault(CarTypes.class).updateComboBox(comboBoxShipTypes); 501 // remove car types not serviced by this location and track 502 for (int i = comboBoxShipTypes.getItemCount() - 1; i >= 0; i--) { 503 String type = comboBoxShipTypes.getItemAt(i); 504 if (_track != null && !_track.isTypeNameAccepted(type)) { 505 comboBoxShipTypes.removeItem(type); 506 } 507 } 508 } 509 510 private void checkForErrors() { 511 if (_track.getLoadOption().equals(Track.INCLUDE_LOADS) && _track.getLoadNames().length == 0 512 || _track.getShipLoadOption().equals(Track.INCLUDE_LOADS) && _track.getShipLoadNames().length == 0) { 513 JmriJOptionPane.showMessageDialog(this, Bundle.getMessage("ErrorNeedLoads"), Bundle.getMessage("ErrorNoLoads"), 514 JmriJOptionPane.ERROR_MESSAGE); 515 } 516 } 517 518 @Override 519 public void dispose() { 520 if (_track != null) { 521 _track.removePropertyChangeListener(this); 522 } 523 _location.removePropertyChangeListener(this); 524 InstanceManager.getDefault(CarLoads.class).removePropertyChangeListener(this); 525 InstanceManager.getDefault(CarTypes.class).removePropertyChangeListener(this); 526 super.dispose(); 527 } 528 529 @Override 530 public void propertyChange(java.beans.PropertyChangeEvent e) { 531 if (Control.SHOW_PROPERTY) { 532 log.debug("Property change ({}) old: ({}) new: ({})", e.getPropertyName(), e.getOldValue(), e.getNewValue()); // NOI18N 533 } 534 if (e.getPropertyName().equals(Location.TYPES_CHANGED_PROPERTY) 535 || e.getPropertyName().equals(CarTypes.CARTYPES_CHANGED_PROPERTY) 536 || e.getPropertyName().equals(Track.TYPES_CHANGED_PROPERTY)) { 537 updateTypeComboBoxes(); 538 } 539 if (e.getPropertyName().equals(CarLoads.LOAD_NAME_CHANGED_PROPERTY) 540 || e.getPropertyName().equals(CarLoads.LOAD_CHANGED_PROPERTY)) { 541 updateLoadComboBoxes(); 542 updateLoadNames(); 543 updateShipLoadNames(); 544 } 545 if (e.getPropertyName().equals(Track.LOADS_CHANGED_PROPERTY)) { 546 updateLoadNames(); 547 updateShipLoadNames(); 548 } 549 if (_track != null) { 550 if (e.getPropertyName().equals(Track.LOAD_OPTIONS_CHANGED_PROPERTY)) { 551 updateButtons(true); 552 } 553 if (e.getPropertyName().equals(Track.HOLD_CARS_CHANGED_PROPERTY)) { 554 holdCars.setSelected(_track.isHoldCarsWithCustomLoadsEnabled()); 555 } 556 if (e.getPropertyName().equals(Track.ALTERNATE_TRACK_CHANGED_PROPERTY) || 557 e.getPropertyName().equals(Track.SCHEDULE_ID_CHANGED_PROPERTY)) { 558 holdCars.setEnabled(_track.getSchedule() != null && _track.getAlternateTrack() != null); 559 } 560 if (e.getPropertyName().equals(Track.LOAD_OPTIONS_CHANGED_PROPERTY)) { 561 disableloadChange.setSelected(_track.isDisableLoadChangeEnabled()); 562 } 563 } 564 } 565 566 private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(TrackLoadEditFrame.class); 567}