Interface KanbanModel
- All Known Implementing Classes:
AbstractKanbanModel, DefaultKanbanModel
public interface KanbanModel
The columns, lanes and cards of a board, and the edits a user may make.
Every mutator answers whether it made the change. A board offers each
edit to its listeners first and then calls the mutator; a model that
answers false leaves the board as it was. AbstractKanbanModel refuses
every edit, for a board that is only shown; DefaultKanbanModel keeps
everything in memory and accepts them.
A model belongs to the event dispatch thread.
-
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.The card with an id, or null.intgetCardCount(KanbanColumn column) The number of cards in a column, in all its lanes.getCards(KanbanColumn column, KanbanLane lane) The cards of one cell, in order: those of a column that are in a lane.The column with an id, or null.The columns, in order.The lane with an id, or null.getLanes()The swimlanes, in order; empty for a board without lanes.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.
-
Method Details
-
getColumns
List<KanbanColumn> getColumns()The columns, in order. Do not modify the list. -
getLanes
List<KanbanLane> getLanes()The swimlanes, in order; empty for a board without lanes. Do not modify the list. -
getCards
The cards of one cell, in order: those of a column that are in a lane.laneis null on a board without lanes, and then the answer is every card of the column. Do not modify the list. -
getCardCount
The number of cards in a column, in all its lanes. -
getCard
The card with an id, or null. -
getColumn
The column with an id, or null. -
getLane
The lane with an id, or null. -
canMoveCard
WhethermoveCardwould 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. -
insertCard
Adds a card to a cell at an index among the cell's cards; an index past the end adds it last. -
removeCard
Removes a card. -
renameCard
Gives a card another title. -
moveCard
Moves 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. -
moveColumn
Moves a column to an index among the columns, counted without it. -
setCollapsed
Folds or unfolds a column. -
setLaneCollapsed
Folds or unfolds a lane. -
addChangeListener
Adds a listener told of every change. -
removeChangeListener
Removes a listener.
-