Interface ISlider

  • All Superinterfaces:
    IAnyGroup<ISlider>, IComponent<ISlider>, IHtmlBasedComponent<ISlider>, IXulElement<ISlider>

    public interface ISlider
    extends IXulElement<ISlider>, IAnyGroup<ISlider>
    Immutable Slider component

    A slider component represents a slider with a scale and a knob. It can be used to let user select a value by sliding the knob along the scale. A slider accepts a range of value starting from 0 to certain maximum value. The default maximum value of slider scale is 100. You could change the maximum allowed value by the maxpos attribute. However the default minimum is 0 and cannot be changed.

    Support @Action

    Name Action Type
    onScroll ActionData: ScrollData
    Denotes the content of a scrollable component has been scrolled by the user.
    onScrolling ActionData: ScrollData
    Denotes that the user is scrolling a scrollable component. Notice that the component's content (at the server) won't be changed until onScroll is received. Thus, you have to invoke the getPos method in the ScrollData class to retrieve the temporary position.

    Support Molds

    Name Snapshot
    "default"
    "sphere"
    "scale"
    "knob"
    Author:
    katherine
    See Also:
    Slider
    • Field Detail

      • DEFAULT

        static final ISlider DEFAULT
        Constant for default attributes of this immutable component.
      • SPHERE

        static final ISlider SPHERE
        Constant for sphere mold attributes of this immutable component.
      • SCALE

        static final ISlider SCALE
        Constant for scale mold attributes of this immutable component.
      • KNOB

        static final ISlider KNOB
        Constant for knob mold attributes of this immutable component.
    • Method Detail

      • getWidgetClass

        default java.lang.String getWidgetClass()
        Returns the client widget class.

        Default: "zul.inp.Slider"

        Specified by:
        getWidgetClass in interface IComponent<ISlider>
        Returns:
      • getName

        @Nullable
        java.lang.String getName()
        Returns the name of this component.

        Default: null.

      • withName

        ISlider withName​(@Nullable
                         java.lang.String name)
        Returns a copy of this immutable component with the specified name.

        Sets the name of this component.

        The name is used only to work with "legacy" Web application that handles user's request by servlets. It works only with HTTP/HTML-based browsers. It doesn't work with other kind of clients.

        Don't use this method if your application is purely based on ZK's event-driven model.

        Parameters:
        name - The name of this component.

        Default: null.

        Returns:
        A modified copy of the this object
      • getOrient

        default java.lang.String getOrient()
        Returns the orient.

        Default: "horizontal".

      • withOrient

        ISlider withOrient​(java.lang.String orient)
        Returns a copy of this immutable component with the specified orient.

        Sets the orient of component

        Parameters:
        orient - Either "horizontal" or "vertical"

        Default: "horizontal".

        Returns:
        A modified copy of the this object
      • withOrient

        default ISlider withOrient​(ISlider.Orient orient)
        Returns a copy of this immutable component with the specified orient.

        Sets the orient of component

        Parameters:
        orient - The orient

        Default: "horizontal".

        Returns:
        A modified copy of the this object
      • getSlidingtext

        default java.lang.String getSlidingtext()
        Returns the sliding text.

        Default : "{0}"

      • withSlidingtext

        ISlider withSlidingtext​(java.lang.String slidingtext)
        Returns a copy of this immutable component with the specified slidingtext.

        Sets the sliding text.

        Parameters:
        slidingtext - The sliding text.

        Default: "{0}".

        Returns:
        A modified copy of the this object
      • getCurpos

        @Lazy
        default int getCurpos()
        Returns the current position of the slider.

        Default: 0.

      • withCurpos

        default ISlider withCurpos​(int curpos)
        Returns a copy of this immutable component with the specified curpos.

        Sets the current position of the slider.

        Parameters:
        curpos - The current position of the slider.

        Default: 0.

        Returns:
        A modified copy of the this object
      • withCurpos

        default ISlider withCurpos​(double curpos)
        Returns a copy of this immutable component with the specified curpos.

        Sets the current position of the slider.

        Parameters:
        curpos - The current position of the slider.

        Default: 0.0.

        Returns:
        A modified copy of the this object
      • getCurposInDouble

        default double getCurposInDouble()
        Returns the double value of slider's current position.

        Default: 0.0

      • withCurposInDouble

        ISlider withCurposInDouble​(double curpos)
        Returns a copy of this immutable component with the specified curpos.

        Sets the current position of the slider.

        Parameters:
        curpos - The current position of the slider.

        Default: 0.0.

        Returns:
        A modified copy of the this object
      • getMinpos

        @Lazy
        default int getMinpos()
        Returns the minimum position of the slider.

        Default: 0.

      • withMinpos

        default ISlider withMinpos​(int minpos)
        Returns a copy of this immutable component with the specified minpos.

        Sets the value of slider's minimum position.

        Parameters:
        minpos - The value of slider's minimum position.

        Default: 0.

        Returns:
        A modified copy of the this object
      • withMinpos

        default ISlider withMinpos​(double minpos)
        Returns a copy of this immutable component with the specified minpos.

        Sets the value of slider's minimum position.

        Parameters:
        minpos - The value of slider's minimum position.

        Default: 0.0.

        Returns:
        A modified copy of the this object
      • getMinposInDouble

        default double getMinposInDouble()
        Returns the double value of slider's minimum position.

        Default: 0.0.

      • withMinposInDouble

        ISlider withMinposInDouble​(double minpos)
        Returns a copy of this immutable component with the specified minpos.

        Sets the value of slider's minimum position.

        Parameters:
        minpos - The value of slider's minimum position.

        Default: 0.0.

        Returns:
        A modified copy of the this object
      • getMaxpos

        @Lazy
        default int getMaxpos()
        Returns the value of slider's maximum position.

        Default: 100.

      • withMaxpos

        default ISlider withMaxpos​(int maxpos)
        Returns a copy of this immutable component with the specified maxpos.

        Sets the value of slider's maximum position.

        Parameters:
        maxpos - The value of slider's minimum position.

        Default: 100.

        Returns:
        A modified copy of the this object
      • withMaxpos

        default ISlider withMaxpos​(double maxpos)
        Returns a copy of this immutable component with the specified maxpos.

        Sets the value of slider's maximum position.

        Parameters:
        maxpos - The value of slider's minimum position.

        Default: 100.0.

        Returns:
        A modified copy of the this object
      • getMaxposInDouble

        default double getMaxposInDouble()
        Returns the double value of slider's maximum position.

        Default: 100.0.

      • withMaxposInDouble

        ISlider withMaxposInDouble​(double maxpos)
        Returns a copy of this immutable component with the specified maxpos.

        Sets the value of slider's maximum position.

        Parameters:
        maxpos - The value of slider's maximum position.

        Default: 0.0.

        Returns:
        A modified copy of the this object
      • getStep

        @Lazy
        default int getStep()
        Returns the step of slider

        Default: -1 (means it will scroll to the position the user clicks). Note: In "decimal" mode, the fraction part only contains one digit if step is -1.

      • withStep

        default ISlider withStep​(int step)
        Returns a copy of this immutable component with the specified step.

        Sets the step of slider

        Parameters:
        step - The step of slider

        Default: -1.

        Returns:
        A modified copy of the this object
      • withStep

        default ISlider withStep​(double step)
        Returns a copy of this immutable component with the specified step.

        Sets the step of slider

        Parameters:
        step - The step of slider

        Default: -1.0.

        Returns:
        A modified copy of the this object
      • getStepInDouble

        default double getStepInDouble()
        Returns the step of slider

        Default: -1.0 (means it will scroll to the position the user clicks). Note: In "decimal" mode, the fraction part only contains one digit if step is -1.

      • withStepInDouble

        ISlider withStepInDouble​(double step)
        Returns a copy of this immutable component with the specified step.

        Sets the step of slider

        Parameters:
        step - The step of slider

        Default: -1.0.

        Returns:
        A modified copy of the this object
      • getPageIncrement

        @Lazy
        default int getPageIncrement()
        Returns the amount that the value of getCurpos() changes by when the tray of the scroll bar is clicked.

        Default: -1 (means it will scroll to the position the user clicks).

      • withPageIncrement

        default ISlider withPageIncrement​(int pageIncrement)
        Returns a copy of this immutable component with the specified pageIncrement.

        Sets the amount that the value of getCurpos() changes by when the tray of the scroll bar is clicked.

        Parameters:
        pageIncrement - The page increment value of slider

        Default: -1.

        Returns:
        A modified copy of the this object
      • withPageIncrement

        default ISlider withPageIncrement​(double pageIncrement)
        Returns a copy of this immutable component with the specified pageIncrement.

        Sets the amount that the value of getCurpos() changes by when the tray of the scroll bar is clicked.

        Parameters:
        pageIncrement - The page increment value of slider

        Default: -1.0.

        Returns:
        A modified copy of the this object
      • getPageIncrementInDouble

        default double getPageIncrementInDouble()
        Returns the amount that the value of getCurpos() changes by when the tray of the scroll bar is clicked.

        Default: -1.0 (means it will scroll to the position the user clicks).

      • withPageIncrementInDouble

        ISlider withPageIncrementInDouble​(double pageIncrement)
        Returns a copy of this immutable component with the specified pageIncrement.

        Sets the amount that the value of getCurpos() changes by when the tray of the scroll bar is clicked.

        Parameters:
        pageIncrement - The page increment value of slider

        Default: -1.0.

        Returns:
        A modified copy of the this object
      • getStrokeWidth

        default double getStrokeWidth()
        Returns the stroke width of the knob slider.

        Default: 10.0

      • withStrokeWidth

        ISlider withStrokeWidth​(double strokeWidth)
        Returns a copy of this immutable component with the specified strokeWidth.

        Sets the stroke width of the knob slider.

        Parameters:
        strokeWidth - The stroke width of the knob slider

        Default: 10.0.

        Returns:
        A modified copy of the this object
      • getAngleArc

        default double getAngleArc()
        Returns the degree of arc of the knob slider.

        Default: 360.0

      • withAngleArc

        ISlider withAngleArc​(double angleArc)
        Returns a copy of this immutable component with the specified angleArc.

        Sets the degree of arc of the knob slider.

        Parameters:
        angleArc - The degree of arc of the knob slider.

        Default: 360.0.

        Returns:
        A modified copy of the this object
      • getScaleInput

        default double getScaleInput()
        Returns the scale ratio of the input in knob mold.

        Default: 1.0

      • withScaleInput

        ISlider withScaleInput​(double scaleInput)
        Returns a copy of this immutable component with the specified scaleInput.

        Sets the scale ratio of the input in knob mold.

        Parameters:
        scaleInput - The scale ratio of the input in knob mold.

        Default: 1.0.

        Returns:
        A modified copy of the this object
      • ofId

        static ISlider ofId​(java.lang.String id)
        Returns the instance with the given id.
        Parameters:
        id - The id to identify this component.