use of com.ait.lienzo.client.widget.LienzoPanel in project kie-wb-common by kiegroup.
the class LienzoPanelUtils method newPanel.
public LienzoPanel newPanel(final Glyph glyph, final int width, final int height) {
final Group glyphGroup = glyphLienzoGlyphRenderer.render(glyph, width, height);
final com.ait.lienzo.client.widget.LienzoPanel panel = new LienzoPanel(width, height);
final Layer layer = new Layer();
panel.add(layer.setTransformable(true));
layer.add(glyphGroup);
return panel;
}
use of com.ait.lienzo.client.widget.LienzoPanel in project kie-wb-common by kiegroup.
the class PrimitivePopup method doShow.
protected void doShow(final IPrimitive<?> _primitive, final double width, final double height, final double x, final double y) {
reset();
lienzoPanel = new LienzoPanel((int) width, (int) height);
this.add(lienzoPanel);
lienzoPanel.getScene().add(canvasLayer);
if (null != _primitive) {
canvasLayer.add(_primitive);
}
this.getElement().getStyle().setLeft(x, Style.Unit.PX);
this.getElement().getStyle().setTop(y, Style.Unit.PX);
this.getElement().getStyle().setZIndex(zIndex);
this.getElement().getStyle().setDisplay(Style.Display.INLINE);
}
use of com.ait.lienzo.client.widget.LienzoPanel in project kie-wb-common by kiegroup.
the class LienzoElementGlyphRenderer method render.
@Override
public IsElement render(final G glyph, final double width, final double height) {
final WidgetElementRendererView view = viewInstances.get();
final LienzoPanel panel = newPanel(glyph, (int) width, (int) height);
return view.setWidget(panel);
}
use of com.ait.lienzo.client.widget.LienzoPanel in project drools-wb by kiegroup.
the class BaseGuidedDecisionTreeNodeFactory method getDragProxyHeight.
private double getDragProxyHeight(final Text nodeLabel) {
final LienzoPanel panel = new LienzoPanel(100, 100);
final Layer layer = new Layer();
panel.add(layer);
final TextMetrics tm = nodeLabel.measure(layer.getContext());
return Math.max(getHeight(), tm.getHeight());
}
use of com.ait.lienzo.client.widget.LienzoPanel 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);
}
Aggregations