Search in sources :

Example 26 with TableLayout

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

the class CasesTableFigure method paintFigure.

protected void paintFigure(Graphics g) {
    super.paintFigure(g);
    TableLayout l = getLayoutManager();
    if (l.rows() == 0)
        return;
    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 : TableLayout(org.whole.lang.ui.layout.TableLayout)

Example 27 with TableLayout

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

the class ChooseTemplateTableFigure 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 28 with TableLayout

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

the class OutputBindingsTableFigure 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.setForegroundColor(ColorConstants.lightGray);
    g.setLineStyle(SWT.LINE_SOLID);
    g.setLineDash((int[]) null);
    drawRowSeparators(g);
}
Also used : Rectangle(org.eclipse.draw2d.geometry.Rectangle) TableLayout(org.whole.lang.ui.layout.TableLayout)

Example 29 with TableLayout

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

the class AttributesTableFigure method paintFigure.

protected void paintFigure(Graphics g) {
    super.paintFigure(g);
    TableLayout l = getLayoutManager();
    if (l.rows() == 0)
        return;
    g.setBackgroundColor(ColorConstants.lightGray);
    int oldAlpha = g.getAlpha();
    int backgroundAlpha = getBackgroundAlpha();
    g.setAlpha(backgroundAlpha);
    Rectangle tb = getTableBounds();
    Rectangle cb = l.getColumnBounds(0);
    g.fillRectangle(cb.x, tb.y, cb.width + 1, tb.height);
    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 30 with TableLayout

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

the class ObjectFigure method paintFigure.

@Override
protected void paintFigure(Graphics graphics) {
    super.paintFigure(graphics);
    TableLayout l = getLayoutManager();
    if (l.rows() == 0)
        return;
    graphics.setBackgroundColor(ColorConstants.lightGray);
    int oldAlpha = graphics.getAlpha();
    graphics.setAlpha(getBackgroundAlpha());
    Rectangle tb = getTableBounds();
    Rectangle cb1 = l.getColumnBounds(0);
    graphics.fillRectangle(tb.x, tb.y, cb1.width + cb1.x - tb.x, tb.height);
    graphics.setAlpha(oldAlpha);
    graphics.setForegroundColor(ColorConstants.lightGray);
    drawRowSeparators(graphics);
}
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