Package jltk.gui

Class Slider


  • public class Slider
    extends Control
    A slider ist used to select a numeric value from a continuous or discrete range. events: changed
    Version:
    19.05.2022
    Author:
    ms
    • Field Detail

      • fxSlider

        protected javafx.scene.control.Slider fxSlider
    • Constructor Detail

      • Slider

        public Slider​(double pLeft,
                      double pTop,
                      double pWidth,
                      double pHeight,
                      double pMin,
                      double pMax,
                      double pInitialValue)
        Creates the slider on the specified postion.
        Parameters:
        pLeft - The horizontal coordinate
        pTop - The vertical coordinate
        pWidth - The width of the slider
        pHeight - The height of the slider
        pMin - The minimal value of the slider
        pMax - The maximal value of the slider
        pStep - The amount to step by
      • Slider

        public Slider​(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
      • Slider

        public Slider​(Window pWindow,
                      double pLeft,
                      double pTop,
                      double pWidth,
                      double pHeight,
                      double pMin,
                      double pMax,
                      double pInitialValue)
        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
      • Slider

        public Slider​(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
    • Method Detail

      • setOnChanged

        public void setOnChanged​(String pMethodName)
        Sets the name of the method, which will be invoked, if the slider is changed
      • increment

        public void increment()
        Attempts to increment the slider by one step.
      • decrement

        public void decrement()
        Attempts to increment the slider by one step.
      • getValueAsInteger

        public int getValueAsInteger()
        Returns the current value as integer
        Returns:
        the current value of the slider
      • getValueAsDouble

        public double getValueAsDouble()
        Returns the current value as double
        Returns:
        the current value of the slider
      • setValue

        public void setValue​(double pValue)
        Sets the value of the slider to the specified value.
        Parameters:
        pValue - New value of the slider
      • showTickMarks

        public void showTickMarks()
        Show tick marks.
      • hideTickMarks

        public void hideTickMarks()
        Hide tick marks.
      • showTickLabels

        public void showTickLabels()
        Show tick labels.
      • hideTickLabels

        public void hideTickLabels()
        Hide tick labels.
      • setLabledTickDistance

        public void setLabledTickDistance​(double pDistance)
        Sets the ditance between two labled ticks.
        Parameters:
        pDistance - The distance between two labled ticks.
      • setUnlabledTickCount

        public void setUnlabledTickCount​(int pCount)
        Set the amount of unlabled ticks between two labled ticks.
        Parameters:
        pCount - The number of unlabled ticks.
      • enableSnaping

        public void enableSnaping()
        Enables "snap to tick. The value of the slider will be align to a tick.
      • disableSnaping

        public void disableSnaping()
        Disables "snap to tick". The slider can be move continously.
      • setMinValue

        public void setMinValue​(double pMin)
        Sets the minimum value represented by this slider
        Parameters:
        pMin - Slider minium value
      • setMaxValue

        public void setMaxValue​(double pMax)
        Sets the maximal value represented by this slider
        Parameters:
        pMax - Slider maximum value
      • getMinValue

        public double getMinValue()
        Gets the minimum value represented by this slider
        Returns:
        Slider minimum value
      • getMaxValue

        public double getMaxValue()
        Gets the maximal value represented by this slider
        Returns:
        Slider maximal value