コード例 #1
0
 // Set up the substance selector box
 private void setUpList() {
   List s = system.getSubstances();
   for (Object o : s) {
     Substance sub = (Substance) o;
     substanceBoxModel.addElement(sub.getName());
   }
 }
コード例 #2
0
 // Sets the substance field to whatever substance is selected by the combo
 // box
 private void setSubstance() {
   String name = (String) substanceSelector.getSelectedItem();
   substance = (Substance) system.getEntity(name);
   if (metric != null) {
     metric.setSubstance(substance);
   }
   updateTarget();
 }