java.lang.Object
qupath.fx.utils.GridPaneUtils
Assorted static functions to help when working with a JavaFX panes.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 theGridPane.setFillHeight(Node, Boolean)
property for specified nodes.static void
setFillWidth
(Boolean doFill, javafx.scene.Node... nodes) Set theGridPane.setFillWidth(Node, Boolean)
property for specified nodes.static void
setHGrowPriority
(javafx.scene.layout.Priority priority, javafx.scene.Node... nodes) Set theGridPane.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 aGridPane
.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 aGridPane
.static void
setVGrowPriority
(javafx.scene.layout.Priority priority, javafx.scene.Node... nodes) Set theGridPane.setVgrow(Node, Priority)
property for specified nodes.
-
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 theGridPane.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 theGridPane.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 toDouble.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 toDouble.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 toRegion.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 toRegion.USE_PREF_SIZE
, indicating that the region should not be shrunk beyond its preferred size.- Parameters:
height
-regions
-
-
setFillWidth
Set theGridPane.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 aGridPane
.- 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 aGridPane
.- Parameters:
nodes
-
-
setFillHeight
Set theGridPane.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:
-