use of com.ait.lienzo.client.core.shape.MultiPath 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.MultiPath in project drools-wb by kiegroup.
the class GuidedDecisionTableRenderer method renderSelector.
@Override
public RendererCommand renderSelector(final double width, final double height, final BaseGridRendererHelper.RenderingInformation renderingInformation) {
return (RenderSelectorCommand) (rc) -> {
if (!rc.isSelectionLayer()) {
final double captionWidth = getHeaderCaptionWidth();
final Bounds bounds = getSelectorBounds(width, height, renderingInformation);
final MultiPath selector = theme.getSelector().M(bounds.getX() + 0.5, bounds.getY() + 0.5).L(bounds.getX() + 0.5, height).L(width, height).L(width, bounds.getY() + GuidedDecisionTableViewImpl.HEADER_CAPTION_HEIGHT).L(bounds.getX() + captionWidth, bounds.getY() + GuidedDecisionTableViewImpl.HEADER_CAPTION_HEIGHT).L(bounds.getX() + captionWidth, bounds.getY() + 0.5).L(bounds.getX() + GuidedDecisionTableViewImpl.HEADER_CAPTION_WIDTH, bounds.getY() + 0.5).L(bounds.getX() + 0.5, bounds.getY() + 0.5).setListening(false);
rc.getGroup().add(selector);
}
};
}
use of com.ait.lienzo.client.core.shape.MultiPath in project kie-wb-common by kiegroup.
the class AssociationView method createLine.
private static Object[] createLine(final double x1, final double y1, final double x2, final double y2) {
final MultiPath head = new MultiPath();
final MultiPath tail = new MultiPath();
final DirectionalLine line = new DirectionalLine(x1, y1, x2, y2);
line.setDashArray(new DashArray(2, 6));
line.setDraggable(true);
line.setSelectionStrokeOffset(SELECTION_OFFSET);
line.setHeadOffset(head.getBoundingBox().getHeight());
line.setTailOffset(tail.getBoundingBox().getHeight());
final MultiPathDecorator headDecorator = new MultiPathDecorator(head);
final MultiPathDecorator tailDecorator = new MultiPathDecorator(tail);
return new Object[] { line, headDecorator, tailDecorator };
}
use of com.ait.lienzo.client.core.shape.MultiPath in project kie-wb-common by kiegroup.
the class KnowledgeRequirementView method createLine.
private static Object[] createLine(final double x1, final double y1, final double x2, final double y2) {
final MultiPath head = new MultiPath();
final MultiPath tail = new MultiPath().M(0, DECORATOR_HEIGHT).L(DECORATOR_WIDTH / 2, 0).L(DECORATOR_WIDTH, DECORATOR_HEIGHT).setFillColor(ColorName.BLACK).setFillAlpha(1);
final DirectionalLine line = new DirectionalLine(x1, y1, x2, y2);
line.setDashArray(new DashArray(4, 4));
line.setDraggable(true);
line.setSelectionStrokeOffset(SELECTION_OFFSET);
line.setHeadOffset(head.getBoundingBox().getHeight());
line.setTailOffset(tail.getBoundingBox().getHeight());
final MultiPathDecorator headDecorator = new MultiPathDecorator(head);
final MultiPathDecorator tailDecorator = new MultiPathDecorator(tail);
return new Object[] { line, headDecorator, tailDecorator };
}
use of com.ait.lienzo.client.core.shape.MultiPath in project kie-wb-common by kiegroup.
the class OrthogonalPolyLineConnectorViewTest method testCreateLine.
@Test
public void testCreateLine() {
double[] points = new double[] { 0, 0, 10, 10 };
OrthogonalPolyLineConnectorFactory factory = new OrthogonalPolyLineConnectorFactory();
Object[] line = PolylineConnectorView.createLine(factory, ConnectorShapeDef.Direction.ONE, points);
MultiPathDecorator head = (MultiPathDecorator) line[1];
MultiPath headPath = head.getPath();
BoundingBox headBoundingBox = headPath.getBoundingBox();
MultiPathDecorator tail = (MultiPathDecorator) line[2];
MultiPath tailPath = tail.getPath();
BoundingBox tailBoundingBox = tailPath.getBoundingBox();
assertEquals(0, headBoundingBox.getWidth(), 0);
assertEquals(0, headBoundingBox.getHeight(), 0);
assertNotEquals(0, tailBoundingBox.getWidth(), 0);
assertNotEquals(0, tailBoundingBox.getHeight(), 0);
}
Aggregations