Class DefaultGridCellRenderer
java.lang.Object
com.codename1.ui.table.DefaultGridCellRenderer
- All Implemented Interfaces:
GridCellRenderer
The renderer a DataGrid uses for a column that has none: text aligned
by kind, a check box for a boolean, and an image scaled to the row.
Subclass it to change one thing, such as the colour of a value, without repainting the rest.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected FontThe font of a cell's text; by default the row style's.intgetPreferredWidth(GridCell cell) The width, in pixels, the cell's content needs, for a column that sizes itself to what it shows.protected static intmirror(int align, boolean rtl) alignas it reads in the grid's direction: right to left, LEFT is the right edge and RIGHT the left one, so text starts and numbers end where the language puts them.voidPaints a cell into the rectanglex,y,width,height.protected voidpaintCheck(Graphics g, GridCell cell, int x, int y, int size, boolean on) Paints a check box of sidesizeatx,y.protected static intplace(int align, int x, int avail, int w) Where somethingwwide starts in a span fromx,availwide.protected StringThe text a cell shows; by default its column's format of the value.protected intThe colour of a cell's text, given the row style's.
-
Constructor Details
-
DefaultGridCellRenderer
public DefaultGridCellRenderer()
-
-
Method Details
-
paint
Description copied from interface:GridCellRendererPaints a cell into the rectanglex,y,width,height. The graphics is clipped to it.- Specified by:
paintin interfaceGridCellRenderer
-
getPreferredWidth
Description copied from interface:GridCellRendererThe width, in pixels, the cell's content needs, for a column that sizes itself to what it shows.- Specified by:
getPreferredWidthin interfaceGridCellRenderer
-
text
-
textColor
The colour of a cell's text, given the row style's. -
font
-
paintCheck
-
mirror
protected static int mirror(int align, boolean rtl) alignas it reads in the grid's direction: right to left, LEFT is the right edge and RIGHT the left one, so text starts and numbers end where the language puts them. -
place
protected static int place(int align, int x, int avail, int w) Where somethingwwide starts in a span fromx,availwide.
-