Package geom

Examples of geom.Position


  private Position calcTopLeft(Box afterRootBox) {
    double centre = (HEIGHT-KetPanel.BORDER_OFFSET.height) / 2.0;
    double heightAboveCentre = afterRootBox.getOuterRectangle().height / 2.0;
    double boxHeight = centre - heightAboveCentre;
    return new Position(KetPanel.LEFT_BORDER_SIZE, boxHeight);
  }
View Full Code Here


    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

    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

   * takes into account offsets due to alignment by a parent box,
   * internal alignment between the minimum sized box and the rectangular
   * region reserved for it.
   */
  public Position getPosition(Position topLeft) {
    return new Position(getXPosition(topLeft), getYPosition(topLeft));
  }
View Full Code Here

    g2D.drawRect(innerX, innerY, innerWidth, innerHeight);
  }

  public boolean innerBoxesOverlap(Box that) { // BUG: In scatter plot, topLeft is box-specific: fix.
    // TopLeft doesn't matter because it is common to both boxes.
    Position topLeft = this.topLeft!=null ? this.topLeft : new Position(0, 0);
    //- if (this.getTopLeft()==null) return false; //D false
    //- if (that.getTopLeft()==null) return false; //D false
    Position rA = this.getPosition(topLeft);
    Position rB = that.getPosition(topLeft);
    Offset iA = this.getInnerRectangle();
    Offset iB = that.getInnerRectangle();
    return rA.x<(rB.x + iB.width) && (rA.x+iA.width)>rB.x && rA.y<(rB.y+iB.height) && (rA.y+iA.height)>rB.y;
  }
View Full Code Here

  /**
   * Recursively set the current offset relative to that of its parent.
   */
  protected void calcRootOffset(Offset parentOffset) {
    Position rootPosition = getPosition(new Position(parentOffset));
    rootOffset = new Offset(rootPosition);
  }
View Full Code Here

  protected abstract void calcMinimumSize();

  protected abstract void draw(Graphics2D g2D, Position topLeft, ColourScheme colourScheme);

  public Position getCentre(Position topLeft) {
    Position corner = getPosition(topLeft);
    Offset innerCentre = getInnerRectangle().getCentre();
    return corner.plus(innerCentre);
  }
View Full Code Here

    ColourScheme localCS = getLocalColourScheme(colourScheme);
    Argument local = getArgument();
    if (local==null) {
      local = a;
    }
    Position childTopLeft = getPosition(topLeft);
    for (Box child : children) {
      if (!isBand(child)) {
        Band b = child.boxesByDepth(local, map, childTopLeft, localCS);
      }
    }
View Full Code Here

  }

  @Override
  public Vector<Pair> getPairs(Position topLeft) {
    Vector<Pair> pairs = super.getPairs(topLeft);
    Position recursiveTopLeft = getPosition(topLeft);
    for (Box b : children) {
      pairs.addAll(b.getPairs(recursiveTopLeft));
    }
    return pairs;
  }
View Full Code Here

public class TPanel extends JPanel implements Runnable {

  Vector<Box.Pair> pairs;

  private TPanel(Box equationBox) {
    pairs = equationBox.getPairs(new Position(0.0, 0.0));
    Argument root = pairs.firstElement().argument.getVisibleRoot();
    for (int i=0; i<pairs.size(); i++) {
      Box.Pair p = pairs.get(i);
      if (p.argument!=root) continue;
      pairs.remove(i);
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.