Class WiresLayoutUtilities


  • public class WiresLayoutUtilities
    extends Object
    Layout utilities
    • Constructor Detail

      • WiresLayoutUtilities

        public WiresLayoutUtilities()
    • Method Detail

      • getLayoutBounds

        public static Rectangle2D getLayoutBounds​(Map<org.uberfire.ext.wires.core.api.shapes.WiresBaseShape,​com.ait.lienzo.client.core.types.Point2D> layout)
        Get the bounds of the layout information
        Parameters:
        layout - Layout information
        Returns:
        The bounds of the layout
      • getCanvasBounds

        public static Rectangle2D getCanvasBounds​(Rectangle2D layoutBounds)
        Get the bounds of the Canvas to hold the provided Layout bounds. This notionally adds padding to the Layout bounds, however if the Canvas bounds are less than a minimum defined as WiresCanvas.DEFAULT_SIZE_WIDTH and WiresCanvas.DEFAULT_SIZE_HEIGHT then the minimum dimensions are used.
        Parameters:
        layoutBounds - The bounds of the Layout
        Returns:
        The bounds of the Canvas including padding to contain the Layout.
      • alignLayoutInCanvas

        public static Rectangle2D alignLayoutInCanvas​(Map<org.uberfire.ext.wires.core.api.shapes.WiresBaseShape,​com.ait.lienzo.client.core.types.Point2D> layout)
        Align the Layout within a Canvas
        Parameters:
        layout - Layout information
        Returns:
        Canvas bounds
      • resizeViewPort

        public static void resizeViewPort​(Rectangle2D canvasBounds,
                                          com.ait.lienzo.client.core.shape.Viewport viewport)
        Resize the canvas based on the layout information
        Parameters:
        canvasBounds - Bounds of the Canvas
        viewport - Viewport to be re-sized