|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsimtools.images.svg.SVGFileHolder
public class SVGFileHolder
The holder of one SVG document in charge of computing the images for each requested sizes
Field Summary | |
---|---|
protected SVGImageFactory |
factory
The SVGImageFactory in charge of this holder |
protected java.io.File |
file
The SVG file |
protected int |
height
Width and height for the original document. |
protected java.util.HashMap |
imageElements
All the generated images with different sizes The key contains the size specification |
protected TranscoderInput |
tinput
The batik transoder SVG input |
protected java.lang.String |
url
The SVG url |
protected int |
width
Width and height for the original document. |
Constructor Summary | |
---|---|
SVGFileHolder(SVGImageFactory factory,
java.io.File f)
Construct a new SVG holder |
Method Summary | |
---|---|
void |
generate(int w,
int h,
SVGImageFactory.FactoryListener l,
boolean background)
Generate an image of the specified size from the SVG file The listener gets back (the image or an error message) If the image is not yet available, it is generated in a thread if background is set to true |
ImageHolder |
get(int w,
int h)
Get an image of the specified size from the SVG file If the image is not yet available then return null |
java.io.File |
getFile()
Get the file managed by this hoder |
java.lang.Object |
getKey(int w,
int h)
Generate a key for an image managed by this holder |
boolean |
isEmpty()
Check if the holder is empty i.e. there is no more user of this SVG file |
void |
read(java.io.ObjectInputStream in,
SVGImageFactory.FactoryListener l)
e Read the image for one of the user of this SVG file |
void |
relase(SVGImageFactory.FactoryListener l)
Release one of the user of this SVG file If there is no more user the related image is freed |
void |
write(java.io.ObjectOutputStream out,
SVGImageFactory.FactoryListener l)
Save the image for one of the user of this SVG file |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.io.File file
protected final java.lang.String url
protected final TranscoderInput tinput
protected java.util.HashMap imageElements
The value is a ImageHolder
which contains
the image and all the related listeners
protected final SVGImageFactory factory
SVGImageFactory
in charge of this holder
protected int width
protected int height
Constructor Detail |
---|
public SVGFileHolder(SVGImageFactory factory, java.io.File f)
factory
- f
- Method Detail |
---|
public boolean isEmpty()
public java.io.File getFile()
public void relase(SVGImageFactory.FactoryListener l)
l
- the user listenerpublic void write(java.io.ObjectOutputStream out, SVGImageFactory.FactoryListener l) throws java.io.IOException
l
- the user listener
java.io.IOException
public void read(java.io.ObjectInputStream in, SVGImageFactory.FactoryListener l) throws java.io.IOException, java.lang.ClassNotFoundException
l
- the user listener
java.io.IOException
java.lang.ClassNotFoundException
public java.lang.Object getKey(int w, int h)
w
- the image widthh
- the image height
public ImageHolder get(int w, int h)
w
- the image widthh
- the image height
public void generate(int w, int h, SVGImageFactory.FactoryListener l, boolean background)
w
- the image widthh
- the image heightl
- the listenerbackground
- equals true to do the process in a new thread
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |