|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.plaf.ComponentUI javax.swing.plaf.ListUI javax.swing.plaf.basic.BasicListUI com.jidesoft.plaf.basic.BasicGroupListUI
public class BasicGroupListUI
A Basic L&F implementation of GroupListUI
.
Nested Class Summary | |
---|---|
class |
BasicGroupListUI.ListSelectionHandler
The ListSelectionListener that's added to the JLists selection model at installUI time, and whenever the JList.selectionModel property changes. |
class |
BasicGroupListUI.PropertyChangeHandler
The PropertyChangeListener that's added to the JList at installUI time. |
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicListUI |
---|
BasicListUI.FocusHandler, BasicListUI.ListDataHandler, BasicListUI.MouseInputHandler |
Field Summary | |
---|---|
protected Map<Integer,Rectangle> |
_headerBounds
Local cache of bounds of all headers |
Fields inherited from class javax.swing.plaf.basic.BasicListUI |
---|
cellHeight, cellHeights, cellRendererChanged, cellWidth, fixedCellHeightChanged, fixedCellWidthChanged, focusListener, fontChanged, list, listDataListener, listSelectionListener, modelChanged, mouseInputListener, propertyChangeListener, prototypeCellValueChanged, rendererPane, selectionModelChanged, updateLayoutStateNeeded |
Constructor Summary | |
---|---|
BasicGroupListUI()
|
Method Summary | |
---|---|
static ComponentUI |
createUI(JComponent list)
Returns a new instance of BasicGroupListUI. |
Rectangle |
getCellBounds(JList list,
int index)
Gets the bounds of the specified model index, returning the resulting bounds, or null if index is
not valid. |
Rectangle |
getCellBounds(JList list,
int index1,
int index2)
|
int |
getColumnCount(int row)
|
Dimension |
getPreferredSize(JComponent c)
The preferredSize of the list depends upon the layout orientation. |
int |
getRowCount()
|
Point |
indexToLocation(JList list,
int index)
|
protected void |
installDefaults()
Initialize JList properties, e.g. |
protected void |
installKeyboardActions()
Registers the keyboard bindings on the JList that the BasicListUI is associated with. |
protected void |
installListeners()
Create and install the listeners for the JList, its model, and its selectionModel. |
static void |
loadActionMap(LazyActionMap map)
|
int |
locationToIndex(JList list,
Point location)
Convert a point in JList coordinates to the closest index of the cell at that location. |
int |
locationToRow(JList list,
Point location)
|
protected void |
maybeUpdateLayoutState()
If updateLayoutStateNeeded is non zero, call updateLayoutState() and reset updateLayoutStateNeeded. |
void |
paint(Graphics g,
JComponent c)
Paint the rows that intersect the Graphics objects clipRect. |
protected void |
uninstallDefaults()
Set the JList properties that haven't been explicitly overridden to null. |
protected void |
uninstallKeyboardActions()
Unregisters keyboard actions installed from installKeyboardActions . |
protected void |
uninstallListeners()
Remove the listeners for the JList, its model, and its selectionModel. |
void |
uninstallUI(JComponent c)
Uninitializes this.list by calling uninstallListeners() ,
uninstallKeyboardActions() , and uninstallDefaults() in order. |
protected void |
updateCellLayoutState(int fixedCellWidth,
int fixedCellHeight)
Invoked when the list is laid out horizontally to determine how many columns to create. |
protected void |
updateGroupLayoutState(int fixedCellWidth,
int fixedCellHeight)
|
protected void |
updateLayoutState()
Recompute the value of cellHeight or cellHeights based and cellWidth, based on the current font and the current values of fixedCellWidth, fixedCellHeight, and prototypeCellValue. |
Methods inherited from class javax.swing.plaf.basic.BasicListUI |
---|
convertRowToY, convertYToRow, createFocusListener, createListDataListener, createListSelectionListener, createMouseInputListener, createPropertyChangeListener, getBaseline, getBaselineResizeBehavior, getRowHeight, installUI, paintCell, selectNextIndex, selectPreviousIndex |
Methods inherited from class javax.swing.plaf.ComponentUI |
---|
contains, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Map<Integer,Rectangle> _headerBounds
Constructor Detail |
---|
public BasicGroupListUI()
Method Detail |
---|
public static void loadActionMap(LazyActionMap map)
public void uninstallUI(JComponent c)
this.list
by calling uninstallListeners()
,
uninstallKeyboardActions()
, and uninstallDefaults()
in order. Sets this.list to null.
uninstallUI
in class BasicListUI
uninstallListeners()
,
uninstallKeyboardActions()
,
uninstallDefaults()
protected void installDefaults()
installDefaults
in class BasicListUI
uninstallDefaults()
,
BasicListUI.installUI(javax.swing.JComponent)
protected void uninstallDefaults()
uninstallDefaults
in class BasicListUI
installDefaults()
,
uninstallUI(javax.swing.JComponent)
protected void installListeners()
installListeners
in class BasicListUI
BasicListUI.installUI(javax.swing.JComponent)
,
uninstallListeners()
protected void uninstallListeners()
uninstallListeners
in class BasicListUI
uninstallUI(javax.swing.JComponent)
,
installListeners()
public void paint(Graphics g, JComponent c)
paint
in class BasicListUI
BasicListUI.paintCell(java.awt.Graphics, int, java.awt.Rectangle, javax.swing.ListCellRenderer, javax.swing.ListModel, javax.swing.ListSelectionModel, int)
public Dimension getPreferredSize(JComponent c)
Layout Orientation | Preferred Size |
---|---|
JList.VERTICAL | The preferredSize of the list is total height of the rows and the maximum width of the cells. If JList.fixedCellHeight is specified then the total height of the rows is just (cellVerticalMargins + fixedCellHeight) * model.getSize() where rowVerticalMargins is the space we allocate for drawing the yellow focus outline. Similarly if fixedCellWidth is specified then we just use that. |
JList.VERTICAL_WRAP | If the visible row count is greater than zero, the preferredHeight is the maximum cell height * visibleRowCount. If the visible row count is <= 0, the preferred height is either the current height of the list, or the maximum cell height, whichever is bigger. The preferred width is than the maximum cell width * number of columns needed. Where the number of columns needs is list.height / max cell height. Max cell height is either the fixed cell height, or is determined by iterating through all the cells to find the maximum height from the ListCellRenderer. |
JList.HORIZONTAL_WRAP | If the visible row count is greater than zero, the
preferredHeight is the maximum cell height * adjustedRowCount. Where visibleRowCount is used to determine the
number of columns. Because this lays out horizontally the number of rows is then determined from the column
count. For example, lets say you have a model with 10 items and the visible row count is 8. The number of
columns needed to display this is 2, but you no longer need 8 rows to display this, you only need 5, thus the
adjustedRowCount is 5. If the visible row count is <= 0, the preferred height is dictated by the number of
columns, which will be as many as can fit in the width of the |
Insets
are determined from
list.getInsets()
.
getPreferredSize
in class BasicListUI
c
- The JList component.
public static ComponentUI createUI(JComponent list)
public int locationToIndex(JList list, Point location)
JList
coordinates to the closest index of the cell at that location. To determine
if the cell actually contains the specified location use a combination of this method and
getCellBounds
. Returns -1 if the model is empty.
locationToIndex
in class BasicListUI
public int locationToRow(JList list, Point location)
public Point indexToLocation(JList list, int index)
indexToLocation
in class BasicListUI
public Rectangle getCellBounds(JList list, int index1, int index2)
getCellBounds
in class BasicListUI
public Rectangle getCellBounds(JList list, int index)
index
is
not valid.
If the index >= 0, it returns the bounds of index'th element If the index <= 2, it returns the bounds of one
group's header
public int getRowCount()
public int getColumnCount(int row)
protected void maybeUpdateLayoutState()
maybeUpdateLayoutState
in class BasicListUI
updateLayoutState()
protected void updateLayoutState()
updateLayoutState
in class BasicListUI
maybeUpdateLayoutState()
protected void updateGroupLayoutState(int fixedCellWidth, int fixedCellHeight)
protected void updateCellLayoutState(int fixedCellWidth, int fixedCellHeight)
rowsPerColumn
, columnCount
, preferredHeight
and
potentially cellHeight
instance variables.
protected void installKeyboardActions()
JList
that the BasicListUI
is associated with.
This method is called at installUI() time.
installKeyboardActions
in class BasicListUI
BasicListUI.installUI(javax.swing.JComponent)
protected void uninstallKeyboardActions()
installKeyboardActions
. This method is called at
uninstallUI() time - subclasses should ensure that all of the keyboard actions registered at installUI time are
removed here.
uninstallKeyboardActions
in class BasicListUI
BasicListUI.installUI(javax.swing.JComponent)
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |