Ejemplo n.º 1
0
  /**
   * Gets background color for cell for row ic. Override it if you want to change the color from the
   * default.
   */
  public Color getBackgroundColorOfCell(int it, boolean selected) {
    if (observedStates == null) {
      doCalcs();
      if (observedStates == null) return null;
    }
    if (observedStates.getParentData() != null) {
      captureCharacterDataFromObservedStates();

      Associable tInfo = data.getTaxaInfo(false);
      NameReference genBankColor = NameReference.getNameReference("genbankcolor");
      Object obj = tInfo.getAssociatedObject(genBankColor, it); // not saved to file
      if (obj instanceof Color) return (Color) obj;
    }
    if (bits == null || it < 0 || it > bits.getSize()) return null;
    String note = getNote(it);
    if (selected) {
      if (bits.isBitOn(it)) return ColorDistribution.darkGreen;
      else return ColorDistribution.darkRed;
    } else if (bits.isBitOn(it)) {
      if (StringUtil.blank(note)) return ColorDistribution.veryLightGreen;
      if (!(note.equalsIgnoreCase("x"))) return ColorDistribution.lightGreenYellowish;
      return ColorDistribution.lightGreenYellow;
    } else {
      if (StringUtil.blank(note)) return ColorDistribution.brown;
      if (!(note.equalsIgnoreCase("x"))) {
        return Color.red;
      }
      return ColorDistribution.lightRed;
    }
  }
Ejemplo n.º 2
0
  public String getExplanationForRow(int ic) {
    if (observedStates != null && observedStates.getParentData() != null) {
      captureCharacterDataFromObservedStates();

      Associable tInfo = data.getTaxaInfo(false);
      if (tInfo == null) return null;
      return "Notes: " + tInfo.toString(ic);
    }
    return null;
  }
Ejemplo n.º 3
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();
  }
Ejemplo n.º 4
0
  public void doCalcs() {
    if (bits != null) bits.clearAllBits();
    if (taxa == null) return;
    if (bits == null) bits = new Bits(taxa.getNumTaxa());
    else bits.resetSize(taxa.getNumTaxa());
    if (observedStates == null) {
      tInfo = null;
      observedStates = matrixSourceTask.getCurrentMatrix(taxa);
      if (observedStates != null) {
        captureCharacterDataFromObservedStates();

        if (data != null) tInfo = data.getTaxaInfo(true);
      }
    }
    if (observedStates == null) return;
    for (int it = 0; it < taxa.getNumTaxa(); it++) {
      if (hasData(it)) bits.setBit(it);
    }
  }