Ejemplo n.º 1
0
 public void updateOptionSetName(String modelName, String optionSetName, String newName) {
   int setIndex;
   _autoModel = _autoModelGroup.get(modelName);
   if (_autoModel != null) {
     setIndex = _autoModel.findOptionSetIndex(optionSetName);
     if (setIndex != -1) {
       _autoModel.updateOptionSetName(setIndex, newName);
     }
   }
 }
Ejemplo n.º 2
0
 // optionName goes with optionset, optVal is the String property in an option.
 public void updateOptionPrice(
     String modelName, String optionName, String optVal, float newprice) {
   int setIndex;
   _autoModel = _autoModelGroup.get(modelName);
   if (_autoModel != null) {
     setIndex = _autoModel.findOptionSetIndex(optionName);
     if (setIndex != -1) {
       _autoModel.updateOptionPrice(setIndex, optVal, newprice);
     }
   }
 }
Ejemplo n.º 3
0
 // optionName goes with optionset, optVal is the String property in an option.
 public void updateOptionValue(
     String modelName, String optionName, String oldOptVal, String newOptVal) {
   int setIndex;
   _autoModel = _autoModelGroup.get(modelName);
   if (_autoModel != null) {
     setIndex = _autoModel.findOptionSetIndex(optionName);
     if (setIndex != -1) {
       if (_autoModel.updateOptionName(setIndex, oldOptVal, newOptVal))
         System.out.println(newOptVal + " set!");
     }
   }
 }
Ejemplo n.º 4
0
 // a separate path with waits, just in case I forget to remove sleep() for the next lab.
 public void waitUpdateOptionValue(
     String modelName, String optionName, String oldOptVal, String newOptVal) {
   System.out.println(
       "Demonstrating Thread named "
           + Thread.currentThread().getName()
           + " and Setting "
           + oldOptVal
           + " to "
           + newOptVal);
   int setIndex;
   _autoModel = _autoModelGroup.get(modelName);
   if (_autoModel != null) {
     setIndex = _autoModel.findOptionSetIndex(optionName);
     if (setIndex != -1) {
       if (_autoModel.updateOptionName2(setIndex, oldOptVal, newOptVal)) {
         System.out.println(newOptVal + " set and updateOptionName2 exited.");
       } else {
         System.out.println(newOptVal + " NOT set but updateOptionName2 exited.");
       }
     }
   }
   System.out.println(Thread.currentThread().getName() + " done.");
 }