Package jisa.gui

Class Fields

    • Field Detail

      • pane

        public javafx.scene.layout.BorderPane pane
      • list

        public javafx.scene.layout.GridPane list
    • Constructor Detail

      • Fields

        public Fields​(java.lang.String title)
        Creates a input fields group for user-input.
        Parameters:
        title - Title of the window/grid-element.
    • 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 field
        initialValue - 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 field
        initialValue - 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 field
        initialValue - 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 field
        initialValue - 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 field
        initialValue - 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 field
        initialValue - 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 field
        initialValue - Index of option to initially have selected
        options - 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 field
        options - 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)
      • iterator

        public java.util.Iterator<Field<?>> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<Field<?>>