Package ket.math.purpose

Examples of ket.math.purpose.Text


    String oldText = line.getLine();
    int index = line.getCursorIndex();
    if (newText.length() < line.length()) {
      index = newText.length();
    }
    previous.getRoot().asToken().setState(new Text(oldText));
    line.setMessage(newText);
    line.setIndex(index);
  }
View Full Code Here


    String oldText = line.getLine();
    int index = line.getCursorIndex();
    if (newText.length() < line.length()) {
      index = newText.length();
    }
    next.getRoot().asToken().setState(new Text(oldText));
    line.setMessage(newText);
    line.setIndex(index);
  }
View Full Code Here

  private void insertIntermediaryEquation() {
    mathCollection.updateUndoStack();
    Argument current = getSelection().getCurrent();
    EquationList el = current.getEquationList();
    Equation appended = new Equation(new Token(new Text(getStart())));
    el.addBefore(current.getEquation(), appended);
    document.getKeyboardEventHandler().setToInitialState(); // Don't reset: record as done and move on.
    Chord chord = document.getKeyboardEventHandler().getChord();
    document.getModes().getNormalMode().replaceCurrentArgument(chord);
    setMessage(getEnd());
View Full Code Here

      Integer z = Like.getInteger(current);
      suggest(Transform.scientificNotation(z));
      suggest(new Token((double) z));
      suggest(Factorize.factorize(z, false));
      suggest(Factorize.factorize(z, true));
      suggest(new Token(new Text(""+z))); // "13" <-> 13
    } else if (cycleMode==REPLACE_DOUBLE) {
      double d = Like.getDouble(current);
      suggest(Transform.scientificNotation(d));
      suggest(new Token((int) d));
      //- suggest(new Token(1+(int) d));
      suggest(new Token(new Text(""+d))); // "13.6" <-> 13.6
    } else if (cycleMode==REPLACE_POWER) {
      suggest(Transform.powerToInteger(current)); // 10^3 -> 1000
      // (a+b)^c | (a*b)^c | (a/b)^c   see expandPower();
      suggest(Transform.powerOfProductExpand(current));
      if (current.isBranch()) {
View Full Code Here

    mathCollection.updateUndoStack();
    Equation previous = getSelection().getCurrent().getPreviousEquation();
    if (previous==null || !previous.isText()) return;
    //?~ Equation previous = getSelection().getCurrent().getEquation().getPreviousTextEquation();
    //   if (previous==null) return;
    Text text = (Text) (previous.getRoot().getState());
    String content = text.getUnquotedString();
    line.home();
    setMessage(content+getLine());
    previous.removeEquation();
  }
View Full Code Here

  private void mergeWithNextLine() {
    mathCollection.updateUndoStack();
    Equation next = getSelection().getCurrent().getNextEquation();
    if (next==null || !next.isText()) return;
    Text text = (Text) (next.getRoot().getState());
    String content = text.getUnquotedString();
    line.home();
    //? line.end();
    setMessage(getLine() + content);
    next.removeEquation();
  }
View Full Code Here

TOP

Related Classes of ket.math.purpose.Text

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.