use of org.whole.lang.ui.layout.UnderColumnLayout in project whole by wholeplatform.
the class TypesPart method createFigure.
protected IFigure createFigure() {
return new CompositeFigure(new UnderColumnLayout().withMinorAlignment(Alignment.LEADING).withSpacing(6)) {
@SuppressWarnings("unchecked")
protected void paintFigure(Graphics g) {
super.paintFigure(g);
String separator = ",";
int spacing = getLayoutManager().getSpacing();
int fontAscent = FigureUtilities.getFontMetrics(getFont()).getHeight() / 2;
int xOffset = FigureUtilities.getTextWidth(separator, getFont()) / 2;
int yOffset = spacing * 5 / 6 + fontAscent + 1;
int x = getClientArea().getCenter().x - xOffset;
g.setForegroundColor(ColorConstants.lightGray);
List<IFigure> children = (List<IFigure>) getChildren();
for (int i = 1; i < children.size(); i++) {
int y = children.get(i).getBounds().y;
g.drawString(separator, x, y - yOffset);
}
}
};
// return new StringSeparatedCompositeColumnFigure(",",
// new UnderColumnLayout().withMinorAlignment(Alignment.LEADING).withSpacing(8));
}
use of org.whole.lang.ui.layout.UnderColumnLayout in project whole by wholeplatform.
the class AttributeDownFigure method initFigure.
@Override
protected void initFigure() {
initContentPanes(3);
EntityFigure headerFigure = new EntityFigure(new RowLayout().withSpacing(8));
headerFigure.add(createContentPane(0));
// headerFigure.addParenthesis(" (");
headerFigure.add(createContentPane(1));
// headerFigure.addParenthesis(")");
EntityFigure shapeFigure0 = new EntityFigure(new UnderColumnLayout().withSpacing(4).withMarginLeft(12).withMinorAlignment(Alignment.CENTER));
shapeFigure0.add(headerFigure);
shapeFigure0.add(createContentPane(2));
add(shapeFigure = shapeFigure0);
}
Aggregations