java.lang.Object
com.cryptoalgo.oursql.support.ui.UIUtils
Convenience methods for UI operations
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
clipToRadius
(javafx.scene.layout.Region targetPane, int r) Clips a provided pane to a specified corner radius.static javafx.stage.Stage
createUtilityStage
(String title, javafx.scene.Node... nodes) Create a stage for utility windows.static String
getResourcePath
(String res) Get non-null URL string of a resource.static URL
getResourceURL
(String res) Get non-null URL of a resource.static <T extends javafx.scene.layout.Pane>
TLoad and return a requested FXML.
-
Constructor Details
-
UIUtils
public UIUtils()
-
-
Method Details
-
clipToRadius
public static void clipToRadius(javafx.scene.layout.Region targetPane, int r) Clips a provided pane to a specified corner radius. For those pesky- Parameters:
targetPane
- Pane to clipr
- Corner radius of the clipping rectangle
-
loadFXML
Load and return a requested FXML.- Type Parameters:
T
- Type of root pane- Parameters:
name
- Name of FXML to load, relative toview/
(do not add file extension)- Returns:
- Loaded root pane from the requested FXML
- Throws:
IOException
- If loading from the requested FXML file failed
-
createUtilityStage
Create a stage for utility windows. Pre-styled with the model css.- Parameters:
title
- Title of stagenodes
- Nodes to add to rootVBox
- Returns:
- Created stage (
Stage.show()
not called)
-
getResourceURL
Get non-null URL of a resource.- Parameters:
res
- Resource string- Returns:
- URL of requested resource
-
getResourcePath
Get non-null URL string of a resource. For those APIs that for some reason have a parameter named "url" with the String type.- Parameters:
res
- Resource string- Returns:
- External string form of URL of requested resource
-