Search in sources :

Example 31 with TableLayout

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

the class SimpleEntityTableFigure method createTableFigure.

protected TableFigure createTableFigure(int columns) {
    return new TableFigure(new TableLayout(columns).withColumnSpacing(10).withRowSpacing(2).withMargin(0, 16, 0, 0)) {

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

Example 32 with TableLayout

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

the class SimpleEntityTreeTableFigure method createTableFigure.

protected TableFigure createTableFigure(int columns) {
    return new TableFigure(new TableLayout(columns).withColumnSpacing(10).withMarginTop(0).withMarginBottom(0)) {

        protected void paintFigure(Graphics g) {
            super.paintFigure(g);
            g.setBackgroundColor(ColorConstants.lightGray);
            drawAlternateColumnsBackground(g, 0);
            g.setForegroundColor(FigureConstants.blueColor);
            drawHeadersRowSeparator(g);
            g.setForegroundColor(ColorConstants.lightGray);
            drawColumnSeparators(g);
            int oldAlpha = g.getAlpha();
            g.setAlpha(80);
            drawRowSeparators(g);
            g.setAlpha(oldAlpha);
        }
    };
}
Also used : Graphics(org.eclipse.draw2d.Graphics) TableFigure(org.whole.lang.ui.figures.TableFigure) TableLayout(org.whole.lang.ui.layout.TableLayout) Point(org.eclipse.draw2d.geometry.Point)

Example 33 with TableLayout

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

the class FeaturesTableFigure method paintFigure.

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

Example 34 with TableLayout

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

the class ModelDeclarationsTableFigure method paintFigure.

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

Example 35 with TableLayout

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

the class VariantsFigure method paintFigure.

@Override
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(oldAlpha);
    g.setForegroundColor(ColorConstants.orange);
    drawRowSeparators(g);
}
Also used : Rectangle(org.eclipse.draw2d.geometry.Rectangle) 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