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

public class DefaultKanbanCardRenderer

  1. Object
  2. DefaultKanbanCardRenderer

ImplementsKanbanCardRenderer

The renderer a board starts with: a card with its title, up to two lines of description, its tags as small labels and its badge, and a strip of colour down its leading edge when its style key has one.

Colours and fonts come from the UIIDs KanbanCard, KanbanCardSelected and KanbanCardTag.

Constructors

public DefaultKanbanCardRenderer()

Methods

public void setAccent(String styleKey, int rgb)Gives the cards with a style key a colour, drawn down their leading edge.
public void setTagColor(String tag, int rgb)Gives a tag a background colour of its own.
public int getTitleLines()The most lines a title takes before it is cut short; 2 by default.
public void setTitleLines(int titleLines)Sets the most lines a title takes.
public int getDescriptionLines()The most lines a description takes; 2 by default, 0 to hide it.
public void setDescriptionLines(int descriptionLines)Sets the most lines a description takes.
public int getCardHeight(KanbanBoard board, KanbanCard card, int width)The height of a card that is width pixels wide, without the component a KanbanCardFactory adds under it.
public void paintCard(Graphics g, KanbanBoard board, KanbanCard card, int x, int y, int w, int h, boolean selected, float lift)Paints a card into a rectangle.

Inherited methods

Constructor details

DefaultKanbanCardRenderer

public DefaultKanbanCardRenderer()

Method details

setAccent

public void setAccent(String styleKey, int rgb)
Gives the cards with a style key a colour, drawn down their leading edge.

setTagColor

public void setTagColor(String tag, int rgb)
Gives a tag a background colour of its own.

getTitleLines

public int getTitleLines()
The most lines a title takes before it is cut short; 2 by default.

setTitleLines

public void setTitleLines(int titleLines)
Sets the most lines a title takes.

getDescriptionLines

public int getDescriptionLines()
The most lines a description takes; 2 by default, 0 to hide it.

setDescriptionLines

public void setDescriptionLines(int descriptionLines)
Sets the most lines a description takes.

getCardHeight

public int getCardHeight(KanbanBoard board, KanbanCard card, int width)
The height of a card that is width pixels wide, without the component a KanbanCardFactory adds under it.

paintCard

public void paintCard(Graphics g, KanbanBoard board, KanbanCard card, int x, int y, int w, int h, boolean selected, float lift)
Paints a card into a rectangle.

Parameters

g Graphics
the graphics, with the colour and alpha the renderer may change
board KanbanBoard
the component
card KanbanCard
the card
x int
, y, w, h: the card on screen; the bottom board.getCardComponentHeight(card) pixels belong to its component
y int
Not documented.
w int
Not documented.
h int
Not documented.
selected boolean
true for the selected card
lift float
how far the card is off the board, from 0 to 1, while it is dragged