use of com.ait.lienzo.client.core.shape.Group 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.Group in project kie-wb-common by kiegroup.
the class ElementShapeGlyphRendererTest method setup.
@Before
public void setup() throws Exception {
when(viewSupplier.get()).thenReturn(view);
when(lienzoShapeGlyphRenderer.render(any(ShapeGlyph.class), anyDouble(), anyDouble())).thenReturn(new Group());
this.tested = new ElementShapeGlyphRenderer(lienzoShapeGlyphRenderer, viewSupplier, viewDestroyer);
}
use of com.ait.lienzo.client.core.shape.Group 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);
}
use of com.ait.lienzo.client.core.shape.Group in project kie-wb-common by kiegroup.
the class SVGBasicShapeViewImplTest method setup.
@Before
public void setup() throws Exception {
this.parent = new SVGContainer("parent", new Group().setID("parent"), false, null);
rectangle = new Rectangle(10d, 10d);
this.shape = new SVGPrimitiveShape(rectangle);
this.childShape = new SVGPrimitiveShape(new Rectangle(10d, 10d));
this.child = new SVGBasicShapeViewImpl("svgChild1", childShape, 50d, 23d);
this.tested = new SVGBasicShapeViewImpl("svg-test1", shape, 100, 340);
}
use of com.ait.lienzo.client.core.shape.Group in project drools-wb by kiegroup.
the class BaseGuidedDecisionTreeNodeFactory method getDragProxy.
@Override
public ShapeDragProxy getDragProxy(final FactoryHelper helper, final ShapeDragProxyPreviewCallback dragPreviewCallback, final ShapeDragProxyCompleteCallback dragEndCallBack) {
final T shape = makeShape();
final Group group = new Group();
group.add(shape);
// Add a label to the drag proxy if needed
double dragProxyWidth = getWidth();
double dragProxyHeight = getHeight();
final String description = getNodeLabel(helper);
if (description != null) {
final Text nodeLabel = new Text(description, ShapeFactoryUtil.FONT_FAMILY_DESCRIPTION, ShapeFactoryUtil.FONT_SIZE_DESCRIPTION);
nodeLabel.setTextAlign(TextAlign.CENTER);
nodeLabel.setTextBaseLine(TextBaseLine.MIDDLE);
nodeLabel.setFillColor(Color.rgbToBrowserHexColor(0, 0, 0));
dragProxyWidth = getDragProxyWidth(nodeLabel);
dragProxyHeight = getDragProxyHeight(nodeLabel);
group.add(nodeLabel);
}
final double _dragProxyWidth = dragProxyWidth;
final double _dragProxyHeight = dragProxyHeight;
return new ShapeDragProxy() {
@Override
public Group getDragGroup() {
return group;
}
@Override
public void onDragPreview(final double x, final double y) {
dragPreviewCallback.callback(x, y);
}
@Override
public void onDragComplete(final double x, final double y) {
dragEndCallBack.callback(x, y);
}
@Override
public double getWidth() {
return _dragProxyWidth;
}
@Override
public double getHeight() {
return _dragProxyHeight;
}
};
}
Aggregations