org.jdesktop.swingx.decorator
Class IconHighlighter
- java.lang.Object
-
- org.jdesktop.swingx.decorator.AbstractHighlighter
-
- org.jdesktop.swingx.decorator.IconHighlighter
-
- All Implemented Interfaces:
- Highlighter
public class IconHighlighter extends AbstractHighlighter
Highlighter which decorates by setting the icon property of a JLabel.Note: The limitation to JLabel icons (vs. covering AbstractButton as well) is intentional. Highlighters are allowed to touch only those properties of the rendering component which are guaranteed to be reset by the corresponding ComponentProvider, this implementation is safe enough - LabelProvider guarantees to reset both text and icon. On the other hand, CheckBoxProvider doesn't touch the icon (which is LAF depend), consequently this Highlighter must not touch it as well. Custom subclasses trying to cover AbstractButton must take care that their custom providers reset the icon property.
- See Also:
ComponentProvider,LabelProvider,CheckBoxProvider
-
-
Constructor Summary
Constructors 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, javax.swing.Icon icon)Instantiates a IconHighlighter with the specified Icon and HighlightPredicate.IconHighlighter(javax.swing.Icon icon)Instantiates a IconHighlighter with the specified Icon and default HighlightPredicate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description javax.swing.IcongetIcon()Returns the Icon used for decoration.voidsetIcon(javax.swing.Icon icon)Sets the icon to use for decoration.-
Methods inherited from class org.jdesktop.swingx.decorator.AbstractHighlighter
addChangeListener, getChangeListeners, getHighlightPredicate, highlight, removeChangeListener, setHighlightPredicate
-
-
-
-
Constructor Detail
-
IconHighlighter
public IconHighlighter()
Instantiates a IconHighlighter with null Icon and default HighlightPredicate.
-
IconHighlighter
public IconHighlighter(HighlightPredicate predicate)
Instantiates a IconHighlighter with null Icon the given predicate.- Parameters:
predicate- the HighlightPredicate to use.
-
IconHighlighter
public IconHighlighter(javax.swing.Icon icon)
Instantiates a IconHighlighter with the specified Icon and default HighlightPredicate.- Parameters:
icon- the icon to use for decoration.
-
IconHighlighter
public IconHighlighter(HighlightPredicate predicate, javax.swing.Icon icon)
Instantiates a IconHighlighter with the specified Icon and HighlightPredicate.- Parameters:
predicate- the HighlightPredicate to use.icon- the Icon to use for decoration.
-
-
Method Detail
-
setIcon
public void setIcon(javax.swing.Icon icon)
Sets the icon to use for decoration. A null icon indicates to not decorate.The default value is null.
- Parameters:
icon- the Icon to use for decoration, might be null.
-
getIcon
public javax.swing.Icon getIcon()
Returns the Icon used for decoration.- Returns:
- icon the Icon used for decoration.
- See Also:
setIcon(Icon)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG