コード例 #1
0
 /*..........................................MContinuousStates................*/
 public int userQueryItem(String message, MesquiteModule module) {
   int numItems = getNumItems();
   String[] items = new String[numItems];
   for (int i = 0; i < items.length; i++) {
     if (StringUtil.blank(getItemName(i))) items[i] = "(unnamed)";
     else items[i] = getItemName(i);
   }
   return ListDialog.queryList(
       module.containerOfModule(), "Select item", message, MesquiteString.helpString, items, 0);
 }
コード例 #2
0
 public PAdjustToolExtra(NodePositionAdjust ownerModule, TreeDisplay treeDisplay) {
   super(ownerModule, treeDisplay);
   selectModule = ownerModule;
   adjustTool =
       new TreeTool(
           this,
           "posadjustor",
           ownerModule.getPath(),
           "adjustPosition.gif",
           7,
           7,
           "Adjust node position",
           "This tool adjusts branch lengths in such a way as to keep the relative positions of nodes constant, except for the node moved.");
   adjustTool.setTouchedCommand(MesquiteModule.makeCommand("touchedPositionAdjust", this));
   adjustTool.setDroppedCommand(MesquiteModule.makeCommand("droppedPositionAdjust", this));
   adjustTool.setDraggedCommand(MesquiteModule.makeCommand("draggedPositionAdjust", this));
   if (ownerModule.containerOfModule() instanceof MesquiteWindow) {
     ((MesquiteWindow) ownerModule.containerOfModule()).addTool(adjustTool);
   }
 }
コード例 #3
0
 /*.................................................................................................................*/
 public void setTableAndTaxa(MesquiteTable table, Taxa taxa) {
   this.table = table;
   this.taxa = taxa;
   if (containerOfModule() instanceof ListWindow && tool == null) {
     String sortExplanation = "Assigns colors to taxa. ";
     tool =
         new TableTool(
             this,
             "sort",
             getPath(),
             "color.gif",
             0,
             0,
             "Color taxon",
             sortExplanation,
             MesquiteModule.makeCommand("paint", this),
             null,
             null);
     tool.setWorksOnRowNames(true);
     ((ListWindow) containerOfModule()).addTool(tool);
     tool.setPopUpOwner(this);
   }
 }
コード例 #4
0
 public String getImagePath() { // TODO: this should use path to standard image
   if (stacked) return MesquiteModule.getRootPath() + "images/miniscrollVert.gif";
   else return MesquiteModule.getRootPath() + "images/miniscrollHoriz.gif";
 }