use of org.whole.lang.ui.layout.TableLayout in project whole by wholeplatform.
the class TypeRulesTableFigure 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(getBackgroundAlpha());
Rectangle tb = getTableBounds();
Rectangle cb1 = l.getColumnBounds(2);
g.fillRectangle(cb1.x, tb.y, cb1.width, tb.height);
g.setAlpha(oldAlpha);
g.setForegroundColor(ColorConstants.lightGray);
drawRowSeparators(g);
drawTableRowsBorder(g);
}
use of org.whole.lang.ui.layout.TableLayout in project whole by wholeplatform.
the class TableFigure method drawAlternateRowsBackground.
protected void drawAlternateRowsBackground(Graphics g, int startIndex, int alpha) {
TableLayout l = getLayoutManager();
int rows = startIndex == -1 ? 1 : l.rows();
int oldAlpha = g.getAlpha();
g.setAlpha(alpha);
if (l.hasHeaderRow())
startIndex++;
Rectangle tb = getTableBounds();
for (int r = startIndex; r < rows; r += 2) if (l.isRowVisible(r)) {
Rectangle rb = l.getRowBounds(r);
int fh = rb.height + 1;
int fy;
if (r == 0) {
fh += rb.y - tb.y;
fy = tb.y;
} else if (r == rows - 1) {
fy = rb.y;
fh = tb.bottom() - fy;
} else
fy = rb.y;
g.fillRectangle(tb.x, fy, tb.width, fh);
} else
r -= 1;
g.setAlpha(oldAlpha);
}
use of org.whole.lang.ui.layout.TableLayout in project whole by wholeplatform.
the class TableFigure method drawRowSeparators.
protected void drawRowSeparators(Graphics g, int leftMargin, int rightMargin) {
TableLayout l = getLayoutManager();
int columns = l.columns();
if (columns > 0) {
Rectangle ca = getTableBounds();
int firstRow = l.hasHeaderRow() ? 2 : 1;
for (int i = firstRow; i < l.rows(); i++) {
Rectangle r = l.getRowBounds(i);
g.drawLine(ca.x - leftMargin, r.y, ca.right() - 1 + rightMargin, r.y);
}
}
}
use of org.whole.lang.ui.layout.TableLayout in project whole by wholeplatform.
the class TableFigure method drawAlternateColumnsBackground.
protected void drawAlternateColumnsBackground(Graphics g, int startIndex, int alpha) {
TableLayout l = getLayoutManager();
if (l.rows() > 0) {
int oldAlpha = g.getAlpha();
g.setAlpha(alpha);
Rectangle tb = getTableBounds();
for (int r = startIndex; r < l.columns(); r += 2) {
Rectangle cb = l.getColumnBounds(r);
g.fillRectangle(cb.x, tb.y, cb.width, tb.height);
}
g.setAlpha(oldAlpha);
}
}
use of org.whole.lang.ui.layout.TableLayout in project whole by wholeplatform.
the class TableFigure method drawColumnSeparators.
protected void drawColumnSeparators(Graphics g, int topMargin, int bottomMargin) {
TableLayout l = getLayoutManager();
if (l.rows() > 0) {
Rectangle ca = getTableBounds();
for (int c = 1; c < l.columns(); c++) {
Rectangle r = l.getColumnBounds(c);
g.drawLine(r.x, ca.y - topMargin, r.x, ca.bottom() - 1 + bottomMargin);
}
}
}
Aggregations