Package org.eclipse.draw2d.geometry

Examples of org.eclipse.draw2d.geometry.Insets


    @SuppressWarnings("unchecked")
    protected void addNodes(ElementEditPart elementEditPart) {
        Node n = new Node(elementEditPart);
        n.width = elementEditPart.getFigure().getPreferredSize(400, 300).width;
        n.height = elementEditPart.getFigure().getPreferredSize(400, 300).height;
        n.setPadding(new Insets(10, 8, 10, 12));
        partToNodesMap.put(elementEditPart, n);
        graph.nodes.add(n);
    }
View Full Code Here


   
  static Rectangle getColumnBounds(GraphicalEditPart editPart,
      IFigure target) {
      Rectangle bounds = getAdjustedColumnBoundingRectangle(editPart);
        target.translateToRelative(bounds);
        Insets insets = target.getInsets();
    bounds.translate(-insets.left, -insets.top);
    bounds.resize(insets.getWidth() + 1, insets.getHeight() + 1);
    return bounds;
  }
View Full Code Here

                new LineBorder(ColorConstants.black, 1)
                {
                    // add an extra pixel of inset to make sure the text
                    // isn't pressed against the border
                    public Insets getInsets(IFigure figure) {
                        return new Insets(getWidth()+1);
                    }
                }
        );
        addFeedback(dropHintLabel);
View Full Code Here

      bounds = ((HandleBounds) getReference()).getHandleBounds();
    } else {
      bounds = getReference().getBounds();
    }
    // bounds = new PrecisionRectangle(bounds.getResized(-1, -1));
    Insets referenceInsets = getReference().getInsets();

    Rectangle r = new Rectangle(bounds.x + bounds.width, bounds.y
        + referenceInsets.top, TableEditConst.WIDTH, bounds.height
        - referenceInsets.getHeight());
    bounds = new PrecisionRectangle(r);

    getReference().translateToAbsolute(bounds);
    target.translateToRelative(bounds);
View Full Code Here

                new LineBorder(ColorConstants.tooltipForeground, 1)
                {
                    // add an extra pixel of inset to make sure the text
                    // isn't pressed against the border
                    public Insets getInsets(IFigure figure) {
                        return new Insets(getWidth()+1);
                    }
                }
        );
        setTextAlignment(PositionConstants.CENTER);
        setForegroundColor(ColorConstants.tooltipForeground);
View Full Code Here

    CSSFigure figure = (CSSFigure) this.getHostFigure();
    if (figure.getFragmentsBounds().length != 1) {
      return false;
    }
    Rectangle bounds = figure.getBounds().getCopy();
    Insets insets = figure.getInsets();
    bounds.crop(insets);
    if (insets.top > THRESHHOLD && insets.left > THRESHHOLD
        && insets.right > THRESHHOLD && insets.bottom > THRESHHOLD) {
      return !bounds.contains(location);
    }
View Full Code Here

    }

    IFigure figure = ((GraphicalEditPart) this.getSourceEditPart())
        .getFigure();
    Rectangle bounds = figure.getBounds();
    Insets insets = figure.getInsets();
    Rectangle rect;
    if (_isrow) {
      int delta = calculateDelta();
      rect = new Rectangle(0, adapter.getRowResizeStart(_index) + delta,
          bounds.width - insets.getWidth(), adapter
              .getRowResizeWidth());
    } else {
      int delta = calculateDelta();
      rect = new Rectangle(adapter.getColumnResizeStart(_index) + delta,
          0, adapter.getColumnResizeWidth(), bounds.height
              - insets.getHeight());
    }
    rect.translate(bounds.x + insets.left, bounds.y + insets.top);

    figure.translateToAbsolute(rect);
    getMarqueeRectangleFigure().translateToRelative(rect);
View Full Code Here

    if (getReference() instanceof HandleBounds) {
      bounds = ((HandleBounds) getReference()).getHandleBounds();
    } else {
      bounds = getReference().getBounds();
    }
    Insets referenceInsets = getReference().getInsets();

    Rectangle r = new Rectangle(bounds.x + referenceInsets.left, bounds.y
        + bounds.height, bounds.width - referenceInsets.getWidth(),
        TableEditConst.HEIGHT);

    getReference().translateToAbsolute(r);
    target.translateToRelative(r);
View Full Code Here

   *
   * @see org.eclipse.jst.pagedesigner.css2.ICSSStyle#getPaddingInsets()
   */
  public Insets getPaddingInsets() {
      int offset = _prefs.getCssArtificialCellPadding();
        return new Insets(offset, offset, offset, offset);
  }
View Full Code Here

    if (_marginInsets == null) {
      int top = getInsetProperty(ICSSPropertyID.ATTR_MARGIN_TOP);
      int left = getInsetProperty(ICSSPropertyID.ATTR_MARGIN_LEFT);
      int bottom = getInsetProperty(ICSSPropertyID.ATTR_MARGIN_BOTTOM);
      int right = getInsetProperty(ICSSPropertyID.ATTR_MARGIN_RIGHT);
      _marginInsets = new Insets(top, left, bottom, right);
    }
    return _marginInsets;
  }
View Full Code Here

TOP

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

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.