Package org.eclipse.jst.pagedesigner.css2

Examples of org.eclipse.jst.pagedesigner.css2.ICSSStyle


   * Called by flush(), adds the BlockBox associated with this BlockFlowLayout
   * to the current line and then ends the line.
   */
  protected void endBlock() {
    layoutLines();
    ICSSStyle style = getCSSStyle();
    if (style != null) {
      int minWidth = 0;
      int minHeight = 0;
      // try to see whether there is any designer specified min size
      ITagEditInfo info = (ITagEditInfo) style
          .getAdapter(ITagEditInfo.class);
      if (info != null) {
        minWidth = info.getMinWidth();
        minHeight = info.getMinHeight();
      }

      // CSS also has the min-width/min-height property. We should also
      // get that,
      // and using the max of the "min-width" css property and the
      // designer specified min size.
      int height = getLengthValue(style, ICSSPropertyID.ATTR_MIN_HEIGHT);
      if (height > minHeight) {
        minHeight = height;
      }
      int width = getLengthValue(style, ICSSPropertyID.ATTR_MIN_WIDTH);
      if (width > minWidth) {
        minWidth = width;
      }
      if (minHeight > _blockBox.getHeight()) {
        _blockBox.setHeight(minHeight);
      }
      if (minWidth > _blockBox.getWidth()) {
        _blockBox.setWidth(minWidth);
      }
    }

    // reset scroll information.
    this._needHScroll = this._needVScroll = false;

    // ok, now we need to adjust the _blockBox's size according to the
    // "overflow" setting.
    // depends on different "overflow" style of this block, different sizing
    // policy may apply.
    // ICSSStyle style = this.getCSSStyle();
    if (style != null) {
      Object overflow = style
          .getStyleProperty(ICSSPropertyID.ATTR_OVERFLOW);
      if (ICSSPropertyID.VAL_HIDDEN.equals(overflow)) {
        if (_userSpecifiedWidth > 0) {
          _blockBox.setWidth(_userSpecifiedWidth);
        }
View Full Code Here


    // line.validate();
  }

  private void setFontinfoForLine(LineBox line) {

    ICSSStyle style = getCSSStyle();
    if (style != null) {
      if (_fontMetrices == null) {
        // as getSwtFont is resource consuming, so we cache the
        // _fontMetrics.
        _fontMetrices = FigureUtilities.getFontMetrics(style
            .getCSSFont().getSwtFont());
      }
      line.setFontMetrics(_fontMetrices);
    }
  }
View Full Code Here

  /**
   * when the "overflow" is "scroll", we need to paint the scrollbar
   */
  public void paintFigurePostClientArea(Graphics g) {
    ICSSStyle style = this.getCSSStyle();
    if (style != null) {
      Object overflow = style
          .getStyleProperty(ICSSPropertyID.ATTR_OVERFLOW);
      if (ICSSPropertyID.VAL_SCROLL.equals(overflow)
          || ICSSPropertyID.VAL_AUTO.equals(overflow)) {
        if (this._needHScroll || this._needVScroll) {
          // as this is using localCoordinate, so translate to
View Full Code Here

  }

  public ICSSStyle getCSSStyle() {
    IFigure parentFigure = this.getParent();
    if (parentFigure instanceof ICSSFigure) {
      ICSSStyle style = ((ICSSFigure) parentFigure).getCSSStyle();
      if (style != null) {
        return style;
      }
    }
    return DefaultStyle.getInstance();
View Full Code Here

    _sub2.paintFigure(g, innerRect2.getCopy().crop(paddingInset));
    // _sub1.paintFigure(g, innerRect1.crop(paddingInset));
  }

  private String getBorderStyle(String edge) {
    ICSSStyle style = getCSSStyle();
    if (style != null) {
      String property = MessageFormater
          .format(BODER_QUERY_TEMPLETE, edge);
      String borderStyle = style.getStyleProperty(property).toString();
      return borderStyle;
    }
    return ICSSPropertyID.VAL_HIDDEN;
  }
View Full Code Here

   * (non-Javadoc)
   *
   * @see org.eclipse.jst.pagedesigner.css2.layout.ICSSPainter#paintFigure(org.eclipse.draw2d.Graphics)
   */
  public void paintFigure(Graphics g) {
    ICSSStyle style = this.getCSSStyle();
    if (style == null) {
      style = DefaultStyle.getInstance();
    }

    Rectangle drawArea = null;
    Font font = getCSSStyle().getCSSFont().getSwtFont();

    // draw the marker box
    Object styleType = style
        .getStyleProperty(ICSSPropertyID.ATTR_LIST_STYLE_TYPE);

    g.pushState();

    Color newColor = null;
    Object color = style.getColor();
    if (color instanceof Color) {
      g.setForegroundColor((Color) color);
      g.setBackgroundColor((Color) color);
    } else if (color instanceof RGB) {
      newColor = new Color(Display.getCurrent(), (RGB) color);
View Full Code Here

    this._rowIndex = context.getCurrentRow();
    List children = getFigure().getChildren();
    for (int i = 0, size = children.size(); i < size; i++) {
      IFigure childfigure = (IFigure) children.get(i);
      if (childfigure instanceof ICSSFigure) {
        ICSSStyle childstyle = ((ICSSFigure) childfigure).getCSSStyle();
        if (childstyle != null
            && "table-row" //$NON-NLS-1$
                .equalsIgnoreCase(childstyle.getDisplay())) {
          TableRowInfo rowInfo = new TableRowInfo(
              (ICSSFigure) childfigure);
          _rowList.add(rowInfo);
          rowInfo.calculateRow(context);
        } else {
View Full Code Here

      }
    }
  }

  private String getVerticalAlign() {
    ICSSStyle style = getCSSStyle();
    if (style != null) {
      return style.getStyleProperty(ICSSPropertyID.ATTR_VERTICAL_ALIGN)
          .toString();
    }
    return VerticalAlignMeta.MIDDLE;
  }
View Full Code Here

   * (non-Javadoc)
   *
   * @see org.eclipse.draw2d.IFigure#paint(org.eclipse.draw2d.Graphics)
   */
  public void paint(Graphics graphics) {
    ICSSStyle style = getCSSStyle();
    if (style != null) {
      Object visibility = style
          .getStyleProperty(ICSSPropertyID.ATTR_VISIBILITY);
      // handle visibility: hidden here.
      // TODO: "collapse" is not supported yet!
      if (VisibilityMeta.HIDDEN.equals(visibility)) {
        return;
View Full Code Here

    if (this.getChildren().isEmpty()) {
      return;
    }

    Object overflow = ICSSPropertyID.VAL_VISIBLE;
    ICSSStyle style = this.getCSSStyle();
    if (style != null) {
      overflow = style.getStyleProperty(ICSSPropertyID.ATTR_OVERFLOW);
    }

    boolean optimizeClip = ICSSPropertyID.VAL_VISIBLE.equals(overflow);

    if (useLocalCoordinates()) {
View Full Code Here

TOP

Related Classes of org.eclipse.jst.pagedesigner.css2.ICSSStyle

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.