Search in sources :

Example 1 with Picture

use of com.ait.lienzo.client.core.shape.Picture in project drools-wb by kiegroup.

the class BaseGuidedDecisionTreeShape method setupControl.

protected Group setupControl(final ImageResource resource, final Command command) {
    final Group controlGroup = new Group();
    final Picture p = new Picture(resource, picture1 -> {
        final double offsetX = -picture1.getImageData().getWidth() / 2;
        final double offsetY = -picture1.getImageData().getHeight() / 2;
        picture1.setLocation(new Point2D(offsetX, offsetY));
        picture1.addNodeMouseClickHandler(e -> command.execute());
    }, ImageSelectionMode.SELECT_BOUNDS);
    controlGroup.add(p);
    return controlGroup;
}
Also used : Group(com.ait.lienzo.client.core.shape.Group) Point2D(com.ait.lienzo.client.core.types.Point2D) Picture(com.ait.lienzo.client.core.shape.Picture)

Aggregations

Group (com.ait.lienzo.client.core.shape.Group)1 Picture (com.ait.lienzo.client.core.shape.Picture)1 Point2D (com.ait.lienzo.client.core.types.Point2D)1