Package jltk.gui
Class Spinner
- java.lang.Object
-
- jltk.Component
-
- jltk.gui.Control
-
- jltk.gui.Spinner
-
public class Spinner extends Control
A single line with an up and down arrow, that let you select a number or an object. A Spinner ca be editable. events: changed- Version:
- 19.05.2022
- Author:
- ms
-
-
Field Summary
Fields Modifier and Type Field Description protected javafx.scene.control.Spinner
fxSpinner
-
Fields inherited from class jltk.Component
fxNode, hasFocus, myWindow, onFocusGained, onFocusLost
-
-
Constructor Summary
Constructors Constructor Description Spinner(double pLeft, double pTop, double pWidth, double pHeight, double pMin, double pMax, double pStep)
Creates the spinner on the specified postion.Spinner(double pLeft, double pTop, double pWidth, double pHeight, double pMin, double pMax, double pInitialValue, double pStep)
Creates the spinner on the specified postion.Spinner(double pLeft, double pTop, double pWidth, double pHeight, int pMin, int pMax, int pStep)
Creates the spinner on the specified postion.Spinner(double pLeft, double pTop, double pWidth, double pHeight, int pMin, int pMax, int pInitialValue, int pStep)
Creates the spinner on the specified postion.Spinner(Window pWindow, double pLeft, double pTop, double pWidth, double pHeight, double pMin, double pMax, double pStep)
Creates the spinner at the specified positionSpinner(Window pWindow, double pLeft, double pTop, double pWidth, double pHeight, double pMin, double pMax, double pInitialValue, double pStep)
Creates the spinner at the specified positionSpinner(Window pWindow, double pLeft, double pTop, double pWidth, double pHeight, int pMin, int pMax, int pStep)
Creates the spinner at the specified positionSpinner(Window pWindow, double pLeft, double pTop, double pWidth, double pHeight, int pMin, int pMax, int pInitialValue, int pStep)
Creates the spinner at the specified position
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
decrement()
Attempts to increment the spinner by one step.void
decrement(int pSteps)
Attempts to increment the spinner by the given number steps.double
getValueAsDouble()
Returns the current value as doubleint
getValueAsInteger()
Returns the current value as integervoid
increment()
Attempts to increment the spinner by one step.void
increment(int pSteps)
Attempts to increment the spinner by the given number steps.void
setOnChanged(String pMethodName)
Sets the name of the method, which will be invoked, if the spinner is changed-
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
-
Spinner
public Spinner(double pLeft, double pTop, double pWidth, double pHeight, double pMin, double pMax, double pStep)
Creates the spinner on the specified postion.- Parameters:
pLeft
- The horizontal coordinatepTop
- The vertical coordinatepWidth
- The width of the spinnerpHeight
- The height of the spinnerpMin
- The minimal value of the spinnerpMax
- The maximal value of the spinnerpStep
- The amount to step by
-
Spinner
public Spinner(double pLeft, double pTop, double pWidth, double pHeight, double pMin, double pMax, double pInitialValue, double pStep)
Creates the spinner on the specified postion.- Parameters:
pLeft
- The horizontal coordinatepTop
- The vertical coordinatepWidth
- The width of the spinnerpHeight
- The height of the spinnerpMin
- The minimal value of the spinnerpMax
- The maximal value of the spinnerpInitialValue
- Value shown on start.pStep
- The amount to step by
-
Spinner
public Spinner(Window pWindow, double pLeft, double pTop, double pWidth, double pHeight, double pMin, double pMax, double pStep)
Creates the spinner at the specified position- Parameters:
pLeft
- The horizontal coordinatepTop
- The vertical coordinatepWidth
- The width of the spinnerpHeight
- The height of the spinnerpWindow
- The window, the spinner should be placedpMin
- The minimal value of the spinnerpMax
- The maximal value of the spinnerpInitialValue
- Value shown on start.pStep
- The amount to step by
-
Spinner
public Spinner(Window pWindow, double pLeft, double pTop, double pWidth, double pHeight, double pMin, double pMax, double pInitialValue, double pStep)
Creates the spinner at the specified position- Parameters:
pLeft
- The horizontal coordinatepTop
- The vertical coordinatepWidth
- The width of the spinnerpHeight
- The height of the spinnerpWindow
- The window, the spinner should be placedpMin
- The minimal value of the spinnerpMax
- The maximal value of the spinnerpInitialValue
- Value shown on start.pStep
- The amount to step by
-
Spinner
public Spinner(double pLeft, double pTop, double pWidth, double pHeight, int pMin, int pMax, int pStep)
Creates the spinner on the specified postion.- Parameters:
pLeft
- The horizontal coordinatepTop
- The vertical coordinatepWidth
- The width of the spinnerpHeight
- The height of the spinnerpMin
- The minimal value of the spinnerpMax
- The maximal value of the spinnerpStep
- The amount to step by
-
Spinner
public Spinner(double pLeft, double pTop, double pWidth, double pHeight, int pMin, int pMax, int pInitialValue, int pStep)
Creates the spinner on the specified postion.- Parameters:
pLeft
- The horizontal coordinatepTop
- The vertical coordinatepWidth
- The width of the spinnerpHeight
- The height of the spinnerpMin
- The minimal value of the spinnerpMax
- The maximal value of the spinnerpInitialValue
- Value shown on start.pStep
- The amount to step by
-
Spinner
public Spinner(Window pWindow, double pLeft, double pTop, double pWidth, double pHeight, int pMin, int pMax, int pStep)
Creates the spinner at the specified position- Parameters:
pLeft
- The horizontal coordinatepTop
- The vertical coordinatepWidth
- The width of the spinnerpHeight
- The height of the spinnerpWindow
- The window, the spinner should be placedpMin
- The minimal value of the spinnerpMax
- The maximal value of the spinnerpInitialValue
- Value shown on start.pStep
- The amount to step by
-
Spinner
public Spinner(Window pWindow, double pLeft, double pTop, double pWidth, double pHeight, int pMin, int pMax, int pInitialValue, int pStep)
Creates the spinner at the specified position- Parameters:
pLeft
- The horizontal coordinatepTop
- The vertical coordinatepWidth
- The width of the spinnerpHeight
- The height of the spinnerpWindow
- The window, the spinner should be placedpMin
- The minimal value of the spinnerpMax
- The maximal value of the spinnerpInitialValue
- Value shown on start.pStep
- The amount to step by
-
-
Method Detail
-
setOnChanged
public void setOnChanged(String pMethodName)
Sets the name of the method, which will be invoked, if the spinner is changed
-
increment
public void increment()
Attempts to increment the spinner by one step.
-
increment
public void increment(int pSteps)
Attempts to increment the spinner by the given number steps.
-
decrement
public void decrement()
Attempts to increment the spinner by one step.
-
decrement
public void decrement(int pSteps)
Attempts to increment the spinner by the given number steps.
-
getValueAsInteger
public int getValueAsInteger()
Returns the current value as integer- Returns:
- the current value of the spinner
-
getValueAsDouble
public double getValueAsDouble()
Returns the current value as double- Returns:
- the current value of the spinner
-
-