multivalent.node

Class LeafImage

public class LeafImage extends Leaf implements ImageObserver

Medium-specific leaf node. LATER: Expose information that's information hidden by Java's getImage(), such as animated GIF frames delays.

Version: $Revision: 1.6 $ $Date: 2002/05/08 09:57:32 $

Field Summary
protected static ImageBroken_
protected static Map<URI,SoftReference<Image>>cache_
Constructor Summary
LeafImage(String name, Map<String,Object> attr, INode parent, Image img)
Take Image from passed parameter.
LeafImage(String name, Map<String,Object> attr, INode parent, URI uri)
Take Image from passed URI.
Method Summary
voidclipboardNode(StringBuffer sb)
booleaneventNode(AWTEvent e, Point rel)
booleanformatNodeContent(Context cx, int start, int end)
ImagegetImage()
booleanimageUpdate(Image img, int infoflags, int x, int y, int width, int height)
booleanpaintNodeContent(Context cx, int start, int end)
Contract violation: painting an image does not paint the background color in place of any transparent pixels, because that might clear out essential existing background.
voidreformat(Node dirty)
For images, just mark dirty and batch to next repaint.
voidsetImage(Image img)
voidsetImage(URI uri)
voidsetSize(int width, int height)
Scale image as necessary to width x height, or to natural dimension of parameter is -1.
intsubelementHit(Point rel)

Field Detail

Broken_

protected static Image Broken_

cache_

protected static Map<URI,SoftReference<Image>> cache_

Constructor Detail

LeafImage

public LeafImage(String name, Map<String,Object> attr, INode parent, Image img)
Take Image from passed parameter.

LeafImage

public LeafImage(String name, Map<String,Object> attr, INode parent, URI uri)
Take Image from passed URI.

Method Detail

clipboardNode

public void clipboardNode(StringBuffer sb)

eventNode

public boolean eventNode(AWTEvent e, Point rel)

formatNodeContent

public boolean formatNodeContent(Context cx, int start, int end)

getImage

public Image getImage()

imageUpdate

public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height)

paintNodeContent

public boolean paintNodeContent(Context cx, int start, int end)
Contract violation: painting an image does not paint the background color in place of any transparent pixels, because that might clear out essential existing background.

reformat

public void reformat(Node dirty)
For images, just mark dirty and batch to next repaint. This way, more likely to batch HTML images when load. Images don't change size, so efficiency not supremely important.

setImage

public void setImage(Image img)

setImage

public void setImage(URI uri)

setSize

public void setSize(int width, int height)
Scale image as necessary to width x height, or to natural dimension of parameter is -1.

subelementHit

public int subelementHit(Point rel)