use of com.ait.lienzo.client.core.shape.Rectangle in project kie-wb-common by kiegroup.
the class BaseExpressionGridThemeTest method testGetBodyBackgroundFillColour.
@Test
public void testGetBodyBackgroundFillColour() {
tests.stream().forEach(test -> {
final GridColumn column = mock(test.getK1());
final Rectangle rectangle = theme.getBodyBackground(column);
assertEquals(test.getK2(), rectangle.getFillColor());
});
}
use of com.ait.lienzo.client.core.shape.Rectangle in project kie-wb-common by kiegroup.
the class DMNGridLayer method addGhost.
void addGhost(final ExpressionContainerGrid container, final GridWidget gridWidget) {
// Rectangle the size of the ExpressionContainerGrid
final Rectangle r = getGhostRectangle();
r.setWidth(container.getWidth() + BaseExpressionGridTheme.STROKE_WIDTH);
r.setHeight(container.getHeight() + BaseExpressionGridTheme.STROKE_WIDTH);
r.setFillColor(ColorName.WHITE);
r.setAlpha(0.50);
r.setListening(false);
final Group g = GWT.create(Group.class);
final Transform transform = getViewport().getTransform();
g.setX(container.getX() + transform.getTranslateX());
g.setY(container.getY() + transform.getTranslateY());
g.add(r);
// LiteralExpression and UndefinedExpression are not handled as grids in
// their own right. In these circumstances use their parent GridWidget.
GridWidget gw = gridWidget;
if (gw instanceof LiteralExpressionGrid) {
gw = ((LiteralExpressionGrid) gw).getParentInformation().getGridWidget();
} else if (gw instanceof UndefinedExpressionGrid) {
gw = ((UndefinedExpressionGrid) gw).getParentInformation().getGridWidget();
}
// Clip the inner GridWidget so everything outside of it is ghosted
final IPathClipper clipper = new InverseGridWidgetClipper(container, gw);
clipper.setActive(true);
g.setPathClipper(clipper);
g.drawWithTransforms(getContext(), 1.0, getStorageBounds());
}
use of com.ait.lienzo.client.core.shape.Rectangle in project kie-wb-common by kiegroup.
the class WiresUtilsTest method shapeUUID.
@Test
public void shapeUUID() {
final String uuid = "uuid";
final IDrawable shape = new Rectangle(0, 0);
WiresUtils.assertShapeUUID(shape, uuid);
assertTrue(shape.getUserData() instanceof WiresUtils.UserData);
assertEquals(uuid, WiresUtils.getShapeUUID(shape));
}
use of com.ait.lienzo.client.core.shape.Rectangle in project kie-wb-common by kiegroup.
the class AbstractLienzoShapeGlyphRenderer method render.
@Override
public Group render(final G glyph, final double width, final double height) {
final Group group = new Group();
final Rectangle decorator = new Rectangle(width, height).setCornerRadius(5).setFillColor(ColorName.LIGHTGREY).setFillAlpha(0.7d);
group.add(decorator);
getShape(glyph, width, height, shape -> {
group.add(shape);
scaleShape(shape, width, height);
group.remove(decorator);
});
return group;
}
use of com.ait.lienzo.client.core.shape.Rectangle in project kie-wb-common by kiegroup.
the class SVGChildViewHandlerTest method setup.
@Before
public void setup() throws Exception {
this.svgGroup = new Group().setID("svgGroup1");
this.group = new Group().setID("parent");
this.rectangle = new Rectangle(10d, 10d);
when(svgChild.getContainer()).thenReturn(svgGroup);
this.parentShape = new SVGContainer("parent", group, false, null);
this.tested = new SVGChildViewHandler(shapeView);
}
Aggregations