Class AbstractKanbanModel
java.lang.Object
com.codename1.kanban.AbstractKanbanModel
- All Implemented Interfaces:
KanbanModel
- Direct Known Subclasses:
DefaultKanbanModel
A model that looks things up by walking its lists and refuses every edit:
what a board that is only shown needs. Override the mutators a user
should have, and call
fireChanged when the data changes.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a listener told of every change.booleancanMoveCard(KanbanCard card, KanbanColumn column, KanbanLane lane) WhethermoveCardwould take the card into a column.protected voidTells the listeners the board changed.The card with an id, or null.intgetCardCount(KanbanColumn column) The number of cards in a column, in all its lanes.The column with an id, or null.The lane with an id, or null.booleaninsertCard(KanbanCard card, KanbanColumn column, KanbanLane lane, int index) Adds a card to a cell at an index among the cell's cards; an index past the end adds it last.booleanmoveCard(KanbanCard card, KanbanColumn column, KanbanLane lane, int index) Moves a card to an index among the cards of a cell, which may be the cell it is in.booleanmoveColumn(KanbanColumn column, int index) Moves a column to an index among the columns, counted without it.booleanremoveCard(KanbanCard card) Removes a card.voidRemoves a listener.booleanrenameCard(KanbanCard card, String title) Gives a card another title.booleansetCollapsed(KanbanColumn column, boolean collapsed) Folds or unfolds a column.booleansetLaneCollapsed(KanbanLane lane, boolean collapsed) Folds or unfolds a lane.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface KanbanModel
getCards, getColumns, getLanes
-
Constructor Details
-
AbstractKanbanModel
public AbstractKanbanModel()
-
-
Method Details
-
getCardCount
Description copied from interface:KanbanModelThe number of cards in a column, in all its lanes.- Specified by:
getCardCountin interfaceKanbanModel
-
getCard
Description copied from interface:KanbanModelThe card with an id, or null.- Specified by:
getCardin interfaceKanbanModel
-
getColumn
Description copied from interface:KanbanModelThe column with an id, or null.- Specified by:
getColumnin interfaceKanbanModel
-
getLane
Description copied from interface:KanbanModelThe lane with an id, or null.- Specified by:
getLanein interfaceKanbanModel
-
canMoveCard
Description copied from interface:KanbanModelWhethermoveCardwould take the card into a column. A board asks while a card is dragged over a column, to show a refusal before the card is let go.- Specified by:
canMoveCardin interfaceKanbanModel
-
insertCard
Description copied from interface:KanbanModelAdds a card to a cell at an index among the cell's cards; an index past the end adds it last.- Specified by:
insertCardin interfaceKanbanModel
-
removeCard
Description copied from interface:KanbanModelRemoves a card.- Specified by:
removeCardin interfaceKanbanModel
-
renameCard
Description copied from interface:KanbanModelGives a card another title.- Specified by:
renameCardin interfaceKanbanModel
-
moveCard
Description copied from interface:KanbanModelMoves a card to an index among the cards of a cell, which may be the cell it is in. The index counts the cell without the card. A null lane is the whole column: the index counts every lane's cards, and the card keeps the lane it names.- Specified by:
moveCardin interfaceKanbanModel
-
moveColumn
Description copied from interface:KanbanModelMoves a column to an index among the columns, counted without it.- Specified by:
moveColumnin interfaceKanbanModel
-
setCollapsed
Description copied from interface:KanbanModelFolds or unfolds a column.- Specified by:
setCollapsedin interfaceKanbanModel
-
setLaneCollapsed
Description copied from interface:KanbanModelFolds or unfolds a lane.- Specified by:
setLaneCollapsedin interfaceKanbanModel
-
addChangeListener
Description copied from interface:KanbanModelAdds a listener told of every change.- Specified by:
addChangeListenerin interfaceKanbanModel
-
removeChangeListener
Description copied from interface:KanbanModelRemoves a listener.- Specified by:
removeChangeListenerin interfaceKanbanModel
-
fireChanged
protected void fireChanged()Tells the listeners the board changed.
-