Search in sources :

Example 11 with TableLayout

use of org.whole.lang.ui.layout.TableLayout in project whole by wholeplatform.

the class TableFigure method drawRowSeparatorBefore.

protected void drawRowSeparatorBefore(Graphics g, int rowIndex, int leftMargin, int rightMargin) {
    TableLayout l = getLayoutManager();
    int columns = l.columns();
    if (rowIndex < columns) {
        Rectangle ca = getTableBounds();
        Rectangle r = l.getRowBounds(rowIndex + (l.hasHeaderRow() ? 1 : 0));
        g.drawLine(ca.x - leftMargin, r.y, ca.right() - 1 + rightMargin, r.y);
    }
}
Also used : Rectangle(org.eclipse.draw2d.geometry.Rectangle) TableLayout(org.whole.lang.ui.layout.TableLayout)

Example 12 with TableLayout

use of org.whole.lang.ui.layout.TableLayout in project whole by wholeplatform.

the class FeatureTableTypeTableFigure method paintFigure.

protected void paintFigure(Graphics g) {
    super.paintFigure(g);
    TableLayout l = getLayoutManager();
    if (l.rows() == 0)
        return;
    g.setForegroundColor(ColorConstants.lightGray);
    drawColumnSeparators(g);
    // drawColumnSeparatorBefore(g, 1);
    Rectangle ca = getTableBounds();
    Rectangle c = l.getColumnBounds(1);
    Rectangle r = l.getRowBounds(1);
    g.drawLine(c.x, r.y, ca.right() - 1, r.y);
}
Also used : Rectangle(org.eclipse.draw2d.geometry.Rectangle) TableLayout(org.whole.lang.ui.layout.TableLayout)

Example 13 with TableLayout

use of org.whole.lang.ui.layout.TableLayout in project whole by wholeplatform.

the class VariantsTableFigure method paintFigure.

protected void paintFigure(Graphics g) {
    super.paintFigure(g);
    TableLayout l = getLayoutManager();
    if (l.rows() == 0)
        return;
    g.setBackgroundColor(ColorConstants.orange);
    g.setBackgroundColor(ColorConstants.orange);
    int oldAlpha = g.getAlpha();
    g.setAlpha(100);
    Rectangle tb = getTableBounds();
    Rectangle cb = l.getColumnBounds(1);
    g.fillRectangle(cb.x, tb.y, cb.width + 1, tb.height);
    g.setAlpha(40);
    cb = l.getColumnBounds(0);
    if (variantIndex != -1) {
        Rectangle vb = l.getCellBounds(0, variantIndex);
        g.fillRectangle(cb.x, tb.y, cb.width + 1, vb.y - tb.y);
        g.fillRectangle(cb.x, vb.bottom(), cb.width + 1, tb.bottom() - vb.bottom());
    } else {
        g.fillRectangle(cb.x, tb.y, cb.width + 1, tb.height);
    }
    g.setAlpha(oldAlpha);
    g.setForegroundColor(ColorConstants.orange);
    drawRowSeparators(g);
}
Also used : Rectangle(org.eclipse.draw2d.geometry.Rectangle) TableLayout(org.whole.lang.ui.layout.TableLayout)

Example 14 with TableLayout

use of org.whole.lang.ui.layout.TableLayout in project whole by wholeplatform.

the class DeclarationsFigure method paintFigure.

@Override
protected void paintFigure(Graphics graphics) {
    super.paintFigure(graphics);
    TableLayout l = getLayoutManager();
    if (l.rows() == 0)
        return;
    Rectangle b = getBounds();
    graphics.setBackgroundColor(FigureConstants.hostLanguageColor);
    graphics.fillRectangle(b.x, b.y, b.width, b.height);
    graphics.setBackgroundColor(ColorConstants.gray);
    drawHeadersRowBackground(graphics);
    graphics.setBackgroundColor(FigureConstants.modulesColor);
    int oldAlpha = graphics.getAlpha();
    graphics.setAlpha(getBackgroundAlpha());
    Rectangle tb = getTableBounds();
    Rectangle cb1 = l.getColumnBounds(1);
    graphics.fillRectangle(cb1.x, tb.y, cb1.width + l.getColumnBounds(2).width, tb.height);
    graphics.setAlpha(oldAlpha);
    graphics.setForegroundColor(ColorConstants.lightGray);
    drawRowSeparators(graphics);
    drawHeadersRowSeparator(graphics);
    drawTableBottomBorder(graphics);
}
Also used : Rectangle(org.eclipse.draw2d.geometry.Rectangle) TableLayout(org.whole.lang.ui.layout.TableLayout)

Example 15 with TableLayout

use of org.whole.lang.ui.layout.TableLayout in project whole by wholeplatform.

the class EnumValuesFigure method paintFigure.

protected void paintFigure(Graphics g) {
    super.paintFigure(g);
    TableLayout l = getLayoutManager();
    if (l.rows() == 0)
        return;
    g.setForegroundColor(ColorConstants.lightGray);
    drawHeadersRowSeparator(g);
    drawColumnSeparators(g);
}
Also used : TableLayout(org.whole.lang.ui.layout.TableLayout)

Aggregations

TableLayout (org.whole.lang.ui.layout.TableLayout)37 Rectangle (org.eclipse.draw2d.geometry.Rectangle)25 TableFigure (org.whole.lang.ui.figures.TableFigure)6 Graphics (org.eclipse.draw2d.Graphics)4 Point (org.eclipse.draw2d.geometry.Point)3 IEntityFigure (org.whole.lang.ui.figures.IEntityFigure)3 TableRowFigure (org.whole.lang.ui.figures.TableRowFigure)3 IFigure (org.eclipse.draw2d.IFigure)2 CompositeFigure (org.whole.lang.ui.figures.CompositeFigure)1 EntityFigure (org.whole.lang.ui.figures.EntityFigure)1 ITextFigure (org.whole.lang.ui.figures.ITextFigure)1 MonoLayout (org.whole.lang.ui.layout.MonoLayout)1 TableRowLayout (org.whole.lang.ui.layout.TableRowLayout)1 CompositeTableFigure (org.whole.lang.ui.notations.styledtree.figures.CompositeTableFigure)1 NodeWithCompositeBranchFigure (org.whole.lang.ui.notations.styledtree.figures.NodeWithCompositeBranchFigure)1 IFeatureStyling (org.whole.lang.ui.notations.styledtree.styling.IFeatureStyling)1