Package jisa.gui
Class Fields
- java.lang.Object
-
- jisa.gui.JFXElement
-
- jisa.gui.Fields
-
- Direct Known Subclasses:
RangeInput
public class Fields extends JFXElement implements Element, java.lang.Iterable<Field<?>>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jisa.gui.Element
Element.ElementBorder
-
-
Constructor Summary
Constructors Constructor Description Fields(java.lang.String title)
Creates a input fields group for user-input.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Field<java.lang.Boolean>
addCheckBox(java.lang.String name)
Adds a check-box to the fields group.Field<java.lang.Boolean>
addCheckBox(java.lang.String name, boolean initialValue)
Adds a check-box to the fields group.Field<java.lang.Integer>
addChoice(java.lang.String name, int initialValue, java.lang.String... options)
Adds a drop-down box with the specified choices.Field<java.lang.Integer>
addChoice(java.lang.String name, java.lang.String... options)
Adds a drop-down box with the specified choices.Field<java.lang.Double>
addDecimalField(java.lang.String name)
Adds a text box that only accepts decimal values.Field<java.lang.Double>
addDecimalField(java.lang.String name, double initialValue)
Adds a text box that only accepts decimal values.Field<java.lang.String>
addDirectorySelect(java.lang.String name)
Field<java.lang.String>
addDirectorySelect(java.lang.String name, java.lang.String initialValue)
Field<java.lang.Double>
addDoubleDisplay(java.lang.String name, double initialValue)
Field<java.lang.Double>
addDoubleField(java.lang.String name)
Adds a text box that only accepts numerical (decimal, floating point) values.Field<java.lang.Double>
addDoubleField(java.lang.String name, double initialValue)
Adds a text box that only accepts numerical (decimal, floating point) values.Field<Range<java.lang.Double>>
addDoubleRange(java.lang.String name, Range<java.lang.Double> defaultValues)
Field<Range<java.lang.Double>>
addDoubleRange(java.lang.String name, Range<java.lang.Double> defaultValues, double min, double max, int count, double dStep, int dOrder)
Field<java.lang.String>
addFileOpen(java.lang.String name)
Adds a text-box with a "browse" button for selecting a file for opening.Field<java.lang.String>
addFileOpen(java.lang.String name, java.lang.String initialValue)
Adds a text-box with a "browse" button for selecting a file for opening.Field<java.lang.String>
addFileSave(java.lang.String name)
Adds a text-box with a "browse" button for selecting a file save location.Field<java.lang.String>
addFileSave(java.lang.String name, java.lang.String initialValue)
Adds a text-box with a "browse" button for selecting a file save location.Field<java.lang.Integer>
addIntegerField(java.lang.String name)
Adds a text box that only accepts integer values.Field<java.lang.Integer>
addIntegerField(java.lang.String name, int initialValue)
Adds a text box that only accepts integer values.Separator
addSeparator()
Field<java.util.List<java.util.List<java.lang.Double>>>
addTable(java.lang.String name, java.lang.String... columns)
Field<java.lang.String>
addTextField(java.lang.String name)
Add a simple text box to the fields group.Field<java.lang.String>
addTextField(java.lang.String name, java.lang.String initialValue)
Add a simple text box to the fields group.Field<java.lang.Integer>
addTimeField(java.lang.String name)
Field<java.lang.Integer>
addTimeField(java.lang.String name, int initialValue)
void
clear()
java.util.Iterator<Field<?>>
iterator()
void
linkToConfig(ConfigBlock config)
void
loadFromConfig(ConfigBlock block)
void
setFieldsDisabled(boolean flag)
void
updateGridding()
void
writeToConfig(ConfigBlock block)
-
Methods inherited from class jisa.gui.JFXElement
addDialogButton, addDialogMenuButton, addToolbarButton, addToolbarMenuButton, addToolbarSeparator, autoAdjustSize, autoSizeWindow, clearDialogButtons, clearToolbar, close, getIcon, getMaxHeight, getMaxWidth, getMaxWindowHeight, getMaxWindowWidth, getMinHeight, getMinWidth, getNode, getStage, getTitle, getWindowHeight, getWindowWidth, hide, iconProperty, isDecorated, isExitOnClose, isMaximised, isShowing, setCentreNode, setDecorated, setExitOnClose, setIcon, setIcon, setMaxHeight, setMaximised, setMaxWidth, setMaxWindowHeight, setMaxWindowWidth, setMinHeight, setMinWidth, setOnClose, setTitle, setWindowHeight, setWindowSize, setWindowWidth, show, showAsAlert, showAsConfirmation, showAsDialog, titleProperty
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jisa.gui.Element
close, getBorderedNode, getIcon, getNode, getTitle, hide, isVisible, setTitle, setVisible, show, titleProperty
-
-
-
-
Method Detail
-
linkToConfig
public void linkToConfig(ConfigBlock config)
-
writeToConfig
public void writeToConfig(ConfigBlock block)
-
loadFromConfig
public void loadFromConfig(ConfigBlock block)
-
updateGridding
public void updateGridding()
-
addTextField
public Field<java.lang.String> addTextField(java.lang.String name, java.lang.String initialValue)
Add a simple text box to the fields group. Accepts any string.- Parameters:
name
- Name of the fieldinitialValue
- Initial value to show in the text-box- Returns:
- Reference object (SetGettable) to set and get the value of the text-box
-
addDoubleRange
public Field<Range<java.lang.Double>> addDoubleRange(java.lang.String name, Range<java.lang.Double> defaultValues)
-
addDoubleRange
public Field<Range<java.lang.Double>> addDoubleRange(java.lang.String name, Range<java.lang.Double> defaultValues, double min, double max, int count, double dStep, int dOrder)
-
addTimeField
public Field<java.lang.Integer> addTimeField(java.lang.String name, int initialValue)
-
addTimeField
public Field<java.lang.Integer> addTimeField(java.lang.String name)
-
addTextField
public Field<java.lang.String> addTextField(java.lang.String name)
Add a simple text box to the fields group. Accepts any string.- Parameters:
name
- Name of the field- Returns:
- Reference object (SetGettable) to set and get the value of the text-box
-
addCheckBox
public Field<java.lang.Boolean> addCheckBox(java.lang.String name, boolean initialValue)
Adds a check-box to the fields group. Provides boolean user input.- Parameters:
name
- Name of the fieldinitialValue
- Initial state of the check-box- Returns:
- Reference object to set and get the value (true or false) of the check-box
-
addCheckBox
public Field<java.lang.Boolean> addCheckBox(java.lang.String name)
Adds a check-box to the fields group. Provides boolean user input.- Parameters:
name
- Name of the field- Returns:
- Reference object to set and get the value (true or false) of the check-box
-
addFileSave
public Field<java.lang.String> addFileSave(java.lang.String name, java.lang.String initialValue)
Adds a text-box with a "browse" button for selecting a file save location.- Parameters:
name
- Name of the fieldinitialValue
- Initial value to display- Returns:
- SetGettable object that can set or get the selected file path as a String
-
addDoubleDisplay
public Field<java.lang.Double> addDoubleDisplay(java.lang.String name, double initialValue)
-
clear
public void clear()
-
addFileSave
public Field<java.lang.String> addFileSave(java.lang.String name)
Adds a text-box with a "browse" button for selecting a file save location.- Parameters:
name
- Name of the field- Returns:
- SetGettable object that can set or get the selected file path as a String
-
addDirectorySelect
public Field<java.lang.String> addDirectorySelect(java.lang.String name, java.lang.String initialValue)
-
addDirectorySelect
public Field<java.lang.String> addDirectorySelect(java.lang.String name)
-
addFileOpen
public Field<java.lang.String> addFileOpen(java.lang.String name, java.lang.String initialValue)
Adds a text-box with a "browse" button for selecting a file for opening.- Parameters:
name
- Name of the field- Returns:
- SetGettable object that can set or get the selected file path as a String
-
addFileOpen
public Field<java.lang.String> addFileOpen(java.lang.String name)
Adds a text-box with a "browse" button for selecting a file for opening.- Parameters:
name
- Name of the field- Returns:
- SetGettable object that can set or get the selected file path as a String
-
addIntegerField
public Field<java.lang.Integer> addIntegerField(java.lang.String name, int initialValue)
Adds a text box that only accepts integer values.- Parameters:
name
- Name of the fieldinitialValue
- Initial value to display- Returns:
- SetGettable to set or get the value as an integer
-
addIntegerField
public Field<java.lang.Integer> addIntegerField(java.lang.String name)
Adds a text box that only accepts integer values.- Parameters:
name
- Name of the field- Returns:
- SetGettable to set or get the value as an integer
-
addDecimalField
public Field<java.lang.Double> addDecimalField(java.lang.String name, double initialValue)
Adds a text box that only accepts decimal values.- Parameters:
name
- Name of the fieldinitialValue
- Initial value to display- Returns:
- SetGettable to set or get the value as a decimal
-
addDecimalField
public Field<java.lang.Double> addDecimalField(java.lang.String name)
Adds a text box that only accepts decimal values.- Parameters:
name
- Name of the field- Returns:
- SetGettable to set or get the value as a decimal
-
addTable
public Field<java.util.List<java.util.List<java.lang.Double>>> addTable(java.lang.String name, java.lang.String... columns)
-
addDoubleField
public Field<java.lang.Double> addDoubleField(java.lang.String name, double initialValue)
Adds a text box that only accepts numerical (decimal, floating point) values.- Parameters:
name
- Name of the fieldinitialValue
- Initial value to display- Returns:
- SetGettable to set or get the value as a double
-
addDoubleField
public Field<java.lang.Double> addDoubleField(java.lang.String name)
Adds a text box that only accepts numerical (decimal, floating point) values.- Parameters:
name
- Name of the field- Returns:
- SetGettable to set or get the value as a double
-
addChoice
public Field<java.lang.Integer> addChoice(java.lang.String name, int initialValue, java.lang.String... options)
Adds a drop-down box with the specified choices.- Parameters:
name
- Name of the fieldinitialValue
- Index of option to initially have selectedoptions
- Array of names for the options- Returns:
- SetGettable to set and get the selected value, represented as an integer (0 = first option, 1 = second option etc)
-
addChoice
public Field<java.lang.Integer> addChoice(java.lang.String name, java.lang.String... options)
Adds a drop-down box with the specified choices.- Parameters:
name
- Name of the fieldoptions
- Array of names for the options- Returns:
- SetGettable to set and get the selected value, represented as an integer (0 = first option, 1 = second option etc)
-
addSeparator
public Separator addSeparator()
-
setFieldsDisabled
public void setFieldsDisabled(boolean flag)
-
-