org.apache.batik.ext.awt.image.renderable

Class DeferRable

public class DeferRable extends Object implements 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.
Constructor Summary
DeferRable()
Constructor takes nothing
Method Summary
RenderedImagecreateDefaultRendering()
Forward the call (blocking until source is set if need be).
RenderedImagecreateRendering(RenderContext rc)
Forward the call (blocking until source is set if need be).
RenderedImagecreateScaledRendering(int w, int h, RenderingHints hints)
Forward the call (blocking until source is set if need be).
Rectangle2DgetBounds2D()
Implement the baseclass method to call getSource() so it will block until we have a real source.
ShapegetDependencyRegion(int srcIndex, Rectangle2D outputRgn)
Forward the call (blocking until source is set if need be).
ShapegetDirtyRegion(int srcIndex, Rectangle2D inputRgn)
Forward the call (blocking until source is set if need be).
floatgetHeight()
floatgetMinX()
floatgetMinY()
ObjectgetProperty(String name)
Forward the call (blocking until source is set if need be).
String[]getPropertyNames()
Forward the call (blocking until source is set if need be).
FiltergetSource()
Key method that blocks if the src has not yet been provided.
VectorgetSources()
longgetTimeStamp()
floatgetWidth()
booleanisDynamic()
Forward the call (blocking until source is set if need be).
voidsetBounds(Rectangle2D bounds)
voidsetProperties(Map props)
voidsetSource(Filter src)
Key method that sets the src.

Constructor Detail

DeferRable

public DeferRable()
Constructor takes nothing

Method Detail

createDefaultRendering

public RenderedImage createDefaultRendering()
Forward the call (blocking until source is set if need be).

createRendering

public RenderedImage createRendering(RenderContext rc)
Forward the call (blocking until source is set if need be).

createScaledRendering

public RenderedImage createScaledRendering(int w, int h, RenderingHints hints)
Forward the call (blocking until source is set if need be).

getBounds2D

public Rectangle2D getBounds2D()
Implement the baseclass method to call getSource() so it will block until we have a real source.

getDependencyRegion

public Shape getDependencyRegion(int srcIndex, Rectangle2D outputRgn)
Forward the call (blocking until source is set if need be).

getDirtyRegion

public Shape getDirtyRegion(int srcIndex, Rectangle2D inputRgn)
Forward the call (blocking until source is set if need be).

getHeight

public float getHeight()

getMinX

public float getMinX()

getMinY

public float getMinY()

getProperty

public Object getProperty(String name)
Forward the call (blocking until source is set if need be).

getPropertyNames

public String[] getPropertyNames()
Forward the call (blocking until source is set if need be).

getSource

public Filter getSource()
Key method that blocks if the src has not yet been provided.

getSources

public Vector getSources()

getTimeStamp

public long getTimeStamp()

getWidth

public float getWidth()

isDynamic

public boolean isDynamic()
Forward the call (blocking until source is set if need be).

setBounds

public void setBounds(Rectangle2D bounds)

setProperties

public void setProperties(Map props)

setSource

public void setSource(Filter src)
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.
Copyright B) 2008 Apache Software Foundation. All Rights Reserved.