public class BorderHighlighter extends AbstractHighlighter
Modifier and Type | Field and Description |
---|---|
private boolean |
compound |
private boolean |
inner |
private Border |
paddingBorder |
listenerList
Constructor and Description |
---|
BorderHighlighter()
Instantiates a BorderHighlighter with no padding.
|
BorderHighlighter(Border paddingBorder)
Instantiates a BorderHighlighter with the given padding.
|
BorderHighlighter(HighlightPredicate predicate)
Instantiates a BorderHighlighter with no padding, using the
given predicate.
|
BorderHighlighter(HighlightPredicate predicate,
Border paddingBorder)
Instantiates a BorderHighlighter with the given padding,
HighlightPredicate and default compound property.
|
BorderHighlighter(HighlightPredicate predicate,
Border paddingBorder,
boolean compound)
Instantiates a BorderHighlighter with the given padding,
HighlightPredicate, compound property and default inner property.
|
BorderHighlighter(HighlightPredicate predicate,
Border paddingBorder,
boolean compound,
boolean inner)
Instantiates a BorderHighlighter with the given padding,
HighlightPredicate and compound property.
|
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. a PainterHighlighter can only be applied
to PainterAware components.
|
private Border |
compoundBorder(Border border)
PRE: paddingBorder !
|
protected Component |
doHighlight(Component renderer,
ComponentAdapter adapter)
Apply the highlights.
|
Border |
getBorder()
Returns the border used for highlighing.
|
boolean |
isCompound() |
boolean |
isInner()
Returns the inner property.
|
void |
setBorder(Border padding)
Sets the Border used for highlighting.
|
void |
setCompound(boolean compound)
Sets the compound property.
|
void |
setInner(boolean inner)
Sets the inner property.
|
addChangeListener, areEqual, fireStateChanged, getChangeListeners, getHighlightPredicate, highlight, removeChangeListener, setHighlightPredicate
private Border paddingBorder
private boolean inner
private boolean compound
public BorderHighlighter()
public BorderHighlighter(HighlightPredicate predicate)
predicate
- the HighlightPredicate to usepublic BorderHighlighter(Border paddingBorder)
paddingBorder
- the border to apply as visual decoration.public BorderHighlighter(HighlightPredicate predicate, Border paddingBorder)
predicate
- the HighlightPredicate to usepaddingBorder
- the border to apply as visual decoration.public BorderHighlighter(HighlightPredicate predicate, Border paddingBorder, boolean compound)
predicate
- the HighlightPredicate to usepaddingBorder
- the border to apply as visual decoration.compound
- the compound property.public BorderHighlighter(HighlightPredicate predicate, Border paddingBorder, boolean compound, boolean inner)
predicate
- the HighlightPredicate to usepaddingBorder
- the border to apply as visual decoration.compound
- the compound propertyinner
- the inner propertyprotected Component doHighlight(Component renderer, ComponentAdapter adapter)
doHighlight
in class AbstractHighlighter
renderer
- the cell renderer component that is to be decoratedadapter
- the ComponentAdapter for this decorate operationAbstractHighlighter.highlight(Component, ComponentAdapter)
protected boolean canHighlight(Component component, ComponentAdapter adapter)
This implementation returns true always.
Overridden to prevent highlighting if there's no padding available or the renderer is not of type JComponent.
canHighlight
in class AbstractHighlighter
component
- the cell renderer component that is to be decoratedadapter
- the ComponentAdapter for this decorate operationpublic void setCompound(boolean compound)
The default value is true;
compound
- a boolean indicating whether the highlight border should be
compounded with the component's border.public boolean isCompound()
setCompound(boolean)
public void setInner(boolean inner)
inner
- a boolean indicating whether the highlight border should be
compounded as inner or outer border.isInner()
public boolean isInner()
setInner(boolean)
public void setBorder(Border padding)
The default value is null.
padding
- the Border to usepublic Border getBorder()
private Border compoundBorder(Border border)
border
- WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses