public class TimeSpinner3D

  1. Object
  2. Component
  3. Container
  4. TimeSpinner3D

ImplementsAnimation, Editable, InternalPickerWidget, Iterable<Component>, StyleListener

Hour and minute wheels selecting a time of day, in either 24 hour or AM/PM form according to #setShowMeridiem(boolean).

The body of a lightweight Picker of type time, and usable on its own as an ordinary Container. The minute wheel can step by more than one minute, which is what a picker offering quarter hours uses.

With #setDurationMode(boolean) set it selects a LENGTH of time instead, and the meridiem is not shown; prefer DurationSpinner3D for that, which also offers a day wheel.

getValue() and setValue(Object) carry the time as minutes since midnight, as an Integer.

Constructors

public TimeSpinner3D(int minuteStep)Default constructor
public TimeSpinner3D()

Methods

protected Dimension calcPreferredSize()Calculates the preferred size based on component content.
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
public Class[] getPropertyTypes()Matches the property names method (see that method for further details).
public Object getPropertyValue(String name)Returns the current value of the property name, this method is used by the GUI builder
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.
public int getMinuteStep()Gets the minutes spinner step size.
public void setMinuteStep(int minuteStep)Sets the step-size for the minutes spinner.
public void setHourRange(int min, int max)Sets the hours range to display.
public int getMinHour()Gets the current minimum hour to display.
public int getMaxHour()Gets the current maximum hour to display.
public boolean isShowMeridiem()
public void setShowMeridiem(boolean showMeridiem)Shows AM/PM indication
public int getCurrentHour()The hour from 1-12 or 0-23
public void setCurrentHour(int currentHour)Set the hour from 1-12 or 0-23
public int getCurrentMinute()
public void setCurrentMinute(int currentMinute)
public boolean isCurrentMeridiem()
public void setCurrentMeridiem(boolean currentMeridiem)
public boolean isDurationMode()Duration mode uses the time spinner to indicate a duration in hours and minutes
public void setDurationMode(boolean durationMode)Duration mode uses the time spinner to indicate a duration in hours and minutes
public void setHoursVisible(boolean visible)Show or hide the hours spinner.
public void setMinutesVisible(boolean visible)Show or hide the minutes spinner.
public Object getValue()The currently selected value.
public void setValue(Object value)Moves the selection to value.
public void paint(Graphics g)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.

Inherited fields

Inherited methods

From Container

encloseIn, encloseIn, initLaf, getUIManager, setUIManager, isSurface, add, addAll, add, add, add, add, add, getLeadComponent, setLeadComponent, getLeadParent, keyPressed, keyReleased, getLayout, setLayout, invalidate, setShouldLayout, setShouldCalcPreferredSize, getLayoutWidth, getLayoutHeight, applyRTL, constrainWidthWhenScrollable, constrainHeightWhenScrollable, addComponent, addComponent, addComponent, addComponent, replaceAndWait, replaceAndWait, replace, replaceAndWait, replace, createReplaceTransition, isEnabled, setEnabled, removeComponent, cancelRepaints, flushReplace, removeAll, revalidateWithAnimationSafety, revalidate, revalidateLater, forceRevalidate, clearClientProperties, paintGlass, layoutContainer, isSafeArea, setSafeArea, isSafeAreaRoot, getSafeAreaRoot, setSafeAreaRoot, getComponentCount, getComponentAt, getComponentIndex, contains, scrollComponentToVisible, getClosestComponentTo, getResponderAt, getComponentAt, findDropTargetAt, pointerPressed, paramString, refreshTheme, isScrollableX, setScrollableX, isScrollableY, setScrollableY, getSideGap, getBottomGap, setScrollable, setCellRenderer, getScrollIncrement, setScrollIncrement, findFirstFocusable, dragInitiated, fireClicked, isSelectableInteraction, getGridPosY, paintComponentBackground, getGridPosX, animateHierarchyAndWait, createAnimateHierarchy, animateHierarchy, animateHierarchyFadeAndWait, createAnimateHierarchyFade, animateHierarchyFade, animateLayoutFadeAndWait, createAnimateLayoutFadeAndWait, animateLayoutFade, createAnimateLayoutFade, animateLayoutAndWait, animateLayout, updateTabIndices, createAnimateLayout, drop, createAnimateMotion, morph, morphAndWait, animateUnlayout, animateUnlayoutAndWait, createAnimateUnlayout, getChildrenAsList, iterator, iterator

