Package org.eclipse.draw2d.geometry

Examples of org.eclipse.draw2d.geometry.Point


  /*
   * We should change this, it is too tricky to do in this way.
   */
  private Point adjustLocation(EditPart rootPart, Point point) {
    Point result = point.getCopy();
    Rectangle bounds = EditPartPositionHelper.getAbsoluteBounds(rootPart);
    if (!bounds.contains(point)) {
      if (bounds.getLeft().x > point.x) {
        result.x = bounds.getLeft().x;
      } else if (bounds.getRight().x < point.x) {
View Full Code Here


        final String hintText = getDropHintText(position);
        dropHintLabel.setText(hintText);
        //TODO: need to handle viewport clipping and adjust label location appropriately
        Dimension hintSize = dropHintLabel.getPreferredSize();
        Point hintLocation = new Point(mousePosition.x, mousePosition.y+DROP_HINT_VERTICAL_OFFSET);
        Rectangle hintRect = new Rectangle(hintLocation, hintSize);

        //Bug 303524 - [WPE] design view flickers on dnd of jsf html column
        //    (translateToRelative BEFORE intersect, so intersection happens on final display bounds)
        dropHintLabel.translateToRelative(hintRect);
View Full Code Here

  public EditPart getConstainedEditableContainer(DesignPosition position,
      Point p, GraphicalViewer viewer) {
    Rectangle rect = new Rectangle(p.x, p.y, 1, 1);
    Viewport port = ((IHTMLGraphicalViewer) viewer).getViewport();

    Point viewLocation = port.getViewLocation();
    Point lastLocation = viewLocation.getCopy();
    new ExposeHelper((IHTMLGraphicalViewer) viewer).exposeArea(rect);
    viewLocation = port.getViewLocation();
    Dimension offset = lastLocation.getDifference(viewLocation);

    p.translate(offset.width, offset.height);
    EditPart part = viewer.findObjectAt(p);
    if (part != null && !(part instanceof ScalableRootEditPart)) {
      while (part != null) {
View Full Code Here

  /**
   * @return the right bottom coordiate
   */
  public Point getRightBottom() {
    return new Point(_x + _width, _y + _height);
  }
View Full Code Here

        }

        public void paintFigure(Graphics graphics) {
            super.paintFigure(graphics);
            final  Image moveImage = PDPlugin.getDefault().getImage(MOVE_HANDLE_IMAGE_FILE);
            Point topLeft = getBounds().getTopLeft().getCopy();
            topLeft.performTranslate(3,3);
            graphics.drawImage(moveImage, topLeft);
        }
View Full Code Here

      return true;
    }

    // for other elements
    if (request instanceof LocationRequest) {
      Point location = ((LocationRequest) request).getLocation()
          .getCopy();
      part.getFigure().translateToRelative(location);
      return shouldUseObjectMode(location);
    }
        return false; // should not happen
View Full Code Here

    if (port == null) {
      return;
    }
    Rectangle exposeRegion = rect.getCopy();
    Rectangle portBounds = port.getBounds().getCopy();
    Point viewLocation = port.getViewLocation();
    Dimension diff = calculateDiff(portBounds, exposeRegion);
    if (diff != null) {
      viewLocation.x -= diff.width;
      viewLocation.y -= diff.height;
      canvas.scrollSmoothTo(viewLocation.x, viewLocation.y);
View Full Code Here

    Viewport port = _viewer.getViewport();

    if (port == null) {
      return;
    }
    Point viewLocation = port.getViewLocation();
    viewLocation.y += offset;
    canvas.scrollSmoothTo(viewLocation.x, viewLocation.y);
  }
View Full Code Here

    Viewport port = _viewer.getViewport();

    if (port == null) {
      return;
    }
    Point viewLocation = port.getViewLocation();
    viewLocation.x += offset;
    canvas.scrollSmoothTo(viewLocation.x, viewLocation.y);
  }
View Full Code Here

   * @param figure
   * @param p
   * @return the translated point
   */
  public Point translateToViewport(IFigure figure, Point p) {
    Point vp = getViewpostLocation();
    return new Point(p.x - vp.x, p.y - vp.y);
  }
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.