Package jltk.gui
Class ProgressBar
- java.lang.Object
-
- jltk.Component
-
- jltk.gui.Control
-
- jltk.gui.ProgressBar
-
public class ProgressBar extends Control
A linear control which is used for indicating progress. Often used to indicate the progress of a task.- Version:
- 24.05.2022
- Author:
- ms
-
-
Field Summary
Fields Modifier and Type Field Description protected javafx.scene.control.ProgressBar
fxProgressBar
-
Fields inherited from class jltk.Component
fxNode, hasFocus, myWindow, onFocusGained, onFocusLost
-
-
Constructor Summary
Constructors Constructor Description ProgressBar(double pLeft, double pTop, double pWidth, double pHeight)
Creates the progress bar on the specified postion.ProgressBar(double pLeft, double pTop, double pWidth, double pHeight, double pMin, double pMax)
Creates the progress bar on the specified postion.ProgressBar(Window pWindow, double pLeft, double pTop, double pWidth, double pHeight, double pMin, double pMax)
Creates the progress bar at the specified position
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
decrement(double pValue)
Attempts to decrement the progress bar by the given value.double
getMaxValue()
Gets the maximal value represented by this progress bardouble
getMinValue()
Gets the minimum value represented by this progress bardouble
getValue()
Returns the current value of the progress barvoid
increment(double pValue)
Attempts to increment the progress bar by the given valuevoid
setMaxValue(double pMax)
Sets the maximal value represented by this progress barvoid
setMinValue(double pMin)
Sets the minimum value represented by this progress barvoid
setValue(double pValue)
Sets the value of the progress bar to the specified value.-
Methods inherited from class jltk.gui.Control
getColor, getHeight, getWidth, init, setColor, setColor, setColor, setHeight, setSize, setTooltip, setWidth
-
Methods inherited from class jltk.Component
activate, deactivate, focus, getX, getY, hasFocus, hide, init, istActive, isVisible, runMethodByName, setOnFocusGained, setOnFocusLost, setPosition, show, toBack, toFront
-
-
-
-
Constructor Detail
-
ProgressBar
public ProgressBar(double pLeft, double pTop, double pWidth, double pHeight)
Creates the progress bar on the specified postion. The minimal value is 0 and the maximal value is 1.- Parameters:
pLeft
- The horizontal coordinatepTop
- The vertical coordinatepWidth
- The width of the progress barpHeight
- The height of the progress bar
-
ProgressBar
public ProgressBar(double pLeft, double pTop, double pWidth, double pHeight, double pMin, double pMax)
Creates the progress bar on the specified postion.- Parameters:
pLeft
- The horizontal coordinatepTop
- The vertical coordinatepWidth
- The width of the progress barpHeight
- The height of the progress barpMin
- The minimal value of the progress barpMax
- The maximal value of the progress bar
-
ProgressBar
public ProgressBar(Window pWindow, double pLeft, double pTop, double pWidth, double pHeight, double pMin, double pMax)
Creates the progress bar at the specified position- Parameters:
pLeft
- The horizontal coordinatepTop
- The vertical coordinatepWidth
- The width of the progress barpHeight
- The height of the progress barpWindow
- The window, the progress bar should be placedpMin
- The minimal value of the progress barpMax
- The maximal value of the progress bar
-
-
Method Detail
-
increment
public void increment(double pValue)
Attempts to increment the progress bar by the given value
-
decrement
public void decrement(double pValue)
Attempts to decrement the progress bar by the given value.
-
getValue
public double getValue()
Returns the current value of the progress bar- Returns:
- the current value of the progress bar
-
setValue
public void setValue(double pValue)
Sets the value of the progress bar to the specified value. The value mus between the minimal and maximal value of the progress bar. A value smaller than the minmal value is interpreted as minimal value. A value greater than the maximum value is interpreted as maximum value.- Parameters:
pValue
- New value of the progress bar.
-
setMinValue
public void setMinValue(double pMin)
Sets the minimum value represented by this progress bar- Parameters:
pMin
- ProgressBar minium value
-
setMaxValue
public void setMaxValue(double pMax)
Sets the maximal value represented by this progress bar- Parameters:
pMax
- ProgressBar maximum value
-
getMinValue
public double getMinValue()
Gets the minimum value represented by this progress bar- Returns:
- ProgressBar minimum value
-
getMaxValue
public double getMaxValue()
Gets the maximal value represented by this progress bar- Returns:
- ProgressBar maximal value
-
-