Package ketUI.panel

Examples of ketUI.panel.KetPanel


    }
  }

  @Override
  public void run() {
    KetPanel ketPanel = document.getKetPanel();
    setLocationRelativeTo(ketPanel);
    setVisible(true);
  }
View Full Code Here


  private KetPanel getKetPanel() {
    return document.getKetPanel();
  }

  public void updateMultipleEquations() {
    KetPanel ketPanel = document.getKetPanel();
    boolean multiple = ketPanel.isListDisplayMode();
    boolean network = ketPanel.isNetworkDisplayMode();
    boolean graph = ketPanel.isGraphDisplayMode();
    boolean animated = ketPanel.isAnimatedDisplayMode();
    boolean treeMap = ketPanel.isGridDisplayMode();
    boolean perspective = ketPanel.isPerspectiveDisplayMode();
    boolean scatter = ketPanel.isScatterDisplayMode();
    //- ketPanel.fromMiddle(getCurrentEquation().getEquationIndex());  //?

    listDisplay.setSelected(multiple);
    networkDisplay.setSelected(network);
    graphDisplay.setSelected(graph);
View Full Code Here

    mouseLoop.clear();
    //- document.getKetPanel().repaint();
    //- Modes mode = document.getModes();
    boolean left = SwingUtilities.isLeftMouseButton(e); // HACK: e.getButton() is 0 rather than BUTTON1 | BUTTON2.
    if (left) {
      KetPanel ketPanel = document.getKetPanel();
      Position p = new Position(e.getX(), e.getY());
      ketPanel.setDragLocation(p);
    }
  }
View Full Code Here

   * Invoked when the mouse cursor has been moved onto a component but no
   * buttons have been pushed.
   */
  @Override
  public void mouseMoved(MouseEvent e) {
    KetPanel ketPanel = document.getKetPanel();
    Modes mode = document.getModes();
    Responder responder = mode.getResponder();
    setCurrentPosition(e.getX(), e.getY());

    // Border what the mouse is currently over.
    boolean normalMode = document.getModes().getDocumentState()==DocumentState.NORMAL;
    if (normalMode) {
      Position p = new Position(e.getX(), e.getY());
      Box deepest = ketPanel.findDeepestBox(p);
      ketPanel.markBorder(deepest);
      ketPanel.repaint();
    } else {
      if (responder==mode.getMouseResponder()) {
        mouseLoop.clear();
      } else if (mode.getDocumentState().isTracked() || responder==mode.getNormalResponder()) {
        mouseLoop.append(e.getX(), e.getY());
      }
    }
    if (ketPanel.isPerspectiveDisplayMode()) { // Move this somewhere more appropriate?
      ketPanel.repaint();
    }
  }
View Full Code Here

    boxFontSize = Box.DEFAULT_BOX_FONT_SIZE;
    this.documentManager = documentManager;
    this.mathCollection = new MathCollection(documentManager!=null?documentManager.getKnownArguments():Ket.KNOWN_ARGUMENTS);
    this.modes = new Modes(this);
    this.colourScheme = new ColourSchemeDecorator(ColourScheme.WHITEBOARD, mathCollection, modes.getSearch(), modes);
    this.ketPanel = new KetPanel(this);
    this.ketPanel.setPreferredSize(new Dimension(FrameManager.SCREEN_WIDTH, FrameManager.SCREEN_HEIGHT));
    this.frameManager = new FrameManager(documentManager, this, existingFrame);
    this.keyboardEventHandler = new KeyboardEventHandler(this, ketPanel);
    this.scrollListener = new ScrollListener(this);
    initContent(filename);
View Full Code Here

      saveAsImage(currentEquation);
    }
  }

  private void updateForAnimatedDisplay() {
    KetPanel ketPanel = document.getKetPanel();
    ketPanel.updateForAnimatedDisplay();
  }
View Full Code Here

   * If the mouse has been draggend (from this docuemnt) to another
   * window, copy the selection and add it as a new equation in the
   * (other) desination document.
   */
  private boolean dragToAnotherDocument(Component component, MouseButton mouseButton, Position p) { // Drag to another document.
    KetPanel toPanel = getLastDestination();
    if (toPanel==null || toPanel==component) {
      // Edit within the current ket panel...
      // Clear (not needed, but just being careful).
      setDestination(null, null); // i.e. clear
      return false;
    } else  if (mouseButton!=MouseButton.LEFT) {
      // TODO: Extend.
      return true; // Done [nothing].
    }
    Document toDocument = toPanel.getDocument();
    Selection toSelection = toDocument.getSelection();
    // Copy argument or equation accross (non-destructively).
    Position to = getLastPosition();
    Equation toEquation = toPanel.pointToEquation(to);
    if (toEquation!=null) {
      toSelection.setCurrent(toEquation.getRoot());
    }
    // Clone and add as a new equation below the selection.
    Equation equationCopy = getSelection().getCurrent().getEquation().cloneEquation(); // Include the entire equation: root and label etc.?
    toSelection.appendEquation(equationCopy);
    setDestination(null, null); // i.e. clear

    getKetPanel().updateAndRepaint();
    toPanel.updateAndRepaint();
    getMathCollection().updateUndoStack();
    toDocument.getMathCollection().updateUndoStack();
    return true;
  }
View Full Code Here

    setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
    pack();
    setSize(FrameManager.SCREEN_WIDTH, FrameManager.SCREEN_HEIGHT);
    KnownArguments knownArguments = documentManager!=null ? documentManager.getKnownArguments() : null;
    Clipboard clipboard = documentManager!=null?documentManager.getClipboard() : null;
    KetPanel ketPanel = document.getKetPanel();
    ketTransfer = new KetTransfer(ketPanel, knownArguments, clipboard, document.getMathCollection());
    ketPanel.setTransferHandler(ketTransfer);
    toolBarEventHandler = new ToolBarEventHandler(document);
    String edge = ToolBarEventHandler.HORIZONAL_TOOLBAR_AXIS?BorderLayout.PAGE_START:BorderLayout.WEST;
    add(toolBarEventHandler.getToolBar(), edge);
    add(ketPanel, BorderLayout.CENTER);
    KetFrameListener ketFrameListener = new KetFrameListener(document);
View Full Code Here

TOP

Related Classes of ketUI.panel.KetPanel

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.