intarsys PDF library API

de.intarsys.pdf.pd
Class PDAnnotation

java.lang.Object
  extended by de.intarsys.pdf.cos.COSBasedObject
      extended by de.intarsys.pdf.pd.PDObject
          extended by de.intarsys.pdf.pd.PDAnnotation
All Implemented Interfaces:
ICOSObjectListener, IAdditionalActionSupport, IAttributeSupport
Direct Known Subclasses:
PDAnyAnnotation, PDLinkAnnotation, PDMarkupAnnotation, PDPopupAnnotation, PDWidgetAnnotation

public abstract class PDAnnotation
extends PDObject
implements IAdditionalActionSupport

An Annotation is an abstract object that allows a PDF document to be changed and extended in a variety of ways. Annotations are recorded with a page in the PDF document. The behavior of an annotation depends on the subtype.


Nested Class Summary
static class PDAnnotation.MetaClass
          The meta class implementation
 
Field Summary
static Set ANNOTATION_ACTION_TRIGGERS
          supported additional action triggers
static COSName CN_Type_Annot
           
static COSName DK_A
           
static COSName DK_AP
           
static COSName DK_AS
           
static COSName DK_Border
           
static COSName DK_BS
           
static COSName DK_C
           
static COSName DK_CA
           
static COSName DK_Contents
           
static COSName DK_F
          The name for the F entry.
static COSName DK_IC
           
static COSName DK_M
           
static COSName DK_NM
           
static COSName DK_OC
           
static COSName DK_P
           
static COSName DK_Rect
           
static COSName DK_StructParent
           
static PDAnnotation.MetaClass META
          The meta class instance
 
Fields inherited from class de.intarsys.pdf.pd.PDObject
DK_Subtype, DK_Type
 
Fields inherited from interface de.intarsys.pdf.pd.IAdditionalActionSupport
DK_AA
 
Method Summary
 void addAction(PDAction newAction)
          Add a PDAction to be executed when this is "activated".
 int basicGetFlags()
          The annotation flags in its integer representation.
 void basicSetFlags(int newFlags)
          Assign the annotation flags in integer representation.
 boolean canReceiveFocus()
          true if this can receive the focus in an interactive viewer.
 PDAnnotation copy()
          Create a copy of the receiver.
 void dispose()
          Deprecated.  
 PDAction getAction()
          The PDAction to be executed when this is "activated".
 PDAdditionalActions getAdditionalActions()
           
 PDAppearance getAppearance()
          The visual appearance of this.
 COSName getAppearanceState()
          The visual appearance state of this.
 Set getAppearanceStates()
          All defined appearance states in this.
 PDBorderStyle getBorderStyle()
          The annotations border style.
 COSName getBorderStyleName()
          The name of the border style.
 float getBorderStyleWidth()
          The width of the annotations border.
 float[] getColor()
          The color values for this.
 String getContents()
          The contents String for this.
 AnnotationFlags getFlags()
          The annotation flags.
 CDSDate getModified()
          The last modification date.
 String getName()
          The annotations name.
 CDSRectangle getNormalizedRectangle()
          Convenience method to access a normalized copy of the receivers rectangle.
 PDPage getPage()
          Try to access the PDPage we are on.
 CDSRectangle getRectangle()
          The CDSRectangle for the visual appearance of this.
abstract  String getSubtypeLabel()
          A String representation of this.
 Set getSupportedTriggerEvents()
           
 void invalidateCaches()
          Invalidate all local caches as the base object may have changed.
 boolean isHidden()
          Convenience method to access "Hidden" flag.
 boolean isInvisible()
          Convenience method to access "Invisible" flag.
 boolean isLocked()
          Convenience method to access "Locked" flag.
 boolean isMarkupAnnotation()
          true if this is a PDMarkupAnnotation.
 boolean isNoRotate()
          Convenience method to access "NoRotate" flag.
 boolean isNoView()
          Convenience method to access "NoView" flag.
 boolean isNoZoom()
          Convenience method to access "NoZoom" flag.
 boolean isPrint()
          Convenience method to access "Print" flag.
 boolean isReadOnly()
          Convenience method to access "ReadOnly" flag.
 boolean isToggleNoView()
          Convenience method to access "ToggleNoView" flag.
 boolean isWidgetAnnotation()
          true if this is a PDWidgetAnnotation.
 void setAction(PDAction newAction)
          Set the PDAction for the "activation" of this.
 void setAdditionalActions(PDAdditionalActions actions)
           
 void setAppearance(PDAppearance newAppearance)
          Assign a PDAppearance to this.
 void setAppearanceState(COSName newAppearanceState)
          Select a concrete PDForm from the PDAppearance.
 void setBorderStyle(PDBorderStyle newBorderStyle)
          Assign a PDBorderStyle.
 void setBorderStyleName(COSName newStyle)
          Assign a border style name.
 void setBorderStyleWidth(float newWidth)
          Assign a border width.
 void setColor(float[] color)
          Assign a color.
 void setContents(String newContents)
          Assign a content String.
 void setHidden(boolean f)
          Convenience method to access "Hidden" flag.
 void setInvisible(boolean f)
          Convenience method to access "Invisible" flag.
 void setLocked(boolean f)
          Convenience method to access "Locked" flag.
 void setName(String newName)
          Assign a name.
 void setNoRotate(boolean f)
          Convenience method to access "NoRotate" flag.
 void setNoView(boolean f)
          Convenience method to access "NoView" flag.
 void setNoZoom(boolean f)
          Convenience method to access "NoZoom" flag.
 void setPrint(boolean f)
          Convenience method to access "Print" flag.
 void setReadOnly(boolean readOnly)
          Convenience method to access "ReadOnly" flag.
 void setRectangle(CDSRectangle newRectangle)
          Assign a CDSRectangle for the visual appearance of this.
 void setToggleNoView(boolean f)
          Convenience method to access "ToggleNoView" flag.
 boolean supportsPrint()
          true if print flag can be selected/changed for this kind of annotation.
 String toString()
           
 void touch()
          Assign the current date as the date of last modification.
 
