コード例 #1
0
 // Determines if all car checkboxes are selected. Disables the Set button if
 // all checkbox are selected.
 protected void check() {
   Enumeration<JCheckBox> en = checkBoxes.elements();
   while (en.hasMoreElements()) {
     JCheckBox checkBox = en.nextElement();
     if (!checkBox.isSelected()) {
       // log.debug("Checkbox (" + checkBox.getText() + ") isn't selected ");
       moveButton.setEnabled(false);
       setButton.setEnabled(true);
       return;
     }
   }
   // all selected, work done!
   moveButton.setEnabled(_train != null && _train.isBuilt());
   setButton.setEnabled(false);
   isSetMode = false;
   setButtonText();
 }
コード例 #2
0
  protected void initialize() {
    removePropertyChangeListerners();
    pPickupLocos.removeAll();
    pSetoutLocos.removeAll();
    pPickups.removeAll();
    pSetouts.removeAll();
    pMoves.removeAll();

    // turn everything off and re-enable if needed
    pWorkPanes.setVisible(false);
    pickupPane.setVisible(false);
    setoutPane.setVisible(false);
    locoPane.setVisible(false);
    pPickupLocos.setVisible(false);
    pSetoutLocos.setVisible(false);
    movePane.setVisible(false);

    textTrainRouteLocationCommentPane.setVisible(false);

    setButtonText();
  }