Search in sources :

Example 1 with GridLayer

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

the class LienzoGridLayerBuilder method getLienzoGridFor.

public static GridLayer getLienzoGridFor(final CanvasGrid canvasGrid) {
    final CanvasGrid.GridLine line1 = canvasGrid.getLine1();
    final CanvasGrid.GridLine line2 = canvasGrid.getLine2();
    final Line gridLine1 = createLine(line1);
    final Line gridLine2 = null != line2 ? createLine(line2) : null;
    if (null != gridLine2) {
        return new GridLayer(line1.getDistance(), gridLine1, line2.getDistance(), gridLine2);
    } else {
        return new GridLayer(line1.getDistance(), gridLine1);
    }
}
Also used : Line(com.ait.lienzo.client.core.shape.Line) GridLayer(com.ait.lienzo.client.core.shape.GridLayer) CanvasGrid(org.kie.workbench.common.stunner.core.client.canvas.CanvasGrid)

Example 2 with GridLayer

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

the class CanvasView method setGrid.

@Override
public AbstractCanvas.View setGrid(final CanvasGrid grid) {
    if (null != grid) {
        GridLayer gridLayer = LienzoGridLayerBuilder.getLienzoGridFor(grid);
        panel.setBackgroundLayer(gridLayer);
    } else {
        panel.setBackgroundLayer(null);
    }
    return this;
}
Also used : GridLayer(com.ait.lienzo.client.core.shape.GridLayer)

Example 3 with GridLayer

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

the class LienzoCanvasView method setGrid.

@Override
public LienzoCanvasView<L> setGrid(final CanvasGrid grid) {
    if (null != grid) {
        GridLayer gridLayer = LienzoGridLayerBuilder.getLienzoGridFor(grid);
        getLienzoPanel().setBackgroundLayer(gridLayer);
    } else {
        getLienzoPanel().setBackgroundLayer(null);
    }
    return this;
}
Also used : GridLayer(com.ait.lienzo.client.core.shape.GridLayer)

Aggregations

GridLayer (com.ait.lienzo.client.core.shape.GridLayer)3 Line (com.ait.lienzo.client.core.shape.Line)1 CanvasGrid (org.kie.workbench.common.stunner.core.client.canvas.CanvasGrid)1