public DoseObjectiveEditor(
     JFrame jf, ParameterSearchDoseResponseEditor e, TargetDoseObjective tdo) {
   this(jf, e);
   metric = tdo.getMetric();
   substance = metric.getSubstance();
   substanceSelector.setSelectedItem(substance.getName());
   objective = tdo.getObjective();
   weightField.setText((new Double(tdo.getWeight())).toString());
   updateTarget();
 }
 private void updateTarget() {
   if (substance == null) {
     return;
   }
   if (metric == null) {
     targetObjective = null;
     return;
   }
   if (objective == null) {
     targetObjective = null;
     return;
   }
   double weight = Double.parseDouble(weightField.getText());
   if (weight <= 0) {
     targetObjective = null;
     return;
   }
   targetObjective = new TargetDoseObjective(metric, objective, weight);
   textField.setText(targetObjective.toString());
 }