Search in sources :

Example 16 with TableLayout

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

the class ArgumentsFigure method paintFigure.

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

Example 17 with TableLayout

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

the class PatternsFigure method paintFigure.

@Override
protected void paintFigure(Graphics graphics) {
    super.paintFigure(graphics);
    TableLayout l = getLayoutManager();
    if (l.rows() == 0)
        return;
    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 18 with TableLayout

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

the class SelectionPointFigure method paintFigure.

protected void paintFigure(Graphics g) {
    super.paintFigure(g);
    TableLayout l = getLayoutManager();
    if (l.rows() == 0)
        return;
    if (asStageDown) {
        final int SP = 2, HM = 3;
        g.setBackgroundColor(FigureConstants.hostLanguageColor);
        Rectangle b = getTableBounds();
        Rectangle b0 = l.getColumnBounds(0);
        g.fillRectangle(b0.right() - 1, b.y, b.width - b0.width - 1, b.height);
        g.setForegroundColor(ColorConstants.lightGray);
        g.drawRectangle(b0.right() - 1, b.y, b.width - b0.width - 1, b.height - 1);
        g.setLineStyle(SWT.LINE_CUSTOM);
        g.setLineDash(new int[] { 1, 3 });
        g.setForegroundColor(ColorConstants.gray);
        Rectangle.SINGLETON.setLocation(b.x, b.y);
        Rectangle.SINGLETON.setSize(b0.width + HM + SP, b.height);
        g.setClip(Rectangle.SINGLETON);
        g.drawRectangle(b.x, b.y, b0.width + HM + SP, b.height - 1);
        g.setClip(b);
        g.setLineStyle(SWT.LINE_SOLID);
        g.setLineDash((int[]) null);
    }
    g.setForegroundColor(ColorConstants.lightGray);
    drawRowSeparators(g);
// g.setForegroundColor(ColorConstants.gray);
// 
// g.setLineStyle(SWT.LINE_CUSTOM);
// g.setLineDash(new int[] {1,3});
// drawRowSeparators(g);
// g.setLineStyle(SWT.LINE_SOLID);
// g.setLineDash((int[]) null);
}
Also used : Rectangle(org.eclipse.draw2d.geometry.Rectangle) TableLayout(org.whole.lang.ui.layout.TableLayout)

Example 19 with TableLayout

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

the class BindingsTableFigure method paintFigure.

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

Example 20 with TableLayout

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

the class InputBindingsTableFigure method paintFigure.

protected void paintFigure(Graphics g) {
    super.paintFigure(g);
    TableLayout l = getLayoutManager();
    if (l.rows() == 0)
        return;
    if (asStageDown) {
        final int SP = 2, HM = 3;
        g.setBackgroundColor(FigureConstants.hostLanguageColor);
        Rectangle b = getTableBounds();
        Rectangle b0 = l.getColumnBounds(0);
        g.fillRectangle(b.x + 1, b.y, b.width - 2, b.height);
    // g.fillRectangle(b0.right()-1, b.y, b.width-b0.width-1, b.height);
    // g.setForegroundColor(ColorConstants.lightGray);
    // g.drawRectangle(b0.right()-1, b.y, b.width-b0.width-1, b.height-1);
    // g.setLineStyle(SWT.LINE_CUSTOM);
    // g.setLineDash(new int[] {1,3});
    // g.setForegroundColor(ColorConstants.gray);
    // Rectangle.SINGLETON.setLocation(b.x, b.y);
    // Rectangle.SINGLETON.setSize(b0.width+HM+SP, b.height);
    // g.setClip(Rectangle.SINGLETON);
    // g.drawRectangle(b.x, b.y, b0.width+HM+SP, b.height-1);
    // g.setClip(b);
    }
    g.setForegroundColor(ColorConstants.lightGray);
    g.setLineStyle(SWT.LINE_SOLID);
    g.setLineDash((int[]) null);
    drawRowSeparators(g);
    drawColumnSeparators(g);
// drawTableBottomBorder(g);
// drawTableBorder(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