Class ImageNode


  • public class ImageNode
    extends Node
    Node representing an image to be inserted into a TextPane.
    • Constructor Detail

      • ImageNode

        public ImageNode()
      • ImageNode

        public ImageNode​(ImageNode imageNode)
      • ImageNode

        public ImageNode​(Image image)
      • ImageNode

        public ImageNode​(java.net.URL image)
      • ImageNode

        public ImageNode​(java.lang.String image)
    • 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.
      • getCharacters

        public java.lang.CharSequence getCharacters()
        Specified by:
        getCharacters in class Node
        Returns:
        The character sequence in this node.
      • getCharacterAt

        public char getCharacterAt​(int offset)
        Specified by:
        getCharacterAt in class Node
        Parameters:
        offset - Offset relative to this node.
        Returns:
        The character at the given offset.
      • getCharacterCount

        public int getCharacterCount()
        Specified by:
        getCharacterCount in class Node
        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 class Node
        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 class Node
        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.
        Specified by:
        getRange in class Node
        Parameters:
        offset - Offset relative to this node.
        characterCount - Count of characters to get.
        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
        Parameters:
        recursive - Whether to duplicate the children also.
        Returns:
        A copy of the current node.