Package org.eclipse.draw2d.geometry

Examples of org.eclipse.draw2d.geometry.Point


  /**
   * @param rect
   * @param policy
   */
  void exposeBorder(Rectangle rect, AbstractEditPolicy policy) {
    Point p = rect.getTopLeft();
    p = translateToViewport(((GraphicalEditPart) policy.getHost())
        .getFigure(), p);
    adjustVertical(p);
    p = rect.getBottomRight();
    p = translateToViewport(((GraphicalEditPart) policy.getHost())
View Full Code Here


  public void paintFigure(Graphics g) {
    List fragments = getFragmentsForRead();
    if (!fragments.isEmpty()) {
      FlowBox box = (FlowBox) fragments.get(0);
      g.drawImage(getSharedHTMLImage(), new Point(box._x, box._y));
    }
  }
View Full Code Here

      case CounterHelper.LIST_T_LOWER_ROMAN:
      case CounterHelper.LIST_T_UPPER_ROMAN:
      case CounterHelper.LIST_T_DECIMAL:
        g.setFont(font);
        String displayString = CounterUtil.convertCount(_count, type);
        Point point = getDrawPointForText(displayString);
        g.drawString(displayString, point);
        break;
      case CounterHelper.LIST_T_CIRCLE:
        drawArea = getDrawAreaForGraph(CIRCLE_DIAMETER, CIRCLE_DIAMETER);
        g.drawArc(drawArea, 0, 360);
View Full Code Here

    x = box.x - FigureUtilities.getTextWidth(displayString, font);
    x = x
        - (TEXT_PADDING - FigureUtilities.getFontMetrics(font)
            .getDescent());

    return new Point(x, y);
  }
View Full Code Here

      // parent.
      xOffset = (horizontal ? box._x : box._y) + leftValue;
    } else {
      xOffset = leftValue; // should not happen.
    }
    Point p;
    if (horizontal) {
      p = new Point(xOffset, 0);
    } else {
      p = new Point(0, xOffset);
    }
    containingPositionedFigure.translateFromParent(p);
    containingPositionedFigure.translateToAbsolute(p);
    parentFigure.translateToRelative(p);
    return horizontal ? p.x : p.y;
View Full Code Here

    updateBounds(r);

    String lett = getLetter(info);

    // Calculate the point to show the info
    Point p = getLoc(r);

    // Adjust background and foregound colors
    g.setBackgroundColor(getBackColor(info));
    g.setForegroundColor(getBordColor(info));
View Full Code Here

    int spannum = i / 4;
    int spansign = i % 2 == 0 ? 1 : -1;
    int y = (i % 4) < 2 ? rec.y : rec.height + rec.y - dim.height;
    int x = (i % 2 == 0 ? rec.x : rec.width + rec.x - dim.width) +
      (spannum * spansign * dim.width);
    return new Point(x, y);
  }
View Full Code Here

    "Diamond",
    "RoundRectWithInfo"};

  public NodeModel()
  {
    this(new Rectangle(new Point(0, 0), NodeModel.DEFAULT_SIZE));
  }
View Full Code Here

  {
    CompoundModel parent = this.getParentModel();

    if (parent != null && parent instanceof CompoundModel)
    {
      Point parentLocation = parent.getLocationAbs();
      p.translate(-parentLocation.x, -parentLocation.y);
    }

    this.setLocation(p);
  }
View Full Code Here

   *
   * @return current absolute location
   */
  public Point getLocationAbs()
  {
    Point location = this.constraint.getLocation();
    CompoundModel parent = this.getParentModel();

    if (parent != null && parent instanceof CompoundModel)
    {
      location.translate(parent.getLocationAbs());
    }

    return location;
  }
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.