org.apache.pdfbox.pdmodel.interactive.annotation
Class PDAnnotationWidget

java.lang.Object
  extended by org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation
      extended by org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationWidget
All Implemented Interfaces:
COSObjectable

public class PDAnnotationWidget
extends PDAnnotation

This is the class that represents a widget.

Version:
$Revision: 1.3 $
Author:
Ben Litchfield

Field Summary
static java.lang.String SUB_TYPE
          The type of annotation.
 
Fields inherited from class org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation
FLAG_HIDDEN, FLAG_INVISIBLE, FLAG_LOCKED, FLAG_NO_ROTATE, FLAG_NO_VIEW, FLAG_NO_ZOOM, FLAG_PRINTED, FLAG_READ_ONLY, FLAG_TOGGLE_NO_VIEW
 
Constructor Summary
PDAnnotationWidget()
          Constructor.
PDAnnotationWidget(COSDictionary field)
          Creates a PDWidget from a COSDictionary, expected to be a correct object definition for a field in PDF.
 
Method Summary
 PDAction getAction()
          Get the action to be performed when this annotation is to be activated.
 PDAnnotationAdditionalActions getActions()
          Get the additional actions for this field.
 PDAppearanceCharacteristicsDictionary getAppearanceCharacteristics()
          Returns the appearance characteristics dictionary.
 PDBorderStyleDictionary getBorderStyle()
          This will retrieve the border style dictionary, specifying the width and dash pattern used in drawing the line.
 java.lang.String getHighlightingMode()
          Returns the highlighting mode.
 void setAction(PDAction action)
          Set the annotation action.
 void setActions(PDAnnotationAdditionalActions actions)
          Set the actions of the field.
 void setAppearanceCharacteristics(PDAppearanceCharacteristicsDictionary appearanceCharacteristics)
          Sets the appearance characteristics dictionary.
 void setBorderStyle(PDBorderStyleDictionary bs)
          This will set the border style dictionary, specifying the width and dash pattern used in drawing the line.
 void setHighlightingMode(java.lang.String highlightingMode)
          Sets the highlighting mode.
 
Methods inherited from class org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation
createAnnotation, getAnnotationFlags, getAnnotationName, getAppearance, getAppearanceStream, getColour, getContents, getCOSObject, getDictionary, getModifiedDate, getPage, getRectangle, getSubtype, isHidden, isInvisible, isLocked, isNoRotate, isNoView, isNoZoom, isPrinted, isReadOnly, isToggleNoView, setAnnotationFlags, setAnnotationName, setAppearance, setAppearanceStream, setColour, setContents, setHidden, setInvisible, setLocked, setModifiedDate, setNoRotate, setNoView, setNoZoom, setPage, setPrinted, setReadOnly, setRectangle, setToggleNoView
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUB_TYPE

public static final java.lang.String SUB_TYPE
The type of annotation.

See Also:
Constant Field Values
Constructor Detail

PDAnnotationWidget

public PDAnnotationWidget()
Constructor.


PDAnnotationWidget

public PDAnnotationWidget(COSDictionary field)
Creates a PDWidget from a COSDictionary, expected to be a correct object definition for a field in PDF.

Parameters:
field - the PDF objet to represent as a field.
Method Detail

getHighlightingMode

public java.lang.String getHighlightingMode()
Returns the highlighting mode. Default value: I
N
(None) No highlighting.
I
(Invert) Invert the contents of the annotation rectangle.
O
(Outline) Invert the annotation's border.
P
(Push) Display the annotation's down appearance, if any. If no down appearance is defined, the contents of the annotation rectangle shall be offset to appear as if it were pushed below the surface of the page
T
(Toggle) Same as P (which is preferred).

Returns:
the highlighting mode

setHighlightingMode

public void setHighlightingMode(java.lang.String highlightingMode)
Sets the highlighting mode.
N
(None) No highlighting.
I
(Invert) Invert the contents of the annotation rectangle.
O
(Outline) Invert the annotation's border.
P
(Push) Display the annotation's down appearance, if any. If no down appearance is defined, the contents of the annotation rectangle shall be offset to appear as if it were pushed below the surface of the page
T
(Toggle) Same as P (which is preferred).

Parameters:
highlightingMode - the highlighting mode the defined values

getAppearanceCharacteristics

public PDAppearanceCharacteristicsDictionary getAppearanceCharacteristics()
Returns the appearance characteristics dictionary.

Returns:
the appearance characteristics dictionary

setAppearanceCharacteristics

public void setAppearanceCharacteristics(PDAppearanceCharacteristicsDictionary appearanceCharacteristics)
Sets the appearance characteristics dictionary.

Parameters:
appearanceCharacteristics - the appearance characteristics dictionary

getAction

public PDAction getAction()
Get the action to be performed when this annotation is to be activated.

Returns:
The action to be performed when this annotation is activated.

setAction

public void setAction(PDAction action)
Set the annotation action. As of PDF 1.6 this is only used for Widget Annotations

Parameters:
action - The annotation action.

getActions

public PDAnnotationAdditionalActions getActions()
Get the additional actions for this field. This will return null if there are no additional actions for this field. As of PDF 1.6 this is only used for Widget Annotations.

Returns:
The actions of the field.

setActions

public void setActions(PDAnnotationAdditionalActions actions)
Set the actions of the field.

Parameters:
actions - The field actions.

setBorderStyle

public void setBorderStyle(PDBorderStyleDictionary bs)
This will set the border style dictionary, specifying the width and dash pattern used in drawing the line.

Parameters:
bs - the border style dictionary to set.

getBorderStyle

public PDBorderStyleDictionary getBorderStyle()
This will retrieve the border style dictionary, specifying the width and dash pattern used in drawing the line.

Returns:
the border style dictionary.