com.qoppa.pdf
Interface Bookmark

All Superinterfaces:
TreeNode

public interface Bookmark
extends TreeNode

This interface represents a Bookmark in a PDF document. A bookmark is essentially a node on a tree that has a list of actions associated with it and a number of children.
The class implements the TreeNode interface so that it can be used directly in a JTree.

Author:
Qoppa Software

Method Summary
 void addAction(Action action)
          Adds an Action to this Bookmark
 Bookmark addChildBookmark(String title)
          Add a child bookmark.
 Enumeration children()
          Returns the children of the node as an Enumeration.
 Vector getActions()
          Gets the list of actions for this Bookmark.
 int getBookmarkIndex(Bookmark bookmark)
          Returns the index of the bookmark node in the node's children.
 Bookmark getChildBookmarkAt(int childIndex)
          Returns the child bookmark at the given index.
 int getChildCount()
          Returns the number of children that this node contains.
 Vector getChildren()
          Returns the children of the node as a Vector.
 Bookmark getParentBookmark()
          Returns the parent node / Bookmark.
 Color getTextColor()
          Returns the text color that should be used when showing this bookmark.
 int getTextStyle()
          Returns the text style to use when displaying the bookmark.
 String getTitle()
          Gets this bookmarks title.
 Bookmark insertChildBookmark(String title, int index)
          Insert a child bookmark at the given index in the node's children.
 boolean isOpen()
          Returns whether this item is opened or closed when the document is opened.
 void removeChildBookmark(int index)
          Removes a child bookmark from the bookmark
 void setActions(Vector actions)
          Sets the list of actions for this Bookmark.
 void setOpen(boolean isOpen)
          Sets the item as either open or closed when the document is opened.
 void setTextColor(Color textColor)
          Sets the text color to use when displaying this bookmark.
 void setTextStyle(int textStyle)
          Sets the text style to use when displaying this bookmark.
 void setTitle(String title)
          Sets this bookmarks title.
 String toString()
          Returns the title or name of the bookmark.
 
Methods inherited from interface javax.swing.tree.TreeNode
getAllowsChildren, getChildAt, getIndex, getParent, isLeaf
 

Method Detail

getActions

Vector getActions()
Gets the list of actions for this Bookmark.

Returns:
A Vector containing the actions to execute when this bookmark is clicked.

addAction

void addAction(Action action)
               throws PDFException
Adds an Action to this Bookmark

Parameters:
action - The new action
Throws:
PDFException

setActions

void setActions(Vector actions)
                throws PDFException
Sets the list of actions for this Bookmark.

Parameters:
actions - A Vector containing the actions to execute when this bookmark is clicked.
Throws:
PDFException

addChildBookmark

Bookmark addChildBookmark(String title)
                          throws PDFException
Add a child bookmark.

Parameters:
title - The title of the new child bookmark.
Returns:
The new child Bookmark.
Throws:
PDFException

insertChildBookmark

Bookmark insertChildBookmark(String title,
                             int index)
                             throws PDFException
Insert a child bookmark at the given index in the node's children.

Parameters:
title - The title of the new child bookmark.
index - index where the new child bookmark will be inserted
Returns:
The new child Bookmark.
Throws:
PDFException

getChildCount

int getChildCount()
Returns the number of children that this node contains.

Specified by:
getChildCount in interface TreeNode
See Also:
TreeNode.getChildCount()

children

Enumeration children()
Returns the children of the node as an Enumeration.

Specified by:
children in interface TreeNode

getChildren

Vector getChildren()
Returns the children of the node as a Vector.


getParentBookmark

Bookmark getParentBookmark()
Returns the parent node / Bookmark. This method returns the parent Bookmark for this Bookmark.


getChildBookmarkAt

Bookmark getChildBookmarkAt(int childIndex)
Returns the child bookmark at the given index.


getBookmarkIndex

int getBookmarkIndex(Bookmark bookmark)
Returns the index of the bookmark node in the node's children.


toString

String toString()
Returns the title or name of the bookmark.

Overrides:
toString in class Object

setTitle

void setTitle(String title)
Sets this bookmarks title. The title is the string that is displayed in the 'outline' view of a PDF document.

Parameters:
title - The new title.

getTitle

String getTitle()
Gets this bookmarks title. The title is the string that is displayed in the 'outline' view of a PDF document.

Returns:
The title.

getTextColor

Color getTextColor()
Returns the text color that should be used when showing this bookmark.

Returns:
The color of the text.

setTextColor

void setTextColor(Color textColor)
Sets the text color to use when displaying this bookmark.

Parameters:
textColor - The text color.

getTextStyle

int getTextStyle()
Returns the text style to use when displaying the bookmark.

Returns:
The text style.

setTextStyle

void setTextStyle(int textStyle)
Sets the text style to use when displaying this bookmark.

Parameters:
textStyle - The text style.

removeChildBookmark

void removeChildBookmark(int index)
                         throws PDFException
Removes a child bookmark from the bookmark

Parameters:
index - index of the child bookmark to remove
Throws:
PDFException

setOpen

void setOpen(boolean isOpen)
             throws PDFException
Sets the item as either open or closed when the document is opened.

Throws:
PDFException

isOpen

boolean isOpen()
Returns whether this item is opened or closed when the document is opened.