コード例 #1
0
  public static boolean processNoContigAceFiles(CharacterData data, MesquiteModule ownerModule) {
    DNAData editedData = ChromaseqUtil.getEditedData(data);
    if (editedData == null) return false;
    boolean changed = false;
    MesquiteFile file = data.getProject().getHomeFile();
    int count = 0;
    int originalChars = editedData.getNumChars();
    for (int it = 0; it < editedData.getNumTaxa(); it++)
      if (ChromaseqUtil.reprocessContig(editedData, it)) {
        AceDirectoryProcessor aceDirProcessor = new AceDirectoryProcessor();
        aceDirProcessor.reprocessAceFileDirectory(file, ownerModule, editedData, it);
        count++;
      }
    if (count > 0) {
      editedData.getTaxa().notifyListeners(ownerModule, new Notification(ownerModule.PARTS_ADDED));
      MesquiteMessage.discreetNotifyUser(
          "Some of the contigs have been reprocessed; this will be lost permanently unless you resave the file.");
      changed = true;
    }
    if (originalChars < editedData.getNumChars())
      editedData.notifyListeners(ownerModule, new Notification(ownerModule.PARTS_ADDED));
    else if (originalChars > editedData.getNumChars())
      editedData.notifyListeners(ownerModule, new Notification(ownerModule.PARTS_DELETED));

    ChromaseqUtil.removeAssociatedObjects(editedData, ChromaseqUtil.reprocessContigRef);
    return changed;
  }
コード例 #2
0
 /*.................................................................................................................*/
 boolean checkUsernamePassword(boolean tellUserAboutCipres) {
   if (StringUtil.blank(username) || StringUtil.blank(password)) {
     MesquiteBoolean answer = new MesquiteBoolean(false);
     MesquiteString usernameString = new MesquiteString();
     if (username != null) usernameString.setValue(username);
     MesquiteString passwordString = new MesquiteString();
     if (password != null) passwordString.setValue(password);
     String help =
         "You will need an account on the CIPRes REST system to use this service.  To register, go to https://www.phylo.org/restusers/register.action";
     new UserNamePasswordDialog(
         ownerModule.containerOfModule(),
         "Sign in to CIPRes",
         help,
         "",
         "Username",
         "Password",
         answer,
         usernameString,
         passwordString);
     if (answer.getValue()) {
       username = usernameString.getValue();
       password = passwordString.getValue();
     }
     ownerModule.storePreferences();
   }
   boolean success = StringUtil.notEmpty(username) && StringUtil.notEmpty(password);
   if (!success && tellUserAboutCipres) {
     MesquiteMessage.discreetNotifyUser(
         "Use of the CIPRes service requires an account with CIPRes's REST service.  Go to https://www.phylo.org/restusers/register.action to register for an account");
   }
   return success;
 }