Class AbstractScheduleModel
java.lang.Object
com.codename1.scheduling.AbstractScheduleModel
- All Implemented Interfaces:
ScheduleModel
- Direct Known Subclasses:
CalendarScheduleModel, DefaultScheduleModel
The listener list and the refusals every read-only model shares.
A subclass has to supply getResources and getItems. Every edit is
refused until the matching method is overridden.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateItem(long start, long end, String resourceId) Creates an item for a range the user dragged out on empty space.protected voidTells every listener the model changed.voidbooleanremoveItem(ScheduleItem item) Removes an item.voidsetVisibleRange(long from, long to) Told by a view whenever the range it shows changes, with a margin around it.booleanupdateItem(ScheduleItem item, long start, long end, String resourceId) Moves or resizes an item, and gives it to another resource whenresourceIddiffers from the one it has.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ScheduleModel
getItems, getResources
-
Constructor Details
-
AbstractScheduleModel
public AbstractScheduleModel()
-
-
Method Details
-
setVisibleRange
public void setVisibleRange(long from, long to) Description copied from interface:ScheduleModelTold by a view whenever the range it shows changes, with a margin around it. A model that keeps everything in memory ignores it.- Specified by:
setVisibleRangein interfaceScheduleModel
-
updateItem
Description copied from interface:ScheduleModelMoves or resizes an item, and gives it to another resource when
resourceIddiffers from the one it has.Returns
false when the model refuses the change; the view puts the item back
- Specified by:
updateItemin interfaceScheduleModel
-
createItem
Description copied from interface:ScheduleModelCreates an item for a range the user dragged out on empty space.
Returns
the new item, or null when the model does not create items this way
- Specified by:
createItemin interfaceScheduleModel
-
removeItem
Description copied from interface:ScheduleModelRemoves an item.
Returns
false when the model refuses
- Specified by:
removeItemin interfaceScheduleModel
-
addChangeListener
- Specified by:
addChangeListenerin interfaceScheduleModel
-
removeChangeListener
- Specified by:
removeChangeListenerin interfaceScheduleModel
-
fireChanged
protected void fireChanged()Tells every listener the model changed.
-