net.lucidviews.util.image
Class RepaintImageObserver
java.lang.Object
net.lucidviews.util.image.BaseImageObserver
net.lucidviews.util.image.RepaintImageObserver
- All Implemented Interfaces:
- ImageObserver
public class RepaintImageObserver
- extends BaseImageObserver
An ImageObserver
that repaints a component once the image has
fully loaded.
- Since:
- 1.0
- Version:
- $Revision: 1.4 $
- Author:
- Stephen Battey
- See Also:
ImageObserver
,
Image
Method Summary |
boolean |
observedImageUpdate(Image img,
int infoflags,
int x,
int y,
int width,
int height)
This method is called when information about the image that is being
observed, and was previously requested using an asynchronous interface,
becomes available. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_targetComponent
protected Component _targetComponent
- The component to repaint once the image has loaded.
RepaintImageObserver
public RepaintImageObserver(Component targetComponent)
- Create an observer that repaints the target component when the observed
image has loaded.
- Parameters:
targetComponent
- the component to be refreshed
RepaintImageObserver
public RepaintImageObserver(Component targetComponent,
Image image)
- Create an observer that repaints the target component when the specified
image has loaded.
The extra image
parameter restricts this observer such that
it only repaints the target component when the specified image has loaded
and not any other image it has been assigned to observe.
- Parameters:
targetComponent
- the component to be refreshedimage
- the image that is to be monitored
observedImageUpdate
public boolean observedImageUpdate(Image img,
int infoflags,
int x,
int y,
int width,
int height)
- Description copied from class:
BaseImageObserver
- This method is called when information about the image that is being
observed, and was previously requested using an asynchronous interface,
becomes available.
This method should return true if further updates are needed or false if
the required information has been acquired. The image which was being
tracked is passed in using the img argument. Various constants are
combined to form the infoflags argument which indicates what information
about the image is now available. The interpretation of the x, y, width,
and height arguments depends on the contents of the infoflags argument.
The infoflags
argument should be the bitwise inclusive
OR of the following flags: WIDTH
,
HEIGHT
, PROPERTIES
, SOMEBITS
,
FRAMEBITS
, ALLBITS
, ERROR
,
ABORT
.
- Specified by:
observedImageUpdate
in class BaseImageObserver
- Parameters:
img
- the image being observedinfoflags
- the bitwise inclusive OR of the following
flags: WIDTH
, HEIGHT
,
PROPERTIES
, SOMEBITS
,
FRAMEBITS
, ALLBITS
,
ERROR
, ABORT
x
- the x coordinatey
- the y coordinatewidth
- the widthheight
- the height
- Returns:
false
if the infoflags indicate that the
image is completely loaded; true
otherwise