use of com.ait.lienzo.client.widget.LienzoPanel in project kie-wb-common by kiegroup.
the class ShapeGlyphDragHandlerImpl method show.
@Override
public DragProxy<AbstractCanvas, Item, DragProxyCallback> show(Item item, int x, int y, DragProxyCallback dragProxyCallback) {
int width = item.getWidth();
int height = item.getHeight();
final Group dragShape = glyphLienzoGlyphRenderer.render(item.getShape(), width, height);
dragShape.setX(0);
dragShape.setY(0);
this.dragProxyPanel = new LienzoPanel((width * 2), (height * 2));
dragProxyPanel.getElement().getStyle().setCursor(Style.Cursor.AUTO);
final Layer dragProxyLayer = new Layer();
dragProxyLayer.add(dragShape);
dragProxyPanel.add(dragProxyLayer);
dragProxyLayer.batch();
setDragProxyPosition(dragProxyPanel, width, height, x, y);
attachDragProxyHandlers(dragProxyPanel, dragProxyCallback);
addKeyboardEscHandler();
RootPanel.get().add(dragProxyPanel);
return this;
}
use of com.ait.lienzo.client.widget.LienzoPanel in project kie-wb-common by kiegroup.
the class WiresCanvasViewTest method setup.
@Before
public void setup() {
this.wiresManagerFactory = spy(new WiresManagerFactoryImpl(new StunnerWiresControlFactory(), new StunnerWiresHandlerFactory()));
this.canvas = new WiresCanvasView(this.wiresManagerFactory);
this.panel = new LienzoPanel(100, 100);
this.layer = new LienzoLayer();
this.canvas.init();
this.canvas.show(panel, 100, 100, layer);
}
use of com.ait.lienzo.client.widget.LienzoPanel in project kie-wb-common by kiegroup.
the class LienzoElementGlyphRenderer method newPanel.
private LienzoPanel newPanel(final G glyph, final int width, final int height) {
final Group glyphGroup = getLienzoGlyphRenderer().render(glyph, width, height);
final 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 drools-wb by kiegroup.
the class NodeLabel method setLabel.
public void setLabel(final String label) {
final Layer scratchLayer = new Layer();
final LienzoPanel scratchPanel = new LienzoPanel(100, 100);
scratchPanel.add(scratchLayer);
text.setText(label);
final TextMetrics tm = text.measure(scratchLayer.getContext());
final double cw = tm.getWidth() + 10;
final double ch = tm.getHeight() + 10;
container.setWidth(cw);
container.setHeight(ch);
container.setLocation(new Point2D(-cw / 2, -ch / 2));
}
use of com.ait.lienzo.client.widget.LienzoPanel in project drools-wb by kiegroup.
the class BaseGuidedDecisionTreeNodeFactory method getDragProxyWidth.
private double getDragProxyWidth(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(getWidth(), tm.getWidth());
}
Aggregations