Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public class Scheduler
ImplementsAnimation, Editable, Iterable<Component>, StyleListener
A schedule on screen: the items of a ScheduleModel by day, week, month,
as an agenda, or by resource.
long start = System.currentTimeMillis();
DefaultScheduleModel model = new DefaultScheduleModel();
model.addItem(new ScheduleItem("1", "Design review", start, start + TimeMath.HOUR));
Scheduler scheduler = new Scheduler(model);
scheduler.setView(Scheduler.View.WEEK);
Form form = new Form("Schedule", new BorderLayout());
form.add(BorderLayout.CENTER, scheduler);
form.show();

The same items by the day, by the month and against the people they are booked for:

The views draw their items and keep no component for each, so a schedule of thousands of items scrolls as one of ten does. Time zooms with a pinch or with the wheel and the control key held.
Editing
With a mouse an item is dragged to move it and by its edge to resize it,
and a drag across empty time selects a range. On a touch screen a drag
scrolls, so a long press picks an item up or starts a range, and the
selected item has handles to resize it by. Every change is offered to the
listeners first, then made through ScheduleModel#updateItem, and either
may refuse. setEditable(false) makes the scheduler read only.
Pointer and motion
Under a mouse the item the pointer is over lights up, free time shows the slot a drag would start in, the cursor says what a drag would do, and a tooltip gives the item’s title and time. An item that is picked up lifts: a shadow comes up under it and the place it left dims. Let go, it glides from where it was dropped to where it belongs. Each takes under a quarter of a second.

setAnimationTime stops the clock these run by, for a screenshot or a
test of a moment in the middle of one.
Styling
SchedulerGrid is the background, with its foreground the colour of the
lines; SchedulerOffHours shades the time outside a WorkCalendar;
SchedulerHeader, SchedulerHeaderToday and SchedulerTimeLabel are the
headings; SchedulerItem, SchedulerBackgroundItem and
SchedulerBlocked the items by kind; SchedulerNow the current time and
SchedulerSelection a range being dragged out. The bar above the views
is SchedulerToolbar, SchedulerTitle and SchedulerViewButton. An item
that names a UIID of its own is painted with that one.

