Package geom

Examples of geom.Offset


    double minimumHeight = box.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


   */
  public static BufferedImage boxToBufferedImage(Box box, int width, int height, ColourScheme colourScheme) {
    BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
    Graphics2D g2D = (Graphics2D) image.getGraphics();
    setHints(g2D);
    box.setupAndPaint(g2D, colourScheme, Box.DEFAULT_BOX_FONT_SIZE, new Position(0.0, 0.0), new Offset(width, height), true);
    return image;
  }
View Full Code Here

   */
  public static BufferedImage boxToBufferedImage(Box box, int width, int height, ColourScheme colourScheme, boolean clear) {
    BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
    Graphics2D g2D = (Graphics2D) image.getGraphics();
    setHints(g2D);
    box.setupAndPaint(g2D, colourScheme, Box.DEFAULT_BOX_FONT_SIZE, new Position(0.0, 0.0), new Offset(width, height), clear);
    return image;
  }
View Full Code Here

   * Convert a box into a buffered image the size of the box's inner
   * rectangle.
   */
  public static BufferedImage boxToBufferedImage(Box box, ColourScheme colourScheme) {
    box.setupInnerRectangle(box.getFontSize());
    Offset innerRectangle = box.getInnerRectangle();
    Offset imageRectangle = new Offset(innerRectangle);
    BufferedImage image = new BufferedImage((int) innerRectangle.width, (int) innerRectangle.height, BufferedImage.TYPE_INT_ARGB);
    Graphics2D g2D = (Graphics2D) image.getGraphics();
    setHints(g2D);
    box.setupOuterRectangle(imageRectangle);
    Position topLeft = new Position(0.0, 0.0);
View Full Code Here

    if (equation==null) { System.out.print(" #2187 "); return false; } // BUG?
    equationBox = equation.toBox(colourScheme);
    labelBox = equation.getLabelBox(colourScheme);
    labelBox.setProperty(Box.RIGHT_ALIGN);
    equationBox.setupInnerRectangle(fontSize);
    Offset equationRectangle = calcEquationRectangle(panelRectangle);
    if (equationRectangle==null) { System.out.print(" #9862 "); return false; } // BUG? // <-- (1)
    labelBox.setup(fontSize, equationRectangle);
    if (equationBox.getInnerRectangle()==null) { System.out.print(" #0391 "); return false; } // BUG?    // <-- (2)
    Offset windowWithoutLabel = calcWindowWithoutLabel(equationRectangle);
    if (windowWithoutLabel==null) { System.out.print(" #9104 "); return false; } // BUG?
    equationBox.setupOuterRectangle(windowWithoutLabel);
    equationBox.calcRootOffset();
    }
    return true;
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

  private Offset calcEquationRectangle(Offset panelRectangle) {
    if (equationBox==null) { System.out.print(" #0291 "); return null; }
    double shapeWidth = panelRectangle.width - KetPanel.BORDER_OFFSET.width;
    if (equationBox.getInnerRectangle()==null) { System.out.print(" #4921 "); return null; } // <-- (1)
    double minimumHeight = equationBox.getInnerRectangle().height; // BUG: innterRectangle can be null!
    return new Offset(shapeWidth, minimumHeight);
  }
View Full Code Here

  private Offset calcWindowWithoutLabel(Offset equationRectangle) {
    if ( equationRectangle==null ) { System.out.print(" #1342 "); return null; } // BUG?
    if ( labelBox==null ) { System.out.print(" #4382 "); return null; } // BUG?
    if ( labelBox.getInnerRectangle()==null ) { System.out.print(" #9889 "); return null; } // BUG?
    return new Offset(equationRectangle.width-labelBox.getInnerRectangle().width, equationRectangle.height);
  }
View Full Code Here

  }

  private Offset getWindowWithoutLabel(Box afterRootBox) {
    double minimumHeight = afterRootBox.getInnerRectangle().height;
    double shapeWidth = WIDTH - KetPanel.BORDER_OFFSET.width;
    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.