use of com.ait.lienzo.client.core.types.BoundingBox in project kie-wb-common by kiegroup.
the class BaseExpressionGridRenderingTest method testRenderQueueCommandsWhenHeaderIsHidden.
@Test
public void testRenderQueueCommandsWhenHeaderIsHidden() {
this.isHeaderHidden = true;
grid.drawWithTransforms(context, 1.0, new BoundingBox());
verify(renderHeaderBackgroundCommand, never()).execute(any(GridRendererContext.class));
verify(renderHeaderGridLinesCommand, never()).execute(any(GridRendererContext.class));
verify(renderHeaderContentCommand, never()).execute(any(GridRendererContext.class));
verify(renderHeaderBodyDividerCommand, never()).execute(any(GridRendererContext.class));
final InOrder order = inOrder(renderBodyGridBackgroundCommand, renderBodyGridContentCommand, renderBodyGridLinesCommand, renderGridBoundaryCommand, renderSelectedCellsCommand);
order.verify(renderBodyGridBackgroundCommand).execute(any(GridRendererContext.class));
order.verify(renderBodyGridContentCommand).execute(any(GridRendererContext.class));
order.verify(renderGridBoundaryCommand).execute(any(GridRendererContext.class));
order.verify(renderBodyGridLinesCommand).execute(any(GridRendererContext.class));
order.verify(renderSelectedCellsCommand).execute(any(GridRendererContext.class));
}
use of com.ait.lienzo.client.core.types.BoundingBox in project kie-wb-common by kiegroup.
the class BaseExpressionGridRenderingTest method testRenderQueueCommandsWhenHeaderIsNotHidden.
@Test
public void testRenderQueueCommandsWhenHeaderIsNotHidden() {
this.isHeaderHidden = false;
grid.drawWithTransforms(context, 1.0, new BoundingBox());
final InOrder order = inOrder(renderHeaderBackgroundCommand, renderHeaderContentCommand, renderBodyGridBackgroundCommand, renderBodyGridContentCommand, renderGridBoundaryCommand, renderHeaderGridLinesCommand, renderBodyGridLinesCommand, renderSelectedCellsCommand);
order.verify(renderHeaderBackgroundCommand).execute(any(GridRendererContext.class));
order.verify(renderHeaderContentCommand).execute(any(GridRendererContext.class));
order.verify(renderBodyGridBackgroundCommand).execute(any(GridRendererContext.class));
order.verify(renderBodyGridContentCommand).execute(any(GridRendererContext.class));
order.verify(renderGridBoundaryCommand).execute(any(GridRendererContext.class));
order.verify(renderHeaderGridLinesCommand).execute(any(GridRendererContext.class));
order.verify(renderBodyGridLinesCommand).execute(any(GridRendererContext.class));
order.verify(renderSelectedCellsCommand).execute(any(GridRendererContext.class));
}
use of com.ait.lienzo.client.core.types.BoundingBox in project kie-wb-common by kiegroup.
the class FocusableGroup method setUpGroupDecorator.
private static MultiPath setUpGroupDecorator(final MultiPath primitive, final Group group) {
final BoundingBox boundingBox = group.getBoundingBox();
final double width = boundingBox.getWidth();
final double height = boundingBox.getHeight();
return primitive.clear().rect(0, 0, width, height).setFillAlpha(0.01).setStrokeAlpha(0.01).setListening(true).setFillBoundsForSelection(true).moveToTop();
}
use of com.ait.lienzo.client.core.types.BoundingBox in project kie-wb-common by kiegroup.
the class ItemGridImpl method itemsUpdated.
private ItemGridImpl itemsUpdated() {
// Reposition items as for the given grid.
repositionItems();
// Calculate BB.
double maxw = 0;
double maxh = 0;
for (final AbstractDecoratedItem item : items) {
final Point2D location = item.asPrimitive().getLocation();
final BoundingBox itemBB = (BoundingBox) item.getBoundingBox().get();
final double itemw = itemBB.getWidth() + location.getX();
final double itemh = itemBB.getHeight() + location.getY();
if (itemw > maxw) {
maxw = itemw;
}
if (itemh > maxh) {
maxh = itemh;
}
}
boundingBox = new BoundingBox(0, 0, maxw, maxh);
// Update decorator.
if (null != getWrapped().getDecorator()) {
getWrapped().getDecorator().setBoundingBox(getBoundingBox().get());
if (getWrapped().getDecorator() instanceof AbstractPrimitiveItem) {
((AbstractPrimitiveItem) getWrapped().getDecorator()).asPrimitive().moveToBottom();
}
}
return this;
}
use of com.ait.lienzo.client.core.types.BoundingBox in project kie-wb-common by kiegroup.
the class ToolboxImpl method updateGridSize.
private ToolboxImpl updateGridSize() {
final BoundingBox boundingBox = shapeBoundingBoxSupplier.get();
final double margin = getGrid().getMargin() * 2;
return setGridSize(boundingBox.getWidth() + margin, boundingBox.getHeight() + margin);
}
Aggregations