Package jisa.gui

Class JFXElement

    • Constructor Detail

      • JFXElement

        public JFXElement​(java.lang.String title,
                          javafx.scene.Node centre)
      • JFXElement

        public JFXElement​(java.lang.String title)
      • JFXElement

        public JFXElement​(java.lang.String title,
                          java.lang.String fxmlPath)
                   throws java.io.IOException
        Creates a GUI window using the specified FXML file.
        Parameters:
        title - Title to display in window title-bar
        fxmlPath - Path to FXML file to use
        Throws:
        java.io.IOException - Upon error reading from FXML file
      • JFXElement

        public JFXElement​(java.lang.String title,
                          java.net.URL resource)
      • JFXElement

        protected JFXElement​(java.lang.String title,
                             Icon icon,
                             java.net.URL resource)
    • Method Detail

      • setCentreNode

        public void setCentreNode​(javafx.scene.Node centre)
      • addToolbarButton

        public Button addToolbarButton​(java.lang.String text,
                                       SRunnable onClick)
        Adds a button to the a toolbar at the top of this element.
        Parameters:
        text - Test to display on the button
        onClick - Action to perform when clicked
        Returns:
        Button handle
      • addToolbarMenuButton

        public MenuButton addToolbarMenuButton​(java.lang.String text)
        Adds a menu button to the toolbar at the top of this element. This button displays a menu with options when clicked.
        Parameters:
        text - Test to display on the button.
        Returns:
        MenuButton handle
      • getMaxWidth

        public double getMaxWidth()
      • setMaxWidth

        public void setMaxWidth​(double width)
      • setMaxWindowWidth

        public void setMaxWindowWidth​(double maxWidth)
      • getMaxWindowWidth

        public double getMaxWindowWidth()
      • getMaxHeight

        public double getMaxHeight()
      • setMaxHeight

        public void setMaxHeight​(double height)
      • setMaxWindowHeight

        public void setMaxWindowHeight​(double maxHeight)
      • getMaxWindowHeight

        public double getMaxWindowHeight()
      • setMinWidth

        public void setMinWidth​(double width)
      • getMinWidth

        public double getMinWidth()
      • setMinHeight

        public void setMinHeight​(double height)
      • getMinHeight

        public double getMinHeight()
      • addToolbarSeparator

        public Separator addToolbarSeparator()
        Adds a separator to the toolbar at the top of this element.
        Returns:
        Separator handle
      • clearToolbar

        public void clearToolbar()
        Removes all items from the toolbar at the top of this element.
      • addDialogButton

        public Button addDialogButton​(java.lang.String text,
                                      SRunnable onClick)
        Adds a button to the bottom-right of the element.
        Parameters:
        text - Text to display in button
        onClick -
        Returns:
      • addDialogMenuButton

        public MenuButton addDialogMenuButton​(java.lang.String text)
      • clearDialogButtons

        public void clearDialogButtons()
      • showAsAlert

        public void showAsAlert()
      • showAsDialog

        public int showAsDialog​(java.lang.String... buttons)
      • showAsConfirmation

        public boolean showAsConfirmation()
      • setWindowSize

        public void setWindowSize​(double width,
                                  double height)
      • getWindowWidth

        public double getWindowWidth()
      • setWindowWidth

        public void setWindowWidth​(double width)
      • getWindowHeight

        public double getWindowHeight()
      • setWindowHeight

        public void setWindowHeight​(double height)
      • autoSizeWindow

        public void autoSizeWindow()
      • getStage

        public javafx.stage.Stage getStage()
      • show

        public void show()
        Shows the window.
        Specified by:
        show in interface Element
      • hide

        public void hide()
        Hides the window
        Specified by:
        hide in interface Element
      • close

        public void close()
        Closes the window
        Specified by:
        close in interface Element
      • isShowing

        public boolean isShowing()
        Returns whether the element is currently open in its own window.
        Returns:
        Open?
      • autoAdjustSize

        public void autoAdjustSize()
      • isMaximised

        public boolean isMaximised()
      • setMaximised

        public void setMaximised​(boolean flag)
        Sets whether the window is maximised or not.
        Parameters:
        flag - Maximised?
      • isDecorated

        public boolean isDecorated()
        Returns whether the element is set to be shown with window decorations (title bar + frame) when shown as window.
        Returns:
        Show window decorations?
      • setDecorated

        public void setDecorated​(boolean decorated)
        Sets whether a title bar + frame should be drawn around this element when shown as a window or not. Can only be called before the window is shown for the first time.
        Parameters:
        decorated - Show window decorations?
      • getNode

        public javafx.scene.layout.BorderPane getNode()
        Description copied from interface: Element
        Returns the JavaFX node of the element.
        Specified by:
        getNode in interface Element
        Returns:
      • getTitle

        public java.lang.String getTitle()
        Description copied from interface: Element
        Returns the title of the element.
        Specified by:
        getTitle in interface Element
        Returns:
        Title of element
      • setTitle

        public void setTitle​(java.lang.String title)
        Description copied from interface: Element
        Sets the title of the element
        Specified by:
        setTitle in interface Element
        Parameters:
        title - Title of element
      • titleProperty

        public javafx.beans.property.ObjectProperty<java.lang.String> titleProperty()
        Specified by:
        titleProperty in interface Element
      • setExitOnClose

        public void setExitOnClose​(boolean close)
      • isExitOnClose

        public boolean isExitOnClose()
      • setOnClose

        public void setOnClose​(SRunnable toRun)
      • getIcon

        public javafx.scene.image.Image getIcon()
        Description copied from interface: Element
        Returns any icon being used by this element.
        Specified by:
        getIcon in interface Element
        Returns:
        Icon
      • setIcon

        public void setIcon​(Icon icon)
      • setIcon

        public void setIcon​(java.net.URL icon)
      • iconProperty

        public javafx.beans.property.ObjectProperty<javafx.scene.image.Image> iconProperty()