/**
  * Sets the accelerator sequence
  *
  * @param accSeq The new accelSeq value
  */
 public void setAccelSeq(AcceleratorSeq accSeq) {
   java.util.List<AcceleratorNode> accNodes = accSeq.getNodesOfType(Electromagnet.s_strType);
   java.util.Iterator<AcceleratorNode> itr = accNodes.iterator();
   while (itr.hasNext()) {
     Electromagnet emg = (Electromagnet) itr.next();
     if (emg.getStatus()) {
       emg.setUseFieldReadback(false);
     }
   }
   ringFoilPosCorr.setAccelSeq(accSeq);
 }
Example #2
0
  /**
   * Checks all the Bean preference editor panels to determine if they are in a state that allows
   * any changes to be committed.
   */
  private boolean canCommit() {
    java.util.Iterator i = mPrefsBeans.iterator();
    boolean can_commit = true;

    while (i.hasNext()) {
      if (!((BeanPreferences) i.next()).canCommit()) {
        can_commit = false;
        break;
      }
    }

    return can_commit;
  }
Example #3
0
  /** Commits changes on all known Bean preference editors. */
  private void commit() {
    java.util.Iterator i = mPrefsBeans.iterator();

    while (i.hasNext()) {
      BeanPreferences bean = (BeanPreferences) i.next();

      try {
        bean.save();
      } catch (java.io.IOException io_ex) {
        JOptionPane.showMessageDialog(
            null,
            "Could not save preferences for " + bean.getEditorName() + ": " + io_ex.getMessage(),
            "I/O Exception on Save",
            JOptionPane.ERROR_MESSAGE);
      }
    }
  }