Package geom

Examples of geom.Offset


      afterRootBox = null;
      return;
    }
    afterRootBox = after.toBox(0L, colourScheme);
    labelSetup(afterEquation, colourScheme);
    Offset windowWithoutLabel = afterBoxSetup(fontSize, panelRectangle);
    Box beforeRootBox = beforeBoxSetup(g2D, colourScheme, before, fontSize, windowWithoutLabel);
    initialTime = System.currentTimeMillis();
    TreeDiff treeDiff = new TreeDiff(before, after);
    transitions = treeDiff.getTransitions(beforeRootBox, afterRootBox);
  }
View Full Code Here


   */
  private Offset afterBoxSetup(int fontSize, Offset panelRectangle) {
    double shapeWidth = panelRectangle.width - KetPanel.BORDER_OFFSET.width;
    afterRootBox.setupInnerRectangle(fontSize);
    double minimumHeight = afterRootBox.getInnerRectangle().height;
    Offset equationRectangle = new Offset(shapeWidth, minimumHeight);
    labelBox.setup(fontSize, equationRectangle);
    Offset windowWithoutLabel = calcWindowWithoutLabel(equationRectangle);
    afterRootBox.setupOuterRectangle(windowWithoutLabel);
    afterRootBox.calcRootOffset();
    return windowWithoutLabel;
  }
View Full Code Here

  private synchronized Offset calcEquationRectangle(Offset panelRectangle) {
    double shapeWidth = panelRectangle.width - KetPanel.BORDER_OFFSET.width;
    if (equationBox==null) { System.out.println(" @291 "); return null; }
    if (equationBox.getInnerRectangle()==null) { System.out.println(" @743 "); return null; }
    double minimumHeight = equationBox.getInnerRectangle().height;
    return new Offset(shapeWidth, minimumHeight);
  }
View Full Code Here

    double minimumHeight = equationBox.getInnerRectangle().height;
    return new Offset(shapeWidth, minimumHeight);
  }

  private Offset calcWindowWithoutLabel(Offset equationRectangle) {
    return new Offset(equationRectangle.width-labelBox.getInnerRectangle().width, equationRectangle.height);
  }
View Full Code Here

    if (bands==null) return null;
    Box deepest = null;
    for (Map.Entry<Integer,Vector<Box.Band>> entry : bands.entrySet()) {
      for (Box.Band band : entry.getValue()) {
        Position q = band.position;
        Offset r = band.box.getInnerRectangle();
        double dx = p.x - q.x;
        double dy = p.y - q.y;
        if (dx>0 && dy>0 && dx<r.width && dy<r.height) {
          deepest = band.box;
        }
View Full Code Here

    if (bands==null) return null;
    Argument deepest = null;
    for (Map.Entry<Integer,Vector<Box.Band>> entry : bands.entrySet()) {
      for (Box.Band band : entry.getValue()) {
        Position q = band.position;
        Offset r = band.box.getInnerRectangle();
        double dx = p.x - q.x;
        double dy = p.y - q.y;
        Argument a = band.box.getArgument();
        if (a!=null && dx>0 && dy>0 && dx<r.width && dy<r.height) {
          deepest = a;
View Full Code Here

    Equation equation = mathCollection.getCursor().getEquation();
    box = equation.toBox(colourScheme);
    labelBox = equation.getLabelBox(colourScheme);
    labelBox.setProperty(Box.RIGHT_ALIGN);
    box.setupInnerRectangle(fontSize);
    Offset equationRectangle = calcEquationRectangle(panelRectangle);
    labelBox.setup(fontSize, equationRectangle);
    Offset windowWithoutLabel = calcWindowWithoutLabel(equationRectangle);
    box.setupOuterRectangle(windowWithoutLabel);
    double boxHeight = getBoxHeight(box, panelRectangle);
    topLeft = new Position(KetPanel.LEFT_BORDER_SIZE, boxHeight);
    box.boxesByDepth(null, bands, topLeft, colourScheme);
    return true;
View Full Code Here

  public void paint(Graphics2D g2D, ColourScheme colourScheme, int fontSize, Offset panelRectangle) {
    if (bands==null || box==null) {
      return;
    }
    labelBox.paint(g2D, topLeft, colourScheme);
    Offset shift = getShift(panelRectangle);
    double scale = 100.0;
    for (Map.Entry<Integer,Vector<Box.Band>> entry : new Vector<Map.Entry<Integer,Vector<Box.Band>>>(bands.entrySet())) {
      int depth = entry.getKey();
      for (Box.Band band : entry.getValue()) {
        double x = band.position.x;
View Full Code Here

  }

  private Offset getShift(Offset panelRectangle) {
    Position p = mouseEventHandler.getCurrentPosition();
    if (p==null) {
      return new Offset(0.0, 0.0);
    } else {
      Position oldPosition = new Position(
          KetPanel.LEFT_BORDER_SIZE + panelRectangle.width/2.0,
          KetPanel.TOP_BORDER_SIZE + panelRectangle.height/2.0);
      return Offset.difference(p, oldPosition);
View Full Code Here

  }

  private Offset calcEquationRectangle(Offset panelRectangle) {
    double shapeWidth = panelRectangle.width - KetPanel.BORDER_OFFSET.width;
    double minimumHeight = box.getInnerRectangle().height;
    return new Offset(shapeWidth, minimumHeight);
  }
View Full Code Here

TOP

Related Classes of geom.Offset

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.