Package org.eclipse.draw2d.geometry

Examples of org.eclipse.draw2d.geometry.Insets


        top += borderOffset;
        left += borderOffset;
        bottom += borderOffset;
        right += borderOffset;
      }
      _paddingInsets = new Insets(top, left, bottom, right);
    }
    return _paddingInsets;
  }
View Full Code Here


    if (_borderInsets == null) {
      int top = getInsetProperty(ICSSPropertyID.ATTR_BORDER_TOP_WIDTH);
      int left = getInsetProperty(ICSSPropertyID.ATTR_BORDER_LEFT_WIDTH);
      int bottom = getInsetProperty(ICSSPropertyID.ATTR_BORDER_BOTTOM_WIDTH);
      int right = getInsetProperty(ICSSPropertyID.ATTR_BORDER_RIGHT_WIDTH);
      _borderInsets = new Insets(top, left, bottom, right);
    }
    return _borderInsets;
  }
View Full Code Here

  /**
   * @param box
   * @param style
   */
  public static void setupBorderPaddingMargin(FlowBox box, ICSSStyle style) {
    box.setMarginInsets(new Insets(style.getMarginInsets()));
    box.setBorderInsets(new Insets(style.getBorderInsets()));
    box.setPaddingInsets(new Insets(style.getPaddingInsets()));

    if (box.getBorderPaddingHeight() > box.getHeight()) {
      box.setHeight(box.getBorderPaddingHeight());
    }
    if (box.getBorderPaddingWidth() > box.getWidth()) {
View Full Code Here

   *
   * @see org.eclipse.jst.pagedesigner.css2.provider.ICSSWidgetProvider#getPreferredDimension(int,
   *      int)
   */
  public DimensionInfo getPreferredDimension(int width, int height) {
    Insets borderInset = new Insets();
    Insets borderPaddingInset = new Insets();
    ICSSStyle style = getCSSStyle();
    if (style != null) {
      borderInset = style.getBorderInsets();
      borderPaddingInset = borderInset.getAdded(style.getPaddingInsets());
    }
View Full Code Here

   *      org.eclipse.draw2d.geometry.Rectangle)
   */
  public void paintFigure(Graphics g, Rectangle rect) {
    Rectangle rect1, rect2;

    Insets borderInset = new Insets();
    Insets paddingInset = new Insets();
    Insets borderPaddingInset = new Insets();
    ICSSStyle style = getCSSStyle();
    if (style != null) {
      borderInset = style.getBorderInsets();
      paddingInset = style.getPaddingInsets();
      borderPaddingInset.add(borderInset).add(paddingInset);
    }

    Dimension d1 = _sub1.getPreferredDimension(-1, -1).getDimension();
    Dimension d2 = _sub2.getPreferredDimension(-1, -1).getDimension();
    int prefWidth = d1.width + d2.width + 2 * borderPaddingInset.left + 2
View Full Code Here

      distributeHeights(contentHeight - sigmaHeight, _rowHeights);
    }

    // now we have calculated the width and height of all cells.
    // FIXME: border?
    Insets insets = (style == null ? new Insets() : style.getBorderInsets()
        .getAdded(style.getPaddingInsets()));
    _internalTableWidth = (_tableInfo.getColumnCount() + 1) * _hspacing;
    for (int i = 0; i < _columnWidths.length; i++) {
      _internalTableWidth += _columnWidths[i];
    }
    int minWidth = getLengthValue(style, ICSSPropertyID.ATTR_MIN_WIDTH);
    _internalTableWidth = _internalTableWidth > minWidth ? _internalTableWidth
        : minWidth;

    _blockBox.setWidth(_internalTableWidth + insets.getWidth());
    _internalTableHeight = (_tableInfo.getRowCount() + 1) * _vspacing;
    for (int i = 0; i < _rowHeights.length; i++) {
      _internalTableHeight += _rowHeights[i];
    }
    int minHeight = getLengthValue(style, ICSSPropertyID.ATTR_MIN_HEIGHT);
    _internalTableHeight = _internalTableHeight > minHeight ? _internalTableHeight
        : minHeight;

    int captionHeight = 0;
    if (_tableInfo.getCaption() != null) {
      _captionSize = _tableInfo.getCaption().getFigure().getPreferredSize(
          _internalTableWidth, SWT.DEFAULT);
      captionHeight = _captionSize.height;
    } else {
      _captionSize = null;
    }
    _internalTableHeight += captionHeight;

    _blockBox.setHeight(_internalTableHeight + insets.getHeight());

    _rowwidth = _internalTableWidth - 2 * _hspacing;
    _rowx = _hspacing; // XXX: table border width left?
  }
View Full Code Here

        _userSpecifiedHeight = h;
        _blockBox.setHeight(h);
        _blockBox.setRecommendedHeight(h);
      }
    }
    _blockBox.setMarginInsets(new Insets(style.getMarginInsets()));
    if (handlingBorderForBlock()) {
      BoxUtil.setupBorderPaddingMargin(_blockBox, getCSSStyle());
    }

    // as in designer, we don't want to the element to have zero size, so
View Full Code Here

    _blockBox._x = 0;
  }

  Insets getBorderPaddingInsets() {
    // FIXME:
    return new Insets();
  }
View Full Code Here

   * @see org.eclipse.draw2d.IFigure#getInsets()
   */
  public Insets getInsets() {
    CSSLayout layout = (CSSLayout) getLayoutManager();
    if (layout != null && !layout.handlingBorderForBlock()) {
      return new Insets();
    }
    ICSSStyle style = this.getCSSStyle();
    if (style != null) {
      return style.getBorderInsets().getAdded(style.getPaddingInsets());
    }
    return new Insets();
  }
View Full Code Here

  public void setValid(boolean value) {
    super.setValid(value);
  }

  public Insets getInsets() {
    return new Insets(8);
  }
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.