Class SliderControl<V extends Number>

Type Parameters:
V - The type of value the slider represents.
All Implemented Interfaces:
com.globalmentor.beans.PropertyBindable, com.globalmentor.beans.PropertyConstrainable, com.globalmentor.model.MutableValued<V>, com.globalmentor.model.Valued<V>, Component, Control, EditComponent, InputFocusableComponent, ValueControl<V>, ValuedComponent<V>, EditListenable, Displayable, Enableable, InfoModel, LabelModel, Model, PresentationModel, ValueModel<V>, DepictedObject

public class SliderControl<V extends Number> extends AbstractEditValueControl<V>
A value control that represents its value by a slider.
Author:
Garret Wilson
  • Field Details

    • FLOW_PROPERTY

      public static final String FLOW_PROPERTY
      The flow bound property.
    • INTERVAL_PROPERTY

      public static final String INTERVAL_PROPERTY
      The interval step bound property.
    • SLIDING_PROPERTY

      public static final String SLIDING_PROPERTY
      The bound property of the sliding state.
    • THUMB_X_IMAGE_PROPERTY

      public static final String THUMB_X_IMAGE_PROPERTY
      The bound property of the horizontal thumb image.
    • THUMB_Y_IMAGE_PROPERTY

      public static final String THUMB_Y_IMAGE_PROPERTY
      The bound property of the vertical thumb image.
    • TRACK_X_IMAGE_PROPERTY

      public static final String TRACK_X_IMAGE_PROPERTY
      The bound property of the horizontal track image.
    • TRACK_Y_IMAGE_PROPERTY

      public static final String TRACK_Y_IMAGE_PROPERTY
      The bound property of the vertical track image.
  • Constructor Details

    • SliderControl

      public SliderControl(Class<V> valueClass, Flow flow)
      Value class and flow constructor with a default data model to represent a given type and a default converter.
      Parameters:
      valueClass - The class indicating the type of value held in the model.
      flow - The flow along which the slider is oriented.
      Throws:
      NullPointerException - if the value class and/or flow is null.
    • SliderControl

      public SliderControl(Class<V> valueClass, Converter<V,String> converter, Flow flow)
      Value class, converter and flow constructor with a default value model to represent a given type.
      Parameters:
      valueClass - The class indicating the type of value held in the model.
      converter - The string literal value converter for this component.
      flow - The flow along which the slider is oriented.
      Throws:
      NullPointerException - if the given value class, converter, and/or flow is null.
    • SliderControl

      public SliderControl(ValueModel<V> valueModel, Flow flow)
      Value model and flow constructor with a default converter.
      Parameters:
      valueModel - The component value model.
      flow - The flow along which the slider is oriented.
      Throws:
      NullPointerException - if the given value model and/or flow is null.
      IllegalArgumentException - if no default converter is available for the given model's value class.
    • SliderControl

      public SliderControl(ValueModel<V> valueModel, Converter<V,String> converter, Flow flow)
      Value model, converter, and flow constructor.
      Parameters:
      valueModel - The component value model.
      converter - The string literal value converter for this component.
      flow - The flow along which the slider is oriented.
      Throws:
      NullPointerException - if the given value model, converter, and/or flow is null.
    • SliderControl

      public SliderControl(ValuePrototype<V> valuePrototype, Flow flow)
      Prototype and flow constructor.
      Parameters:
      valuePrototype - The prototype on which this component should be based.
      flow - The flow along which the slider is oriented.
      Throws:
      NullPointerException - if the given prototype and/or flow is null.
  • Method Details

    • getFlow

      public Flow getFlow()
      Returns:
      The flow along which the slider is oriented.
    • setFlow

      public void setFlow(Flow newFlow)
      Sets the flow of the slider. This is a bound property
      Parameters:
      newFlow - The flow along which the slider is oriented.
      Throws:
      NullPointerException - if the given flow is null.
      See Also:
    • getConverter

      public Converter<V,String> getConverter()
      Returns:
      The converter for this component.
    • setConverter

      public void setConverter(Converter<V,String> newConverter)
      Sets the converter. This is a bound property
      Parameters:
      newConverter - The converter for this component.
      Throws:
      NullPointerException - if the given converter is null.
      See Also:
    • getInterval

      public V getInterval()
      Returns:
      The value of the intervals, or null if a default interval should be used.
    • setInterval

      public void setInterval(V newInterval) throws ValidationException
      Sets the value of the intervals. This is a bound property.
      Parameters:
      newInterval - The new value of the intervals, or null if a default interval should be used.
      Throws:
      ValidationException - If the new interval is not valid.
      See Also:
    • getThumbImage

      public URI getThumbImage(Axis axis)
      Returns the thumb image for the indicated axis.
      Parameters:
      axis - The axis for which a thumb image should be returned.
      Returns:
      The thumb image for the given axis.
    • ThumbXImage

      public URI ThumbXImage()
      Returns the thumb image for the X axis.
      Returns:
      The thumb image for the indicated axis.
    • ThumbYImage

      public URI ThumbYImage()
      Returns the thumb image for the Y axis.
      Returns:
      The thumb image for the indicated axis.
    • setThumbImage

      public void setThumbImage(Axis axis, URI newThumbImage)
      Sets the thumb image for a given axis. The thumb image of each axis represents a bound property.
      Parameters:
      axis - The axis for which the thumb image should be set.
      newThumbImage - The thumb image.
      Throws:
      NullPointerException - if the given axis and/or thumb image is null.
      See Also:
    • setThumbXImage

      public void setThumbXImage(URI newThumbImage)
      Sets the thumb image for the X axis. This is a bound property.
      Parameters:
      newThumbImage - The thumb image.
      Throws:
      NullPointerException - if the given thumb image is null.
      See Also:
    • setThumbYImage

      public void setThumbYImage(URI newThumbImage)
      Sets the thumb image for the Y axis. This is a bound property.
      Parameters:
      newThumbImage - The thumb image.
      Throws:
      NullPointerException - if the given thumb image is null.
      See Also:
    • getTrackImage

      public URI getTrackImage(Axis axis)
      Returns the track image for the indicated axis.
      Parameters:
      axis - The axis for which a track image should be returned.
      Returns:
      The track image for the given axis.
    • TrackXImage

      public URI TrackXImage()
      Returns the track image for the X axis.
      Returns:
      The track image for the indicated axis.
    • TrackYImage

      public URI TrackYImage()
      Returns the track image for the Y axis.
      Returns:
      The track image for the indicated axis.
    • setTrackImage

      public void setTrackImage(Axis axis, URI newTrackImage)
      Sets the track image for a given axis. The track image of each axis represents a bound property.
      Parameters:
      axis - The axis for which the track image should be set.
      newTrackImage - The track image.
      Throws:
      NullPointerException - if the given axis and/or track image is null.
      See Also:
    • setTrackXImage

      public void setTrackXImage(URI newTrackImage)
      Sets the track image for the X axis. This is a bound property.
      Parameters:
      newTrackImage - The track image.
      Throws:
      NullPointerException - if the given track image is null.
      See Also:
    • setTrackYImage

      public void setTrackYImage(URI newTrackImage)
      Sets the track image for the Y axis. This is a bound property.
      Parameters:
      newTrackImage - The track image.
      Throws:
      NullPointerException - if the given track image is null.
      See Also:
    • isSliding

      public boolean isSliding()
      Returns:
      Whether the slider is being slid.
    • setSliding

      public void setSliding(boolean newSliding)
      Sets whether the slider is being slid. This is a bound property of type Boolean.
      Parameters:
      newSliding - true if the slider is sliding, else false.
      See Also: