Пример #1
0
 public void crement(int i) {
   if (MesquiteWindow.getQueryMode(this)) {
     MesquiteWindow.respondToQueryMode("Mini scroll", command, this);
     return;
   }
   if (i <= maxValue && (i >= minValue) && command != null) {
     currentValue = i;
     command.doItMainThread(
         Long.toString(currentValue),
         CommandChecker.getQueryModeString("Mini scroll", command, this),
         this);
     tf.setText(Long.toString(currentValue));
     decrementButton.setEnabled(i > minValue);
     incrementButton.setEnabled(i < maxValue);
   }
 }
Пример #2
0
 public void decrement() {
   if (MesquiteWindow.getQueryMode(this)) {
     MesquiteWindow.respondToQueryMode("Mini scroll", command, this);
     return;
   }
   if (currentValue > minValue && command != null) {
     currentValue--;
     tf.setText(Long.toString(currentValue));
     command.doItMainThread(
         Long.toString(currentValue),
         CommandChecker.getQueryModeString("Mini scroll", command, this),
         this);
     enterButton.setEnabled(false);
     decrementButton.setEnabled(currentValue > minValue);
     incrementButton.setEnabled(currentValue < maxValue);
   }
 }
Пример #3
0
 public void
     increment() { // have interface incrementable and pass object to this miniscroll so it can
   // notify object
   if (MesquiteWindow.getQueryMode(this)) {
     MesquiteWindow.respondToQueryMode("Mini scroll", command, this);
     return;
   }
   if (currentValue < maxValue && command != null) {
     currentValue++;
     command.doItMainThread(
         Long.toString(currentValue),
         CommandChecker.getQueryModeString("Mini scroll", command, this),
         this);
     tf.setText(Long.toString(currentValue));
     enterButton.setEnabled(false);
     decrementButton.setEnabled(currentValue > minValue);
     incrementButton.setEnabled(currentValue < maxValue);
   }
 }
Пример #4
0
  /*.................................................................................................................*/
  public boolean arrowTouchInRow(
      Graphics g, int ic, int x, int y, boolean doubleClick, int modifiers) {
    if (MesquiteEvent.rightClick(modifiers)) {
      MesquitePopup popup = new MesquitePopup(table.getMatrixPanel());

      String copyMenuText = "Copy ";
      if (observedStates != null) {
        CharacterData data = observedStates.getParentData();
        if (data != null) {
          copyMenuText += data.getName() + " Data";
          copyMenuText += " [from " + data.getTaxa().getTaxonName(ic) + "]";
        }
      }
      MesquiteCommand mcCopy = makeCommand("copyData", this);
      mcCopy.setDefaultArguments("" + ic);
      MesquiteCheckMenuItem mCopyItem =
          new MesquiteCheckMenuItem(copyMenuText, this, mcCopy, null, null);
      popup.add(mCopyItem);

      String pasteMenuText = "Paste ";
      if (StringUtil.notEmpty(localCopyDataClipboard) && localCopyData != null) {
        pasteMenuText += localCopyData.getName() + " Data";
        if (StringUtil.notEmpty(localCopyDataTaxon)) {
          pasteMenuText += " [from " + localCopyDataTaxon + "] ";
        }
      }
      MesquiteCommand mcPaste = makeCommand("pasteData", this); // only if something in clipboard
      mcPaste.setDefaultArguments("" + ic);
      MesquiteCheckMenuItem mPasteItem =
          new MesquiteCheckMenuItem(pasteMenuText, this, mcPaste, null, null);
      mPasteItem.setEnabled(StringUtil.notEmpty(localCopyDataClipboard));
      popup.add(mPasteItem);

      MesquiteCommand mcDelete = makeCommand("deleteDataTouched", this);
      mcDelete.setDefaultArguments("" + ic);
      MesquiteCheckMenuItem mDeleteItem =
          new MesquiteCheckMenuItem("Delete Data", this, mcDelete, null, null);
      popup.add(mDeleteItem);

      popup.showPopup(x, y + 18);

      return true;
    }
    return false;
  }