/** Called to operate on the CharacterData blocks. Returns true if taxa altered */
  public boolean operateOnDatas(ListableVector datas, MesquiteTable table) {
    boolean anyExcluded = false;
    for (int im = 0; im < datas.size(); im++) {
      CharacterData data = (CharacterData) datas.elementAt(im);
      if (data.numCharsCurrentlyIncluded() < data.getNumChars()) anyExcluded = true;
    }
    if (anyExcluded) queryOptions();
    if (getProject() != null) getProject().incrementProjectWindowSuppression();
    for (int im = 0; im < datas.size(); im++) {
      CharacterData data = (CharacterData) datas.elementAt(im);
      CharacterData starter = data.makeCharacterData(data.getMatrixManager(), data.getTaxa());

      starter.addToFile(
          getProject().getHomeFile(), getProject(), findElementManager(CharacterData.class));

      boolean success =
          starter.concatenate(data, false, duplicateExcludedCharacters, false, false, false, false);
      if (success) {
        starter.setName(datas.getUniqueName(data.getName() + " (duplicate)"));
      }
    }
    if (getProject() != null) getProject().decrementProjectWindowSuppression();
    resetAllMenuBars();
    return true;
  }
예제 #2
0
  /*.................................................................................................................*/
  void zapData(CharacterData data, int it) {
    Taxa taxa = data.getTaxa();
    if (it < 0 || it >= taxa.getNumTaxa()) return;
    Associable tInfo = data.getTaxaInfo(false);
    int myColumn = -1;
    if (getEmployer() instanceof ListModule) {

      myColumn = ((ListModule) getEmployer()).getMyColumn(this);
    }
    if (tInfo != null) tInfo.deassignAssociated(it);
    for (int ic = 0; ic < data.getNumChars(); ic++) data.deassign(ic, it);

    data.notifyListeners(this, new Notification(MesquiteListener.DATA_CHANGED));
    outputInvalid();
    parametersChanged();
  }