org.springframework.richclient.image
Class AwtImageResource
java.lang.Object
org.springframework.core.io.AbstractResource
org.springframework.richclient.image.AwtImageResource
- All Implemented Interfaces:
- ImageObserver, InputStreamSource, Resource
public class AwtImageResource
- extends AbstractResource
- implements ImageObserver
A resource decorator that represents an underlying graphical AWT image, such
as a GIF, JPEG, or PNG.
- Author:
- Keith Donald
Constructor Summary |
AwtImageResource(Resource resource)
Constructs a AwtImageResource for the following io.core.Resource. |
RESOURCE_PREFIX
public static final String RESOURCE_PREFIX
- See Also:
- Constant Field Values
AwtImageResource
public AwtImageResource(Resource resource)
- Constructs a AwtImageResource for the following io.core.Resource. This
assumes the wrapped resource actually points to a underlying image.
- Parameters:
resource
- The wrapped resource.
- Throws:
IllegalArgumentException,
- if the resource is invalid.
getDescription
public String getDescription()
- Specified by:
getDescription
in interface Resource
createRelative
public Resource createRelative(String relativePath)
throws IOException
- Specified by:
createRelative
in interface Resource
- Overrides:
createRelative
in class AbstractResource
- Throws:
IOException
exists
public boolean exists()
- Specified by:
exists
in interface Resource
- Overrides:
exists
in class AbstractResource
isOpen
public boolean isOpen()
- Specified by:
isOpen
in interface Resource
- Overrides:
isOpen
in class AbstractResource
getURL
public URL getURL()
throws IOException
- Specified by:
getURL
in interface Resource
- Overrides:
getURL
in class AbstractResource
- Throws:
IOException
getFile
public File getFile()
throws IOException
- Specified by:
getFile
in interface Resource
- Overrides:
getFile
in class AbstractResource
- Throws:
IOException
getFilename
public String getFilename()
throws IllegalStateException
- Specified by:
getFilename
in interface Resource
- Overrides:
getFilename
in class AbstractResource
- Throws:
IllegalStateException
getInputStream
public InputStream getInputStream()
throws IOException
- Specified by:
getInputStream
in interface InputStreamSource
- Throws:
IOException
getImage
public Image getImage()
throws IOException
- Loads the image from the underlying
core.io.Resource.
This method does not cache. Calling it successively will result in a new
image being loaded each time.
- Throws:
IOException
- If an error occurred while reading from the resource input
stream.
imageUpdate
public boolean imageUpdate(Image img,
int infoflags,
int x,
int y,
int w,
int h)
- Specified by:
imageUpdate
in interface ImageObserver
equals
public boolean equals(Object o)
- Overrides:
equals
in class AbstractResource
hashCode
public int hashCode()
- Overrides:
hashCode
in class AbstractResource
Copyright © 2004-2008 The Spring Framework. All Rights Reserved.