Package jltk.gui

Class 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 Detail

      • fxSpinner

        protected javafx.scene.control.Spinner fxSpinner
    • 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 coordinate
        pTop - The vertical coordinate
        pWidth - The width of the spinner
        pHeight - The height of the spinner
        pMin - The minimal value of the spinner
        pMax - The maximal value of the spinner
        pStep - 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 coordinate
        pTop - The vertical coordinate
        pWidth - The width of the spinner
        pHeight - The height of the spinner
        pMin - The minimal value of the spinner
        pMax - The maximal value of the spinner
        pInitialValue - 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 coordinate
        pTop - The vertical coordinate
        pWidth - The width of the spinner
        pHeight - The height of the spinner
        pWindow - The window, the spinner should be placed
        pMin - The minimal value of the spinner
        pMax - The maximal value of the spinner
        pInitialValue - 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 coordinate
        pTop - The vertical coordinate
        pWidth - The width of the spinner
        pHeight - The height of the spinner
        pWindow - The window, the spinner should be placed
        pMin - The minimal value of the spinner
        pMax - The maximal value of the spinner
        pInitialValue - 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 coordinate
        pTop - The vertical coordinate
        pWidth - The width of the spinner
        pHeight - The height of the spinner
        pMin - The minimal value of the spinner
        pMax - The maximal value of the spinner
        pStep - 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 coordinate
        pTop - The vertical coordinate
        pWidth - The width of the spinner
        pHeight - The height of the spinner
        pMin - The minimal value of the spinner
        pMax - The maximal value of the spinner
        pInitialValue - 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 coordinate
        pTop - The vertical coordinate
        pWidth - The width of the spinner
        pHeight - The height of the spinner
        pWindow - The window, the spinner should be placed
        pMin - The minimal value of the spinner
        pMax - The maximal value of the spinner
        pInitialValue - 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 coordinate
        pTop - The vertical coordinate
        pWidth - The width of the spinner
        pHeight - The height of the spinner
        pWindow - The window, the spinner should be placed
        pMin - The minimal value of the spinner
        pMax - The maximal value of the spinner
        pInitialValue - 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