Package org.apache.pivot.wtk.text
Class ImageNode
- java.lang.Object
-
- org.apache.pivot.wtk.text.Node
-
- org.apache.pivot.wtk.text.ImageNode
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Node
duplicate(boolean recursive)
Creates a copy of this node.char
getCharacterAt(int offset)
int
getCharacterCount()
java.lang.CharSequence
getCharacters()
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(java.lang.String imageName)
Sets the image node's icon by resource name.void
setImage(java.net.URL imageURL)
Sets the image node's current image by URL.void
setImage(Image image)
-
Methods inherited from class org.apache.pivot.wtk.text.Node
getDocumentOffset, getDocumentSpan, getNodeListeners, getOffset, getParagraph, getParent, getUserData, nodeInserted, nodesRemoved, rangeInserted, rangeRemoved, replaceRange, setOffset, setParent, setUserData
-
-
-
-
Method Detail
-
getImage
public Image getImage()
-
setImage
public void setImage(Image image)
-
setImage
public void setImage(java.net.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(java.lang.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)
,ImageUtils.findByName(String,String)
-
getCharacters
public java.lang.CharSequence getCharacters()
- Specified by:
getCharacters
in classNode
- Returns:
- The character sequence in this node.
-
getCharacterAt
public char getCharacterAt(int offset)
- Specified by:
getCharacterAt
in classNode
- Parameters:
offset
- Offset relative to this node.- Returns:
- The character at the given offset.
-
getCharacterCount
public int getCharacterCount()
- Specified by:
getCharacterCount
in classNode
- Returns:
- The number of characters in this node.
-
insertRange
@UnsupportedOperation 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 classNode
- Parameters:
range
- The node containing the text to insert.offset
- Offset relative to this node.
-
removeRange
@UnsupportedOperation public Node removeRange(int offset, int span)
Description copied from class:Node
Removes a range from the node.- Specified by:
removeRange
in classNode
- Parameters:
offset
- Offset relative to this node.span
- Count of characters to remove.- 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.
-
duplicate
public Node duplicate(boolean recursive)
Description copied from class:Node
Creates a copy of this node.
-
getImageNodeListeners
public ListenerList<ImageNodeListener> getImageNodeListeners()
-
-