Package org.eclipse.draw2d

Examples of org.eclipse.draw2d.IFigure


            _mouseOverBorder.setForegroundColor(HOVER_FEEDBACK_COLOR);
        }
       
        addFeedback(_mouseOverBorder);
       
        IFigure hostFigure = getHostFigure();
        Rectangle r = hostFigure.getBounds().getCopy().expand(1, 1);
        hostFigure.translateToAbsolute(r);
        _mouseOverBorder.translateToRelative(r);

        _mouseOverBorder.setBounds(r);
    }
View Full Code Here


    // First the cells don't span multiple rows.
    cells = _tableInfo.getCells();
    for (int i = 0, size = cells.size(); i < size; i++) {
      TableCellInfo cellinfo = (TableCellInfo) cells.get(i);
      IFigure figure = cellinfo.getFigure();
      int rowspan = cellinfo.getRowSpan();
      if (rowspan == 1) {
        int cellWidth = getCellWidth(cellinfo, _columnWidths);
        Dimension d = figure.getPreferredSize(cellWidth, cellinfo
            .getHeight());
        if (d.height > _rowHeights[cellinfo.getRowIndex()]) {
          _rowHeights[cellinfo.getRowIndex()] = d.height;
        }
      }
    }

    // Next those cells span multiple rows.
    cells = _tableInfo.getCells();
    for (int i = 0, size = cells.size(); i < size; i++) {
      TableCellInfo cellinfo = (TableCellInfo) cells.get(i);
      IFigure figure = cellinfo.getFigure();
      int rowspan = cellinfo.getRowSpan();
      if (rowspan > 1) {
        int cellWidth = getCellWidth(cellinfo, _columnWidths);
        Dimension d = figure.getPreferredSize(cellWidth, cellinfo
            .getHeight());
        if (d.height > getCellHeight(cellinfo, _rowHeights)) {
          adjustHeight(cellinfo.getRowIndex(), rowspan, d.height,
              _rowHeights);
        }
View Full Code Here

          .getAdapter(ITagEditInfo.class);
      if (info != null && info.needTableDecorator()) {
        List cells = _tableInfo.getCells();
        for (int i = 0, size = cells.size(); i < size; i++) {
          TableCellInfo cellInfo = (TableCellInfo) cells.get(i);
          IFigure cellfigure = cellInfo.getFigure();
          Rectangle rect = cellfigure.getBounds().getCopy();
          rect = rect.expand(1, 1);
          g.setLineStyle(Graphics.LINE_SOLID);
          g.setLineWidth(1);
          g.setForegroundColor(ColorConstants.lightGray);
          g.drawRectangle(rect);
View Full Code Here

  /**
   * @return the parent figure of TRGroup should be table figure. If so, return the
     * corresponding table layout.
   */
  public CSSTableLayout2 getTableLayoutContext() {
    IFigure parent = getCSSFigure().getParent();
    if (parent != null) {
      LayoutManager parentLayout = parent.getLayoutManager();
      if (parentLayout instanceof CSSTableLayout2) {
        return (CSSTableLayout2) parentLayout;
      }
    }

View Full Code Here

   * (non-Javadoc)
   *
   * @see org.eclipse.draw2d.Figure#paintChildren(org.eclipse.draw2d.Graphics)
   */
  protected void paintChildren(Graphics graphics) {
    IFigure child;

    Rectangle clip = Rectangle.SINGLETON;
    List children = this.getChildren();
    for (int i = 0; i < children.size(); i++) {
      child = (IFigure) children.get(i);
      if (child.isVisible() && child.intersects(graphics.getClip(clip))) {
        // graphics.clipRect(child.getBounds());
        child.paint(graphics);
        graphics.restoreState();
      }
    }
  }
View Full Code Here

    _provider = provider;
    this.setLayoutManager(createDefaultFlowLayout());
  }

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

   */
  public void calculateRowGroup(TableInfoContext context) {
    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())) {
View Full Code Here

   * corresponding table layout.
   *
   * @return the table layout context
   */
  public CSSTableLayout2 getTableLayoutContext() {
    IFigure parent = getCSSFigure().getParent();
    if (parent != null) {
      LayoutManager parentLayout = parent.getLayoutManager();
      if (parentLayout instanceof CSSTRLayout) {
        return ((CSSTRLayout) parentLayout).getTableLayoutContext();
      }
    }

View Full Code Here


    void constructTable() {
    List child = getFigure().getChildren();
    for (int i = 0, size = child.size(); i < size; i++) {
      IFigure childfigure = (IFigure) child.get(i);
      if (childfigure instanceof ICSSFigure) {
        ICSSStyle style = ((ICSSFigure) childfigure).getCSSStyle();
        if (style != null) {
          String display = style.getDisplay();
          if ("table-caption".equalsIgnoreCase(display)) //$NON-NLS-1$
View Full Code Here

  /**
   * @return the parent figure of TRGroup should be table figure. If so, return the
     * corresponding table layout.
   */
  public CSSTableLayout2 getTableLayoutContext() {
    IFigure parent = getCSSFigure().getParent();
    if (parent != null) {
      LayoutManager parentLayout = parent.getLayoutManager();
      if (parentLayout instanceof CSSTableLayout2) {
        return (CSSTableLayout2) parentLayout;
      } else if (parentLayout instanceof CSSTRGroupLayout) {
        return ((CSSTRGroupLayout) parentLayout)
            .getTableLayoutContext();
View Full Code Here

TOP

Related Classes of org.eclipse.draw2d.IFigure

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.