Methods inherited from class de.intarsys.pdf.pd.PDObject
cosGetFieldDescendant, cosGetFieldInheritable, cosGetFieldInherited, cosGetSubtype, cosGetType, cosRemoveFieldInheritable, cosSetFieldInheritable, cosSetSubtype, cosSetType, getDoc, getGenericChildren, getGenericParent, setGenericParent
 
Methods inherited from class de.intarsys.pdf.cos.COSBasedObject
changed, cosGetArray, cosGetDict, cosGetDoc, cosGetField, cosGetObject, cosGetStream, cosHasField, cosRemoveField, cosSetField, getAttribute, getFieldBoolean, getFieldDate, getFieldFixed, getFieldFixedArray, getFieldInt, getFieldMLString, getFieldString, removeAttribute, setAttribute, setFieldBoolean, setFieldFixed, setFieldInt, setFieldMLString, setFieldName, setFieldObject, setFieldString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

META

public static final PDAnnotation.MetaClass META
The meta class instance


DK_Contents

public static final COSName DK_Contents

DK_P

public static final COSName DK_P

DK_Rect

public static final COSName DK_Rect

DK_NM

public static final COSName DK_NM

DK_M

public static final COSName DK_M

DK_F

public static final COSName DK_F
The name for the F entry.

Currently:


DK_BS

public static final COSName DK_BS

DK_Border

public static final COSName DK_Border

DK_AP

public static final COSName DK_AP

DK_AS

public static final COSName DK_AS

DK_C

public static final COSName DK_C

DK_CA

public static final COSName DK_CA

DK_IC

public static final COSName DK_IC

DK_A

public static final COSName DK_A

DK_StructParent

public static final COSName DK_StructParent

DK_OC

public static final COSName DK_OC

CN_Type_Annot

public static final COSName CN_Type_Annot

ANNOTATION_ACTION_TRIGGERS

public static final Set ANNOTATION_ACTION_TRIGGERS
supported additional action triggers

Method Detail

addAction

public void addAction(PDAction newAction)
Add a PDAction to be executed when this is "activated".

Parameters:
newAction - The PDAction to be executed.

basicGetFlags

public int basicGetFlags()
The annotation flags in its integer representation.

Returns:
The annotation flags in its integer representation.

basicSetFlags

public void basicSetFlags(int newFlags)
Assign the annotation flags in integer representation.

Parameters:
newFlags - The new annotation flags.

canReceiveFocus

public boolean canReceiveFocus()
true if this can receive the focus in an interactive viewer.

Returns:
true if this can receive the focus in an interactive viewer.

copy

public PDAnnotation copy()
Create a copy of the receiver.

Returns:
A copy of the receiver.

dispose

public void dispose()
Deprecated. 


getAction

public PDAction getAction()
The PDAction to be executed when this is "activated".

Returns:
The PDAction to be executed when this is "activated".

getAdditionalActions

public PDAdditionalActions getAdditionalActions()
Specified by:
getAdditionalActions in interface IAdditionalActionSupport

getAppearance

public PDAppearance getAppearance()
The visual appearance of this.

Returns:
The PDAction to be executed when this is "activated".

getAppearanceState

public COSName getAppearanceState()
The visual appearance state of this. This state selects an appearance within its PDAppearance.

Returns:
The visual appearance state of this.

getAppearanceStates

public Set getAppearanceStates()
All defined appearance states in this.

Returns:
All defined appearance states in this.

getBorderStyle

public PDBorderStyle getBorderStyle()
The annotations border style.

Returns:
The annotations border style.

getBorderStyleName

public COSName getBorderStyleName()
The name of the border style.

Returns:
The name of the border style.

getBorderStyleWidth

public float getBorderStyleWidth()
The width of the annotations border.

Returns:
The width of the annotations border.

getColor

public float[] getColor()
The color values for this.

Returns:
The color values for this.

getContents

public String getContents()
The contents String for this.

Returns:
The contents String for this.

getFlags

public AnnotationFlags getFlags()
The annotation flags.

Returns:
The annotation flags.

