Package geom

Examples of geom.Offset


  }

  private Offset getDrawRectangle() {
    double drawWidth = this.getWidth() - BORDER_OFFSET.width;
    double drawHeight = this.getHeight() - BORDER_OFFSET.height;
    return new Offset(drawWidth, drawHeight);
  }
View Full Code Here


  private int getFontSize() {
    return document.getBoxFontSize();
  }

  public Offset getPanelRectangle() {
    return new Offset(this.getWidth(), this.getHeight());
  }
View Full Code Here

  public void updateDragIcon(Position dragPosition) {
    //- this.dragPosition = dragPosition;
    Box box = getCurrent().toBox(0L, getColourScheme());
    box.setupInnerRectangle(getFontSize());
    Offset innerRectangle = box.getInnerRectangle();
    int w = (int) Math.max(10, innerRectangle.width);
    int h = (int) Math.max(10, innerRectangle.height);
    icon = ImageTools.boxToBufferedImage(box, w, h, getColourScheme(), false);
    deepest = null;
  }
View Full Code Here

      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();
    topLeft = new Position(KetPanel.LEFT_BORDER_SIZE, getBoxHeight(afterRootBox, panelRectangle));
    return windowWithoutLabel;
  }
View Full Code Here

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

    equationBox.setupInnerRectangle(fontSize);
    double minimumHeight = equationBox.getInnerRectangle().height;
    double shapeWidth = panelRectangle.width - KetPanel.BORDER_OFFSET.width;

    Offset equationRectangle = new Offset(shapeWidth, minimumHeight);

    labelBox.setup(fontSize, equationRectangle);

    Offset windowWithoutLabel = new Offset(shapeWidth-labelBox.getInnerRectangle().width, minimumHeight);
    equationBox.setupOuterRectangle(windowWithoutLabel);
    //- equationBox.setBackground(true);

    double panelHeightOfNextBox;
    if (equation.isText()) {
View Full Code Here

    // Don't measure the width of text and instead have it wrap to multiple lines.
    if (!e.isText()) {
      return Math.max(widest, boxEquation.getFullWidth());
    } // otherwise:
    double wrappedWidth = scale ? Math.min(boxEquation.getWidth(), maxWidth/2.0) : maxWidth;
    Offset leftRectangle = new Offset(wrappedWidth, Double.MAX_VALUE);
    boxEquation.getEquationBox().setupOuterRectangle(leftRectangle);
    return Math.max(widest, boxEquation.getFullWidth());
  }
View Full Code Here

        box.setProperties(Box.LEFT_ALIGN, Box.Y_CENTRE_ALIGN, Box.Y_CENTRE_ALIGN);
      } else {
        box.setProperties(Box.X_CENTRE_ALIGN, Box.Y_CENTRE_ALIGN, Box.Y_CENTRE_ALIGN);
      }
      labelBox.setProperties(Box.RIGHT_ALIGN, Box.SMALL_FONT, Box.BOLD_FONT);
      Offset equationRectangle = new Offset(widest, step);
      labelBox.setupOuterRectangle(equationRectangle);
      Offset leftRectangle = new Offset(equationRectangle);
      leftRectangle.width -= labelBox.getInnerRectangle().width;
      box.setupOuterRectangle(leftRectangle);
      double left = KetPanel.LEFT_BORDER_SIZE + width;
      double top = KetPanel.TOP_BORDER_SIZE + sum;
      Position topLeft = new Position(left, top);
View Full Code Here

    equationBox = equation.toBox(colourScheme);
    if (equationBox==null) { System.out.println(" @321 "); return false; }
    labelBox = equation.getLabelBox(colourScheme);
    labelBox.setProperty(Box.RIGHT_ALIGN);
    equationBox.setupInnerRectangle(fontSize);
    Offset equationRectangle = calcEquationRectangle(panelRectangle);
    if (equationRectangle==null) { System.out.println(" @498 "); return false; }
    labelBox.setup(fontSize, equationRectangle);
    Offset windowWithoutLabel = calcWindowWithoutLabel(equationRectangle);
    equationBox.setupOuterRectangle(windowWithoutLabel);
    equationBox.calcRootOffset();
    return true;
  }
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.