|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.code.validationframework.swing.decoration.AbstractComponentDecoration
public abstract class AbstractComponentDecoration
Abstract implementation of a decoration that can be attached to a component.
Concrete implementations will just
need to provide the size and do the painting on the already-computed location.
| Nested Class Summary | |
|---|---|
protected class |
AbstractComponentDecoration.DecorationPainter
Entity responsible of calling the paint(Graphics) method.It is a hook in the Swing paint mechanism. |
| Field Summary | |
|---|---|
protected AbstractComponentDecoration.DecorationPainter |
decorationPainter
Decoration painter component. It is merely a hook into the Swing painting mechanism. This is the component that is actually added to the layered pane. |
| Constructor Summary | |
|---|---|
AbstractComponentDecoration(JComponent decoratedComponent,
AnchorLink anchorLink)
Constructor specifying the component to be decorated and the anchor link between the decorated component and its decoration. |
|
| Method Summary | |
|---|---|
void |
dispose()
|
protected void |
followDecoratedComponent()
Updates the decoration painter with respect to the decorated component. This method is to be called whenever changes on the decorated component have an impact on the decoration (for instance, its size, location, etc.). This method has been made protected so that it can be easily called from the implementing sub-classes. |
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. If null is returned, the parent container of the decorated component is used. |
JComponent |
getDecoratedComponent()
Gets the decorated component to which the decoration is attached. |
protected abstract int |
getHeight()
Returns the height of the decoration. |
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. If set to null, the parent container of the decorated component will be used. Note that the specified clipping component shall be an ancestor of the decorated component, or the component itself. |
void |
setVisible(boolean visible)
Sets the visibility of the decoration. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected AbstractComponentDecoration.DecorationPainter decorationPainter
DECORATION_LAYER_OFFSET,
attach(JComponent),
getDecoratedComponentLayerInLayeredPane(javax.swing.JLayeredPane),
decorationPainter| Constructor Detail |
|---|
public AbstractComponentDecoration(JComponent decoratedComponent,
AnchorLink anchorLink)
decoratedComponent - Component to be decorated.anchorLink - Anchor link between the decorated component and its decoration.| Method Detail |
|---|
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.protected void followDecoratedComponent()
public void dispose()
dispose in interface com.google.code.validationframework.api.common.DisposableDisposableprotected abstract int getWidth()
protected abstract int getHeight()
public abstract void paint(Graphics g)
g - Graphics to paint the decoration to.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||