|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectus.zuercher.gpx2map.image.CompositeImageFactory
public class CompositeImageFactory
CompositeImageFactory delegates image creation to the
NetpbmImageFactory
and GenericImageFactory
classes.
Field Summary | |
---|---|
private static List<ImageFormatDescriptor> |
formatDescriptors
List of ImageFormatDescriptor objects for our supported
formats. |
static CompositeImageFactory |
instance
The singleton instance of this image factory. |
private static List<ImageFactory> |
subordinates
List of ImageFactory implmentations that compose this image factory. |
Constructor Summary | |
---|---|
private |
CompositeImageFactory()
CompositeImageFactory is a singleton. |
Method Summary | |
---|---|
boolean |
canLoad(File imageFile)
Tests whether the given file can be loaded. |
boolean |
canLoad(URL imageUrl)
Tests whether the given URL refers to an image that can be loaded. |
List<ImageFormatDescriptor> |
getSupportedImageFormats()
Returns the ImageFormatDescriptors for
image formats supported by this factory. |
Image |
loadImage(File imageFile)
Loads the given image file. |
Image |
loadImage(URL imageUrl)
Loads the given image. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final CompositeImageFactory instance
private static final List<ImageFactory> subordinates
private static final List<ImageFormatDescriptor> formatDescriptors
ImageFormatDescriptor
objects for our supported
formats.
Constructor Detail |
---|
private CompositeImageFactory()
instance
Method Detail |
---|
public List<ImageFormatDescriptor> getSupportedImageFormats()
ImageFormatDescriptors
for
image formats supported by this factory.
getSupportedImageFormats
in interface ImageFactory
public boolean canLoad(File imageFile) throws IOException
canLoad
in interface ImageFactory
imageFile
- the file to test
IOException
- if there's an error reading the filepublic boolean canLoad(URL imageUrl) throws IOException
canLoad
in interface ImageFactory
imageUrl
- the URL to test
IOException
- if there's an error reading the URLpublic Image loadImage(File imageFile) throws IOException, UnknownFormatException
loadImage
in interface ImageFactory
imageFile
- an image file
IOException
- if there's an error reading the file
UnknownFormatException
- if the file's format is not knownpublic Image loadImage(URL imageUrl) throws IOException, UnknownFormatException
loadImage
in interface ImageFactory
imageUrl
- an image URL
IOException
- if there's an error reading the file
UnknownFormatException
- if the file's format is not known
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |