Search in sources :

Example 1 with LienzoPanel

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;
}
Also used : Group(com.ait.lienzo.client.core.shape.Group) LienzoPanel(com.ait.lienzo.client.widget.LienzoPanel) LienzoPanel(com.ait.lienzo.client.widget.LienzoPanel) Layer(com.ait.lienzo.client.core.shape.Layer)

Example 2 with LienzoPanel

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);
}
Also used : LienzoPanel(com.ait.lienzo.client.widget.LienzoPanel)

Example 3 with LienzoPanel

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);
}
Also used : LienzoPanel(com.ait.lienzo.client.widget.LienzoPanel) WidgetElementRendererView(org.kie.workbench.common.stunner.core.client.components.views.WidgetElementRendererView)

Example 4 with LienzoPanel

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());
}
Also used : LienzoPanel(com.ait.lienzo.client.widget.LienzoPanel) TextMetrics(com.ait.lienzo.client.core.types.TextMetrics) Layer(com.ait.lienzo.client.core.shape.Layer)

Example 5 with LienzoPanel

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);
}
Also used : LienzoPanel(com.ait.lienzo.client.widget.LienzoPanel) FocusableLienzoPanel(org.uberfire.ext.wires.core.client.canvas.FocusableLienzoPanel) PaletteShape(org.uberfire.ext.wires.core.client.palette.PaletteShape) Layer(com.ait.lienzo.client.core.shape.Layer) FocusableLienzoPanel(org.uberfire.ext.wires.core.client.canvas.FocusableLienzoPanel)

Aggregations

LienzoPanel (com.ait.lienzo.client.widget.LienzoPanel)10 Layer (com.ait.lienzo.client.core.shape.Layer)7 Group (com.ait.lienzo.client.core.shape.Group)3 TextMetrics (com.ait.lienzo.client.core.types.TextMetrics)3 Point2D (com.ait.lienzo.client.core.types.Point2D)1 Before (org.junit.Before)1 LienzoLayer (org.kie.workbench.common.stunner.client.lienzo.canvas.LienzoLayer)1 StunnerWiresControlFactory (org.kie.workbench.common.stunner.client.lienzo.wires.StunnerWiresControlFactory)1 StunnerWiresHandlerFactory (org.kie.workbench.common.stunner.client.lienzo.wires.StunnerWiresHandlerFactory)1 WiresManagerFactoryImpl (org.kie.workbench.common.stunner.client.lienzo.wires.WiresManagerFactoryImpl)1 WidgetElementRendererView (org.kie.workbench.common.stunner.core.client.components.views.WidgetElementRendererView)1 FocusableLienzoPanel (org.uberfire.ext.wires.core.client.canvas.FocusableLienzoPanel)1 PaletteShape (org.uberfire.ext.wires.core.client.palette.PaletteShape)1