use of com.ait.lienzo.client.core.types.BoundingBox in project lienzo-core by ahome-it.
the class ContainerNode method getBoundingBox.
@Override
public BoundingBox getBoundingBox() {
final BoundingBox bbox = new BoundingBox();
final NFastArrayList<M> list = getChildNodes();
final int size = list.size();
for (int i = 0; i < size; i++) {
final BoundingPoints bpts = list.get(i).getBoundingPoints();
if (null != bpts) {
bbox.add(bpts.getArray());
}
}
return bbox;
}
use of com.ait.lienzo.client.core.types.BoundingBox 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.types.BoundingBox 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);
}
use of com.ait.lienzo.client.core.types.BoundingBox in project kie-wb-common by kiegroup.
the class PolyLineConnectorViewTest method testCreateLine.
@Test
public void testCreateLine() {
double[] points = new double[] { 0, 0, 10, 10 };
PolyLineConnectorFactory factory = new PolyLineConnectorFactory();
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);
}
use of com.ait.lienzo.client.core.types.BoundingBox in project kie-wb-common by kiegroup.
the class EmptyStateLayer method updateCursor.
private void updateCursor() {
BoundingBox captionBB = caption.getBoundingBox();
double captionCenterY = captionBB.getHeight() / 2d;
double cursorTargetWidth = 40;
double cursorTargetHeight = 62.4;
double cursorCenterX = cursorTargetWidth / 2d;
double centerX = getWidth() / 2d;
double centerY = getHeight() / 2d;
BoundingBox cursorBB = cursor.getBoundingBox();
final double[] cursorScale = getScaleFactor(cursorBB.getWidth(), cursorBB.getHeight(), cursorTargetWidth, cursorTargetHeight);
cursor.setScale(cursorScale[0], cursorScale[1]);
cursor.setX(centerX - cursorCenterX);
cursor.setY(centerY - captionCenterY - 25 - cursorTargetHeight);
}
Aggregations