Module qupath.fx

Class GridPaneUtils

java.lang.Object
qupath.fx.utils.GridPaneUtils

public class GridPaneUtils extends Object
Assorted static functions to help when working with a JavaFX panes.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addGridRow(javafx.scene.layout.GridPane pane, int row, int col, String tooltipText, javafx.scene.Node... nodes)
    Add a row of nodes.
    static javafx.scene.layout.GridPane
    createColumnGrid(int nCols)
    Create a GridPane containing columns that resize similarly to Swing's GridLayout().
    static javafx.scene.layout.GridPane
    createColumnGrid(javafx.scene.Node... nodes)
    Create a GridPane containing columns that resize similarly to Swing's GridLayout().
    static javafx.scene.layout.GridPane
    createColumnGridControls(javafx.scene.Node... nodes)
    Create a GridPane containing columns that resize similarly to Swing's GridLayout(), where controls have their widths bound to their parent.
    static javafx.scene.layout.GridPane
    createRowGrid(javafx.scene.Node... nodes)
    Create a GridPane containing rows that resize similarly to Swing's GridLayout().
    static javafx.scene.layout.GridPane
    createRowGridControls(javafx.scene.Node... nodes)
    Create a GridPane containing columns that resize similarly to Swing's GridLayout(), while also resizing contained objects to have the corresponding widths.
    static void
    setFillHeight(Boolean doFill, javafx.scene.Node... nodes)
    Set the GridPane.setFillHeight(Node, Boolean) property for specified nodes.
    static void
    setFillWidth(Boolean doFill, javafx.scene.Node... nodes)
    Set the GridPane.setFillWidth(Node, Boolean) property for specified nodes.
    static void
    setHGrowPriority(javafx.scene.layout.Priority priority, javafx.scene.Node... nodes)
    Set the GridPane.setHgrow(Node, Priority) property for specified nodes.
    static void
    setMaxHeight(double height, javafx.scene.layout.Region... regions)
    Set the max height property for the specified regions.
    static void
    setMaxWidth(double width, javafx.scene.layout.Region... regions)
    Set the max width property for the specified regions.
    static void
    setMinHeight(double height, javafx.scene.layout.Region... regions)
    Set the min height property for the specified regions.
    static void
    setMinWidth(double width, javafx.scene.layout.Region... regions)
    Set the min width property for the specified regions.
    static void
    setToExpandGridPaneHeight(javafx.scene.Node... nodes)
    Set constraints and max width values (where possible) so that the specified nodes fill all available vertical space in a GridPane.
    static void
    setToExpandGridPaneWidth(javafx.scene.Node... nodes)
    Set constraints and max width values (where possible) so that the specified nodes fill all available horizontal space in a GridPane.
    static void
    setVGrowPriority(javafx.scene.layout.Priority priority, javafx.scene.Node... nodes)
    Set the GridPane.setVgrow(Node, Priority) property for specified nodes.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GridPaneUtils

      public GridPaneUtils()
  • Method Details

    • addGridRow

      public static void addGridRow(javafx.scene.layout.GridPane pane, int row, int col, String tooltipText, javafx.scene.Node... nodes)
      Add a row of nodes. The rowspan is always 1. The colspan is 1 by default, unless a Node is added multiple times consecutively in which case it is the sum of the number of times the node is added.
      Parameters:
      pane -
      row -
      col -
      tooltipText -
      nodes -
    • setHGrowPriority

      public static void setHGrowPriority(javafx.scene.layout.Priority priority, javafx.scene.Node... nodes)
      Set the GridPane.setHgrow(Node, Priority) property for specified nodes.
      Parameters:
      priority -
      nodes -
    • setVGrowPriority

      public static void setVGrowPriority(javafx.scene.layout.Priority priority, javafx.scene.Node... nodes)
      Set the GridPane.setVgrow(Node, Priority) property for specified nodes.
      Parameters:
      priority -
      nodes -
    • setMaxWidth

      public static void setMaxWidth(double width, javafx.scene.layout.Region... regions)
      Set the max width property for the specified regions. This can be especially useful when setting the width to Double.MAX_VALUE, indicating that the region may be enlarged as required.
      Parameters:
      width -
      regions -
    • setMaxHeight

      public static void setMaxHeight(double height, javafx.scene.layout.Region... regions)
      Set the max height property for the specified regions. This can be especially useful when setting the height to Double.MAX_VALUE, indicating that the region may be enlarged as required.
      Parameters:
      height -
      regions -
    • setMinWidth

      public static void setMinWidth(double width, javafx.scene.layout.Region... regions)
      Set the min width property for the specified regions. This can be especially useful when setting the width to Region.USE_PREF_SIZE, indicating that the region should not be shrunk beyond its preferred size.
      Parameters:
      width -
      regions -
    • setMinHeight

      public static void setMinHeight(double height, javafx.scene.layout.Region... regions)
      Set the min height property for the specified regions. This can be especially useful when setting the height to Region.USE_PREF_SIZE, indicating that the region should not be shrunk beyond its preferred size.
      Parameters:
      height -
      regions -
    • setFillWidth

      public static void setFillWidth(Boolean doFill, javafx.scene.Node... nodes)
      Set the GridPane.setFillWidth(Node, Boolean) property for specified nodes.
      Parameters:
      doFill -
      nodes -
    • setToExpandGridPaneWidth

      public static void setToExpandGridPaneWidth(javafx.scene.Node... nodes)
      Set constraints and max width values (where possible) so that the specified nodes fill all available horizontal space in a GridPane.
      Parameters:
      nodes -
    • setToExpandGridPaneHeight

      public static void setToExpandGridPaneHeight(javafx.scene.Node... nodes)
      Set constraints and max width values (where possible) so that the specified nodes fill all available vertical space in a GridPane.
      Parameters:
      nodes -
    • setFillHeight

      public static void setFillHeight(Boolean doFill, javafx.scene.Node... nodes)
      Set the GridPane.setFillHeight(Node, Boolean) property for specified nodes.
      Parameters:
      doFill -
      nodes -
    • createRowGrid

      public static javafx.scene.layout.GridPane createRowGrid(javafx.scene.Node... nodes)
      Create a GridPane containing rows that resize similarly to Swing's GridLayout().
      Parameters:
      nodes -
      Returns:
    • createRowGridControls

      public static javafx.scene.layout.GridPane createRowGridControls(javafx.scene.Node... nodes)
      Create a GridPane containing columns that resize similarly to Swing's GridLayout(), while also resizing contained objects to have the corresponding widths.
      Parameters:
      nodes -
      Returns:
    • createColumnGridControls

      public static javafx.scene.layout.GridPane createColumnGridControls(javafx.scene.Node... nodes)
      Create a GridPane containing columns that resize similarly to Swing's GridLayout(), where controls have their widths bound to their parent.
      Parameters:
      nodes -
      Returns:
    • createColumnGrid

      public static javafx.scene.layout.GridPane createColumnGrid(javafx.scene.Node... nodes)
      Create a GridPane containing columns that resize similarly to Swing's GridLayout().
      Parameters:
      nodes -
      Returns:
    • createColumnGrid

      public static javafx.scene.layout.GridPane createColumnGrid(int nCols)
      Create a GridPane containing columns that resize similarly to Swing's GridLayout().
      Parameters:
      nCols -
      Returns: