Class WiresLayoutUtilities
- java.lang.Object
-
- org.uberfire.ext.wires.core.trees.client.layout.WiresLayoutUtilities
-
public class WiresLayoutUtilities extends Object
Layout utilities
-
-
Field Summary
Fields Modifier and Type Field Description static doublePADDING
-
Constructor Summary
Constructors Constructor Description WiresLayoutUtilities()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Rectangle2DalignLayoutInCanvas(Map<org.uberfire.ext.wires.core.api.shapes.WiresBaseShape,com.ait.lienzo.client.core.types.Point2D> layout)Align the Layout within a Canvasstatic Rectangle2DgetCanvasBounds(Rectangle2D layoutBounds)Get the bounds of the Canvas to hold the provided Layout bounds.static Rectangle2DgetLayoutBounds(Map<org.uberfire.ext.wires.core.api.shapes.WiresBaseShape,com.ait.lienzo.client.core.types.Point2D> layout)Get the bounds of the layout informationstatic voidresizeViewPort(Rectangle2D canvasBounds, com.ait.lienzo.client.core.shape.Viewport viewport)Resize the canvas based on the layout information
-
-
-
Field Detail
-
PADDING
public static final double PADDING
- See Also:
- Constant Field Values
-
-
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 Canvasviewport- Viewport to be re-sized
-
-