org.apache.pivot.wtk.text
Class ImageNode

java.lang.Object
  extended by org.apache.pivot.wtk.text.Node
      extended by org.apache.pivot.wtk.text.ImageNode

public class ImageNode
extends Node

Node representing an image.


Constructor Summary
ImageNode()
           
ImageNode(Image image)
           
ImageNode(ImageNode imageNode)
           
ImageNode(String image)
           
ImageNode(URL image)
           
 
Method Summary
 Node duplicate(boolean recursive)
          Creates a copy of this node.
 char getCharacterAt(int offset)
          Returns the character at the given offset.
 int getCharacterCount()
          Returns the number of characters in this node.
 Image getImage()
           
 ListenerList<ImageNodeListener> getImageNodeListeners()
           
 Node getRange(int offset, int characterCount)
          Returns a range from the node.
 void insertRange(Node range, int offset)
          Inserts a range into the node.
 Node removeRange(int offset, int span)
          Removes a range from the node.
 void setImage(Image image)
           
 void setImage(String imageName)
          Sets the image node's icon by resource name.
 void setImage(URL imageURL)
          Sets the image node's current image by URL.
 
Methods inherited from class org.apache.pivot.wtk.text.Node
getDocumentOffset, getDocumentSpan, getNodeListeners, getOffset, getParent, nodeInserted, nodesRemoved, rangeInserted, rangeRemoved, replaceRange, setOffset, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageNode

public ImageNode()

ImageNode

public ImageNode(ImageNode imageNode)

ImageNode

public ImageNode(Image image)

ImageNode

public ImageNode(URL image)

ImageNode

public ImageNode(String image)
Method Detail

getImage

public Image getImage()

setImage

public void setImage(Image image)

setImage

public void setImage(URL imageURL)
Sets the image node's current image by URL.

If the icon already exists in the application context resource cache, the cached value will be used. Otherwise, the icon will be loaded synchronously and added to the cache.

Parameters:
imageURL - The location of the image to set.

setImage

public void setImage(String imageName)
Sets the image node's icon by resource name.

Parameters:
imageName - The resource name of the image to set.
See Also:
setImage(URL)

getCharacterAt

public char getCharacterAt(int offset)
Description copied from class: Node
Returns the character at the given offset.

Specified by:
getCharacterAt in class Node

getCharacterCount

public int getCharacterCount()
Description copied from class: Node
Returns the number of characters in this node.

Specified by:
getCharacterCount in class Node

insertRange

public void insertRange(Node range,
                        int offset)
Description copied from class: Node
Inserts a range into the node. Note that the contents of the range, rather than the range itself, is added to the node.

Specified by:
insertRange in class Node

removeRange

public Node removeRange(int offset,
                        int span)
Description copied from class: Node
Removes a range from the node.

Specified by:
removeRange in class Node
Returns:
The removed range. This will be a copy of the node structure relative to this node.

getRange

public Node getRange(int offset,
                     int characterCount)
Description copied from class: Node
Returns a range from the node.

Specified by:
getRange in class Node
Returns:
A node containing a copy of the node structure spanning the given range, relative to this node.

duplicate

public Node duplicate(boolean recursive)
Description copied from class: Node
Creates a copy of this node.

Specified by:
duplicate in class Node

getImageNodeListeners

public ListenerList<ImageNodeListener> getImageNodeListeners()