| java.lang.Object abbot.editor.widgets.AbstractComponentDecorator
All known Subclasses: abbot.editor.widgets.WaitIndicator, abbot.editor.widgets.Highlighter,
AbstractComponentDecorator | abstract public class AbstractComponentDecorator (Code) | | Provide a method for consistently augmenting the appearance of a given
component by painting something on it after the component itself
gets painted. If not explicitly removed via
AbstractComponentDecorator.dispose , an instance
of this object will live as long as its target component.
By default, the decorator matches the location and size of the decorated
component, but the bounds can be adjusted by overriding
AbstractComponentDecorator.getDecorationBounds() . The
AbstractComponentDecorator.synch() method should be called
whenever the bounds returned by
AbstractComponentDecorator.getDecorationBounds() would change.
The decoration is clipped to the bounds set on the decoration, which does
not necessarily need to be the same as the decorated component's bounds. The
decoration may extend beyond the decorated component bounds, or it may be
reduced to a smaller region.
|
Inner Class :protected class Painter extends JComponent | |
Method Summary | |
protected void | attach() | protected Rectangle | clipDecorationBounds(Rectangle decorated) Adjust the painting offsets and size of the decoration to
account for ancestor clipping. | public void | dispose() Stop decorating. | protected JComponent | getComponent() Returns the decorated component. | protected Rectangle | getDecorationBounds() Return the bounds, relative to the decorated component, of the
decoration. | protected JComponent | getPainter() Returns the component used to paint the decoration and optionally
track events. | public String | getToolTipText() Return the currently set default tooltip text. | public String | getToolTipText(MouseEvent e) Provide for different tool tips depending on the actual location
over the decoration. | public boolean | isShowing() Indicate whether the decoration is showing. | public boolean | isVisible() Indicate whether any of the decoration is visible. | abstract public void | paint(Graphics g) Define the decoration's appearance. | public void | repaint() Force a refresh of the underlying component and its decoration. | public void | setCursor(Cursor cursor) Set the cursor to appear anywhere over the decoration bounds. | public void | setDecorationBounds(Rectangle bounds) Change the bounds of the decoration, relative to the decorated
component. | public void | setDecorationBounds(int x, int y, int w, int h) Change the bounds of the decoration, relative to the decorated
component. | protected void | setPainterBounds(int x, int y, int w, int h) | public void | setToolTipText(String text) Set the text to be displayed when the mouse is over the decoration. | public void | setVisible(boolean visible) Use this to change the visibility of the decoration. | protected void | synch() Ensure the size of the decorator matches the current
decoration bounds with appropriate clipping to viewports. | public String | toString() |
TOP | final public static int TOP(Code) | | |
AbstractComponentDecorator | public AbstractComponentDecorator(JComponent c)(Code) | | Create a decorator for the given component.
|
AbstractComponentDecorator | public AbstractComponentDecorator(JComponent c, int layerOffset)(Code) | | Create a decorator for the given component, indicating the layer
offset from the target component. Negative values mean the decoration
is painted before the target component is painted.
|
attach | protected void attach()(Code) | | |
clipDecorationBounds | protected Rectangle clipDecorationBounds(Rectangle decorated)(Code) | | Adjust the painting offsets and size of the decoration to
account for ancestor clipping. This might be due to scroll panes
or having the decoration lie outside the parent layered pane.
|
dispose | public void dispose()(Code) | | Stop decorating.
|
getComponent | protected JComponent getComponent()(Code) | | Returns the decorated component.
|
getDecorationBounds | protected Rectangle getDecorationBounds()(Code) | | Return the bounds, relative to the decorated component, of the
decoration. The default covers the entire component. Note that
this method will be called from the constructor, so be careful
when overriding and referencing derived class state.
|
getPainter | protected JComponent getPainter()(Code) | | Returns the component used to paint the decoration and optionally
track events.
|
isShowing | public boolean isShowing()(Code) | | Indicate whether the decoration is showing. Its painter must be
visible and showing (showing depends on window ancestor).
|
isVisible | public boolean isVisible()(Code) | | Indicate whether any of the decoration is visible. The decoration
may be clipped by ancestor scroll panes or by being moved outside
if the visible region of its parent window.
|
paint | abstract public void paint(Graphics g)(Code) | | Define the decoration's appearance. The point (0,0) represents
the upper left corner of the decorated component.
The default clip mask will be the extents of the decoration bounds, as
indicated by
AbstractComponentDecorator.getDecorationBounds() , which defaults to the
decorated component bounds.
|
repaint | public void repaint()(Code) | | Force a refresh of the underlying component and its decoration.
|
setCursor | public void setCursor(Cursor cursor)(Code) | | Set the cursor to appear anywhere over the decoration bounds.
If null, the cursor of the decorated component will be used.
|
setDecorationBounds | public void setDecorationBounds(int x, int y, int w, int h)(Code) | | Change the bounds of the decoration, relative to the decorated
component.
|
setPainterBounds | protected void setPainterBounds(int x, int y, int w, int h)(Code) | | |
setVisible | public void setVisible(boolean visible)(Code) | | Use this to change the visibility of the decoration.
|
synch | protected void synch()(Code) | | Ensure the size of the decorator matches the current
decoration bounds with appropriate clipping to viewports.
|
|
|