Class CompoundHighlighter
java.lang.Object
org.jdesktop.swingx.decorator.AbstractHighlighter
org.jdesktop.swingx.decorator.CompoundHighlighter
- All Implemented Interfaces:
Highlighter, UIDependent
A class which manages the lists of
Highlighters.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Highlighter[]private ChangeListenerthe listener for changes in contained Highlighters.protected List<Highlighter> Fields inherited from class AbstractHighlighter
listenerList -
Constructor Summary
ConstructorsConstructorDescriptionCompoundHighlighter(Highlighter... inList) Instantiates a CompoundHighlighter containing the givenHighlighters.CompoundHighlighter(HighlightPredicate predicate, Highlighter... inList) Instantiates a CompoundHighlighter with the given predicate containing the givenHighlighters. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHighlighter(Highlighter highlighter) Appends a highlighter to the pipeline.voidaddHighlighter(Highlighter highlighter, boolean prepend) Adds a highlighter to the pipeline.private voidaddHighlighterSilently(Highlighter highlighter, boolean prepend) protected ChangeListenerCreates and returns the ChangeListener registered to containedHighlighters.protected ComponentdoHighlight(Component stamp, ComponentAdapter adapter) Apply the highlights.protected ChangeListenerReturns theChangeListnerto containedHighlighters.Returns an array of contained Highlighters.private voidRemoves all contained highlighters without firing an event.voidRemoves a highlighter from the pipeline.voidsetHighlighters(Highlighter... inList) Sets the givenHighlighters.voidupdateUI()Updates all internal visuals after changing a UI-delegate.private voidupdateUI(Highlighter hl) Updates the ui-dependent state of the given Highlighter.Methods inherited from class AbstractHighlighter
addChangeListener, areEqual, canHighlight, fireStateChanged, getChangeListeners, getHighlightPredicate, highlight, removeChangeListener, setHighlightPredicate
-
Field Details
-
EMPTY_HIGHLIGHTERS
-
highlighters
-
highlighterChangeListener
the listener for changes in contained Highlighters.
-
-
Constructor Details
-
CompoundHighlighter
Instantiates a CompoundHighlighter containing the givenHighlighters.- Parameters:
inList- zero or more not-null Highlighters to manage by this CompoundHighlighter.- Throws:
NullPointerException- if array is null or array contains null values.
-
CompoundHighlighter
Instantiates a CompoundHighlighter with the given predicate containing the givenHighlighters.- Parameters:
predicate- the highlightPredicate to useinList- zero or more not-null Highlighters to manage by this CompoundHighlighter.- Throws:
NullPointerException- if array is null or array contains null values.
-
-
Method Details
-
setHighlighters
Sets the givenHighlighters.- Parameters:
inList- zero or more not-null Highlighters to manage by this CompoundHighlighter.- Throws:
NullPointerException- if array is null or array contains null values.
-
removeAllHighlightersSilently
private void removeAllHighlightersSilently()Removes all contained highlighters without firing an event. Deregisters the listener from all. -
addHighlighter
Appends a highlighter to the pipeline.- Parameters:
highlighter- highlighter to add- Throws:
NullPointerException- if highlighter is null.
-
addHighlighter
Adds a highlighter to the pipeline. PENDING: Duplicate inserts?- Parameters:
highlighter- highlighter to addprepend- prepend the highlighter if true; false will append- Throws:
NullPointerException- if highlighter is null.
-
addHighlighterSilently
-
removeHighlighter
Removes a highlighter from the pipeline.- Parameters:
hl- highlighter to remove
-
getHighlighters
Returns an array of contained Highlighters.- Returns:
- the contained Highlighters, might be empty but never null.
-
updateUI
public void updateUI()Updates all internal visuals after changing a UI-delegate.Implemented to call updateUI on contained Highlighters.
- Specified by:
updateUIin interfaceUIDependent- See Also:
-
getHighlighterChangeListener
Returns theChangeListnerto containedHighlighters. The listener is lazily created.- Returns:
- the listener for contained highlighters, guaranteed to be not null.
-
createHighlighterChangeListener
Creates and returns the ChangeListener registered to containedHighlighters. Here: fires a stateChanged on each notification.- Returns:
- the listener for contained Highlighters.
-
updateUI
Updates the ui-dependent state of the given Highlighter.- Parameters:
hl- the highlighter to update.
-
doHighlight
Apply the highlights.- Specified by:
doHighlightin classAbstractHighlighter- Parameters:
stamp- the cell renderer component that is to be decoratedadapter- the ComponentAdapter for this decorate operation- See Also:
-