Search in sources :

Example 21 with TableLayout

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

the class TableFigure method drawColumnBackground.

protected void drawColumnBackground(Graphics g, int index, int alpha) {
    TableLayout l = getLayoutManager();
    if (l.rows() > 0) {
        int oldAlpha = g.getAlpha();
        g.setAlpha(alpha);
        Rectangle tb = getTableBounds();
        Rectangle cb = l.getColumnBounds(index);
        g.fillRectangle(cb.x, tb.y, cb.width, tb.height);
        g.setAlpha(oldAlpha);
    }
}
Also used : Rectangle(org.eclipse.draw2d.geometry.Rectangle) TableLayout(org.whole.lang.ui.layout.TableLayout)

Example 22 with TableLayout

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

the class TableFigure method drawHeadersRowSeparator.

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

Example 23 with TableLayout

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

the class TableFigure method drawColumnSeparatorBefore.

protected void drawColumnSeparatorBefore(Graphics g, int columnIndex, int topMargin, int bottomMargin) {
    TableLayout l = getLayoutManager();
    if (l.rows() > 0 && columnIndex < l.columns()) {
        Rectangle ca = getTableBounds();
        Rectangle r = l.getColumnBounds(columnIndex);
        g.drawLine(r.x, ca.y - topMargin, r.x, ca.bottom() - 1 + bottomMargin);
    }
}
Also used : Rectangle(org.eclipse.draw2d.geometry.Rectangle) TableLayout(org.whole.lang.ui.layout.TableLayout)

Example 24 with TableLayout

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

the class ChooseTableFigure method paintFigure.

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

Example 25 with TableLayout

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

the class RevisionsFigure method paintFigure.

protected void paintFigure(Graphics g) {
    super.paintFigure(g);
    TableLayout l = getLayoutManager();
    if (l.rows() == 0)
        return;
    Rectangle tb = getTableBounds();
    Rectangle cb1 = l.getColumnBounds(1);
    Rectangle cb2 = l.getColumnBounds(2);
    Rectangle cb3 = l.getColumnBounds(3);
    g.setBackgroundColor(FigureConstants.hostLanguageColor);
    g.fillRectangle(cb1.x, tb.y, cb1.width + 1, tb.height);
    g.setBackgroundColor(FigureConstants.addBackgroundColor);
    g.fillRectangle(cb2.x, tb.y, cb2.width + 1, tb.height);
    g.setBackgroundColor(FigureConstants.deleteBackgroundColor);
    g.fillRectangle(cb3.x, tb.y, cb3.width + 1, tb.height);
    g.setBackgroundColor(ColorConstants.gray);
    drawHeadersRowBackground(g);
    g.setForegroundColor(ColorConstants.lightGray);
    drawHeadersRowSeparator(g);
    drawRowSeparators(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