Package ket.math.purpose

Examples of ket.math.purpose.Text


      if (getSelection().getCurrent()==target || getSelection().getCurrent()==argument) {
        getSelection().appendEquation(new Equation());
      }
      synchronized (getSelection()) {
        synchronized (target) {
          Argument u = new Token(new Text((titles[i])));
          target.replace(u);
          target = u;
        }
        synchronized (argument) {
          Argument v = parse(acts[i]);
View Full Code Here


      return ArgumentParser.parseArgument(content, knownArguments, null, this);
    }
    String text = content.trim();
    if (text.matches("\\*.+\\*")) { // *heading* or *a longer title*
      text = text.substring(1, text.length()-1); // ish
      Token token = new Token(new Text(text));
      token.setBold(true);
      return token;
    } else {
      return new Token(new Text(text));
    }
  }
View Full Code Here

    }
    String[] lines = clipboardString.split("\n");
    Ket.out.println("Clipboard:");
    for (String l : lines) {
      Ket.out.println("\t" + l);
      Token text = new Token(new Text(l.trim()));
      getSelection().appendEquation(new Equation(text));
    }
    return true;
  }
View Full Code Here

  public AddMode(Modes modes) {
    this.modes = modes;
  }

  public boolean insertBlankLine(Chord chord, boolean prepend) {
    Token token = new Token(new Text(""));
    Equation equation = new Equation(token);
    if (prepend) {
      getSelection().prependEquation(equation);
    } else {
      getSelection().appendEquation(equation);
View Full Code Here

    }
    return true;
  }

  public boolean replaceTextLine(Chord chord) {
    Text text = new Text("");
    Argument root = new Token(text);
    getSelection().replace(getCurrent().getRoot(), root);
    modes.setDocumentState(DocumentState.UPDATE_TEXT);
    chord.setComplete(false);
    return true;
View Full Code Here

    chord.setComplete(false);
    return true;
  }

  public boolean replaceSelectionWithText(Chord chord) {
    Argument text = new Token(new Text(""));
    getSelection().replace(getCurrent(), text);
    modes.setDocumentState(DocumentState.UPDATE_TEXT);
    chord.setComplete(false);
    return true;
  }
View Full Code Here

    chord.setComplete(false);
    return true;
  }

  public boolean appendTextLine(Chord chord) {
    Text text = new Text("");
    Argument root = new Token(text);
    getSelection().appendEquation(new Equation(root));
    modes.setDocumentState(DocumentState.UPDATE_TEXT);
    chord.setComplete(false);
    return true;
View Full Code Here

    }
    return true;
  }

  public boolean prependTextLine(Chord chord) {
    Text text = new Text("");
    Argument root = new Token(text);
    getSelection().prependEquation(new Equation(root));
    modes.setDocumentState(DocumentState.UPDATE_TEXT);
    chord.setComplete(false);
    return true;
View Full Code Here

      }
    } else {
      // WORKS!
      document.getModes().setDocumentState(DocumentState.UPDATE_TEXT);
      if (nonblank) {
        s.replace(new Token(new Text(line)));
        setMessage(line);
      }
    }
  }
View Full Code Here

  private void insertNewTextLineSplit() {
    mathCollection.updateUndoStack();
    // Note: This avoids calling selection.setCurrent() implicitly.
    Argument current = getSelection().getCurrent();
    EquationList el = current.getEquationList();
    Equation appended = new Equation(new Token(new Text(getStart()))); // Don't reset: record as done and move on.
    el.addBefore(current.getEquation(), appended);
    setMessage(getEnd());
  }
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.