/*.................................................................................................................*/
 public Object doCommand(String commandName, String arguments, CommandChecker checker) {
   if (checker.compare(
       this.getClass(),
       "Sets the number of trees included in each tree block",
       "[number of trees]",
       commandName,
       "setNumberTrees")) {
     MesquiteInteger pos = new MesquiteInteger(0);
     int newNum = MesquiteInteger.fromFirstToken(arguments, pos);
     if (!MesquiteInteger.isCombinable(newNum))
       newNum =
           MesquiteInteger.queryInteger(
               containerOfModule(),
               "Set Number of Trees",
               "Number of Trees:",
               numTrees,
               0,
               MesquiteInteger.infinite);
     if (newNum > 0 && newNum != numTrees) {
       numTrees = newNum;
       parametersChanged();
     }
   } else if (checker.compare(
       this.getClass(),
       "Returns the module supplying trees",
       "[name of module]",
       commandName,
       "getTreeFiller")) {
     return fillerTask;
   } else return super.doCommand(commandName, arguments, checker);
   return null;
 }
Ejemplo n.º 2
0
 /*.................................................................................................................*/
 public Object doCommand(String commandName, String arguments, CommandChecker checker) {
   if (checker.compare(
       this.getClass(),
       "Sets the number of trees included in each tree block",
       "[number of trees]",
       commandName,
       "setNumberTrees")) {
     MesquiteInteger pos = new MesquiteInteger(0);
     int newNum = MesquiteInteger.fromFirstToken(arguments, pos);
     if (!MesquiteInteger.isCombinable(newNum))
       newNum =
           MesquiteInteger.queryInteger(
               containerOfModule(),
               "Set Number of Trees",
               "Number of Trees:",
               numTrees,
               0,
               MesquiteInteger.infinite);
     if (newNum > 0 && newNum != numTrees) {
       numTrees = newNum;
       parametersChanged();
     }
   } else if (checker.compare(
       this.getClass(),
       "Sets the module supplying trees",
       "[name of module]",
       commandName,
       "setTreeFiller")) {
     TreeBlockFiller temp =
         (TreeBlockFiller)
             replaceEmployee(
                 TreeBlockFiller.class, arguments, "Source of trees for tree blocks", fillerTask);
     if (temp != null) {
       fillerTask = temp;
       initialize(preferredTaxa);
       parametersChanged(); // ?
     }
     return temp;
   } else return super.doCommand(commandName, arguments, checker);
   return null;
 }