cwi.SVGGraphics
Class SVGImageFilter
java.lang.Object
java.awt.image.ImageFilter
cwi.SVGGraphics.SVGImageFilter
- All Implemented Interfaces:
- java.lang.Cloneable, java.awt.image.ImageConsumer
- public class SVGImageFilter
- extends java.awt.image.ImageFilter
A simple image filter, which adds a "url" property to the image object.
Otherwise the image is not changed.
A possible and simple use of the filter is as follows:
import java.awt.image.*;
...
ImageFilter addProperty = new SVGImageFilter("The.URL.of.the.image");
FilteredImageSource imageSource = new FilteredImageSource(oldImg.getSource(),addProperty);
Image newImg = Toolkit.getDefaultToolkit().createImage(imageSource);
The class also includes two static methods which simply include these lines, and can be
used as a simple tool.
- Version:
- 1.0
- Author:
- Ivan Herman
| Fields inherited from class java.awt.image.ImageFilter |
consumer |
| Fields inherited from interface java.awt.image.ImageConsumer |
COMPLETESCANLINES, IMAGEABORTED, IMAGEERROR, RANDOMPIXELORDER, SINGLEFRAME, SINGLEFRAMEDONE, SINGLEPASS, STATICIMAGEDONE, TOPDOWNLEFTRIGHT |
|
Method Summary |
static java.awt.Image |
addURL(java.awt.Image img,
java.lang.String s)
Create a new image with a property with a key "url". |
static java.awt.Image |
addURL(java.awt.Image img,
java.net.URL s)
Create a new image with a property with a key "url". |
void |
setProperties(java.util.Hashtable props)
This is the inherited method from ImageFilter which sets the new property. |
| Methods inherited from class java.awt.image.ImageFilter |
clone, getFilterInstance, imageComplete, resendTopDownLeftRight, setColorModel, setDimensions, setHints, setPixels, setPixels |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SVGImageFilter
public SVGImageFilter(java.lang.String s)
- Parameters:
s - the url to be stored with the image.
SVGImageFilter
public SVGImageFilter(java.net.URL s)
- Parameters:
s - the url to be stored with the image. The stored property is the string
s.toExternalForm().
setProperties
public void setProperties(java.util.Hashtable props)
- This is the inherited method from
ImageFilter which sets the new property.
addURL
public static java.awt.Image addURL(java.awt.Image img,
java.lang.String s)
- Create a new image with a property with a key
"url".
- Parameters:
s - the property to be stored.
addURL
public static java.awt.Image addURL(java.awt.Image img,
java.net.URL s)
- Create a new image with a property with a key
"url".
- Parameters:
s - the property to be stored. The stored property is the string
s.toExternalForm().