Package org.eclipse.draw2d.geometry

Examples of org.eclipse.draw2d.geometry.Point


   */
  public abstract List<IRecord> createLayoutRecords(Rectangle layout,
      boolean onlyCreateNewRecords);

  public Rectangle getLayout() {
    Point loc = getLocation();
    Dimension dim = getSize();
    if (loc == null | dim == null)
      return null;
    else
      return new Rectangle(loc, dim);
View Full Code Here


  @Override
  public Point getLocation() {
    try {
      int x = getAttributeInt(SVGConstants.SVG_X_ATTRIBUTE);
      int y = getAttributeInt(SVGConstants.SVG_Y_ATTRIBUTE);
      return new Point(x, y);
    } catch (Exception e) {
      return null;
    }

  }
View Full Code Here

    return x;
  }

  protected static PointList performScale(PointList points, double sx,
      double sy) {
    Point anchor = points.getBounds().getLocation();
    int[] rawPoints = points.toIntArray();
    PointList ps = new PointList(points.size());
    int x, y;

    for (int i = 0; i < rawPoints.length; i += 2) {
View Full Code Here

   * Extends (or creates if applicable) the feedback and adds the last point.
   *
   * @param request
   */
  protected void showPointlistCreationFeedback(CreatePointlistRequest request) {
    Point p = new Point(request.getPoints().getLastPoint().getCopy());
    AbstractPointListShape feedback = getPolylineFeedback(request);
    /*
     * For efficiency reasons we don't use getPointListFor() and don't
     * normalize the feedback
     */
    feedback.translateToRelative(p);
    if (feedback.getPoints().size() == 0) {
      Point start = request.getPoints().getFirstPoint().getCopy();
      feedback.translateToRelative(start);
      feedback.addPoint(start);
    }
    feedback.addPoint(p);
  }
View Full Code Here

   * until reaching a record that is a composite.
   */
  public static LayoutElementRecord translateAndGetParent(
      Translatable translatable, LayoutElementRecord parent) {
    while (!parent.isComposite()) {
      Point loc = parent.getLayout().getLocation();
      translatable.performTranslate(loc.x, loc.y);
      parent = (LayoutElementRecord) parent.getParent();
    }
    return parent;
  }
View Full Code Here

   * until reaching the root
   */
  public static LayoutElementRecord translateToAndGetRoot(
      Translatable translatable, LayoutElementRecord parent) {
    while (!(parent instanceof SVGRootRecord)) {
      Point loc = parent.getLayout().getLocation();
      translatable.performTranslate(loc.x, loc.y);
      parent = (LayoutElementRecord) parent.getParent();
    }
    return parent;
  }
View Full Code Here

   
    private void hide(ElementMenuBar menuBar, boolean animate)
    {
        if (animate)
        {
            final Point endPoint = this.getLocation().getCopy();
            //TODO: don't understand when translation is necessary...
            //this.translateToAbsolute(endPoint);
           
            endPoint.x += this.getBounds().width / 2;
            endPoint.y += this.getBounds().height / 2;
View Full Code Here

     * Relocates the target figure to the reference point with possible x and y
     * offsetting.  Uses the target's preferredSize as the new size.
     */
    public void relocate(IFigure target)
    {
        Point leftTop = new Point(_referencePoint.x+_xOffset, _referencePoint.y+_yOffset);
       

        //figure.translateToAbsolute(leftTop);
        target.translateToRelative(leftTop);
        Dimension d = target.getPreferredSize();
View Full Code Here

            _endPoint = endPoint;
        }
       
        public void relocate(IFigure target)
        {
            final Point newEndPoint = _endPoint.getCopy();
            target.translateToRelative(_endPoint);
            Rectangle startBounds = target.getBounds().getCopy();
            animateBoundsChange(target, startBounds, newEndPoint);
        }
View Full Code Here

    }
    IMovementMediator moveMediator = new InlineEditingNavigationMediator(
        new ActionData(ActionData.KEYBOARD_NAVAGATION, null));
    DesignPosition position = range.getEndPosition();
    Caret caret = _viewer.getCaret();
    Point point = null;
    DesignPosition newPos = position;
    EditPart containerpart = null, rootpart1;
    if (_up) {
      point = new Point(((CaretPositionTracker) _viewer).getXoffset(),
          caret.getBounds().y);
    } else {
      point = new Point(((CaretPositionTracker) _viewer).getXoffset(),
          caret.getBounds().y + caret.getBounds().height);

    }
    rootpart1 = getRootEditablePart(position.getContainerPart(),
        moveMediator);// position.getContainerPart();
View Full Code Here

TOP

Related Classes of org.eclipse.draw2d.geometry.Point

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.