Package ketUI

Examples of ketUI.Document


    if ( ! getDocument().getFrameManager().isStandAlone() ) {
      Ket.out.println("[Can't open "+filename+"]");
      return;
    }
    DocumentManager documentManager = getDocument().getDocumentManager();
    Document document = new Document(documentManager, null, filename);
    document.getKetPanel().toggleGridDisplay();
    if (documentManager!=null) {
      documentManager.addDocument(document);
    }
  }
View Full Code Here


    if (filename==null) {
      Ket.out.println(" !!! Unexpected filename !!! ");
      return false;
    }
    // TODO: Check that the filename exists before actually openning the window.
    Document document = null;
    String label = Like.getString(location);
    Integer equationNumber = Like.getInteger(location);
    if (location==null) {
      document = new Document(documentManager, null, filename);
    } else if (equationNumber!=null) {
      int equationIndex = equationNumber-1;
      document = new Document(documentManager, null, filename, equationIndex);
    } else if (label!=null) {
      // TODO: Check that the filename exists before actually openning the window.
      document = new Document(documentManager, null, filename, label);
    } else {
      Ket.out.println(" !!! Unexpected label() syntax !!! ");
      return false;
    }
    documentManager.addDocument(document);
View Full Code Here

    public WindowOpener() {

    }
    public void run() {
      DocumentManager documentManager = getDocumentManager();
      Document d = new Document(documentManager, null, null);
      documentManager.addDocument(d);
    }
View Full Code Here

    Set<Symbol> set = argumentPurpose.getMatchSymbols();
    return set.contains(searchSymbol);
  }

  private Argument parsePattern(String pattern) {
    Document document = modes.getDocument();
    MathCollection mathCollection = document.getMathCollection();
    return ArgumentParser.parseArgument(pattern, knownArguments, clipboard, mathCollection);
  }
View Full Code Here

    }
    return string;
  }
 
  private String processNextChordIterationString(String string, Chord chord) {
    Document document = modes.getDocument();
    switch (modes.getDocumentState()) {
      case GET_LABEL_STRING:
        if (string.matches("\\s*")) {
          // An empty string removes the label.
          getCurrent().getEquation().setLabel(null);
          string = "";
          // A blank string means clear; a null string would imply failure.
        } else {
          getCurrent().getEquation().setLabel(string);
        }
        return string;

      case SIFT:
        if (string.matches("\\s*")) {
          modes.error(" !!! Cannot search for whitespace !!! ");
          return null;
        }
        modes.getSearch().search(string, Search.FORWARDS);
        // Restrict the view to those lines that matched the search.
        Vector<Equation> eqtns = modes.getSearch().getEquationMatches();
        if (eqtns!=null) {
          document.getKetPanel().setVisibleEquations(eqtns);
        }
        return string;

      case SEARCH_FORWARDS:
        if (string.matches("\\s*")) {
          modes.error(" !!! Cannot search for whitespace !!! ");
          return null;
        }
        modes.getSearch().search(string, Search.FORWARDS);
        return string;

      case SEARCH_BACKWARDS:
        if (string.matches("\\s*")) {
          modes.error(" !!! Cannot search for whitespace !!! ");
          return null;
        }
        modes.getSearch().search(string, Search.BACKWARDS);
        return string;

      case COMMAND:
        /*-
        // TODO: If on processing the command, the responder
        // changed, don't return to normal responder.
        modes.getCommandMode().processCommand(string, chord);
        // TODO: Only return the string if command responder worked as expected.
        return string;
        */
        //- Ket.out.println(" --- TEST: Normal command --- ");
        //- document.getKeyboardEventHandler().normal(string);
        CommandListener cl = document.getCommandListener();
        if (cl!=null) {
          cl.ketCommand(string);
        } else {
          Ket.out.println("[no command listener: '"+string+"']");
        }
View Full Code Here

      chord.setComplete(false);
    }
  }

  private boolean messageBoxClick(boolean singleClick, Position p) {
    Document document = modes.getDocument();
    Message message = modes.getMessage();
    KetPanel ketPanel = document.getKetPanel();
    // box list: (BoxWord) start, (BoxWord) "|", (BoxWord) end
    BoxList messageBox = ketPanel.getMessageBoxList();
    if (messageBox==null) return false;
    Box clickedOn = messageBox.findDeepestBox(p);
    boolean messageBoxClick = clickedOn!=null;
View Full Code Here

      5, 5); // Gaps
    setLayout(layout);
    Container contentPane = this.getContentPane();

    DocumentManager dm = new DocumentManager(new String[]{});
    document = new Document(dm, (JFrame) this, null);

    ketPanel = document.getKetPanel();
    ketPanel.setSize(420, 300);
    ketPanel.addKeyListener(this);
View Full Code Here

    ketPanel.requestFocus();
    graphPanel.calc();
  }

  public void setEquation(Argument a) {
    Document d = ketPanel.getDocument();
    Selection s = d.getSelection();
    s.replace(a);
  }
View Full Code Here

    Selection s = d.getSelection();
    s.replace(a);
  }

  public void addEquation(Argument a) {
    Document d = ketPanel.getDocument();
    d.getEquationList().addLast(new Equation(a));
  }
View Full Code Here

    // Load the non-open help files as plain text;
    for (String filename : helpFiles) {
      boolean helpFileMatches = searchJar(filename, topic);
      //?+ boolean helpFileMatches = searchPlainText(filename, topic);
      if (helpFileMatches) {
        Document document = new Document(documentManager, null, filename); // TODO: Use this.getDocument()'s clipboard?
        documentManager.addDocument(document);
        //- boolean ok = selectWithinAnotherDocument(document, topic);
        selectWithinAnotherDocument(document, topic);
        return true;
      }
View Full Code Here

TOP

Related Classes of ketUI.Document

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.