Example #1
0
  /** Start with a locomotive selected, so we're opening an existing RosterEntry. */
  protected void openKnownLoco() {

    if (locoBox.getSelectedRosterEntries().length != 0) {
      RosterEntry re = locoBox.getSelectedRosterEntries()[0];
      if (log.isDebugEnabled()) {
        log.debug("loco file: " + re.getFileName());
      }

      startProgrammer(null, re, (String) programmerBox.getSelectedItem());
    } else {
      log.error("No roster entry was selected to open.");
    }
  }
Example #2
0
 /** handle pushing the open programmer button by finding names, then calling a template method */
 protected void openButton() {
   // figure out which we're dealing with
   if (locoBox.getSelectedRosterEntries().length != 0) {
     // known loco
     openKnownLoco();
   } else if (isDecoderSelected()) {
     // new loco
     openNewLoco();
   } else {
     // should not happen, as the button should be disabled!
     log.error("openButton with neither combobox nonzero");
   }
 }