Nested types
enum Scheduler.View | The ways a schedule is shown. |
Constructors
public Scheduler() | A scheduler with nothing in it yet. |
public Scheduler(ScheduleModel model) |
Methods
Inherited fields
From Component
DEFAULT_CURSOR, CROSSHAIR_CURSOR, TEXT_CURSOR, WAIT_CURSOR, SW_RESIZE_CURSOR, SE_RESIZE_CURSOR, NW_RESIZE_CURSOR, NE_RESIZE_CURSOR, N_RESIZE_CURSOR, S_RESIZE_CURSOR, W_RESIZE_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, MOVE_CURSOR, DRAG_REGION_NOT_DRAGGABLE, DRAG_REGION_POSSIBLE_DRAG_X, DRAG_REGION_POSSIBLE_DRAG_Y, DRAG_REGION_POSSIBLE_DRAG_XY, DRAG_REGION_LIKELY_DRAG_X, DRAG_REGION_LIKELY_DRAG_Y, DRAG_REGION_LIKELY_DRAG_XY, DRAG_REGION_IMMEDIATELY_DRAG_X, DRAG_REGION_IMMEDIATELY_DRAG_Y, DRAG_REGION_IMMEDIATELY_DRAG_XY, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_CENTER_OFFSET, BRB_OTHER, CENTER, TOP, LEFT, BOTTOM, RIGHT, BASELINE
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, paint, paintGlass, isSafeArea, setSafeArea, isSafeAreaRoot, getSafeAreaRoot, setSafeAreaRoot, getComponentCount, getComponentAt, getComponentIndex, contains, scrollComponentToVisible, getClosestComponentTo, getResponderAt, getComponentAt, findDropTargetAt, pointerPressed, calcPreferredSize, 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, laidOut, isInitialized, setInitialized, styleChanged, getNextFocusDown, setNextFocusDown, getNextFocusUp, setNextFocusUp, getNextFocusLeft, setNextFocusLeft, getNextFocusRight, setNextFocusRight, getName, setName, initCustomStyle, deinitializeCustomStyle, isRTL, setRTL, isTactileTouch, isTactileTouch, setTactileTouch, getPropertyNames, getPropertyTypes, getPropertyTypeNames, getPropertyValue, setPropertyValue, 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
From Iterable
Constructor details
Scheduler
public Scheduler()Scheduler
public Scheduler(ScheduleModel model)Method details
layoutContainer
public void layoutContainer()setToolbarVisible
public void setToolbarVisible(boolean v)next,
previous, today and setView itself.isToolbarVisible
public boolean isToolbarVisible()setCompactToolbar
public void setCompactToolbar(boolean v)isCompactToolbar
public boolean isCompactToolbar()getModel
public ScheduleModel getModel()setModel
public void setModel(ScheduleModel m)refresh
public void refresh()getResource
public ScheduleResource getResource(String id)getView
public Scheduler.View getView()setView
public void setView(Scheduler.View v)setViews
public void setViews(Scheduler.View... offered)setDate
public void setDate(long millis)getDate
public long getDate()next
public void next()previous
public void previous()today
public void today()getVisibleStart
public long getVisibleStart()getVisibleEnd
public long getVisibleEnd()getZone
public ZoneId getZone()setZone
public void setZone(ZoneId z)getFirstDayOfWeek
public int getFirstDayOfWeek()setFirstDayOfWeek
public void setFirstDayOfWeek(int isoDay)getWorkCalendar
public WorkCalendar getWorkCalendar()setWorkCalendar
public void setWorkCalendar(WorkCalendar c)is24Hours
public boolean is24Hours()set24Hours
public void set24Hours(boolean v)getSnapMinutes
public int getSnapMinutes()setSnapMinutes
public void setSnapMinutes(int minutes)getDefaultMinutes
public int getDefaultMinutes()setDefaultMinutes
public void setDefaultMinutes(int minutes)getInitialMinute
public int getInitialMinute()setInitialMinute
public void setInitialMinute(int minute)getTimelineDays
public int getTimelineDays()setTimelineDays
public void setTimelineDays(int days)getAgendaDays
public int getAgendaDays()setAgendaDays
public void setAgendaDays(int days)isEditable
public boolean isEditable()setEditable
public void setEditable(boolean v)isOpenOnTap
public boolean isOpenOnTap()setOpenOnTap
public void setOpenOnTap(boolean v)setDragEdits
public void setDragEdits(boolean v)getItemRenderer
public ScheduleItemRenderer getItemRenderer()setItemRenderer
public void setItemRenderer(ScheduleItemRenderer r)setCurrentTime
public void setCurrentTime(long millis)setAnimationTime
public void setAnimationTime(long millis)Stops the clock the scheduler animates by at a time, for a screenshot of an animation or a test of one: the light of a hover, the rise of an item that is picked up and the travel of one that was dropped are drawn as far along as that time makes them. A negative value returns to the clock.
Scheduler scheduler = new Scheduler();
scheduler.setAnimationTime(1000); // nothing has started
// ... press, drag, release ...
scheduler.setAnimationTime(1100); // 100 milliseconds into what followed
getSelectedItem
public ScheduleItem getSelectedItem()setSelectedItem
public void setSelectedItem(ScheduleItem item)item is null. The listeners are
not told: this is the application’s own doing.addSchedulerListener
public void addSchedulerListener(SchedulerListener l)removeSchedulerListener
public void removeSchedulerListener(SchedulerListener l)formatTime
public String formatTime(long millis)formatRange
public String formatRange(long start, long end)initComponent
protected void initComponent()deinitialize
protected void deinitialize()