Class UISlider

    • Constructor Detail

      • UISlider

        public UISlider()
        Creates the component without a name. The name must be set in all cases using the setPropertyAtom call.
      • UISlider

        public UISlider​(Atom propertyAtom)
        Creates the component with the specified name. All system-reserved names for components begins with "$".
        Parameters:
        propertyAtom - the name of the component, unique within it's parent.
    • Method Detail

      • getDeviceType

        public final int getDeviceType()
        Gets the device type: -1=mobile, 0=both, 1=desktop.
        Specified by:
        getDeviceType in interface IUIComp
        Returns:
        0=both.
      • isMobileContextMenuSupported

        public boolean isMobileContextMenuSupported()
        Returns if the component can show the context menu in mobile mode.
        Specified by:
        isMobileContextMenuSupported in interface IUIContextMenuOwner
        Returns:
        Slider does not support a mobile context menu.
      • getOrientation

        public int getOrientation()
        Gets the slider orientation.
        Returns:
        0 for horizontal, 1 for vertical.
      • canFillX

        public boolean canFillX()
        Returns if the component can fill in X or not.
        Overrides:
        canFillX in class UIComp
        Returns:
        true (default) for fill supported, false otherwise (e.g. for a checkbox).
      • canFillY

        public boolean canFillY()
        Returns if the component can fill in Y or not.
        Overrides:
        canFillY in class UIComp
        Returns:
        true (default) for fill supported, false otherwise (e.g. for a checkbox).
      • canAlignX

        public boolean canAlignX()
        Returns if the component can be aligned left, right, center, or horizontal fill.
        Overrides:
        canAlignX in class UIComp
        Returns:
        false, swap container takes up entire width.
      • canAlignY

        public boolean canAlignY()
        Returns if the component can be aligned top, bottom, middle or vertical fill.
        Overrides:
        canAlignY in class UIComp
        Returns:
        false, grid takes up entire height.
      • hasImplicitAlignFillX

        public boolean hasImplicitAlignFillX()
        Returns if the component has implicit component horizontal fill.
        Overrides:
        hasImplicitAlignFillX in class UIComp
        Returns:
        Always true: true means component will always fill the space in X.
      • hasImplicitAlignFillY

        public boolean hasImplicitAlignFillY()
        Returns if the component has implicit component vertical fill.
        Overrides:
        hasImplicitAlignFillY in class UIComp
        Returns:
        Always: true means component will always fill the space in Y.
      • setComponentToVSField

        public int setComponentToVSField()
        Sets the text or value from this text or value component to its VirtualSpace Field, if any.
        Specified by:
        setComponentToVSField in interface IUIComp
        Overrides:
        setComponentToVSField in class UIComp
        Returns:
        1 for update completed, 0 for nothing done and -1 for error occurred.
      • onValueChanged

        public void onValueChanged​(VSField field,
                                   Value value,
                                   GProp<?> trigger,
                                   IPostEventProcessing postProcessing)
        Called when the field value is set.
        Specified by:
        onValueChanged in interface IVSFieldListener
        Overrides:
        onValueChanged in class UIComp
        Parameters:
        field - The VS field.
        value - The value, never null, but value.isNull() could be true.
        trigger - The trigger property that may be null.
        postProcessing - Post-processing instance.
      • getTicks

        public int getTicks()
        Get the ticks value.
        Returns:
        The ticks value, or zero meaning no ticks, i.e. continuous scale (no discrete values). A defined ticks property value of 1 has the same meaning as zero, so zero is returned if the ticks property is set to 1.
      • setTicks

        public boolean setTicks​(int ticks)
                         throws java.lang.IllegalArgumentException
        Set the ticks value. Zero means continuous scale (no discrete values).
        Parameters:
        ticks - The ticks value must be either zero (means continuous scale) or a value of 2 or larger.
        Returns:
        true if ticks is set successfully.
        Throws:
        java.lang.IllegalArgumentException - When ticks is negative or one.
      • getPageIncrement

        public int getPageIncrement()
        Get the page increment value. Number of discrete values (if specified) to move on Page Up/Page Down (default 5). If the scale is set to continuous, this value is not used.

        This value is only used for Desktop, not for Mobile.

        Returns:
        The page increment or if property is undefined, 5 (default).
      • setPageIncrement

        public boolean setPageIncrement​(int pi)
                                 throws java.lang.IllegalArgumentException
        Set the page increment value. Number of discrete values (if specified) to move on Page Up/Page Down (default 5). If the scale is set to continuous, this value is not used.

        This value is only used for Desktop, not for Mobile.

        Parameters:
        pi - The page increment.
        Returns:
        true for value changed, false for no change.
        Throws:
        java.lang.IllegalArgumentException - When pi is negative or if pi is larger than the number of ticks.
      • getShowButtons

        public boolean getShowButtons()
        Gets the show buttons option.
        Returns:
        The show buttons option.
      • setShowButtons

        public boolean setShowButtons​(boolean on)
        Sets the show buttons option.
        Parameters:
        on - Set the show buttons option.
        Returns:
        true for value changed, false for no change.
      • getClickSelect

        public boolean getClickSelect()
        Gets the click select option.
        Returns:
        The click select option.
      • setClickSelect

        public boolean setClickSelect​(boolean on)
        Sets the click select option.
        Parameters:
        on - Set the click select option.
        Returns:
        true for value changed, false for no change.
      • getSlideDuration

        public int getSlideDuration()
        Gets slide duration option (in milliseconds). The default value is 500 ms.
        Returns:
        The slide duration or 500 by default.
      • setMaximalLength

        public boolean setMaximalLength​(int ms)
        Sets the slide duration option (in milliseconds).
        Parameters:
        ms - The duration to set.
        Returns:
        Successful or not.
      • getApproximateSize

        public Size getApproximateSize()
        Returns the size of the component in pixels. The size is a calculation and does not exactly reflect the real size that may be different due to additional styles not taken into account by this method. The size is calculated from the font of the component and default or defined values (such as character length or number of lines for text area).
        Specified by:
        getApproximateSize in class UIComp
        Returns:
        The size of the component.
      • verify

        public void verify​(PropVerification verification)
        Verifies this property container. The check performed is the extension of classes and that no circular reference is present.
        Specified by:
        verify in interface IGProp<GProp<?>[]>
        Overrides:
        verify in class UIComp
        Parameters:
        verification - The property verification class.