Package org.eclipse.jst.pagedesigner.css2.property

Examples of org.eclipse.jst.pagedesigner.css2.property.VerticalAlignMeta


   *
   * @return the default height
   * @see TextInputWidgetProvider#getDefaultHeight()
   */
  public int getDefaultHeight() {
    ICSSStyle style = this.getCSSStyle();
    if (style == null) {
      style = DefaultStyle.getInstance();
    }
    ICSSFont font = style.getCSSFont();
    Font swtfont = font.getSwtFont();
    int fontHeight = FigureUtilities.getFontMetrics(swtfont).getHeight();
    return (fontHeight) * _rows + VERTICAL_PADDING;
  }
View Full Code Here


   */
  public void paintFigure(Graphics g, Rectangle rect) {
    BorderUtil.drawBorder(g, rect.x, rect.y, rect.width, rect.height,
        BORDERTHICK, true);
    if (_options != null) {
      ICSSStyle style = this.getCSSStyle();
      if (style == null) {
        style = DefaultStyle.getInstance();
      }
      ICSSFont font = style.getCSSFont();
      Font swtfont = font.getSwtFont();
      g.setFont(swtfont);

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

  /**
   * @return
   */
  private int getDefaultHeight() {
    ICSSStyle style = this.getCSSStyle();
    if (style == null) {
      style = DefaultStyle.getInstance();
    }
    ICSSFont font = style.getCSSFont();
    Font swtfont = font.getSwtFont();
    int fontHeight = FigureUtilities.getFontMetrics(swtfont).getHeight();

    return (fontHeight) * _rows + VERTICAL_PADDING;
  }
View Full Code Here

  /**
   * @return
   */
  private int getDefaultWidth() {
    ICSSStyle style = this.getCSSStyle();
    if (style == null) {
      style = DefaultStyle.getInstance();
    }
    ICSSFont font = style.getCSSFont();

    int fontWidth = FigureUtilities.getFontMetrics(font.getSwtFont())
        .getAverageCharWidth();
    return _columns * fontWidth + ARRAWWIDTH + HORIZONTAL_PADDING;
  }
View Full Code Here

   *      org.eclipse.draw2d.geometry.Rectangle)
   */
  public void paintFigure(Graphics g, Rectangle rect) {
    if (_value != null) {
      g.clipRect(rect);
      ICSSStyle style = this.getCSSStyle();
      if (style == null) {
        style = DefaultStyle.getInstance();
      }
      int decoration = ((Integer) style
          .getStyleProperty(ICSSPropertyID.ATTR_TEXTDECORATION))
          .intValue();
      ICSSFont font = style.getCSSFont();
      g.setFont(font.getSwtFont());

      Color newColor = null;
      Object color = style.getColor();
      if (color instanceof Color) {
        g.setForegroundColor((Color) color);
      } else if (color instanceof RGB) {
        newColor = new Color(Display.getCurrent(), (RGB) color);
        g.setForegroundColor(newColor);
      } else {
        g.setForegroundColor(ColorConstants.black);
      }

      Object textAlign = style
          .getStyleProperty(ICSSPropertyID.ATTR_TEXTALIGN);
      int begin = 0;
      int end = 0;
      int fontHeight = FigureUtilities.getFontMetrics(font.getSwtFont())
          .getHeight();
View Full Code Here

   *      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());
    }

    Dimension d1 = _sub1.getPreferredDimension(-1, -1).getDimension();
    Dimension d2 = _sub2.getPreferredDimension(-1, -1).getDimension();

View Full Code Here

    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();
View Full Code Here

  protected void flush() {
    if (_fragments.isEmpty()) {
      createFirstLine();
    } else if (_fragments.size() == 1) {

      ICSSStyle style = getCSSStyle();
      int minWidth = 0, 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();
      }
View Full Code Here

    setLineVerticalAlign(line);
    setFontinfoForLine(line);

    if (firstline && getCSSStyle() != null) {
      ICSSStyle style = getCSSStyle();
      int minWidth = 0, 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();
      }
View Full Code Here

      }
    }
  }

  private void setLineVerticalAlign(LineBox box) {
    ICSSStyle style = getCSSStyle();
    if (style != null) {
      box.setVerticalAlignData(style
          .getStyleProperty(ICSSPropertyID.ATTR_VERTICAL_ALIGN));
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jst.pagedesigner.css2.property.VerticalAlignMeta

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.