public class IconHighlighter extends AbstractHighlighter
listenerList
Constructor and Description |
---|
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,
Icon icon)
Instantiates a IconHighlighter with the specified Icon and
HighlightPredicate.
|
IconHighlighter(Icon icon)
Instantiates a IconHighlighter with the specified Icon and default
HighlightPredicate.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
canHighlight(Component component,
ComponentAdapter adapter)
Subclasses may override to further limit the highlighting based
on Highlighter state, f.i.
|
protected Component |
doHighlight(Component component,
ComponentAdapter adapter)
Apply the highlights.
|
Icon |
getIcon()
Returns the Icon used for decoration.
|
void |
setIcon(Icon icon)
Sets the icon to use for decoration.
|
addChangeListener, areEqual, fireStateChanged, getChangeListeners, getHighlightPredicate, highlight, removeChangeListener, setHighlightPredicate
public IconHighlighter()
public IconHighlighter(HighlightPredicate predicate)
predicate
- the HighlightPredicate to use.public IconHighlighter(Icon icon)
icon
- the icon to use for decoration.public IconHighlighter(HighlightPredicate predicate, Icon icon)
predicate
- the HighlightPredicate to use.icon
- the Icon to use for decoration.public void setIcon(Icon icon)
The default value is null.
icon
- the Icon to use for decoration, might be null.public Icon getIcon()
setIcon(Icon)
protected Component doHighlight(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(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
Copyright © 2013. All Rights Reserved.