use of org.whole.lang.ui.figures.CompositeFigure in project whole by wholeplatform.
the class ChildrenBranchesFigure method createCompositeFigure.
protected IEntityFigure createCompositeFigure() {
CompositeFigure figure = new CompositeFigure(false);
// {
// protected void paintFigure(Graphics g) {
// super.paintFigure(g);
//
// if (getChildren().isEmpty()) {
// Rectangle b = getBounds().getResized(-1, -1);
//
// g.setForegroundColor(FigureConstants.blueColor);
// g.setLineStyle(SWT.LINE_CUSTOM);
// g.setLineDash(new int[] {4,2});
// g.drawRoundRectangle(b, 8, 8);
// g.setLineStyle(SWT.LINE_SOLID);
// g.setLineDash((int[]) null);
// }
// }
// };
// .withMinorAlignment(Alignment.MATHLINE)
figure.getLayoutManager().withSpacing(4).withMarginLeft(0).withMarginRight(10);
figure.setBorder(CompositePlaceHolderBorder.OPTIONAL_VERTICAL);
return figure;
}
use of org.whole.lang.ui.figures.CompositeFigure in project whole by wholeplatform.
the class OutlineCompositeNodeFigure method paintConnections.
protected void paintConnections(Graphics graphics) {
IFigure contentPane = getContentPane(getContentPanesSize() - 1);
List<?> list = contentPane.getChildren();
if (contentPane.isVisible() && !list.isEmpty()) {
IFigure contentsFigure = (IFigure) list.get(0);
Point[] children;
if (contentsFigure instanceof CompositeFigure) {
int compositeChildrenNumber = contentsFigure.getChildren().size();
if (compositeChildrenNumber == 0)
return;
children = new Point[compositeChildrenNumber];
for (int i = 0; i < compositeChildrenNumber; i++) {
IFigure compositeChild = (IFigure) contentsFigure.getChildren().get(i);
// calculate target point position
Point targetLocation;
if (compositeChild instanceof INodeFigure)
targetLocation = ((INodeFigure) compositeChild).getTargetAnchor(0).getLocation(null);
else {
Rectangle compositeChildBounds = compositeChild.getBounds();
targetLocation = compositeChildBounds.getLeft();
if (compositeChild instanceof IEntityFigure)
targetLocation.y = compositeChildBounds.y + ((IEntityFigure) compositeChild).getAscent();
compositeChild.translateToAbsolute(targetLocation);
}
translateToRelative(targetLocation);
children[i] = targetLocation;
}
} else {
children = new Point[1];
// calculate target point position
Point targetLocation;
if (contentsFigure instanceof INodeFigure)
targetLocation = ((INodeFigure) contentsFigure).getTargetAnchor(0).getLocation(null);
else {
Rectangle compositeChildBounds = contentsFigure.getBounds();
targetLocation = compositeChildBounds.getLeft();
if (contentsFigure instanceof IEntityFigure)
targetLocation.y = compositeChildBounds.y + ((IEntityFigure) contentsFigure).getAscent();
contentsFigure.translateToAbsolute(targetLocation);
}
translateToRelative(targetLocation);
children[0] = targetLocation;
}
Point start = getSourceAnchor(0).getLocation(null);
translateToRelative(start);
graphics.setForegroundColor(ColorConstants.lightGray);
graphics.setLineDash(new int[] { 1, 1 });
DrawUtils.drawOutline(graphics, start, children);
}
}
use of org.whole.lang.ui.figures.CompositeFigure in project whole by wholeplatform.
the class CompositeEntityTreeTableNoEmbeddingFigure method createCompositeFigure.
protected IEntityFigure createCompositeFigure() {
CompositeFigure figure = new CompositeFigure(false);
figure.getLayoutManager().withSpacing(4).withMarginLeft(DrawUtils.SPACING * 2).withMarginRight(2);
figure.setBorder(null);
return figure;
}
use of org.whole.lang.ui.figures.CompositeFigure in project whole by wholeplatform.
the class FeaturesPart method createFigure.
protected IFigure createFigure() {
CompositeFigure f = new CompositeFigure(false);
f.getLayoutManager().withSpacing(64);
return f;
}
use of org.whole.lang.ui.figures.CompositeFigure in project whole by wholeplatform.
the class SubfeaturesRightPart method createFigure.
protected IFigure createFigure() {
CompositeFigure f = new CompositeFigure(false);
f.getLayoutManager().withMinorAlignment(Alignment.MATHLINE);
return f;
}
Aggregations