Package org.eclipse.draw2d.geometry

Examples of org.eclipse.draw2d.geometry.Rectangle


        Node node = getNode();
        Integer x = (Integer) node.getMetaData("x");
        Integer y = (Integer) node.getMetaData("y");
        Integer width = (Integer) node.getMetaData("width");
        Integer height = (Integer) node.getMetaData("height");
        return new Rectangle(
            x == null ? 0 : x,
            y == null ? 0 : y,
            width == null ? -1 : width,
            height == null ? -1 : height);
    }
View Full Code Here


        Node node = getNode();
        Integer x = (Integer) node.getMetaData("x");
        Integer y = (Integer) node.getMetaData("y");
        Integer width = (Integer) node.getMetaData("width");
        Integer height = (Integer) node.getMetaData("height");
        return new Rectangle(
            x == null ? 0 : x,
            y == null ? 0 : y,
            width == null ? -1 : width,
            height == null ? -1 : height);
    }
View Full Code Here

    }

    protected Object createModel() {
        RuleFlowProcessWrapper result = new RuleFlowProcessWrapper();
        StartNodeWrapper start = new StartNodeWrapper();
        start.setConstraint(new Rectangle(100, 100, -1, -1));
        result.addElement(start);
        start.setParent(result);
        IFile file = ((IFileEditorInput)getEditorInput()).getFile();
        String name = file.getName();
        result.setName(name.substring(0, name.length() - 3));
View Full Code Here

    buf.append("<map name=\"generated_map\">\n");

    // we need to find out the source rect that was taken
    // to construct the image, so we can base the bounds
    // on this minimal bound
    Rectangle rect = partRectangleMap.get(root);
   
    // for all the saved children
    for (RenderedChildInformation child : partChildrenListMap.get(root)) {
     
      // do any edit parts link up to this one?
      DiagramEditPart found = null;
      for (DiagramEditPart target : partEObjectMap.keySet()) {
        if (EcoreUtil.equals(partEObjectMap.get(target), child.getResolvedObject())) {
          found = target;
          break;
        }
      }
     
      if (found != null) {
        // found a link
        // assume the link is square
       
        Rectangle bounds = child.getBounds();
        IPath dest = partDestinationMap.get(found);
       
        buf.append("<area shape=\"rect\" coords=\"")
          .append(bounds.x-rect.x).append(",")
          .append(bounds.y-rect.y).append(",")
          .append(bounds.width+bounds.x-rect.x).append(",")
          .append(bounds.height+bounds.y-rect.y)
          .append("\" href=\"")
          .append(escapeHTML(getHTMLDestinationFor(dest).lastSegment()))
          .append("\" alt=\"")
          .append(escapeHTML(child.getTooltip()))
          .append("\" title=\"")
          .append(escapeHTML(child.getTooltip()))
          .append("\" />\n");
      } else {
        // we can still add tooltip information anyway

        Rectangle bounds = child.getBounds();
       
        buf.append("<area shape=\"rect\" coords=\"")
          .append(bounds.x-rect.x).append(",")
          .append(bounds.y-rect.y).append(",")
          .append(bounds.width+bounds.x-rect.x).append(",")
View Full Code Here

      partDestinationMap.put(part, destination);
      partEObjectMap.put(part, part.resolveSemanticElement());
     
      // make a copy of the image rectangle used
      // we do this before we close the editor, so that we don't lose the editor instance/children
      Rectangle rect = DiagramImageUtils.calculateImageRectangle(
          part.getPrimaryEditParts(),
          getImageMargin(part),
          getEmptyImageSize(part));
      partRectangleMap.put(part, rect);
     
View Full Code Here

   */
  @Override
  protected void paintFigure(Graphics g) {
  super.paintFigure(g);

  Rectangle r = getClientArea();

  PointList points = new PointList();
    points.addPoint(r.x+10, r.y+10) ;
    points.addPoint(r.x+21, r.y) ;

View Full Code Here

   */
  @Override
    protected void paintFigure(Graphics g) {
    super.paintFigure(g);

    Rectangle r = getClientArea();
   
    PointList points = new PointList();
    points.addPoint(r.x+20, r.y) ;
    points.addPoint(r.x + r.width - 20, r.y) ;
    points.addPoint(r.x + r.width - 20, r.y +r.height) ;
View Full Code Here

  protected void paintFigure(Graphics g) {
    super.paintFigure(g);
//    System.out.println("ElementFigure.paintFigure");
    //the height and weight for the figure could only be accessed here
    //after the figure it painted!
    Rectangle r = getClientArea();
    this.height = r.height;
    this.width = r.width;

  }
View Full Code Here

   */
  @Override
    protected void paintFigure(Graphics g) {
    super.paintFigure(g);

    Rectangle r = getClientArea();
   
    PointList points = new PointList();
    points.addPoint(r.x, r.y +r.height / 2-1) ;
    points.addPoint(r.x + r.width * 1/64, r.y +r.height*1/4) ;
    points.addPoint(r.x + r.width * 1/16, r.y+r.height*1/16) ;
View Full Code Here

     */
    @Override
    protected void paintFigure(Graphics g) {
    super.paintFigure(g);

    Rectangle r = getClientArea();

    PointList points = new PointList();
    points.addPoint(r.x+20, r.y) ;
    points.addPoint(r.x+ r.width-1, r.y) ;
    points.addPoint(r.x+ r.width - 20, r.y + r.height-1) ;
View Full Code Here

TOP

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

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.