use of org.whole.lang.ui.figures.CompositeFigure in project whole by wholeplatform.
the class OrPart 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);
}
};
}
use of org.whole.lang.ui.figures.CompositeFigure in project whole by wholeplatform.
the class GrammarBasedUIUtils method createCompositeFigure.
public static IEntityFigure createCompositeFigure(IEntity entity) {
ILanguageKit lk = entity.wGetLanguageKit();
EntityDescriptorEnum edEnum = lk.getEntityDescriptorEnum();
FeatureDescriptorEnum fdEnum = lk.getFeatureDescriptorEnum();
IEntity configuration = Matcher.findAncestor(edEnum.valueOf("CompositePart"), entity);
IEntity multiline = configuration.wGet(fdEnum.valueOf("multiline"));
boolean isMultiline = EntityUtils.safeBooleanValue(multiline, false);
IEntity columns = configuration.wGet(fdEnum.valueOf("columns"));
int columnsNum = EntityUtils.safeIntValue(columns, 0);
IEntity separator = configuration.wGet(fdEnum.valueOf("separator"));
IEntityFigure entityFigure;
if (EntityUtils.isNotResolver(separator)) {
String separatorText = GrammarBasedUIUtils.calculateSeparator(separator);
CompositeFigure compositeFigure = isMultiline ? new StringSeparatedCompositeColumnFigure(separatorText, 10) : new StringSeparatedCompositeRowFigure(separatorText, 10);
if (isMultiline)
compositeFigure.getLayoutManager().withMinorAlignment(Alignment.LEADING);
entityFigure = compositeFigure;
} else if (columnsNum > 0) {
TableFigure tableFigure = new TableFigure(columnsNum);
tableFigure.setBorder(CompositePlaceHolderBorder.OPTIONAL_VERTICAL);
entityFigure = tableFigure;
} else
entityFigure = new CompositeFigure(!isMultiline, true);
return entityFigure;
}
use of org.whole.lang.ui.figures.CompositeFigure in project whole by wholeplatform.
the class BlockPart method createFigure.
protected IFigure createFigure() {
IFigure figure = new // StringSeparatedCompositeColumnFigure("",
CompositeFigure(new OverColumnLayout().withMarginTop(5).withMarginBottom(5).withSpacing(13));
figure.setBorder(new BlockBracketsBorder());
return figure;
}
use of org.whole.lang.ui.figures.CompositeFigure in project whole by wholeplatform.
the class SubfeaturesDownPart method createFigure.
protected IFigure createFigure() {
CompositeFigure f = new CompositeFigure(true);
f.getLayoutManager().withMinorAlignment(Alignment.MATHLINE);
return f;
}
use of org.whole.lang.ui.figures.CompositeFigure in project whole by wholeplatform.
the class TextualFigurePart method createFigure.
protected IFigure createFigure() {
return new CompositeFigure(false) {
{
setBackgroundColor(FigureConstants.templateLanguageColor);
setBorder(new CompoundBorder(new LineBorder(), getBorder()));
}
};
}
Aggregations