Class LayoutFactory
java.lang.Object
org.netbeans.api.visual.layout.LayoutFactory
This class is a factory of all built-in layouts.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Alignment of children widgets within a calculated connection widgets used by default layout used in a connection widget.static enum
Alignment of children widgets within a calculated widget used by FlowLayout (vertical and horizontal flow layout). -
Method Summary
Modifier and TypeMethodDescriptionstatic Layout
Creates an absolute layout where widgets are located at placed defined by their preferredLocation.static Layout
createCardLayout
(Widget cardLayoutWidget) Creates a card layout where all children widgets except the active one are hidden.static SceneLayout
createDevolveWidgetLayout
(Widget widget, Layout devolveLayout, boolean animate) Returns a scene layout which performs one-time layout using specified devolve-layout.static Layout
Deprecated.use createOverlayLayout method insteadstatic Layout
Creates a horizontal flow layout with default style where widgets are placed horizontally one to the right from another.static Layout
createHorizontalFlowLayout
(LayoutFactory.SerialAlignment alignment, int gap) Creates a horizontal flow layout with a specific style where widgets are placed horizontally one to the right from another.static Layout
Deprecated.use createHorizontalFlowLayout method insteadstatic Layout
createHorizontalLayout
(LayoutFactory.SerialAlignment alignment, int gap) Deprecated.use createHorizontalFlowLayout (alignment, gap) method insteadstatic Layout
Returns a overlay layout where all children widgets has the boundary at the biggest one of them or they are expanded to the parent widget boundaries during justification.static <N,
E> SceneLayout createSceneGraphLayout
(GraphPinScene<N, E, ?> graphPinScene, GraphLayout<N, E> graphLayout) Creates a scene layout which performs a specified graph-oriented layout on a specified GraphPinScene.static <N,
E> SceneLayout createSceneGraphLayout
(GraphScene<N, E> graphScene, GraphLayout<N, E> graphLayout) Creates a scene layout which performs a specified graph-oriented layout on a specified GraphScene.static Layout
Creates a vertical flow layout with default style where widgets are placed vertically one to the bottom from another.static Layout
createVerticalFlowLayout
(LayoutFactory.SerialAlignment alignment, int gap) Creates a vertical flow layout with a specific style where widgets are placed vertically one to the bottom from another.static Layout
Deprecated.use createVerticalFlowLayout method insteadstatic Layout
createVerticalLayout
(LayoutFactory.SerialAlignment alignment, int gap) Deprecated.use createVerticalFlowLayout (alignment, gap) method insteadstatic Widget
getActiveCard
(Widget cardLayoutWidget) Returns active card of a specified widget where a card layout is used.static void
setActiveCard
(Widget widget, Widget activeChildWidget) Sets active card of a specified widget where a card layout is used.
-
Method Details
-
createAbsoluteLayout
Creates an absolute layout where widgets are located at placed defined by their preferredLocation. The instance can be shared by multiple widgets.- Returns:
- the absolute layout
-
createVerticalLayout
Deprecated.use createVerticalFlowLayout method insteadCreates a vertical flow layout with default style where widgets are placed vertically one to the bottom from another. The instance can be shared by multiple widgets. If child widget constraint is an Number value, then its integer value is takes as a weight in which the remaining height of the parent widget is split.- Returns:
- the vertical flow layout
-
createVerticalLayout
@Deprecated public static Layout createVerticalLayout(LayoutFactory.SerialAlignment alignment, int gap) Deprecated.use createVerticalFlowLayout (alignment, gap) method insteadCreates a vertical flow layout with a specific style where widgets are placed vertically one to the bottom from another. The instance can be shared by multiple widgets. If child widget constraint is an Number value, then its integer value is takes as a weight in which the remaining height of the parent widget is split.- Parameters:
alignment
- the alignmentgap
- the gap between widgets- Returns:
- the vertical flow layout
-
createVerticalFlowLayout
Creates a vertical flow layout with default style where widgets are placed vertically one to the bottom from another. The instance can be shared by multiple widgets. If child widget constraint is an Number value, then its integer value is takes as a weight in which the remaining height of the parent widget is split.- Returns:
- the vertical flow layout
-
createVerticalFlowLayout
Creates a vertical flow layout with a specific style where widgets are placed vertically one to the bottom from another. The instance can be shared by multiple widgets. If child widget constraint is an Number value, then its integer value is takes as a weight in which the remaining height of the parent widget is split.- Parameters:
alignment
- the alignmentgap
- the gap between widgets- Returns:
- the vertical flow layout
-
createHorizontalLayout
Deprecated.use createHorizontalFlowLayout method insteadCreates a horizontal flow layout with default style where widgets are placed horizontally one to the right from another. The instance can be shared by multiple widgets. If child widget constraint is an Number value, then its integer value is takes as a weight in which the remaining width of the parent widget is split.- Returns:
- the horizontal flow layout
-
createHorizontalLayout
@Deprecated public static Layout createHorizontalLayout(LayoutFactory.SerialAlignment alignment, int gap) Deprecated.use createHorizontalFlowLayout (alignment, gap) method insteadCreates a horizontal flow layout with a specific style where widgets are placed horizontally one to the right from another. The instance can be shared by multiple widgets. If child widget constraint is an Number value, then its integer value is takes as a weight in which the remaining width of the parent widget is split.- Parameters:
alignment
- the alignmentgap
- the gap between widgets- Returns:
- the horizontal flow layout
-
createHorizontalFlowLayout
Creates a horizontal flow layout with default style where widgets are placed horizontally one to the right from another. The instance can be shared by multiple widgets. If child widget constraint is an Number value, then its integer value is takes as a weight in which the remaining width of the parent widget is split.- Returns:
- the horizontal flow layout
-
createHorizontalFlowLayout
Creates a horizontal flow layout with a specific style where widgets are placed horizontally one to the right from another. The instance can be shared by multiple widgets. If child widget constraint is an Number value, then its integer value is takes as a weight in which the remaining width of the parent widget is split.- Parameters:
alignment
- the alignmentgap
- the gap between widgets- Returns:
- the horizontal flow layout
-
createCardLayout
Creates a card layout where all children widgets except the active one are hidden. The active one is the only shown. The active widget could be managed using LayoutFactory.getActiveCard and LayoutFactory.setActiveCard methods. The instance cannot be shared.- Parameters:
cardLayoutWidget
- the widget where the card layout is going to be used- Returns:
- the card layout
-
getActiveCard
-
setActiveCard
-
createFillLayout
Deprecated.use createOverlayLayout method insteadReturns a fill layout where all children widgets has the boundary at the biggest one of them or they are expanded to the parent widget boundaries during justification. The instance can be shared by multiple widgets.- Returns:
- the fill layout
-
createOverlayLayout
Returns a overlay layout where all children widgets has the boundary at the biggest one of them or they are expanded to the parent widget boundaries during justification. The instance can be shared by multiple widgets.- Returns:
- the overlay layout
-
createDevolveWidgetLayout
public static SceneLayout createDevolveWidgetLayout(Widget widget, Layout devolveLayout, boolean animate) Returns a scene layout which performs one-time layout using specified devolve-layout. The instance cannot be shared.- Parameters:
widget
- thedevolveLayout
- the layout that is going to be used for one-time layoutanimate
- if true, then setting preferredLocation is gone animated- Returns:
- the scene layout
-
createSceneGraphLayout
public static <N,E> SceneLayout createSceneGraphLayout(GraphScene<N, E> graphScene, GraphLayout<N, E> graphLayout) Creates a scene layout which performs a specified graph-oriented layout on a specified GraphScene.- Parameters:
graphScene
- the graph scenegraphLayout
- the graph layout- Returns:
- the scene layout
-
createSceneGraphLayout
public static <N,E> SceneLayout createSceneGraphLayout(GraphPinScene<N, E, ?> graphPinScene, GraphLayout<N, E> graphLayout) Creates a scene layout which performs a specified graph-oriented layout on a specified GraphPinScene.- Parameters:
graphPinScene
- the graph pin scenegraphLayout
- the graph layout- Returns:
- the scene layout
-