Search in sources :

Example 1 with PictureShapeDef

use of org.kie.workbench.common.stunner.shapes.def.picture.PictureShapeDef in project kie-wb-common by kiegroup.

the class BasicShapesFactory method newPicture.

@SuppressWarnings("unchecked")
private Shape newPicture(final Object instance, final BasicShapeDef shapeDef) {
    final PictureShapeDef pictShapeDef = (PictureShapeDef) shapeDef;
    final Object pictureSource = pictShapeDef.getPictureSource(instance);
    final double width = pictShapeDef.getWidth(instance);
    final double height = pictShapeDef.getHeight(instance);
    final PictureShapeView view = shapeViewFactory.picture(pictureSource, width, height);
    return new PictureShape(view);
}
Also used : PictureShapeDef(org.kie.workbench.common.stunner.shapes.def.picture.PictureShapeDef) PictureShape(org.kie.workbench.common.stunner.shapes.client.PictureShape) PictureShapeView(org.kie.workbench.common.stunner.shapes.client.view.PictureShapeView)

Aggregations

PictureShape (org.kie.workbench.common.stunner.shapes.client.PictureShape)1 PictureShapeView (org.kie.workbench.common.stunner.shapes.client.view.PictureShapeView)1 PictureShapeDef (org.kie.workbench.common.stunner.shapes.def.picture.PictureShapeDef)1