| |
|
| java.lang.Object java.awt.Image com.javelin.swinglets.SImage
SImage | public class SImage extends Image (Code) | | SImage is an AWT Image that can be created from dimensions, or
a file. The written to an output stream. The image is cached
as a byte array to write quickly to the output stream. If the
image has changed used the flush() method to ensure that the
new image is reflected in the next write().
author: Robin Sharp |
Constructor Summary | |
public | SImage(int width, int height) Create a blank image with the following dimensions. | public | SImage(String url) | public | SImage(URL url) |
COUNTER | protected static int COUNTER(Code) | | |
byteArray | protected byte[] byteArray(Code) | | |
height | protected int height(Code) | | |
loadStatus | transient int loadStatus(Code) | | |
width | protected int width(Code) | | |
SImage | public SImage(int width, int height)(Code) | | Create a blank image with the following dimensions.
exception: IllegalArgumentException - if width or height is less than 1 |
SImage | public SImage(URL url)(Code) | | Create an image with the following url suitable for painting on.
Parameters: url - the image URL exception: IllegalArgumentException - if the url does not exist |
equals | public boolean equals(Object object)(Code) | | Equals is based on the name and class.
|
flush | public void flush()(Code) | | Flush the image.
|
getBytes | public byte[] getBytes()(Code) | | Get the image as a byte array
|
getGraphics | public Graphics getGraphics()(Code) | | Creates a graphics context for drawing to an off-screen image.
|
getHeight | public int getHeight()(Code) | | Determines the height of the image.
|
getHeight | public int getHeight(ImageObserver observer)(Code) | | Determines the height of the image.
|
getImage | protected Image getImage(URL url, int w, int h) throws IllegalArgumentException(Code) | | Load the image from a file or create it in memory.
If the url is not null then load the image from the url
and set the width and height. Otherwise create an image
from memory with the defined dimensions and set the
width and height proprerties.
|
getName | public String getName()(Code) | | Determines the name of the image.
|
getSource | public ImageProducer getSource()(Code) | | Gets the object that produces the pixels for the image.
|
getWidth | public int getWidth()(Code) | | Determines the width of the image.
|
hashCode | public int hashCode()(Code) | | Hashcode. Is based on the name.
|
loadByteArray | protected void loadByteArray()(Code) | | |
paint | public void paint(Object out) throws IOException(Code) | | Write the image as a GIF.
This will handle either OutputStream's or Graphics.
|
toString | public String toString()(Code) | | To String returns the stream that would be painted. This is useful
for JSP and debugging.
|
|
|
|