Package geom

Examples of geom.Position


  public boolean calcBiggest() {
    double biggest = 0.0;
    for (Box box : boxSet) {
      Equation e = boxToEquation.get(box);
      if (e==null) continue;
      Position p = equationToPosition.get(e);
      if (p==null) continue;
      Vector<Position> ps = e2ps.get(e);
      if (ps==null) return false;
      if (ps.size()<HISTORY) return false;
      int n = ps.size();

      double tSum = 0.0;
      double txSum = 0.0;
      double tySum = 0.0;
      double tSqSum = 0.0;
      double xSum = 0.0;
      double ySum = 0.0;
      for (int t=0; t<n; t++) {
        tSum += t;
        tSqSum += t*t;
        Position q = ps.get(t);
        double x = q.x;
        double y = q.y;
        txSum += t*x;
        tySum += t*y;
        xSum += x;
View Full Code Here


  public void paint(Graphics2D g2D, ColourScheme colourScheme, int fontSize, Offset panelRectangle) {
    if (boxSet==null) return;
    for (Box box : boxSet) {
      Equation equation = boxToEquation.get(box);
      if (equation==null) continue;
      Position topLeft = equationToPosition.get(equation);
      if (topLeft==null) continue;
      box.paint(g2D, topLeft, colourScheme);
    }
    if (update) {
      if (calcBiggest()) {
View Full Code Here

    double minimumHeight = equationBox.getInnerRectangle().height;
    double shapeWidth = panelRectangle.width - KetPanel.BORDER_OFFSET.width;
    Offset windowWithoutLabel = new Offset(shapeWidth, minimumHeight);
    equationBox.setupOuterRectangle(windowWithoutLabel);
    double panelHeightOfNextBox = KetPanel.TOP_BORDER_SIZE;
    actualEquationTopLeft = new Position(KetPanel.LEFT_BORDER_SIZE, panelHeightOfNextBox);
  }
View Full Code Here

  public void drawTreeMap(Graphics g2D, Offset panelRectangle) {
    if ( ! TREE_MAP ) {
      return;
    }
    for (int q=0; q<100; q++) { // was 100
      Position p = new Position(Math.random()*panelRectangle.width, Math.random()*panelRectangle.height);
      Node nearest = findNearestNode(p, false);
      if (nearest==null) continue;
      if (random.nextInt(1+nearest.depth)!=0) continue;
      if (!cloud.containsKey(nearest)) {
        cloud.put(nearest, new Vector<Position>());
View Full Code Here

      BoxText content = new BoxText(null, " " + label.name + " " , Box.RIGHT_ALIGN|Box.BOTTOM_ALIGN);
      Color colour = colourScheme.getBorderColour(); // This doesn't appear appear to be used.
      Box border = new BorderedBox(null, content, Box.X_CENTRE_ALIGN|Box.Y_CENTRE_ALIGN, highlight, colourScheme);

      Position centre = new Position(label.actualX, label.actualY);
      border.setupAndPaint(g2D, colourScheme, Box.DEFAULT_BOX_FONT_SIZE, centre, new Offset(2*large, 2*large), background);
    }
  }
View Full Code Here

    } else {
      double centre = (panelRectangle.height-KetPanel.BORDER_OFFSET.height) / 2.0;
      double heightAboveCentre = equationBox.getOuterRectangle().height / 2.0;
      panelHeightOfNextBox = centre - heightAboveCentre;
    }
    actualEquationTopLeft = new Position(KetPanel.LEFT_BORDER_SIZE, panelHeightOfNextBox);
    return true;
  }
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.