From Component

setSameSize, isSetCursorSupported, parsePreferredSize, getDefaultDragTransparency, setDefaultDragTransparency, getEditingDelegate, setEditingDelegate, getCursor, setCursor, showNativeOverlay, hideNativeOverlay, updateNativeOverlay, getNativeOverlay, getAllStyles, getSameWidth, setSameWidth, getSameHeight, setSameHeight, getX, setX, getOuterX, getInnerX, getY, setY, getOuterY, getInnerY, isVisible, setVisible, getClientProperty, stripMarginAndPadding, putClientProperty, getDirtyRegion, setDirtyRegion, isOpaque, setOpaque, getWidth, setWidth, getOuterWidth, getInnerWidth, getHeight, setHeight, getOuterHeight, getInnerHeight, isDragRegion, getDragRegionStatus, getBaseline, getBaselineResizeBehavior, getPreferredSizeStr, setPreferredSizeStr, getPreferredSize, setPreferredSize, getScrollDimension, calcScrollSize, setScrollSize, getPreferredW, setPreferredW, getPreferredH, setPreferredH, getOuterPreferredH, getInnerPreferredH, getOuterPreferredW, getInnerPreferredW, setSize, getUIID, setUIID, setUIIDFinal, setUIID, getInlineAllStyles, setInlineAllStyles, getInlineSelectedStyles, setInlineSelectedStyles, getInlineUnselectedStyles, setInlineUnselectedStyles, getInlineDisabledStyles, setInlineDisabledStyles, getInlinePressedStyles, setInlinePressedStyles, remove, getParent, getOwner, setOwner, isOwnedBy, containsOrOwns, addFocusListener, removeFocusListener, addScrollListener, removeScrollListener, getSelectCommandText, setSelectCommandText, getLabelForComponent, setLabelForComponent, focusGained, focusLost, paintBackgrounds, paintShadows, getAbsoluteX, getAbsoluteY, isInClippingRegion, paintIntersectingComponentsAbove, paintScrollbars, paintScrollbarX, getScrollOpacity, getSelectedRect, paintScrollbarY, paintComponent, paintComponent, getBorder, getScrollable, paintBackground, isScrollable, getScrollX, setScrollX, getScrollY, setScrollY, onScrollX, onScrollY, getDraggedx, getDraggedy, contains, visibleBoundsContains, hasFixedPreferredSize, getBounds, getBounds, getVisibleBounds, getVisibleBounds, isFocusable, setFocusable, onSetFocusable, resetFocusable, getTabIndex, setTabIndex, getPreferredTabIndex, setPreferredTabIndex, isTraversable, setTraversable, handlesInput, setHandlesInput, consumesRawTextInput, hasFocus, setFocus, getComponentForm, getTopLevelContainer, repaint, repaint, longKeyPress, keyRepeated, registerForAnimation, deregisterFromAnimation, getAnimationManager, getScrollAnimationSpeed, setScrollAnimationSpeed, isBlockLead, setBlockLead, isIgnorePointerEvents, setIgnorePointerEvents, isRippleEffect, setRippleEffect, getInlineStylesTheme, setInlineStylesTheme, shouldRenderComponentSelection, isHideInLandscape, setHideInLandscape, createStyleAnimation, isSmoothScrolling, setSmoothScrolling, pointerHover, stopScrollMomentum, pointerHoverReleased, pointerHoverPressed, pinch, pinchReleased, pinch, rotation, isPinchBlocksDragAndDrop, setPinchBlocksDragAndDrop, pointerDragged, getDragImage, getDragTransparency, setDragTransparency, toImage, drawDraggedImage, draggingOver, dragEnter, dragExit, addPullToRefresh, setPullToRefresh, respondsToPointerEvents, pointerDragged, isStickyDrag, pointerPressed, isDragAndDropOperation, pointerReleased, longPointerPress, pointerReleased, setVerticalScrollBounds, setHorizontalScrollBounds, isVScrollThumbGrabbed, isHScrollThumbGrabbed, isVScrollThumbHover, isHScrollThumbHover, isTensileDragEnabled, setTensileDragEnabled, getTextSelectionSupport, addDropListener, removeDropListener, addDragOverListener, removeDragOverListener, isNativeDragSource, setNativeDragSource, getNativeDragOperation, setNativeDragOperation, createNativeDragOperation, isNativeDropTarget, setNativeDropTarget, getAcceptedDropMimeTypes, setAcceptedDropMimeTypes, getAcceptedDropActions, setAcceptedDropActions, canAcceptNativeDrop, nativeDragEnter, nativeDragOver, nativeDragExit, nativeDrop, addNativeDropListener, removeNativeDropListener, addNativeDragOverListener, removeNativeDragOverListener, dragFinished, addDragFinishedListener, addStateChangeListener, removeStateChangeListener, addPointerPressedListener, addLongPressListener, addContextMenuListener, removeContextMenuListener, addMouseWheelListener, removeMouseWheelListener, addStylusListener, removeStylusListener, getContextMenuCommands, setContextMenuCommands, mouseWheel, paintRippleOverlay, removePointerPressedListener, removeLongPressListener, removeDragFinishedListener, addPointerReleasedListener, removePointerReleasedListener, addPointerDraggedListener, removePointerDraggedListener, getDragSpeed, getStyle, getPressedStyle, getHoverStyle, setHoverStyle, isHovered, setHovered, setPressedStyle, initUnselectedStyle, initPressedStyle, initDisabledStyle, initSelectedStyle, getUnselectedStyle, setUnselectedStyle, getSelectedStyle, setSelectedStyle, getDisabledStyle, setDisabledStyle, installDefaultPainter, requestFocus, toString, refreshTheme, refreshTheme, isDragActivated, animate, scrollRectToVisible, scrollRectToVisible, paintBorder, paintBorderBackground, isCellRenderer, isScrollVisible, setScrollVisible, setIsScrollVisible, startEditingAsync, stopEditing, isEditing, isEditable, laidOut, deinitialize, initComponent, isInitialized, setInitialized, styleChanged, getNextFocusDown, setNextFocusDown, getNextFocusUp, setNextFocusUp, getNextFocusLeft, setNextFocusLeft, getNextFocusRight, setNextFocusRight, getName, setName, initCustomStyle, deinitializeCustomStyle, isRTL, setRTL, isTactileTouch, isTactileTouch, setTactileTouch, getPropertyTypeNames, paintLockRelease, paintLock, isSnapToGrid, setSnapToGrid, shouldBlockSideSwipe, shouldBlockSideSwipeLeft, shouldBlockSideSwipeRight, blocksSideSwipe, isFlatten, setFlatten, getTensileLength, setTensileLength, isGrabsPointerEvents, setGrabsPointerEvents, getScrollOpacityChangeSpeed, setScrollOpacityChangeSpeed, growShrink, isAlwaysTensile, setAlwaysTensile, isDraggable, setDraggable, isDropTarget, setDropTarget, isChildOf, isHideInPortrait, setHideInPortrait, getBindablePropertyNames, getBindablePropertyTypes, bindProperty, unbindProperty, getBoundPropertyValue, setBoundPropertyValue, getCloudBoundProperty, setCloudBoundProperty, getCloudDestinationProperty, setCloudDestinationProperty, getComponentState, setComponentState, setHidden, isHidden, setHidden, isHidden, announceForAccessibility, getAccessibilityText, setAccessibilityText, getSemantics, getAccessibilityNode, accessibilityChanged, accessibilityChanged, getTooltip, setTooltip

