use of org.whole.lang.ui.figures.CompositeFigure in project whole by wholeplatform.
the class SequencePart method createFigure.
protected IFigure createFigure() {
IFigure figure = new CompositeFigure(new ColumnLayout().withMarginTop(5).withMarginBottom(5).withSpacing(13));
figure.setBorder(new CurlyBracketsBorder());
return figure;
}
use of org.whole.lang.ui.figures.CompositeFigure in project whole by wholeplatform.
the class WorkflowsDiagramPartFactoryVisitor method visit.
public void visit(FlowObjects entity) {
if (context instanceof ParallelPart)
part = new AbstractCompositePart() {
protected IFigure createFigure() {
CompositeFigure f = new CompositeFigure(true);
f.getLayoutManager().withMinorAlignment(Alignment.LEADING);
return f;
}
};
else
part = new AbstractCompositePart() {
protected IFigure createFigure() {
CompositeFigure f = new CompositeFigure(false);
f.getLayoutManager().withSpacing(7).withMinorAlignment(Alignment.CENTER);
return f;
}
};
}
use of org.whole.lang.ui.figures.CompositeFigure 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.figures.CompositeFigure in project whole by wholeplatform.
the class AndPart method createFigure.
protected IFigure createFigure() {
border = new RoundBracketsBorder() {
@Override
protected void setBracketsStyle(Graphics g) {
g.setForegroundColor(FigureConstants.contentLighterColor);
}
};
return new CompositeFigure(true) {
protected void paintFigure(Graphics g) {
super.paintFigure(g);
g.setForegroundColor(FigureConstants.contentLighterColor);
g.setLineStyle(SWT.LINE_CUSTOM);
g.setLineDash(new int[] { 1, 3 });
drawFixedSizeColumnSeparators(g);
g.setLineStyle(SWT.LINE_SOLID);
g.setLineDash((int[]) null);
}
};
}
use of org.whole.lang.ui.figures.CompositeFigure in project whole by wholeplatform.
the class UnionTypePart method createFigure.
protected IFigure createFigure() {
border = new RoundBracketsBorder() {
@Override
protected void setBracketsStyle(Graphics g) {
g.setForegroundColor(FigureConstants.contentLighterColor);
}
};
return new CompositeFigure(false) {
protected void paintFigure(Graphics g) {
super.paintFigure(g);
g.setForegroundColor(ColorConstants.lightGray);
g.setLineStyle(SWT.LINE_CUSTOM);
g.setLineDash(new int[] { 1, 1 });
drawFixedSizeRowSeparators(g);
g.setLineStyle(SWT.LINE_SOLID);
g.setLineDash((int[]) null);
}
};
// return new StringSeparatedCompositeRowFigure("\u222a", 10) {
// @Override
// public Color getLocalForegroundColor() {
// return FigureConstants.contentColor;
// }
// };
}
Aggregations