use of org.uberfire.ext.wires.core.client.palette.PaletteShape in project drools-wb by kiegroup.
the class GuidedDecisionTreePaletteGroup method addStencil.
public void addStencil(final ShapeFactory factory, final GuidedDecisionTreeStencilPaletteBuilder stencilBuilder, final FactoryHelper helper, final boolean isReadOnly) {
final LienzoPanel panel = new FocusableLienzoPanel(GuidedDecisionTreeStencilPaletteBuilder.STENCIL_WIDTH, GuidedDecisionTreeStencilPaletteBuilder.STENCIL_HEIGHT + ShapeFactoryUtil.SPACE_BETWEEN_BOUNDING);
final Layer layer = new Layer();
panel.getScene().add(layer);
// Create a new PaletteShape from the given factory
final PaletteShape shape = stencilBuilder.build(panel, helper, factory, isReadOnly);
layer.add(shape);
layer.batch();
add(panel);
}
use of org.uberfire.ext.wires.core.client.palette.PaletteShape in project drools-wb by kiegroup.
the class GuidedDecisionTreeStencilPaletteBuilder method build.
public PaletteShape build(final LienzoPanel dragProxyParentPanel, final FactoryHelper helper, final ShapeFactory factory, final boolean isReadOnly) {
// If the Editor is not Read Only delegate to super class
if (!isReadOnly) {
return super.build(dragProxyParentPanel, helper, factory);
}
// Otherwise make a Read Only Stencil
final PaletteShape paletteShape = new PaletteShape();
final ShapeGlyph glyph = drawGlyph(factory, helper);
final Text description = drawDescription(factory, helper);
final Rectangle bounding = drawBoundingBox(factory, helper);
// Build Palette Shape
paletteShape.setBounding(bounding);
paletteShape.setGroup(scaleGlyph(glyph));
paletteShape.setDescription(description);
return paletteShape;
}
Aggregations