Exemplo n.º 1
0
  // calc the current value of the arithmetic tree
  @Override
  public final void compute() {

    boolean useLaTeX = true;

    if (!geo.isDefined()
        || (substituteVars != null && !substituteVars.isDefined())
        || showName != null && !showName.isDefined()) {
      text.setTextString("");

    } else {
      boolean substitute = substituteVars == null ? true : substituteVars.getBoolean();
      boolean show = showName == null ? false : showName.getBoolean();

      text.setTemporaryPrintAccuracy();

      // Application.debug(geo.getFormulaString(StringType.LATEX, substitute ));
      if (show) {
        text.setTextString(geo.getLaTeXAlgebraDescription(substitute));
        if (text.getTextString() == null) {
          text.setTextString(geo.getAlgebraDescriptionTextOrHTML());
          useLaTeX = false;
        }
      } else {
        if (geo.isGeoText()) {
          // needed for eg Text commands eg FormulaText[Text[
          text.setTextString(((GeoText) geo).getTextString());
        } else {
          text.setTextString(geo.getFormulaString(StringType.LATEX, substitute));
        }
      }

      text.restorePrintAccuracy();
    }

    text.setLaTeX(useLaTeX, false);

    /*
    int tempCASPrintForm = kernel.getCASPrintForm();
    kernel.setCASPrintForm(StringType.LATEX);
    text.setTextString(geo.getCommandDescription());
    kernel.setCASPrintForm(tempCASPrintForm);*/
  }
Exemplo n.º 2
0
  @Override
  public Component getTableCellEditorComponent(
      JTable table, Object value, boolean isSelected, int row, int column) {

    editGeo = (GeoBoolean) value;
    delegate.setValue(editGeo.getBoolean());
    editing = true;
    checkBox.setBackground(table.getBackground());
    checkBox.setHorizontalAlignment(SwingConstants.CENTER);

    // enabled == isIndependent
    checkBox.setEnabled(editGeo.isIndependent());

    if (editGeo.isLabelVisible()) {
      // checkBox.setText(editGeo.getCaption());
    }
    return editorComponent;
  }