Search in sources :

Example 1 with CanvasGrid

use of org.kie.workbench.common.stunner.core.client.canvas.CanvasGrid 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)

Aggregations

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