|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JLabel | +--javax.swing.DefaultListCellRenderer
Safe: Renders an item in a list.
Implementation Note:
This class overrides
validate
,
revalidate
,
repaint
,
and
firePropertyChange
solely to improve performance.
If not overridden, these frequently called methods would execute code paths
that are unnecessary for the default list cell renderer.
If you write your own renderer,
take care to weigh the benefits and
drawbacks of overriding these methods.
Warning:
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeansTM
has been added to the java.beans
package.
Please see java.beans.XMLEncoder
.
Field Summary | |
protected static javax.swing.border.Border |
noFocusBorder
|
Fields inherited from class javax.swing.JLabel |
LABELED_BY_PROPERTY, labelFor |
Fields inherited from class javax.swing.JComponent |
_bounds, accessibleContext, listenerList, paintingChild, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Container |
|
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Constructor Summary | |
DefaultListCellRenderer()
Enabled: Constructs a default renderer object for an item in a list. |
Method Summary | |
void |
firePropertyChange(String propertyName,
boolean oldValue,
boolean newValue)
Suppressed: Overridden for performance reasons. |
void |
firePropertyChange(String propertyName,
byte oldValue,
byte newValue)
Suppressed: Overridden for performance reasons. |
void |
firePropertyChange(String propertyName,
char oldValue,
char newValue)
Suppressed: Overridden for performance reasons. |
void |
firePropertyChange(String propertyName,
double oldValue,
double newValue)
Suppressed: Overridden for performance reasons. |
void |
firePropertyChange(String propertyName,
float oldValue,
float newValue)
Suppressed: Overridden for performance reasons. |
void |
firePropertyChange(String propertyName,
int oldValue,
int newValue)
Suppressed: Overridden for performance reasons. |
void |
firePropertyChange(String propertyName,
long oldValue,
long newValue)
Suppressed: Overridden for performance reasons. |
protected void |
firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
Overridden for performance reasons. |
void |
firePropertyChange(String propertyName,
short oldValue,
short newValue)
Suppressed: Overridden for performance reasons. |
Component |
getListCellRendererComponent(JList list,
Object value,
int index,
boolean isSelected,
boolean cellHasFocus)
Enabled: |
void |
repaint(long tm,
int x,
int y,
int width,
int height)
Suppressed: Overridden for performance reasons. |
void |
repaint(Rectangle r)
Suppressed: Overridden for performance reasons. |
void |
revalidate()
Suppressed: Overridden for performance reasons. |
void |
validate()
Suppressed: Overridden for performance reasons. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static javax.swing.border.Border noFocusBorder
Constructor Detail |
public DefaultListCellRenderer()
Method Detail |
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus)
getListCellRendererComponent
in interface ListCellRenderer
list
- The JList we're painting.value
- The value returned by list.getModel().getElementAt(index).index
- The cells index.isSelected
- True if the specified cell was selected.cellHasFocus
- True if the specified cell has the focus.
JList
,
ListSelectionModel
,
ListModel
public void validate()
validate
in class Container
Container.add(java.awt.Component)
,
Component.invalidate()
,
#revalidate
public void revalidate()
revalidate
in class JComponent
java.awt.Component#invalidate
,
java.awt.Container#validate
,
JComponent.isValidateRoot()
,
RepaintManager.addInvalidComponent(javax.swing.JComponent)
public void repaint(long tm, int x, int y, int width, int height)
repaint
in class JComponent
tm
- this parameter is not usedx
- the x value of the dirty regiony
- the y value of the dirty regionwidth
- the width of the dirty regionheight
- the height of the dirty regionjava.awt.Component#isShowing
,
RepaintManager.addDirtyRegion(javax.swing.JComponent, int, int, int, int)
public void repaint(Rectangle r)
repaint
in class JComponent
r
- a Rectangle
containing the dirty regionjava.awt.Component#isShowing
,
RepaintManager.addDirtyRegion(javax.swing.JComponent, int, int, int, int)
protected void firePropertyChange(String propertyName, Object oldValue, Object newValue)
firePropertyChange
in class JComponent
propertyName
- the programmatic name of the property
that was changedoldValue
- the old value of the property (as an Object)newValue
- the new value of the property (as an Object)java.beans.PropertyChangeSupport
public void firePropertyChange(String propertyName, byte oldValue, byte newValue)
firePropertyChange
in class JComponent
propertyName
- the programmatic name of the property
that was changedoldValue
- the old value of the property (as a byte)newValue
- the new value of the property (as a byte)JComponent.firePropertyChange(java.lang.String, java.lang.Object,
java.lang.Object)
public void firePropertyChange(String propertyName, char oldValue, char newValue)
firePropertyChange
in class JComponent
propertyName
- the programmatic name of the property
that was changedoldValue
- the old value of the property (as a char)newValue
- the new value of the property (as a char)JComponent.firePropertyChange(java.lang.String, java.lang.Object,
java.lang.Object)
public void firePropertyChange(String propertyName, short oldValue, short newValue)
firePropertyChange
in class JComponent
propertyName
- the programmatic name of the property
that was changedoldValue
- the old value of the property (as a short)newValue
- the old value of the property (as a short)JComponent.firePropertyChange(java.lang.String, java.lang.Object,
java.lang.Object)
public void firePropertyChange(String propertyName, int oldValue, int newValue)
firePropertyChange
in class JComponent
propertyName
- the programmatic name of the property
that was changedoldValue
- the old value of the property (as an int)newValue
- the new value of the property (as an int)JComponent.firePropertyChange(java.lang.String, java.lang.Object,
java.lang.Object)
public void firePropertyChange(String propertyName, long oldValue, long newValue)
firePropertyChange
in class JComponent
propertyName
- the programmatic name of the property
that was changedoldValue
- the old value of the property (as a long)newValue
- the new value of the property (as a long)JComponent.firePropertyChange(java.lang.String, java.lang.Object,
java.lang.Object)
public void firePropertyChange(String propertyName, float oldValue, float newValue)
firePropertyChange
in class JComponent
propertyName
- the programmatic name of the property
that was changedoldValue
- the old value of the property (as a float)newValue
- the new value of the property (as a float)JComponent.firePropertyChange(java.lang.String, java.lang.Object,
java.lang.Object)
public void firePropertyChange(String propertyName, double oldValue, double newValue)
firePropertyChange
in class JComponent
propertyName
- the programmatic name of the property
that was changedoldValue
- the old value of the property (as a double)newValue
- the new value of the property (as a double)JComponent.firePropertyChange(java.lang.String, java.lang.Object,
java.lang.Object)
public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue)
firePropertyChange
in class JComponent
propertyName
- the programmatic name of the property
that was changedoldValue
- the old value of the property (as a boolean)JComponent.firePropertyChange(java.lang.String, java.lang.Object,
java.lang.Object)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |