use of com.ait.lienzo.client.core.shape.Group in project drools-wb by kiegroup.
the class RadarMenuViewImpl method makeDecisionTableGlyph.
private Group makeDecisionTableGlyph(final GuidedDecisionTableView view) {
final Group g = new Group();
final Rectangle r = new Rectangle(view.getWidth(), view.getHeight());
r.setFillColor(ColorName.LIGHTGRAY);
r.setLocation(view.getLocation());
g.setListening(false);
g.add(r);
return g;
}
use of com.ait.lienzo.client.core.shape.Group in project drools-wb by kiegroup.
the class GuidedDecisionTableViewImpl method makeHeaderCaption.
private Group makeHeaderCaption() {
final Group g = GWT.create(Group.class);
final double captionWidth = ((GuidedDecisionTableRenderer) renderer).getHeaderCaptionWidth();
final GuidedDecisionTableTheme theme = (GuidedDecisionTableTheme) renderer.getTheme();
final Rectangle r = theme.getBaseRectangle(GuidedDecisionTableTheme.ModelColumnType.CAPTION);
r.setWidth(captionWidth);
r.setHeight(HEADER_CAPTION_HEIGHT);
final MultiPath border = theme.getBodyGridLine();
border.M(0.5, HEADER_CAPTION_HEIGHT + 0.5);
border.L(0.5, 0.5);
border.L(captionWidth + 0.5, 0.5);
border.L(captionWidth + 0.5, HEADER_CAPTION_HEIGHT + 0.5);
border.L(0.5, HEADER_CAPTION_HEIGHT + 0.5);
final Text caption = theme.getHeaderText();
caption.setText(model.getTableName());
caption.setX(captionWidth / 2);
caption.setY(HEADER_CAPTION_HEIGHT / 2);
// Clip Caption Group
final BoundingBox bb = new BoundingBox(0, 0, captionWidth + border.getStrokeWidth(), HEADER_CAPTION_HEIGHT + 0.5);
final IPathClipper clipper = getPathClipper(bb);
g.setPathClipper(clipper);
clipper.setActive(true);
g.add(r);
g.add(caption);
g.add(border);
return g;
}
use of com.ait.lienzo.client.core.shape.Group in project drools-wb by kiegroup.
the class GuidedDecisionTreeStencilPaletteBuilder method scaleGlyph.
@Override
protected Group scaleGlyph(final ShapeGlyph glyph) {
final double sx = GLYPH_WIDTH / glyph.getWidth();
final double sy = GLYPH_HEIGHT / glyph.getHeight();
final Group group = glyph.getGroup();
return group.setX(STENCIL_HEIGHT / 2).setY(STENCIL_HEIGHT / 2).setScale(sx, sy);
}
use of com.ait.lienzo.client.core.shape.Group in project drools-wb by kiegroup.
the class BaseGuidedDecisionTreeShape method setupControl.
protected Group setupControl(final ImageResource resource, final Command command) {
final Group controlGroup = new Group();
final Picture p = new Picture(resource, picture1 -> {
final double offsetX = -picture1.getImageData().getWidth() / 2;
final double offsetY = -picture1.getImageData().getHeight() / 2;
picture1.setLocation(new Point2D(offsetX, offsetY));
picture1.addNodeMouseClickHandler(e -> command.execute());
}, ImageSelectionMode.SELECT_BOUNDS);
controlGroup.add(p);
return controlGroup;
}
use of com.ait.lienzo.client.core.shape.Group in project drools-wb by kiegroup.
the class GuidedDecisionTableRenderer method renderHeaderBodyDivider.
@Override
public RendererCommand renderHeaderBodyDivider(final double width) {
return (RenderHeaderGridLinesCommand) (rc) -> {
if (!rc.isSelectionLayer()) {
final Group g = new Group();
final Line dividerLine1 = theme.getGridHeaderBodyDivider();
final Line dividerLine2 = theme.getGridHeaderBodyDivider();
dividerLine1.setPoints(new Point2DArray(new Point2D(0, getHeaderHeight() - 1.5), new Point2D(width, getHeaderHeight() - 1.5)));
dividerLine2.setPoints(new Point2DArray(new Point2D(0, getHeaderHeight() + 0.5), new Point2D(width, getHeaderHeight() + 0.5)));
g.add(dividerLine1);
g.add(dividerLine2);
rc.getGroup().add(g);
}
};
}
Aggregations