getModified

public CDSDate getModified()
The last modification date.

Returns:
The last modification date.

getName

public String getName()
The annotations name.

Returns:
The annotations name.

getNormalizedRectangle

public CDSRectangle getNormalizedRectangle()
Convenience method to access a normalized copy of the receivers rectangle.


getPage

public PDPage getPage()
Try to access the PDPage we are on. This may return null, as this reference is not required by the spec.

Returns:
Try to access the PDPage we are on.

getRectangle

public CDSRectangle getRectangle()
The CDSRectangle for the visual appearance of this.

Returns:
The CDSRectangle for the visual appearance of this.

getSubtypeLabel

public abstract String getSubtypeLabel()
A String representation of this.

Returns:
A String representation of this.

getSupportedTriggerEvents

public Set getSupportedTriggerEvents()
Specified by:
getSupportedTriggerEvents in interface IAdditionalActionSupport

invalidateCaches

public void invalidateCaches()
Description copied from class: COSBasedObject
Invalidate all local caches as the base object may have changed.

Overrides:
invalidateCaches in class COSBasedObject

isHidden

public boolean isHidden()
Convenience method to access "Hidden" flag.


isInvisible

public boolean isInvisible()
Convenience method to access "Invisible" flag.


isLocked

public boolean isLocked()
Convenience method to access "Locked" flag.


isMarkupAnnotation

public boolean isMarkupAnnotation()
true if this is a PDMarkupAnnotation.

Returns:
true if this is a PDMarkupAnnotation.

isNoRotate

public boolean isNoRotate()
Convenience method to access "NoRotate" flag.


isNoView

public boolean isNoView()
Convenience method to access "NoView" flag.


isNoZoom

public boolean isNoZoom()
Convenience method to access "NoZoom" flag.


isPrint

public boolean isPrint()
Convenience method to access "Print" flag.


supportsPrint

public boolean supportsPrint()
true if print flag can be selected/changed for this kind of annotation.

Returns:
true if print flag can be selected/changed for this kind of annotation.

isReadOnly

public boolean isReadOnly()
Convenience method to access "ReadOnly" flag.


isToggleNoView

public boolean isToggleNoView()
Convenience method to access "ToggleNoView" flag.


isWidgetAnnotation

public boolean isWidgetAnnotation()
true if this is a PDWidgetAnnotation.

Returns:
true if this is a PDWidgetAnnotation.

setAction

public void setAction(PDAction newAction)
Set the PDAction for the "activation" of this.

Parameters:
newAction - Set the PDAction for the "activation" of this.

setAdditionalActions

public void setAdditionalActions(PDAdditionalActions actions)
Specified by:
setAdditionalActions in interface IAdditionalActionSupport

setAppearance

public void setAppearance(PDAppearance newAppearance)
Assign a PDAppearance to this.

Parameters:
newAppearance - The new PDAppearance.

setAppearanceState

public void setAppearanceState(COSName newAppearanceState)
Select a concrete PDForm from the PDAppearance.

Parameters:
newAppearanceState - The new state name.

setBorderStyle

public void setBorderStyle(PDBorderStyle newBorderStyle)
Assign a PDBorderStyle.

Parameters:
newBorderStyle - The new PDBorderStyle

setBorderStyleName

public void setBorderStyleName(COSName newStyle)
Assign a border style name.

Parameters:
newStyle - The new border style name.

setBorderStyleWidth

public void setBorderStyleWidth(float newWidth)
Assign a border width.

Parameters:
newWidth - The new Border width.

setColor

public void setColor(float[] color)
Assign a color.

Parameters:
color - The new color values.

setContents

public void setContents(String newContents)
Assign a content String.

Parameters:
newContents - The new content String.

setHidden

public void setHidden(boolean f)
Convenience method to access "Hidden" flag.


setInvisible

public void setInvisible(boolean f)
Convenience method to access "Invisible" flag.


setLocked

public void setLocked(boolean f)
Convenience method to access "Locked" flag.


setName

public void setName(String newName)
Assign a name.

Parameters:
newName - The new name.

setNoRotate

public void setNoRotate(boolean f)
Convenience method to access "NoRotate" flag.


setNoView

public void setNoView(boolean f)
Convenience method to access "NoView" flag.


setNoZoom

public void setNoZoom(boolean f)
Convenience method to access "NoZoom" flag.


setPrint

public void setPrint(boolean f)
Convenience method to access "Print" flag.


setReadOnly

public void setReadOnly(boolean readOnly)
Convenience method to access "ReadOnly" flag.


setRectangle

public void setRectangle(CDSRectangle newRectangle)
Assign a CDSRectangle for the visual appearance of this.

Parameters:
newRectangle - Assign a CDSRectangle for the visual appearance of this.

setToggleNoView

public void setToggleNoView(boolean f)
Convenience method to access "ToggleNoView" flag.


toString

public String toString()
Overrides:
toString in class PDObject

touch

public void touch()
Assign the current date as the date of last modification.


intarsys PDF library API

Copyright © 2006 intarsys consulting GmbH. All Rights Reserved.