Class LayoutFactory

java.lang.Object
org.netbeans.api.visual.layout.LayoutFactory

public final class LayoutFactory extends Object
This class is a factory of all built-in layouts.
  • Method Details

    • createAbsoluteLayout

      public static Layout 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 public static Layout createVerticalLayout()
      Deprecated.
      use createVerticalFlowLayout method instead
      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
    • createVerticalLayout

      @Deprecated public static Layout createVerticalLayout(LayoutFactory.SerialAlignment alignment, int gap)
      Deprecated.
      use createVerticalFlowLayout (alignment, gap) method instead
      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 alignment
      gap - the gap between widgets
      Returns:
      the vertical flow layout
    • createVerticalFlowLayout

      public static 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

      public 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. 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 alignment
      gap - the gap between widgets
      Returns:
      the vertical flow layout
    • createHorizontalLayout

      @Deprecated public static Layout createHorizontalLayout()
      Deprecated.
      use createHorizontalFlowLayout method instead
      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
    • createHorizontalLayout

      @Deprecated public static Layout createHorizontalLayout(LayoutFactory.SerialAlignment alignment, int gap)
      Deprecated.
      use createHorizontalFlowLayout (alignment, gap) method instead
      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 alignment
      gap - the gap between widgets
      Returns:
      the horizontal flow layout
    • createHorizontalFlowLayout

      public static 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

      public 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. 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 alignment
      gap - the gap between widgets
      Returns:
      the horizontal flow layout
    • createCardLayout

      public static Layout createCardLayout(Widget cardLayoutWidget)
      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

      public static Widget getActiveCard(Widget cardLayoutWidget)
      Returns active card of a specified widget where a card layout is used.
      Parameters:
      cardLayoutWidget - the widget with card layout
      Returns:
      the active widget
    • setActiveCard

      public static void setActiveCard(Widget widget, Widget activeChildWidget)
      Sets active card of a specified widget where a card layout is used.
      Parameters:
      widget - the widget with card layout
      activeChildWidget - the new active widget
    • createFillLayout

      @Deprecated public static Layout createFillLayout()
      Deprecated.
      use createOverlayLayout method instead
      Returns 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

      public static 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 - the
      devolveLayout - the layout that is going to be used for one-time layout
      animate - 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 scene
      graphLayout - 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 scene
      graphLayout - the graph layout
      Returns:
      the scene layout