Package jisa.gui
Class Progress
- java.lang.Object
-
- jisa.gui.JFXElement
-
- jisa.gui.Progress
-
- All Implemented Interfaces:
Element
public class Progress extends JFXElement
GUI element consisting of a progress bar with title, percentage and status text.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jisa.gui.Element
Element.ElementBorder
-
-
Field Summary
Fields Modifier and Type Field Description protected javafx.scene.control.Label
pctLabel
protected javafx.scene.control.ProgressBar
progressBar
protected javafx.scene.control.Label
statusText
protected javafx.scene.control.Label
titleText
-
Constructor Summary
Constructors Constructor Description Progress(java.lang.String title)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getFractionProgress()
Returns the progress as a fraction of the maximum (ie value/max).double
getPercentProgress()
Returns the progress as a percentage of the maximum.double
getProgress()
Returns the current progress value.java.lang.String
getStatus()
Returns the current status text displayed underneath the progress bar.void
incrementProgress()
Increments the current progress value by 1.0.void
incrementProgress(java.lang.Number increment)
Increments the current progress value by a given amount.void
setProgress(double value)
Sets the progress value, while leaving the max value unchanged.void
setProgress(int value)
void
setProgress(java.lang.Number value, java.lang.Number max)
Sets the current value of the progress as value/max.void
setStatus(java.lang.String text)
Sets the status text to display underneath the progress bar.void
setTitle(java.lang.String text)
Sets the title of the element, including the title text above the progress bar.-
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, 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
getBorderedNode, isVisible, setVisible
-
-
-
-
Method Detail
-
setProgress
public void setProgress(java.lang.Number value, java.lang.Number max)
Sets the current value of the progress as value/max.- Parameters:
value
- Progress valuemax
- Max value
-
incrementProgress
public void incrementProgress(java.lang.Number increment)
Increments the current progress value by a given amount.- Parameters:
increment
- Increment to use
-
incrementProgress
public void incrementProgress()
Increments the current progress value by 1.0.
-
getProgress
public double getProgress()
Returns the current progress value.- Returns:
- Progress value
-
setProgress
public void setProgress(double value)
Sets the progress value, while leaving the max value unchanged.- Parameters:
value
- Progress value
-
setProgress
public void setProgress(int value)
-
getFractionProgress
public double getFractionProgress()
Returns the progress as a fraction of the maximum (ie value/max). That is a value between 0 and 1.- Returns:
- Progress fraction
-
getPercentProgress
public double getPercentProgress()
Returns the progress as a percentage of the maximum. That is a value between 0 and 100.- Returns:
- Percentage progress
-
setTitle
public void setTitle(java.lang.String text)
Sets the title of the element, including the title text above the progress bar.- Specified by:
setTitle
in interfaceElement
- Overrides:
setTitle
in classJFXElement
- Parameters:
text
- New title text
-
getStatus
public java.lang.String getStatus()
Returns the current status text displayed underneath the progress bar.- Returns:
- Current status text
-
setStatus
public void setStatus(java.lang.String text)
Sets the status text to display underneath the progress bar.- Parameters:
text
- New status text to display
-
-