⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 parseacd.java

📁 emboss的linux版本的源代码
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
  */  private void setGuiHandleNumber(String dataType, ApplicationFields appF)  {    if ( dataType.startsWith("datafile") || dataType.startsWith("featout") ||         dataType.startsWith("string")   || dataType.startsWith("seqout")  ||         dataType.startsWith("outfile")  || dataType.startsWith("matrix")  ||         dataType.startsWith("infile")   || dataType.startsWith("regexp")  ||         dataType.startsWith("codon")    || dataType.startsWith("dirlist") )    {      appF.setGuiHandleNumber(ntextf);      ntextf++;    }    else if(dataType.startsWith("pattern"))    {      appF.setGuiHandleNumber(nmultiTextField);      nmultiTextField++;    }    else if (dataType.startsWith("int"))    {      appF.setGuiHandleNumber(nint);      nint++;    }    else if (dataType.startsWith("float"))    {      appF.setGuiHandleNumber(nfloat);      nfloat++;    }    else if (dataType.startsWith("bool"))    {      appF.setGuiHandleNumber(nbool);      nbool++;    }    else if (dataType.startsWith("seqset") ||             dataType.startsWith("seqall") ||             dataType.startsWith("sequence") )    {      appF.setGuiHandleNumber(nseqs);      nseqs++;    }    else if (dataType.startsWith("filelist") )    {      appF.setGuiHandleNumber(nflist);      nflist++;    }    else if (dataType.startsWith("list") || dataType.startsWith("select"))    {      double max = 1.;      if(isMaxParamValue(numofFields))        max = Double.parseDouble(getMaxParam(numofFields));      if(max > 1.0)       // multiple list selection      {        appF.setGuiHandleNumber(mlist);        mlist++;      }      else                // single selection      {        appF.setGuiHandleNumber(nlist);        nlist++;      }    }    else if (dataType.startsWith("range"))    {      appF.setGuiHandleNumber(nrange);      nrange++;    }  }  /**  *  * Gets the double value of a parameter.  * @return 	double value of the parameter.   *  */  public double getParamValueDbl(int field, int param)   {    ApplicationFields aF = (ApplicationFields)vappF.get(field);    return aF.getParamValueDbl(param);  }  /**  *  * Determine if there is a default parameter in a field of the ACD.  * @param  field 	field number  * @return 		true if the default parameter value is a String  *  */  public boolean isDefaultParamValueStr(int field)   {    int num = getNumofParams(field);    int i;    for(i=0;i<num;i++)     {      if (getParameterAttribute(field,i).startsWith("def"))         return isParamValueStr(field,i);    }    return false;  }  /**  *  * Return a double default parameter  * @param  field 	field number  * @return 		default parameter value as a double.  *  */  public double getDefaultParamValueDbl(int field)   {    int num = getNumofParams(field);        ApplicationFields aF = (ApplicationFields)vappF.get(field);    for(int i=0;i<num;i++)     {      if (getParameterAttribute(field,i).startsWith("def"))         return aF.getParamValueDbl(i);    }    return 0.0;  }//  Methods for dealing with dependent variables.   /**  *  * Always start by calling isDependents(), which calculates  * the number of dependents and construct the Dependent array.  *  * @param attr 	String name of the attribute  * @param field 	field number  * @param numofFields	total number of fields    * @return  		true if there are dependent parameters.  *  */  public boolean isDependents(String attr, int field, int numofFields)  {    numOfDependents = 0;    for(int i=field+1;i<numofFields;i++)     {      int num = getNumofParams(i);      for(int j=0;j<num;j++)       {        if(isParamValueStr(i,j))           {          String val = getParamValueStr(i,j);          if(val.startsWith("$") || val.startsWith("@"))             numOfDependents++;        }      }    }    dep = new Dependent[numOfDependents];        numOfDependents = 0;    for(int i=field+1;i<numofFields;i++)     {      int num = getNumofParams(i);      for(int j=0;j<num;j++)       {        if(isParamValueStr(i,j))         {          String val = getParamValueStr(i,j);          if(val.startsWith("$") || val.startsWith("@"))           {            String type = getParameterAttribute(i,j);            dep[numOfDependents] = new Dependent(i,j,val,type);            numOfDependents++;                      }        }       }    }    if(numOfDependents>0)      return true;    else      return false;  }  /**  *  * Gets the dependents associated with the ACD.  * @return 	the Dependent array for those fields  *         	with dependents  *  */  public Dependent[] getDependents()   {    return dep;  }  /**  *  * Gets the number of dependent parameters in the ACD.  * @return 	number of Dependent making up the array  *  */  public int getNumOfDependents()   {    return numOfDependents;  }  /**  *  * Locates the min parameter in a field and returns it as a String.  * @param field	field number  * @return  		minimum value defined in a field.  *  */  public String getMinParam(int field)   {    int num = getNumofParams(field);    String min = "";    for(int i=0;i<num;i++)     {      if (getParameterAttribute(field,i).startsWith("min"))       {        ApplicationFields aF = (ApplicationFields)vappF.get(field);        if(isParamValueStr(field,i))           min = aF.getParamValueStr(i);        else         {          Double val = new Double(aF.getParamValueDbl(i));          if(getParameterAttribute(field,0).startsWith("int"))            min = (new Integer(val.intValue())).toString();                     else            min = val.toString();        }        return min;      }    }       return min;  }  /**  *  * Locates the max parameter in a field and returns it as a String.  * @param field 	field number  * @return  		maximum value defined in a field.  *  */  public String getMaxParam(int field)   {    int num = getNumofParams(field);    String max = "";    for(int i=0;i<num;i++)     {      if (getParameterAttribute(field,i).startsWith("max"))       {        ApplicationFields aF = (ApplicationFields)vappF.get(field);        if(isParamValueStr(field,i))          max = aF.getParamValueStr(i);        else         {          Double val = new Double(aF.getParamValueDbl(i));          if(getParameterAttribute(field,0).startsWith("int"))            max = (new Integer(val.intValue())).toString();          else            max = val.toString();        }        return max;      }    }    return max;  }  /**  *  * Determine if there is a min parameter in a field of the ACD.  * @param field 	field number  * @return  		true if there is a minimum value specified  *          		in a field.  *  */  public boolean isMinParamValue(int field)   {    int num = getNumofParams(field);    for(int i=0;i<num;i++)     {      if (getParameterAttribute(field,i).startsWith("min"))       {        ApplicationFields aF = (ApplicationFields)vappF.get(field);        if(isParamValueStr(field,i) )          if(aF.getParamValueStr(i).startsWith("$"))            return false;        return true;      }    }    return false;  }  /**  *  * Determine if there is a max parameter in a field of the ACD.  * @param field 	field number  * @return  		true if there is a maximum value specified  *          		in a field.  *  */  public boolean isMaxParamValue(int field)   {    int num = getNumofParams(field);    for(int i=0;i<num;i++)     {      if (getParameterAttribute(field,i).startsWith("max"))          {//      if(isParamValueStr(field,i) )//        if(appF[field].getParamValueStr(i).startsWith("$"))//          return false;        return true;      }    }    return false;  }  /**  *  * Finds the prompt, info or help parameter in an ACD field, in that  * order.  * @param field	field number  * @return 		information specified by the prompt parameter, if  *          		present else the information parameter  *          		or the help parameter.  *  */  public String getInfoParamValue(int field)   {    int num = getNumofParams(field);    int i;    ApplicationFields aF = (ApplicationFields)vappF.get(field);    for(i=0;i<num;i++)     {      if (getParameterAttribute(field,i).startsWith("prompt"))         return aF.getParamValueStr(i);    }    for(i=0;i<num;i++)     {      if (getParameterAttribute(field,i).startsWith("info"))         return aF.getParamValueStr(i);    }    for(i=0;i<num;i++)    {      if (getParameterAttribute(field,i).startsWith("help"))        return aF.getParamValueStr(i);    }    return "";  }  /**  *  * Finds the help parameter in an ACD field.  * @param field 	field number  * @return  		help parameter defined in a field or a blank  *          		String if not specified.  *  */  public String getHelpParamValue(int field)   {    int num = getNumofParams(field);    int i;    String help = "";    String helpText = "";    ApplicationFields aF = (ApplicationFields)vappF.get(field);    for(i=0;i<num;i++)       if (getParameterAttribute(field,i).startsWith("help"))         return formatHelpText(aF.getParamValueStr(i));//  for(i=0;i<num;i++) //    if (getParameterAttribute(field,i).startsWith("info")) //      return formatHelpText(appF[field].getParamValueStr(i));        return "";  }  /**  *  * Finds if the program is identifies as being able to  * run in a batch queue  * @return 	true if the program is suitable for putting  *         	in a batch queue   *  */  public boolean isBatchable()  {    int num = getNumofParams(0);    ApplicationFields aF = (ApplicationFields)vappF.get(0);    for(int i=0;i<num;i++)    {      if(getParameterAttribute(0,i).startsWith("batch"))        if(aF.getParamValueStr(i).equalsIgnoreCase("Y") ||           aF.getParamValueStr(i).equalsIgnoreCase("Yes") )             return true;    }    return false;  }  /**  *  * Finds any expected cpu level indicator (low, medium, high)  * @return 	cpu level indicator  *  */  public String getExpectedCPU()  {    String cpu = "";    int num = getNumofParams(0);    ApplicationFields aF = (ApplicationFields)vappF.get(0);    for(int i=0;i<num;i++)    {      if(getParameterAttribute(0,i).startsWith("cpu"))        return aF.getParamValueStr(i);    }    return cpu;  }  /**  *  * Find URL prefix if an embassy application  * @return     url prefix   *  */  public String getUrlPrefix()  {    int num = getNumofParams(0);    ApplicationFields aF = (ApplicationFields)vappF.get(0);    for(int i=0;i<num;i++)    {      if(getParameterAttribute(0,i).startsWith("embassy"))        return aF.getParamValueStr(i);    }    return null;  }  /**  *  * Limits the length of the line for the help text used in  * the tool tips.  *  * @param help	help text  * @return  	formated help text.  *  */  protected String formatHelpText(String help)   {    String helpText = "";    int start = 0;    int stop;    help = help.replace('\n',' ');

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -