java.lang.Object
com.dua3.utility.fx.controls.Controls
Utility class for creating and managing UI controls.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ButtonBuilder<Button>button()CreateButtonBuilderinstance for standard buttons.static ButtonBuilder<CheckBox>checkbox()CreateButtonBuilderinstance for checkboxes.static ButtonBuilder<CheckBox>checkbox(boolean selected) CreateButtonBuilderinstance for checkboxes.static FileInputBuilderfileInput(FileDialogMode mode) Creates a new FileInputBuilder instance with the given mode.static NodeGet graphic for an icon by icon name.static NodeGet graphic for an icon by icon name.static NodeGet graphic for an icon by icon name.static NodeGet graphic for an icon by icon name.static com.dua3.utility.fx.icons.IconGet icon by name.static voidmakeResizable(Region region, int resizeMargin, Position... borders) Make a region resizable by dragging its edge.static voidmakeResizable(Region region, Position... borders) Make a region resizable by dragging its edge.static MenuCreate newMenu.static MenuCreate newMenu.static MenuItemCreate newMenuItem.static MenuItemCreate newMenuItem.static MenuItemCreate newMenuItem.static MenuItemCreate newMenuItem.static LabelrigidLabel(String text) Create a fixed minimum width label with the given text to prevent an ellipsis being display.static LabelrigidLabel(String text, Node node) Create a fixed minimum width label with the given text to prevent an ellipsis being display.static Nodeseparator(Orientation orientation) CreateSeparator.static SliderBuilderslider()CreateSliderBuilderinstance.static SliderBuilderslider(SliderWithButtons.Mode mode, BiFunction<Double, Double, String> formatter) CreateSliderBuilderinstance.static TextFieldBuilderGet TextFieldBuilder for creating a TextField.static ButtonBuilder<ToggleButton>CreateButtonBuilderinstance for toggle buttons.static ButtonBuilder<ToggleButton>toggleButton(boolean selected) CreateButtonBuilderinstance for toggle buttons.static NodetooltipIcon(String name, int size, com.dua3.utility.data.Color color, String tooltipText) Create an Icon with a tooltip.static NodetooltipIcon(String name, int size, Paint paint, String tooltipText) Create an Icon with a tooltip.
-
Method Details
-
button
CreateButtonBuilderinstance for standard buttons.- Returns:
- new ButtonBuilder
-
toggleButton
CreateButtonBuilderinstance for toggle buttons.- Returns:
- new ButtonBuilder
-
toggleButton
CreateButtonBuilderinstance for toggle buttons.- Parameters:
selected- the initial selection state of the button- Returns:
- new ButtonBuilder
-
checkbox
CreateButtonBuilderinstance for checkboxes.- Returns:
- new ButtonBuilder
-
checkbox
CreateButtonBuilderinstance for checkboxes.- Parameters:
selected- the initial selection state of the button- Returns:
- new ButtonBuilder
-
fileInput
Creates a new FileInputBuilder instance with the given mode.- Parameters:
mode- theFileDialogModeof the file dialog- Returns:
- a new FileInputBuilder instance
-
slider
CreateSliderBuilderinstance.- Returns:
- new SliderBuilder
-
slider
public static SliderBuilder slider(SliderWithButtons.Mode mode, BiFunction<Double, Double, String> formatter) CreateSliderBuilderinstance.- Parameters:
mode- theSliderWithButtons.Modeformatter- the formatter that generates the label text; first argument is current value and second is max value- Returns:
- new SliderBuilder
-
separator
CreateSeparator.- Parameters:
orientation- the separator orientation- Returns:
- new
Separator
-
graphic
Get graphic for an icon by icon name.- Parameters:
name- the icon name- Returns:
- a node for the graphic
- Throws:
IllegalStateException- if no icon with a matching name is found- See Also:
-
IconUtil.iconFromName(String)
-
icon
Get icon by name.- Parameters:
name- the icon name- Returns:
- icon
- Throws:
IllegalStateException- if no icon with a matching name is found- See Also:
-
IconUtil.iconFromName(String)
-
rigidLabel
Create a fixed minimum width label with the given text to prevent an ellipsis being display.- Parameters:
text- the text to display on the label- Returns:
- a new Label instance with fixed miimum width
- See Also:
-
rigidLabel
Create a fixed minimum width label with the given text to prevent an ellipsis being display.- Parameters:
text- the text to display on the labelnode- the node to display on the label- Returns:
- a new Label instance with fixed miimum width
- See Also:
-
graphic
Get graphic for an icon by icon name.- Parameters:
name- the icon namesize- the requested size- Returns:
- a node for the graphic
- Throws:
IllegalStateException- if no icon with a matching name is found- See Also:
-
IconUtil.iconFromName(String)
-
graphic
Get graphic for an icon by icon name.- Parameters:
name- the icon namesize- the requested sizepaint- thePaintto use- Returns:
- a node for the graphic
- Throws:
IllegalStateException- if no icon with a matching name is found- See Also:
-
IconUtil.iconFromName(String)
-
graphic
Get graphic for an icon by icon name.- Parameters:
name- the icon namesize- the requested sizecolor- theColorto use- Returns:
- a node for the graphic
- Throws:
IllegalStateException- if no icon with a matching name is found- See Also:
-
IconUtil.iconFromName(String)
-
tooltipIcon
Create an Icon with a tooltip.- Parameters:
name- the icon namesize- the requested sizepaint- thePaintto usetooltipText- the text to display as tooltip- Returns:
- a node for the graphic
- Throws:
IllegalStateException- if no icon with a matching name is found- See Also:
-
IconUtil.iconFromName(String)
-
tooltipIcon
public static Node tooltipIcon(String name, int size, com.dua3.utility.data.Color color, String tooltipText) Create an Icon with a tooltip.- Parameters:
name- the icon namesize- the requested sizecolor- theColorto usetooltipText- the text to display as tooltip- Returns:
- a node for the graphic
- Throws:
IllegalStateException- if no icon with a matching name is found- See Also:
-
IconUtil.iconFromName(String)
-
textField
Get TextFieldBuilder for creating a TextField.- Returns:
- TextFieldBuilder instance
-
makeResizable
Make a region resizable by dragging its edge.- Parameters:
region- the regionborders- the borders to make draggable
-
makeResizable
Make a region resizable by dragging its edge.- Parameters:
region- the regionresizeMargin- size of the draggable marginborders- the borders to make draggable
-