Class DeferRable
java.lang.Object
org.apache.batik.ext.awt.image.renderable.DeferRable
- All Implemented Interfaces:
RenderableImage, Filter
This class allows for the return of a proxy object quickly, while a
heavy weight object is constrcuted in a background Thread. This
proxy object will then block if any methods are called on it that
require talking to the source object.
This is actually a particular instance of a very general pattern
this is probably best represented using the Proxy class in the
Reflection APIs.
- Version:
- $Id$
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) Rectangle2D(package private) Map(package private) FilterFields inherited from interface RenderableImage
HINTS_OBSERVED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionForward the call (blocking until source is set if need be).Forward the call (blocking until source is set if need be).createScaledRendering(int w, int h, RenderingHints hints) Forward the call (blocking until source is set if need be).Implement the baseclass method to call getSource() so it will block until we have a real source.getDependencyRegion(int srcIndex, Rectangle2D outputRgn) Forward the call (blocking until source is set if need be).getDirtyRegion(int srcIndex, Rectangle2D inputRgn) Forward the call (blocking until source is set if need be).floatfloatgetMinX()floatgetMinY()getProperty(String name) Forward the call (blocking until source is set if need be).String[]Forward the call (blocking until source is set if need be).Key method that blocks if the src has not yet been provided.longReturns the current modification timestamp on this Renderable node.floatgetWidth()booleanForward the call (blocking until source is set if need be).voidsetBounds(Rectangle2D bounds) voidsetProperties(Map props) voidKey method that sets the src.
-
Field Details
-
src
-
bounds
Rectangle2D bounds -
props
Map props
-
-
Constructor Details
-
DeferRable
public DeferRable()Constructor takes nothing
-
-
Method Details
-
getSource
Key method that blocks if the src has not yet been provided. -
setSource
Key method that sets the src. The source can only be set once (this makes sense given the intent of the class is to stand in for a real object, so swaping that object isn't a good idea. This will wake all the threads that might be waiting for the source to be set. -
setBounds
-
setProperties
-
getTimeStamp
public long getTimeStamp()Description copied from interface:FilterReturns the current modification timestamp on this Renderable node. This value will change whenever cached output data becomes invalid.- Specified by:
getTimeStampin interfaceFilter- Returns:
- Current modification timestamp value.
-
getSources
- Specified by:
getSourcesin interfaceRenderableImage
-
isDynamic
public boolean isDynamic()Forward the call (blocking until source is set if need be).- Specified by:
isDynamicin interfaceRenderableImage
-
getBounds2D
Implement the baseclass method to call getSource() so it will block until we have a real source.- Specified by:
getBounds2Din interfaceFilter
-
getMinX
public float getMinX()- Specified by:
getMinXin interfaceRenderableImage
-
getMinY
public float getMinY()- Specified by:
getMinYin interfaceRenderableImage
-
getWidth
public float getWidth()- Specified by:
getWidthin interfaceRenderableImage
-
getHeight
public float getHeight()- Specified by:
getHeightin interfaceRenderableImage
-
getProperty
Forward the call (blocking until source is set if need be).- Specified by:
getPropertyin interfaceRenderableImage
-
getPropertyNames
Forward the call (blocking until source is set if need be).- Specified by:
getPropertyNamesin interfaceRenderableImage
-
createDefaultRendering
Forward the call (blocking until source is set if need be).- Specified by:
createDefaultRenderingin interfaceRenderableImage
-
createScaledRendering
Forward the call (blocking until source is set if need be).- Specified by:
createScaledRenderingin interfaceRenderableImage
-
createRendering
Forward the call (blocking until source is set if need be).- Specified by:
createRenderingin interfaceRenderableImage
-
getDependencyRegion
Forward the call (blocking until source is set if need be).- Specified by:
getDependencyRegionin interfaceFilter- Parameters:
srcIndex- The source to do the dependency calculation for.outputRgn- The region of output you are interested in generating dependencies for. The is given in the user coordiate system for this node.- Returns:
- The region of input required. This is in the user coordinate system for the source indicated by srcIndex.
-
getDirtyRegion
Forward the call (blocking until source is set if need be).- Specified by:
getDirtyRegionin interfaceFilter- Parameters:
srcIndex- The input that inputRgn reflects changes in.inputRgn- the region of input that has changed, used to calculate the returned shape. This is given in the user coordinate system of the source indicated by srcIndex.- Returns:
- The region of output that would be invalid given a change to inputRgn of the source selected by srcIndex. this is in the user coordinate system of this node.
-