1 package be
.nikiroo
.utils
.compat
;
3 import java
.awt
.Component
;
5 import javax
.swing
.JList
;
6 import javax
.swing
.ListCellRenderer
;
7 import javax
.swing
.ListModel
;
8 import javax
.swing
.ListSelectionModel
;
11 * Compatibility layer so I can at least get rid of the warnings of using
12 * {@link JList} without a parameter (and still staying Java 1.6 compatible).
14 * This class is merely a {@link ListCellRenderer} that you can parametrise also
22 @SuppressWarnings({ "unchecked", "rawtypes" }) // not compatible Java 1.6
23 public abstract class ListCellRenderer6
<E
> implements ListCellRenderer
{
27 * @deprecated please use@deprecated please use
28 * {@link ListCellRenderer6#getListCellRendererComponent(JList6, Object, int, boolean, boolean)}
30 * {@link ListCellRenderer6#getListCellRendererComponent(JList6, Object, int, boolean, boolean)}
33 public Component
getListCellRendererComponent(JList list
, Object value
,
34 int index
, boolean isSelected
, boolean cellHasFocus
) {
35 return getListCellRendererComponent((JList6
<E
>) list
, (E
) value
, index
,
36 isSelected
, cellHasFocus
);
40 * Return a component that has been configured to display the specified
41 * value. That component's <code>paint</code> method is then called to
42 * "render" the cell. If it is necessary to compute the dimensions of a list
43 * because the list cells do not have a fixed size, this method is called to
44 * generate a component on which <code>getPreferredSize</code> can be
48 * The JList we're painting.
50 * The value returned by list.getModel().getElementAt(index).
54 * True if the specified cell was selected.
56 * True if the specified cell has the focus.
57 * @return A component whose paint() method will render the specified value.
60 * @see ListSelectionModel
63 public abstract Component
getListCellRendererComponent(JList6
<E
> list
,
64 E value
, int index
, boolean isSelected
, boolean cellHasFocus
);