Exemple #1
0
  public void setValue(String value) {
    if (value != null) {
      value = MiSystem.getProperty(value, value);
    }

    if (Utility.isEqualTo(value, textField.getValue())) {
      return;
    }

    if (restrictingValuesToThoseInList) {
      if ((list.getIndexOfItem(value, restrictionIgnoresCase) == -1)
          && (list.getNumberOfItems() > 0)) {
        if (restrictionWarnsOnly) {
          textField.setValue(value);
          list.getSelectionManager().deSelectAll();
        } else {
          throw new IllegalArgumentException(
              MiDebug.getMicaClassName(this)
                  + ": Rejecting value: \""
                  + value
                  + "\" because it is not present in list"
                  + " (see MiComboBox.setRestrictingValuesToThoseInList()).\n"
                  + "Values present in list are: "
                  + getContents());
        }
      }
    }
    textField.setValue(value);
    if (!list.getContents().contains(value)) list.getSelectionManager().deSelectAll();
    else list.setValue(textField.getValue());
  }
  public int processEvent(MiEvent event) {
    if ((isEnabled())
        && (event.getType() != MiEvent.Mi_TIMER_TICK_EVENT)
        && (event.getType() != MiEvent.Mi_IDLE_EVENT)) {
      tmpPoint.copy(event.worldPt);
      MiPageManager pageManager = event.editor.getPageManager();
      String unitsName = "";
      if (pageManager != null) {
        pageManager.transformWorldPointToUnitsPoint(tmpPoint);
        unitsName = pageManager.getUnits().getAbbreviation();
      }

      if (tmpPoint.x != lastX) {
        lastX = tmpPoint.x;
        xPos.setValue("X: " + Utility.toShortString(tmpPoint.x) + " " + unitsName);
      }
      if (tmpPoint.y != lastY) {
        lastY = tmpPoint.y;
        yPos.setValue("Y: " + Utility.toShortString(tmpPoint.y) + " " + unitsName);
      }
    }
    return (Mi_PROPOGATE_EVENT);
  }
Exemple #3
0
 /**
  * ------------------------------------------------------ Creates a prototype from the class named
  * by the Mi_COMBOBOX_PROTOTYPE_CLASS_NAME system property, if specified.
  * ------------------------------------------------------
  */
 static {
   String prototypeClassName = MiSystem.getProperty(Mi_COMBOBOX_PROTOTYPE_CLASS_NAME);
   if (prototypeClassName != null) {
     prototype = (MiComboBox) Utility.makeInstanceOfClass(prototypeClassName);
   }
 }