org.jdesktop.swingx.decorator
Class ConditionalHighlighter

java.lang.Object
  extended by org.jdesktop.swingx.decorator.AbstractHighlighter
      extended by org.jdesktop.swingx.decorator.LegacyHighlighter
          extended by org.jdesktop.swingx.decorator.ConditionalHighlighter
All Implemented Interfaces:
Highlighter
Direct Known Subclasses:
PatternHighlighter, RolloverHighlighter

Deprecated. use a AbstractHighlighter with HighlightPredicate instead

public abstract class ConditionalHighlighter
extends LegacyHighlighter

ConditionalHighlighter.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.jdesktop.swingx.decorator.LegacyHighlighter
LegacyHighlighter.UIHighlighter
 
Field Summary
protected  int highlightColumn
          Deprecated.  
protected  int mask
          Deprecated.  
protected  int testColumn
          Deprecated.  
 
Fields inherited from class org.jdesktop.swingx.decorator.LegacyHighlighter
immutable, ledgerBackground, notePadBackground
 
Fields inherited from class org.jdesktop.swingx.decorator.AbstractHighlighter
listenerList
 
Constructor Summary
ConditionalHighlighter()
          Deprecated.  
ConditionalHighlighter(Color cellBackground, Color cellForeground, int testColumn, int highlightColumn)
          Deprecated. Constructs a ConditionalHighlighter instance with the specified background and foreground colors that will be used to highlight the renderer component for a cell in the specified highlightColumn of any row if and only if needsHighlight returns true for the adapter that identifies that cell.
 
Method Summary
protected  Color computeSelectedForeground(Color seed)
          Deprecated. 
protected  Component doMask(Component renderer, ComponentAdapter adapter)
          Deprecated. TODO: ??
 int getHighlightColumnIndex()
          Deprecated. Returns the index of the column to highlight if the condition is met.
 int getMask()
          Deprecated. TODO: JW ??
 int getTestColumnIndex()
          Deprecated. Returns the index of the column to use for deciding if the highlight should be on.
 Component highlight(Component renderer, ComponentAdapter adapter)
          Deprecated. Performs a conditional highlight.
protected  void maskBackground(Component renderer, ComponentAdapter adapter)
          Deprecated. TODO: ??
protected  void maskForeground(Component renderer, ComponentAdapter adapter)
          Deprecated. TODO: ??
protected  boolean needsHighlight(ComponentAdapter adapter)
          Deprecated. Checks if the cell identified by the specified adapter is a potential candidate for highlighting, and returns true if so; otherwise, it returns false.
 void setHighlightColumnIndex(int columnIndex)
          Deprecated. Sets the index of the column to highlight if the condition is met.
 void setMask(int alpha)
          Deprecated. TODO: JW ??
 void setTestColumnIndex(int columnIndex)
          Deprecated. Sets the index of the column to use for deciding if the highlight should be on.
protected abstract  boolean test(ComponentAdapter adapter)
          Deprecated. Tests if the cell identified by the specified adapter should actually be highlighted, and returns true if so; otherwise, it returns false.
 
Methods inherited from class org.jdesktop.swingx.decorator.LegacyHighlighter
addChangeListener, applyBackground, applyForeground, computeBackground, computeForeground, computeSelectedBackground, computeSelectedBackground, computeSelectedForeground, computeUnselectedBackground, computeUnselectedForeground, doHighlight, getBackground, getForeground, getSelectedBackground, getSelectedForeground, isImmutable, setBackground, setForeground, setSelectedBackground, setSelectedForeground
 
Methods inherited from class org.jdesktop.swingx.decorator.AbstractHighlighter
fireStateChanged, getChangeListeners, getHighlightPredicate, removeChangeListener, setHighlightPredicate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

testColumn

protected int testColumn
Deprecated. 

highlightColumn

protected int highlightColumn
Deprecated. 

mask

protected int mask
Deprecated. 
Constructor Detail

ConditionalHighlighter

public ConditionalHighlighter()
Deprecated. 

ConditionalHighlighter

