|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.swingx.decorator.AbstractHighlighter
org.jdesktop.swingx.decorator.IconHighlighter
public class IconHighlighter
Highlighter which decorates by setting the icon property of a JLabel.
Note: The limitation to JLabel icons (vs. covering AbstractButton as well) is intentional. Highlighters are allowed to touch only those properties of the rendering component which are guaranteed to be reset by the corresponding ComponentProvider, this implementation is safe enough - LabelProvider guarantees to reset both text and icon. On the other hand, CheckBoxProvider doesn't touch the icon (which is LAF depend), consequently this Highlighter must not touch it as well. Custom subclasses trying to cover AbstractButton must take care that their custom providers reset the icon property.
ComponentProvider
,
LabelProvider
,
CheckBoxProvider
Field Summary |
---|
Fields inherited from class org.jdesktop.swingx.decorator.AbstractHighlighter |
---|
listenerList |
Constructor Summary | |
---|---|
IconHighlighter()
Instantiates a IconHighlighter with null Icon and default HighlightPredicate. |
|
IconHighlighter(HighlightPredicate predicate)
Instantiates a IconHighlighter with null Icon the given predicate. |
|
IconHighlighter(HighlightPredicate predicate,
javax.swing.Icon icon)
Instantiates a IconHighlighter with the specified Icon and HighlightPredicate. |
|
IconHighlighter(javax.swing.Icon icon)
Instantiates a IconHighlighter with the specified Icon and default HighlightPredicate. |
Method Summary | |
---|---|
protected boolean |
canHighlight(java.awt.Component component,
ComponentAdapter adapter)
Subclasses may override to further limit the highlighting based on Highlighter state, f.i. |
protected java.awt.Component |
doHighlight(java.awt.Component component,
ComponentAdapter adapter)
Apply the highlights. |
javax.swing.Icon |
getIcon()
Returns the Icon used for decoration. |
void |
setIcon(javax.swing.Icon icon)
Sets the icon to use for decoration. |
Methods inherited from class org.jdesktop.swingx.decorator.AbstractHighlighter |
---|
addChangeListener, areEqual, fireStateChanged, getChangeListeners, getHighlightPredicate, highlight, removeChangeListener, setHighlightPredicate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IconHighlighter()
public IconHighlighter(HighlightPredicate predicate)
predicate
- the HighlightPredicate to use.public IconHighlighter(javax.swing.Icon icon)
icon
- the icon to use for decoration.public IconHighlighter(HighlightPredicate predicate, javax.swing.Icon icon)
predicate
- the HighlightPredicate to use.icon
- the Icon to use for decoration.Method Detail |
---|
public void setIcon(javax.swing.Icon icon)
The default value is null.
icon
- the Icon to use for decoration, might be null.public javax.swing.Icon getIcon()
setIcon(Icon)
protected java.awt.Component doHighlight(java.awt.Component component, ComponentAdapter adapter)
doHighlight
in class AbstractHighlighter
component
- the cell renderer component that is to be decoratedadapter
- the ComponentAdapter for this decorate operationcanHighlight(Component, ComponentAdapter)
,
setIcon(Icon)
protected boolean canHighlight(java.awt.Component component, ComponentAdapter adapter)
This implementation returns true always.
Overridden to return true if the component is of type JLabel, false otherwise.
canHighlight
in class AbstractHighlighter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |