org.jdesktop.swingx.decorator
Class CompoundHighlighter

java.lang.Object
  extended by org.jdesktop.swingx.decorator.AbstractHighlighter
      extended by org.jdesktop.swingx.decorator.CompoundHighlighter
All Implemented Interfaces:
Highlighter, LegacyHighlighter.UIHighlighter, UIDependent

public class CompoundHighlighter
extends AbstractHighlighter
implements UIDependent, LegacyHighlighter.UIHighlighter

A class which manages the lists of Highlighters.

See Also:
Highlighter

Field Summary
static Highlighter[] EMPTY_HIGHLIGHTERS
           
protected  List<Highlighter> highlighters
           
 
Fields inherited from class org.jdesktop.swingx.decorator.AbstractHighlighter
listenerList
 
Constructor Summary
CompoundHighlighter(Highlighter... inList)
          Instantiates a CompoundHighlighter containing the given Highlighters.
 
Method Summary
 void addHighlighter(Highlighter highlighter)
          Appends a highlighter to the pipeline.
 void addHighlighter(Highlighter highlighter, boolean prepend)
          Adds a highlighter to the pipeline.
 Component apply(Component stamp, ComponentAdapter adapter)
          Deprecated. use highlight
protected  ChangeListener createHighlighterChangeListener()
          Creates and returns the ChangeListener registered to contained Highlighters.
protected  Component doHighlight(Component stamp, ComponentAdapter adapter)
          Apply the highlights.
protected  ChangeListener getHighlighterChangeListener()
          Returns the ChangeListner to contained Highlighters.
 Highlighter[] getHighlighters()
           
 void removeHighlighter(Highlighter hl)
          Removes a highlighter from the pipeline.
 void updateUI()
          method to call after the LookAndFeel changed.
 
Methods inherited from class org.jdesktop.swingx.decorator.AbstractHighlighter
addChangeListener, fireStateChanged, getChangeListeners, getHighlightPredicate, highlight, removeChangeListener, setHighlightPredicate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_HIGHLIGHTERS

public static final Highlighter[] EMPTY_HIGHLIGHTERS

highlighters

protected List<Highlighter> highlighters
Constructor Detail

CompoundHighlighter

public CompoundHighlighter(Highlighter... inList)
Instantiates a CompoundHighlighter containing the given Highlighters.

Parameters:
inList - zero or more not-null Highlighters to manage by this CompoundHighlighter.
Throws:
NullPointerException - if array is null or array contains null values.
Method Detail

addHighlighter

public void addHighlighter(Highlighter highlighter)
Appends a highlighter to the pipeline.

Parameters:
highlighter - highlighter to add
Throws:
NullPointerException - if highlighter is null.

addHighlighter

public void addHighlighter(Highlighter highlighter,
                           boolean prepend)
Adds a highlighter to the pipeline. PENDING: Duplicate inserts?

Parameters:
highlighter - highlighter to add
prepend - prepend the highlighter if true; false will append
Throws:
NullPointerException - if highlighter is null.

removeHighlighter

public void removeHighlighter(Highlighter hl)
Removes a highlighter from the pipeline.

Parameters:
hl - highlighter to remove

getHighlighters

public Highlighter[] getHighlighters()

updateUI

public void updateUI()
Description copied from interface: UIDependent
method to call after the LookAndFeel changed.

Specified by:
updateUI in interface LegacyHighlighter.UIHighlighter
Specified by:
updateUI in interface UIDependent

getHighlighterChangeListener

protected ChangeListener getHighlighterChangeListener()
Returns the ChangeListner to contained Highlighters. The listener is lazily created.

Returns:
the listener for contained highlighters, guaranteed to be not null.

createHighlighterChangeListener

protected ChangeListener createHighlighterChangeListener()
Creates and returns the ChangeListener registered to contained Highlighters. Here: fires a stateChanged on each notification.

Returns:
the listener for contained Highlighters.

apply

public Component apply(Component stamp,
                       ComponentAdapter adapter)
Deprecated. use highlight

Applies all contained highlighters to the components.

Throws:
NullPointerException - if either stamp or adapter is null.
See Also:
AbstractHighlighter.highlight(Component, ComponentAdapter)

doHighlight

protected Component doHighlight(Component stamp,
                                ComponentAdapter adapter)
Description copied from class: AbstractHighlighter
Apply the highlights.

Specified by:
doHighlight in class AbstractHighlighter
Parameters:
stamp - the cell renderer component that is to be decorated
adapter - the ComponentAdapter for this decorate operation
See Also:
AbstractHighlighter.highlight(Component, ComponentAdapter)