public ConditionalHighlighter(Color cellBackground,
                              Color cellForeground,
                              int testColumn,
                              int highlightColumn)
Deprecated. 

Constructs a ConditionalHighlighter instance with the specified background and foreground colors that will be used to highlight the renderer component for a cell in the specified highlightColumn of any row if and only if needsHighlight returns true for the adapter that identifies that cell.

Parameters:
cellBackground - background color for highlighted cells, or null, if background should not be changed
cellForeground - foreground color for highlighted cells, or null, if foreground should not be changed
testColumn - column whose value is to be tested to determine if a cell should be highlighted
highlightColumn - column whose index is used to determine if a cell could be highlighted; may be a valid column index in model coordinates, or -1 to indicate all columns
Method Detail

setMask

public void setMask(int alpha)
Deprecated. 
TODO: JW ??


getMask

public int getMask()
Deprecated. 
TODO: JW ??

Returns:
mask

highlight

public Component highlight(Component renderer,
                           ComponentAdapter adapter)
Deprecated. 
Performs a conditional highlight. Calls doHighlight if and only if needsHighlight returns true.

Specified by:
highlight in interface Highlighter
Overrides:
highlight in class LegacyHighlighter
Parameters:
renderer -
adapter -
Returns:
the highlighted component
See Also:
AbstractHighlighter.doHighlight(Component, ComponentAdapter), AbstractHighlighter.getHighlightPredicate()

doMask

protected Component doMask(Component renderer,
                           ComponentAdapter adapter)
Deprecated. 
TODO: ??

Parameters:
renderer -
adapter -
Returns:
renderer

maskBackground

protected void maskBackground(Component renderer,
                              ComponentAdapter adapter)
Deprecated. 
TODO: ??


maskForeground

protected void maskForeground(Component renderer,
                              ComponentAdapter adapter)
Deprecated. 
TODO: ??

Parameters:
renderer -
adapter -

computeSelectedForeground

@Deprecated
protected Color computeSelectedForeground(Color seed)
Deprecated. 

Description copied from class: LegacyHighlighter
Computes the selected foreground color. This implementation simply returns the selectedBackground property.

Overrides:
computeSelectedForeground in class LegacyHighlighter
Parameters:
seed - initial foreground color; must cope with null!
Returns:
the foreground color for a selected cell

getTestColumnIndex

public int getTestColumnIndex()
Deprecated. 
Returns the index of the column to use for deciding if the highlight should be on.

Returns:
the index of the column to use for deciding about highlighting. The index is in model coordinates, -1 denotes any column.
See Also:
setTestColumnIndex(int)

setTestColumnIndex

public void setTestColumnIndex(int columnIndex)
Deprecated. 
Sets the index of the column to use for deciding if the highlight should be on.

Parameters:
columnIndex - index of the column to used for deciding about highlighting. The index is in model coordinates, -1 denotes any column.

getHighlightColumnIndex

public int getHighlightColumnIndex()
Deprecated. 
Returns the index of the column to highlight if the condition is met.

Returns:
the index of the column to highlight. The index is in model coordinates, -1 denotes any column.
See Also:
setHighlightColumnIndex(int)

setHighlightColumnIndex

public void setHighlightColumnIndex(int columnIndex)
Deprecated. 
Sets the index of the column to highlight if the condition is met.

Parameters:
columnIndex - index of the column to highlight. The index is in model coordinates, -1 denotes every column.

needsHighlight

protected boolean needsHighlight(ComponentAdapter adapter)
Deprecated. 
Checks if the cell identified by the specified adapter is a potential candidate for highlighting, and returns true if so; otherwise, it returns false.

Parameters:
adapter -
Returns:
true if the cell identified by the specified adapter needs highlight; false otherwise

test

protected abstract boolean test(ComponentAdapter adapter)
Deprecated. 
Tests if the cell identified by the specified adapter should actually be highlighted, and returns true if so; otherwise, it returns false.

Parameters:
adapter -
Returns:
true if the test succeeds; false otherwise