Class DateTimeSpinner3D

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

public class DateTimeSpinner3D extends Container implements InternalPickerWidget

A date and a time of day on one row of wheels: a day wheel beside the hour and minute wheels of TimeSpinner3D.

The body of a lightweight Picker of type date and time, and usable on its own as an ordinary Container. The day wheel spans the configured range and shows each day by name rather than by number, which is what the iOS picker it follows does.

getValue() and setValue(Object) carry a java.util.Date in which both the date and the time components are used.

  • Constructor Details

    • DateTimeSpinner3D

      public DateTimeSpinner3D(int minuteStep)
      Default constructor
    • DateTimeSpinner3D

      public DateTimeSpinner3D()
  • Method Details

    • getMinuteStep

      public int getMinuteStep()
    • setMinuteStep

      public void setMinuteStep(int minuteStep)
    • calcPreferredSize

      protected Dimension calcPreferredSize()
      Description copied from class: Container

      Calculates the preferred size based on component content. This method is invoked lazily by getPreferred size.

      Returns

      the calculated preferred size based on component content

      Overrides:
      calcPreferredSize in class Container
    • getCurrentDate

      public Date getCurrentDate()
      Returns

      the currentDate

    • setCurrentDate

      public void setCurrentDate(Date currentDate)
      Parameters
      • currentDate: the currentDate to set
    • getStartDate

      public Date getStartDate()
      Returns

      the startDate

    • setStartDate

      public void setStartDate(Date startDate)
      Parameters
      • startDate: the startDate to set
    • getEndDate

      public Date getEndDate()
      Returns

      the endDate

    • setEndDate

      public void setEndDate(Date endDate)
      Parameters
      • endDate: the endDate to set
    • isMarkToday

      public boolean isMarkToday()
      Returns

      the markToday

    • setMarkToday

      public void setMarkToday(boolean markToday)
      Parameters
      • markToday: the markToday to set
    • isIncludeYear

      public boolean isIncludeYear()
      Returns

      the includeYear

    • setIncludeYear

      public void setIncludeYear(boolean includeYear)
      Parameters
      • includeYear: the includeYear to set
    • isShowMeridiem

      public boolean isShowMeridiem()

      Checks if time is shown in 12 hour format with AM/PM selector.

      Returns

      True if time is in 12 hour format. False otherwise.

      See also
      • #setShowMeridiem(boolean)
    • setShowMeridiem

      public void setShowMeridiem(boolean showMeridiem)

      Sets whether the time spinner should show times 12 hour format with an AM/PM selector.

      Parameters
      • showMeridiem: True to show times in 12 hour format (the default). False to show in 24 hour format.
      See also
      • #isShowMeridiem()
    • setHourRange

      public void setHourRange(int min, int max)

      Sets the hour range to show for the time selector. Setting the range will automatically switch the time to 24 hour format.

      Parameters
      • min: The minimum hour to display (0-24). -1 for no limit.

      • max: The max hour to display (0-24). -1 for no limit.

      See also
      • #getMinHour()

      • #getMaxHour()

    • getMinHour

      public int getMinHour()

      Gets the minimum hour to display. Default -1 (for no limit).

      Returns

      Min hour (0-24) or -1 for no limit.

      See also
      • #getMaxHour()

      • #setHourRange(int, int)

    • getMaxHour

      public int getMaxHour()

      Gets the maximum hour to display. Default -1 (for no limit).

      Returns

      Max hour (0-24) or -1 for no limit.

      See also
      • #getMinHour()

      • #setHourRange(int, int)

    • getPropertyNames

      public String[] getPropertyNames()

      A component may expose mutable property names for a UI designer to manipulate, this API is designed for usage internally by the GUI builder code

      Returns

      the property names allowing mutation

      Overrides:
      getPropertyNames in class Component
    • getPropertyTypes

      public Class[] getPropertyTypes()

      Matches the property names method (see that method for further details).

      Returns

      the types of the properties

      Overrides:
      getPropertyTypes in class Component
    • getPropertyValue

      public Object getPropertyValue(String name)

      Returns the current value of the property name, this method is used by the GUI builder

      Parameters
      • name: the name of the property
      Returns

      the value of said property

      Overrides:
      getPropertyValue in class Component
    • setPropertyValue

      public String setPropertyValue(String name, Object value)

      Sets a new value to the given property, returns an error message if failed and null if successful. Notice that some builtin properties such as "$designMode" might be sent to components to indicate application state.

      Parameters
      • name: the name of the property

      • value: new value for the property

      Returns

      error message or null

      Overrides:
      setPropertyValue in class Component
    • 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
    • paint

      public void paint(Graphics g)
      Description copied from class: Container

      This method paints the Component on the screen, it should be overriden by subclasses to perform custom drawing or invoke the UI API's to let the PLAF perform the rendering.

      Parameters
      • g: the component graphics
      Specified by:
      paint in interface Animation
      Overrides:
      paint in class Container