public class Bookmark
extends java.lang.Object
Constructor and Description |
---|
Bookmark()
A constructor.
|
Bookmark(Obj in_bookmark_dict)
A constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(Bookmark in_bookmark)
Adds the specified Bookmark as the new last child of this Bookmark.
|
Bookmark |
addChild(java.lang.String in_title)
Adds a new Bookmark as the new last child of this Bookmark.
|
void |
addNext(Bookmark in_bookmark)
Adds the specified Bookmark as the new right sibling to this Bookmark,
adjusting the tree containing this Bookmark appropriately.
|
Bookmark |
addNext(java.lang.String in_title)
Adds a new Bookmark to the tree containing this Bookmark, as the
new right sibling.
|
void |
addPrev(Bookmark in_bookmark)
Adds the specified Bookmark as the new left sibling to this Bookmark,
adjusting the tree containing this Bookmark appropriately.
|
Bookmark |
addPrev(java.lang.String in_title)
Adds a new Bookmark to the tree containing this Bookmark, as the
new left sibling.
|
static Bookmark |
create(PDFDoc in_doc,
java.lang.String in_title)
Creates a new valid Bookmark with given title in the
specified document.
|
void |
delete()
Removes the Bookmark's subtree from the bookmark tree containing it.
|
boolean |
equals(java.lang.Object b)
Compares two Bookmark objects for equality.
|
Bookmark |
find(java.lang.String in_title)
Get the Bookmark specified by the given title string.
|
Action |
getAction()
Get the Bookmark's action.
|
double[] |
getColor()
Get the Bookmark's RGB color value.
|
Bookmark |
getFirstChild()
Returns the Bookmark's first child.
|
int |
getFlags()
Get the Bookmark's flags.
|
int |
getIndent()
Get the indentation level of the Bookmark in its containing tree.
|
Bookmark |
getLastChild()
Returns the Bookmark's last child.
|
Bookmark |
getNext()
Returns the Bookmark's next (right) sibling.
|
int |
getOpenCount()
Get the number of opened bookmarks in this subtree.
|
Bookmark |
getParent()
Returns the Bookmark's parent Bookmark.
|
Bookmark |
getPrev()
Returns the Bookmark's previous (left) sibling.
|
Obj |
getSDFObj()
Returns the underlying SDF/Cos object.
|
java.lang.String |
getTitle()
Get the Bookmark's title string.
|
Obj |
getTitleObj()
Get the Bookmark's title string object.
|
boolean |
hasChildren()
Indicates whether the Bookmark has children.
|
int |
hashCode() |
boolean |
isOpen()
Indicates whether the Bookmark is open.
|
boolean |
isValid()
Indicates whether the Bookmark is valid (non-null).
|
void |
removeAction()
Removes the Bookmark?s action.
|
void |
setAction(Action in_action)
Set the Bookmark?s action.
|
void |
setColor()
Set Bookmark's text to black.
|
void |
setColor(double in_r,
double in_g,
double in_b)
Set Bookmark's text to specified color in RGB value
|
void |
setFlags(int in_flags)
Set the Bookmark's flags.
|
void |
setOpen(boolean in_open)
Open or close the Bookmark.
|
void |
setTitle(java.lang.String title)
Set the Bookmark?s title string.
|
void |
unlink()
Unlinks this Bookmark from the bookmark tree that contains it, and
adjusts the tree appropriately.
|
public Bookmark()
public Bookmark(Obj in_bookmark_dict)
Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.
in_bookmark_dict
- Pointer to the Cos/SDF object (outline item dictionary).public static Bookmark create(PDFDoc in_doc, java.lang.String in_title) throws PDFNetException
Note: The new Bookmark is not linked to the outline tree. Use AddChild()/AddNext()/AddPrev() methods in order to link the Bookmark to the outline tree
in_doc
- The document in which a Bookmark is to be created.in_title
- The title string value of the new Bookmark.PDFNetException
public boolean equals(java.lang.Object b)
equals
in class java.lang.Object
b
- the bpublic int hashCode()
hashCode
in class java.lang.Object
public boolean isValid() throws PDFNetException
Note: If this method returns false the underlying SDF/Cos object is null and the Bookmark object should be treated as null as well.
PDFNetException
public boolean hasChildren() throws PDFNetException
PDFNetException
public Bookmark getNext() throws PDFNetException
PDFNetException
public Bookmark getPrev() throws PDFNetException
PDFNetException
public Bookmark getFirstChild() throws PDFNetException
PDFNetException
public Bookmark getLastChild() throws PDFNetException
PDFNetException
public Bookmark getParent() throws PDFNetException
PDFNetException
public Bookmark find(java.lang.String in_title) throws PDFNetException
in_title
- The title string value of the Bookmark to find.PDFNetException
public Bookmark addChild(java.lang.String in_title) throws PDFNetException
Note: If this Bookmark previously had no children, it will be open after the child is added.
in_title
- The title string value of the new Bookmark.PDFNetException
public void addChild(Bookmark in_bookmark) throws PDFNetException
Note: Parameter in_bookmark must not be linked to a bookmark tree.
Note: If this Bookmark previously had no children, it will be open after the child is added.
in_bookmark
- The Bookmark object to be added as a last child of this Bookmark.PDFNetException
public Bookmark addNext(java.lang.String in_title) throws PDFNetException
in_title
- The title string value of the new Bookmark.PDFNetException
public void addNext(Bookmark in_bookmark) throws PDFNetException
Note: Parameter in_bookmark must not be linked to a bookmark tree.
in_bookmark
- The Bookmark object to be added to this Bookmark.PDFNetException
public Bookmark addPrev(java.lang.String in_title) throws PDFNetException
in_title
- The title string value of the new Bookmark.PDFNetException
public void addPrev(Bookmark in_bookmark) throws PDFNetException
Note: Parameter in_bookmark must not be linked to a bookmark tree.
in_bookmark
- The Bookmark object to be added to this Bookmark.PDFNetException
public void delete() throws PDFNetException
PDFNetException
public void unlink() throws PDFNetException
Note: After the bookmark is unlinked is can be moved to another place in the bookmark tree located in the same document.
PDFNetException
public int getIndent() throws PDFNetException
Note: The root level has an indentation level of zero.
PDFNetException
public boolean isOpen() throws PDFNetException
Note: An open Bookmark shows all its children.
PDFNetException
public void setOpen(boolean in_open) throws PDFNetException
Note: An opened Bookmark shows its children, while a closed Bookmark does not.
in_open
- Boolean value that contains the status.
If true, the Bookmark is opened. Otherwise the Bookmark is closed.PDFNetException
public int getOpenCount() throws PDFNetException
PDFNetException
public java.lang.String getTitle() throws PDFNetException
PDFNetException
public Obj getTitleObj() throws PDFNetException
PDFNetException
public void setTitle(java.lang.String title) throws PDFNetException
title
- The new title string for the bookmark.PDFNetException
public Action getAction() throws PDFNetException
PDFNetException
public void setAction(Action in_action) throws PDFNetException
in_action
- The new Action for the Bookmark.PDFNetException
public void removeAction() throws PDFNetException
PDFNetException
public int getFlags() throws PDFNetException
PDFNetException
public void setFlags(int in_flags) throws PDFNetException
in_flags
- The new bookmark flags.
Bit 1 (the least-significant bit) indicates italic font whereas
bit 2 indicates bold font.
Therefore, 0 indicates normal, 1 is italic, 2 is bold, and 3 is bold-italic.PDFNetException
public double[] getColor() throws PDFNetException
Note: The three numbers out_r, out_g, and out_b are in the range 0.0 to 1.0,
representing the components in the DeviceRGB color space of the color
to be used for the Bookmark?s text.
double red, green, blue;
bookmark.GetColor(red, green, blue);
PDFNetException
public void setColor() throws PDFNetException
PDFNetException
public void setColor(double in_r, double in_g, double in_b) throws PDFNetException
in_r
- the red component in the DeviceRGB color spacein_g
- the green component in the DeviceRGB color spacein_b
- the blue component in the DeviceRGB color spacePDFNetException
public Obj getSDFObj()
Note: A null (non-valid) bookmark returns a null object.