Class UISlider

All Implemented Interfaces:
EventListener, IFocusComp, IMessageBox, IComponent, ICustomDataProvider, IGProp<GProp<?>[]>, IPropCnr, IUIComp, IUICompRelativeTarget, IUIContextMenuOwner, IUIFocusComp, IUILabelForTarget, IUIDoubleRangeValueComponent, IUIDoubleValueComponent, IUIValueComponent, IVSComponentListener, IVSComponentState, IVSFieldListener, Cloneable
Direct Known Subclasses:
EUISlider

Slider UI component.
Author:
Christopher Mindus
  • Constructor Details

    • 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 Details

    • 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 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:
      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 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:
      IllegalArgumentException - When pi is negative or if pi is larger than the number of ticks.
    • getMinimumDefault

      public double getMinimumDefault()
      Gets the default minimum value.
      Specified by:
      getMinimumDefault in interface IUIDoubleRangeValueComponent
      Returns:
      Zero, the default minimum value.
    • getMaximumDefault

      public double getMaximumDefault()
      Gets the default maximum value.
      Specified by:
      getMaximumDefault in interface IUIDoubleRangeValueComponent
      Returns:
      100, the default maximum value.
    • getDefaultValue

      public double getDefaultValue()
      Gets the default value of the component as a double.
      Specified by:
      getDefaultValue in interface IUIDoubleValueComponent
      Returns:
      The minimum value IUIDoubleRangeValueComponent.getMinimum() is used as the default double value of the component.
    • 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 boolean 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.
      Returns:
      true if verification should proceed, false if disposed of and verification should not take place.