Package geom

Examples of geom.Position


  public Box findDeepestBox(Position p) {
    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


  public Argument findDeepestArgument(Position p) {
    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) {
View Full Code Here

    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

      }
    }
  }

  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);
      // return Offset.difference(oldPosition, p);
    }
View Full Code Here

      return null;
    }
    BufferedImage image = new BufferedImage(width+1, height+1, BufferedImage.TYPE_INT_ARGB);
    Graphics2D g2D = (Graphics2D) image.getGraphics();
    setHints(g2D);
    Position topLeft = new Position(0, 0);
    double boxXPos = box.getXPosition(topLeft);
    double boxYPos = box.getYPosition(topLeft);
    if (band) {
      box.paintBand(g2D, new Position(-boxXPos, -boxYPos), colourScheme);
    } else {
      box.paint(g2D, new Position(-boxXPos, -boxYPos), colourScheme);
    }
    return image;
  }
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

    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);
    box.paint(g2D, topLeft, colourScheme);
    return image;
  }
View Full Code Here

      Graphics2D g2D,
      ColourScheme colourScheme,
      int fontSize,
      Offset panelRectangle) {

    Position position = null; // <--- Locally repurpose (q) version.
    if (boxSet!=null) {
      for (BoxEquation boxEquation : boxSet) {
        if (animate && boxEquation.getEquation()==equationBox.getArgument().getEquation()) {
          position = boxEquation.getTopLeft();
        } else {
View Full Code Here

    Box beforeRootBox = getBeforeRootBox(windowWithoutLabel);
    afterRootBox.setupOuterRectangle(windowWithoutLabel);
    afterRootBox.calcRootOffset();
    int animationStart = initialFrameNumber + START_NUMBER;
    int animationEnd = animationStart + TRANSITION_NUMBER;
    Position topLeft = calcTopLeft(afterRootBox);
    Vector<Transition> transitions = treeDiff.getTransitions(beforeRootBox, afterRootBox); // Done once!
    for (int frame=initialFrameNumber; frame<animationEnd+END_NUMBER; frame++) {
      g2D.setColor(COLOUR_SCHEME.getBackgroundColour());
      g2D.fillRect(0, 0, WIDTH, HEIGHT);
      if (frame<animationStart) { // Draw the 'before' box.
View Full Code Here

TOP

Related Classes of geom.Position

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.