Constructor details

TimeSpinner3D

public TimeSpinner3D(int minuteStep)
Default constructor

TimeSpinner3D

public TimeSpinner3D()

Method details

calcPreferredSize

protected Dimension calcPreferredSize()
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

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

getPropertyTypes

public Class[] getPropertyTypes()
Matches the property names method (see that method for further details).

Returns

the types of the properties

getPropertyValue

public Object getPropertyValue(String name)
Returns the current value of the property name, this method is used by the GUI builder

Parameters

name String
the name of the property

Returns

the value of said property

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 String
the name of the property
value Object
new value for the property

Returns

error message or null

getMinuteStep

public int getMinuteStep()
Gets the minutes spinner step size.

Returns

the minuteStep

setMinuteStep

public void setMinuteStep(int minuteStep)
Sets the step-size for the minutes spinner.

Parameters

minuteStep int
The step size. Must be beween 1 and 60.

setHourRange

public void setHourRange(int min, int max)
Sets the hours range to display. Note that the spinner must not be in duration mode, and must by in 24 hour mode, otherwise this will thrown an IllegalStateException.

Parameters

min int
The minimum hour to display (0-24). Set to -1 to allow any minimum.
max int
Not documented.

Throws

IllegalStateException
If the spinner is not in 24 hour mode.

