Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public interface KanbanModel

Known subtypesAbstractKanbanModel, DefaultKanbanModel

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.

Methods

public abstract List<KanbanColumn> getColumns()The columns, in order.
public abstract List<KanbanLane> getLanes()The swimlanes, in order; empty for a board without lanes.
public abstract List<KanbanCard> getCards(KanbanColumn column, KanbanLane lane)The cards of one cell, in order: those of a column that are in a lane.
public abstract int getCardCount(KanbanColumn column)The number of cards in a column, in all its lanes.
public abstract KanbanCard getCard(String id)The card with an id, or null.
public abstract KanbanColumn getColumn(String id)The column with an id, or null.
public abstract KanbanLane getLane(String id)The lane with an id, or null.
public abstract boolean canMoveCard(KanbanCard card, KanbanColumn column, KanbanLane lane)Whether moveCard would take the card into a column.
public abstract boolean insertCard(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.
public abstract boolean removeCard(KanbanCard card)Removes a card.
public abstract boolean renameCard(KanbanCard card, String title)Gives a card another title.
public abstract boolean moveCard(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.
public abstract boolean moveColumn(KanbanColumn column, int index)Moves a column to an index among the columns, counted without it.
public abstract boolean setCollapsed(KanbanColumn column, boolean collapsed)Folds or unfolds a column.
public abstract boolean setLaneCollapsed(KanbanLane lane, boolean collapsed)Folds or unfolds a lane.
public abstract void addChangeListener(KanbanChangeListener l)Adds a listener told of every change.
public abstract void removeChangeListener(KanbanChangeListener l)Removes a listener.

Method details

getColumns

public abstract List<KanbanColumn> getColumns()
The columns, in order. Do not modify the list.

getLanes

public abstract List<KanbanLane> getLanes()
The swimlanes, in order; empty for a board without lanes. Do not modify the list.

getCards

public abstract List<KanbanCard> getCards(KanbanColumn column, KanbanLane lane)
The cards of one cell, in order: those of a column that are in a lane. lane is null on a board without lanes, and then the answer is every card of the column. Do not modify the list.

getCardCount

public abstract int getCardCount(KanbanColumn column)
The number of cards in a column, in all its lanes.

getCard

public abstract KanbanCard getCard(String id)
The card with an id, or null.

getColumn

public abstract KanbanColumn getColumn(String id)
The column with an id, or null.

getLane

public abstract KanbanLane getLane(String id)
The lane with an id, or null.

canMoveCard

public abstract boolean canMoveCard(KanbanCard card, KanbanColumn column, KanbanLane lane)
Whether moveCard would 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

public abstract boolean insertCard(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.

removeCard

public abstract boolean removeCard(KanbanCard card)
Removes a card.

renameCard

public abstract boolean renameCard(KanbanCard card, String title)
Gives a card another title.

moveCard

public abstract boolean moveCard(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. 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

public abstract boolean moveColumn(KanbanColumn column, int index)
Moves a column to an index among the columns, counted without it.

setCollapsed

public abstract boolean setCollapsed(KanbanColumn column, boolean collapsed)
Folds or unfolds a column.

setLaneCollapsed

public abstract boolean setLaneCollapsed(KanbanLane lane, boolean collapsed)
Folds or unfolds a lane.

addChangeListener

public abstract void addChangeListener(KanbanChangeListener l)
Adds a listener told of every change.

removeChangeListener

public abstract void removeChangeListener(KanbanChangeListener l)
Removes a listener.