Package geom

Examples of geom.Position


    // Paint the border.
    g2D.setColor(this.colourScheme.getBorderColour()); // edge
    g2D.drawRoundRect(x, y, (int) innerRectangle.width, (int) innerRectangle.height, 10, 10);

    Position contentTL = new Position(x+2, y+2);
    content.paint(g2D, contentTL, this.colourScheme);
  }
View Full Code Here


    if (icon!=null) { // TODO: Clean up:
      if (dragPosition!=null) {
        g2D.drawImage(icon, (int) dragPosition.x-icon.getWidth()/2, (int) dragPosition.y-icon.getHeight()/2, null);
        g2D.drawOval((int) dragPosition.x-3, (int) dragPosition.y-3, 5, 5); // D
      }
      Position topLeft = deepest!=null ? deepest.getTopLeft() : null;
      if (topLeft!=null) {
        //- deepest.drawBorder(g2D, topLeft, getColourScheme());
        deepest.drawInnerBorder(g2D, topLeft, getColourScheme(), true);
      }
      repaint();
    } else if (mark!=null) {
      Position topLeft = mark!=null ? mark.getTopLeft() : null;
      if (topLeft!=null) {

        mark.drawInnerBorder(g2D, topLeft, getColourScheme(), highlightMark());
      }
      repaint();
View Full Code Here

    g2D.fillRect(0, 0, width, height);
  }

  public Position getCentre() {
    Point p = getLocationOnScreen();
    return new Position(p.x + getWidth()/2, p.y + getHeight()/2);
  }
View Full Code Here

    return new Position(p.x + getWidth()/2, p.y + getHeight()/2);
  }

  public Position getTopLeft() {
    Point p = getLocationOnScreen();
    return new Position(p.x, p.y);
  }
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

    // Spread equations out evenly across the horizontal.
    if (width>0.0 && width<maxWidth) { // i.e. multiple lines with gaps.
      double scale = maxWidth/width; // final 'widest' has already been added.
      for (BoxEquation boxEquation : source) {
        if (boxEquation==null || !boxEquation.isValid()) continue;
        Position topLeft = boxEquation.getTopLeft();
        topLeft.x *= scale;
      }
    }
  }
View Full Code Here

      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);
      b.setTopLeft(topLeft);
      sum += step;
    }
  }
View Full Code Here

  }


  @Override
  public void paint(Graphics2D g2D, ColourScheme colourScheme, int fontSize, Offset panelRectangle) {
    Position position = null; // <--- Locally repurpose (q) version.
    if (boxSet!=null) {
      position = paintBoxes(g2D, colourScheme);
    }
    if (equationBox!=null && position!=null) {
      paintAnimation(g2D, colourScheme, position);
View Full Code Here

      paintAnimation(g2D, colourScheme, position);
    }
  }

  private Position paintBoxes(Graphics2D g2D, ColourScheme colourScheme) {
    Position position = null;
    for (BoxEquation boxEquation : boxSet) {
      if (animate && boxEquation.getEquation()==equationBox.getArgument().getEquation()) {
        position = boxEquation.getTopLeft();
      } else {
        g2D.setColor(Color.BLACK); // <-- use colourscheme.
View Full Code Here

    // Select current mouse location.
    // TODO: Move this to a separate selectCurrent() method where appropriate.

    DropLocation dl = transferSupport.getDropLocation();
    Point p = dl.getDropPoint();
    Position release = new Position(p.getX(), p.getY());

    Argument finishArgument = ketPanel.findDeepestArgument(release);
    if (finishArgument==null) {
      Equation finishEquation = finishArgument!=null ?
        finishArgument.getEquation() :
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.