public abstract class AbstractComponentDecoration extends Object implements com.google.code.validationframework.api.common.Disposable
| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractComponentDecoration.DecorationPainter
Entity responsible of calling the
paint(Graphics) method. |
| Modifier and Type | Field and Description |
|---|---|
protected AbstractComponentDecoration.DecorationPainter |
decorationPainter
Decoration painter component.
|
| Constructor and Description |
|---|
AbstractComponentDecoration(JComponent decoratedComponent,
Anchor decoratedComponentAnchor,
Anchor decorationAnchor)
Constructor specifying the component to be decorated and the two anchors composing the anchor link between the
decorated component and its decoration.
|
AbstractComponentDecoration(JComponent decoratedComponent,
AnchorLink anchorLink)
Constructor specifying the component to be decorated and the anchor link between the decorated component and its
decoration.
|
| Modifier and Type | Method and Description |
|---|---|
void |
dispose() |
void |
followAndRepaint()
Triggers a repaint of the component decoration.
|
protected void |
followDecoratedComponent()
Updates the decoration painter with respect to the decorated component.
|
AnchorLink |
getAnchorLink()
Gets the anchor link between the decorated component and its decoration.
|
JComponent |
getClippingAncestor()
Gets the custom clipping ancestor component that will be used to clip the decoration.
|
JComponent |
getDecoratedComponent()
Gets the decorated component to which the decoration is attached.
|
protected abstract int |
getHeight()
Returns the height of the decoration.
|
boolean |
getPaintWhenDisabled()
States whether the decoration is painted (shown) even when the decorated component is disabled.
|
protected abstract int |
getWidth()
Returns the width of the decoration.
|
boolean |
isVisible()
States whether the decoration is visible or not.
|
abstract void |
paint(Graphics g)
Paints the decoration in the specified graphics.
|
void |
setAnchorLink(AnchorLink anchorLink)
Sets the anchor link between the component and its decoration.
|
void |
setClippingAncestor(JComponent decorationClippingAncestor)
Sets the custom clipping ancestor component that will be used to clip the decoration.
|
void |
setPaintWhenDisabled(boolean paintWhenDisabled)
States whether the decoration is to be painted (shown) even when the decorated component is disabled.
|
void |
setVisible(boolean visible)
Sets the visibility of the decoration.
|
protected final AbstractComponentDecoration.DecorationPainter decorationPainter
public AbstractComponentDecoration(JComponent decoratedComponent, AnchorLink anchorLink)
decoratedComponent - Component to be decorated.anchorLink - Anchor link between the decorated component and its decoration.public AbstractComponentDecoration(JComponent decoratedComponent, Anchor decoratedComponentAnchor, Anchor decorationAnchor)
decoratedComponent - Component to be decorated.decoratedComponentAnchor - Anchor on the decorated component.decorationAnchor - Anchor on the decoration.AbstractComponentDecoration(JComponent, AnchorLink)public JComponent getDecoratedComponent()
public JComponent getClippingAncestor()
public void setClippingAncestor(JComponent decorationClippingAncestor)
decorationClippingAncestor - Clipping ancestor or null topublic AnchorLink getAnchorLink()
public void setAnchorLink(AnchorLink anchorLink)
anchorLink - Anchor link between the component and its decoration.public boolean isVisible()
public void setVisible(boolean visible)
visible - True to make the decoration visible, false to make it invisible.public boolean getPaintWhenDisabled()
public void setPaintWhenDisabled(boolean paintWhenDisabled)
paintWhenDisabled - True if decoration is to be painted (shown) even when the decorated component is
disabled, false otherwise.protected void followDecoratedComponent()
public void dispose()
dispose in interface com.google.code.validationframework.api.common.DisposableDisposablepublic void followAndRepaint()
followDecoratedComponent()protected abstract int getWidth()
protected abstract int getHeight()
public abstract void paint(Graphics g)
g - Graphics to paint the decoration to.Copyright © 2015. All Rights Reserved.