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 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

      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

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

      KanbanCard getCard(String id)
      The card with an id, or null.
    • getColumn

      KanbanColumn getColumn(String id)
      The column with an id, or null.
    • getLane

      KanbanLane getLane(String id)
      The lane with an id, or null.
    • canMoveCard

      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

      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

      boolean removeCard(KanbanCard card)
      Removes a card.
    • renameCard

      boolean renameCard(KanbanCard card, String title)
      Gives a card another title.
    • moveCard

      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

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

      boolean setCollapsed(KanbanColumn column, boolean collapsed)
      Folds or unfolds a column.
    • setLaneCollapsed

      boolean setLaneCollapsed(KanbanLane lane, boolean collapsed)
      Folds or unfolds a lane.
    • addChangeListener

      void addChangeListener(KanbanChangeListener l)
      Adds a listener told of every change.
    • removeChangeListener

      void removeChangeListener(KanbanChangeListener l)
      Removes a listener.