getMinHour

public int getMinHour()
Gets the current minimum hour to display. -1 for no limit

Returns

The current minimum hour (0-24). -1 for no limit.

getMaxHour

public int getMaxHour()
Gets the current maximum hour to display. -1 for no limit.

Returns

The current maximum hour (0-24). -1 for no limit.

isShowMeridiem

public boolean isShowMeridiem()

Returns

the showMeridiem

setShowMeridiem

public void setShowMeridiem(boolean showMeridiem)
Shows AM/PM indication

Parameters

showMeridiem boolean
the showMeridiem to set

getCurrentHour

public int getCurrentHour()
The hour from 1-12 or 0-23

Returns

the currentHour

setCurrentHour

public void setCurrentHour(int currentHour)
Set the hour from 1-12 or 0-23

Parameters

currentHour int
the currentHour to set

getCurrentMinute

public int getCurrentMinute()

Returns

the currentMinute

setCurrentMinute

public void setCurrentMinute(int currentMinute)

Parameters

currentMinute int
the currentMinute to set

isCurrentMeridiem

public boolean isCurrentMeridiem()

Returns

the currentMeridiem

setCurrentMeridiem

public void setCurrentMeridiem(boolean currentMeridiem)

Parameters

currentMeridiem boolean
the currentMeridiem to set

isDurationMode

public boolean isDurationMode()
Duration mode uses the time spinner to indicate a duration in hours and minutes

Returns

the durationMode

setDurationMode

public void setDurationMode(boolean durationMode)
Duration mode uses the time spinner to indicate a duration in hours and minutes

Parameters

durationMode boolean
the durationMode to set

setHoursVisible

public void setHoursVisible(boolean visible)
Show or hide the hours spinner.

Parameters

visible boolean
True to show the hours spinner.

setMinutesVisible

public void setMinutesVisible(boolean visible)
Show or hide the minutes spinner.

Parameters

visible boolean
True to make the minutes spinner visible.

getValue

public Object getValue()
The currently selected value.

Returns

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

setValue

public void setValue(Object value)

Moves the selection to value.

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

Parameters

value Object
the new selection, in the type this implementation documents. A value outside the widget’s range is clamped into it.

paint

public void paint(Graphics g)
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 Graphics
the component graphics