interface org.aswing.ListCellFactory

List cell renderer factory, a ListCellFactory should not change it return value of these method isAllCellHasSameHeight, getCellHeight after created. Mean, if one of its instance method isAllCellHasSameHeight returned false, it should always return false. @author paling

Instance Fields

function createNewCell(): ListCell

Creates a new list cell.

function getCellHeight(): Int

If isAllCellHasSameHeight or isShareCells returns true, this method will be used, it returned value means each cell's same height.

returns

the height for every cells

function isAllCellHasSameHeight(): Bool

Returns is all cells has same height.

If all cells has same height, the List component will has more efficient on speed.

If this method return true, the List component will set all list cells height what getCellHeight returned, otherwise, the getPreferredSize() of list cell's component will be used.

If shareCells, this method must return true. @see #isShareCells()

returns

is all cells has same height.

function isShareCells(): Bool

Returns is list data should share cell instances for items.

If this return true, the List component will just create enough cell instance to display viewable items. This may cause the List component have shorter time to create, but may get slow when scrolling.

If this return false, the List component will create cells instances for every value of the list. This may cause the List component have hard time to create with huge list, but may get fast when scrolling.

Ordinary, if your List component will hold a very huge list(more than 100), you many need a isAllCellHasSameHeight and shareCells factory. If your list will just hold a small list(less than 50), and you want a smooth scrolling, you may need a not shareCells factory, and in this case, allCellHasSameHeight is not matter with speed, just matter whether you need different height items.

Note that if shareCells, allCellHasSameHeight must be true @see #createNewCell()

returns

is share cell instances.