Class DefaultKanbanCardRenderer
java.lang.Object
com.codename1.ui.kanban.DefaultKanbanCardRenderer
- All Implemented Interfaces:
KanbanCardRenderer
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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetCardHeight(KanbanBoard board, KanbanCard card, int width) The height of a card that iswidthpixels wide, without the component aKanbanCardFactoryadds under it.intThe most lines a description takes; 2 by default, 0 to hide it.intThe most lines a title takes before it is cut short; 2 by default.voidpaintCard(Graphics g, KanbanBoard board, KanbanCard card, int x, int y, int w, int h, boolean selected, float lift) Paints a card into a rectangle.voidGives the cards with a style key a colour, drawn down their leading edge.voidsetDescriptionLines(int descriptionLines) Sets the most lines a description takes.voidsetTagColor(String tag, int rgb) Gives a tag a background colour of its own.voidsetTitleLines(int titleLines) Sets the most lines a title takes.
-
Constructor Details
-
DefaultKanbanCardRenderer
public DefaultKanbanCardRenderer()
-
-
Method Details
-
setAccent
Gives the cards with a style key a colour, drawn down their leading edge. -
setTagColor
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
Description copied from interface:KanbanCardRendererThe height of a card that iswidthpixels wide, without the component aKanbanCardFactoryadds under it.- Specified by:
getCardHeightin interfaceKanbanCardRenderer
-
paintCard
public void paintCard(Graphics g, KanbanBoard board, KanbanCard card, int x, int y, int w, int h, boolean selected, float lift) Description copied from interface:KanbanCardRendererPaints a card into a rectangle.
Parameters
g: the graphics, with the colour and alpha the renderer may changeboard: the componentcard: the cardx,y,w,h: the card on screen; the bottomboard.getCardComponentHeight(card)pixels belong to its componentselected: true for the selected cardlift: how far the card is off the board, from 0 to 1, while it is dragged
- Specified by:
paintCardin interfaceKanbanCardRenderer
-