Search in sources :

Example 26 with Layer

use of com.ait.lienzo.client.core.shape.Layer in project kie-wb-common by kiegroup.

the class PrimitivePopup method reset.

protected void reset() {
    this.clear();
    canvasLayer = new Layer();
    lienzoPanel = null;
}
Also used : Layer(com.ait.lienzo.client.core.shape.Layer)

Example 27 with Layer

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

Example 28 with Layer

use of com.ait.lienzo.client.core.shape.Layer 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());
}
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)

Aggregations

Layer (com.ait.lienzo.client.core.shape.Layer)28 Test (org.junit.Test)9 LienzoPanel (com.ait.lienzo.client.widget.LienzoPanel)7 Group (com.ait.lienzo.client.core.shape.Group)6 Before (org.junit.Before)5 Point2D (com.ait.lienzo.client.core.types.Point2D)4 MultiPath (com.ait.lienzo.client.core.shape.MultiPath)3 WiresLayer (com.ait.lienzo.client.core.shape.wires.WiresLayer)3 WiresShape (com.ait.lienzo.client.core.shape.wires.WiresShape)3 TextMetrics (com.ait.lienzo.client.core.types.TextMetrics)3 IsWidget (com.google.gwt.user.client.ui.IsWidget)2 LienzoLayer (org.kie.workbench.common.stunner.client.lienzo.canvas.LienzoLayer)2 WiresLayer (org.kie.workbench.common.stunner.client.lienzo.canvas.wires.WiresLayer)2 ClientTranslationService (org.kie.workbench.common.stunner.core.client.i18n.ClientTranslationService)2 RGBIgnoreAlphaImageDataFilter (com.ait.lienzo.client.core.image.filter.RGBIgnoreAlphaImageDataFilter)1 IPathClipper (com.ait.lienzo.client.core.shape.IPathClipper)1 MultiPathDecorator (com.ait.lienzo.client.core.shape.MultiPathDecorator)1 PolyLine (com.ait.lienzo.client.core.shape.PolyLine)1 Rectangle (com.ait.lienzo.client.core.shape.Rectangle)1 IControlHandle (com.ait.lienzo.client.core.shape.wires.IControlHandle)1