Class DurationSpinner3D

java.lang.Object
com.codename1.ui.Component
com.codename1.ui.Container
com.codename1.ui.spinner.DurationSpinner3D
All Implemented Interfaces:
Animation, Editable, StyleListener, InternalPickerWidget, Iterable<Component>

public class DurationSpinner3D extends Container implements InternalPickerWidget

Wheels that select a LENGTH of time rather than a point in it -- days, hours and minutes, according to how it is configured.

The body of a lightweight Picker of type duration, and usable on its own as an ordinary Container. Which wheels appear is decided at construction; a duration picker that only needs hours and minutes does not show a day wheel.

getValue() and setValue(Object) carry the duration in MILLISECONDS, as a Long, so that it can be added to a timestamp without unit conversion at the call site.

  • Field Details

  • Constructor Details

    • DurationSpinner3D

      public DurationSpinner3D(int fields)
    • DurationSpinner3D

      public DurationSpinner3D(int fields, int minuteStep)
  • Method Details

    • getValue

      public Object getValue()
      Description copied from interface: InternalPickerWidget

      The currently selected value.

      Returns

      the selection, in whatever type this implementation documents; never null once the widget has been laid out

      Specified by:
      getValue in interface InternalPickerWidget
    • setValue

      public void setValue(Object value)
      Description copied from interface: InternalPickerWidget

      Moves the selection to value.

      The widget scrolls to the new selection rather than jumping, when it is already on screen.

      Parameters
      • value: the new selection, in the type this implementation documents. A value outside the widget's range is clamped into it.
      Specified by:
      setValue in interface InternalPickerWidget