public class Widget extends Annot
Annot.BorderStyle
Modifier and Type | Field and Description |
---|---|
static int |
e_Always
This enum represents the circumstances under which
the icon shall be scaled inside the annotation rectangle .
|
static int |
e_Anamorphic
This integer list represents the scale type of the Widget annotation
e_Anamorphic - Scale the icon to fill the annotation rectangle
exactly, without regard to its original aspect
ratio (ratio of width to height).
|
static int |
e_CAboveI
The Constant e_CAboveI.
|
static int |
e_CBelowI
The Constant e_CBelowI.
|
static int |
e_CLeftIRight
The Constant e_CLeftIRight.
|
static int |
e_COverlayI
The Constant e_COverlayI.
|
static int |
e_CRightILeft
The Constant e_CRightILeft.
|
static int |
e_invert
The Constant e_invert.
|
static int |
e_Never
The Constant e_Never.
|
static int |
e_NoCaption
The Constant e_NoCaption.
|
static int |
e_NoIcon
This enum represents the Icon and Caption Relation of the Widget annotation
e_NoIcon - No icon; caption only
e_NoCaption - No caption; icon only
e_CBelowI - Caption below the icon
e_CAboveI - Caption above the icon
e_CRightILeft - Caption to the right of the icon
e_CLeftIRight - Caption to the left of the icon
e_COverlayI - Caption overlaid directly on the icon
Default value: e_NoIcon.
|
static int |
e_none
This integer list spedifies the Highlighting mode of the Widget Annotation
e_none - No highlighting.
|
static int |
e_outline
The Constant e_outline.
|
static int |
e_Proportional
The Constant e_Proportional.
|
static int |
e_push
The Constant e_push.
|
static int |
e_toggle
The Constant e_toggle.
|
static int |
e_WhenBigger
The Constant e_WhenBigger.
|
static int |
e_WhenSmaller
The Constant e_WhenSmaller.
|
e_3D, e_action_trigger_activate, e_action_trigger_annot_blur, e_action_trigger_annot_down, e_action_trigger_annot_enter, e_action_trigger_annot_exit, e_action_trigger_annot_focus, e_action_trigger_annot_page_close, e_action_trigger_annot_page_invisible, e_action_trigger_annot_page_open, e_action_trigger_annot_page_visible, e_action_trigger_annot_up, e_Caret, e_Circle, e_down, e_FileAttachment, e_FreeText, e_hidden, e_Highlight, e_Ink, e_invisible, e_Line, e_Link, e_locked, e_locked_contents, e_Movie, e_no_rotate, e_no_view, e_no_zoom, e_normal, e_Polygon, e_Polyline, e_Popup, e_print, e_PrinterMark, e_Projection, e_read_only, e_Redact, e_RichMedia, e_rollover, e_Screen, e_Sound, e_Square, e_Squiggly, e_Stamp, e_StrikeOut, e_Text, e_toggle_no_view, e_TrapNet, e_Underline, e_Unknown, e_Watermark, e_Widget
Constructor and Description |
---|
Widget()
Create an empty Widget annotation.
|
Widget(Annot annot)
Creates a Widget annotation and initialize it using given annotation object.
|
Widget(Obj d)
Creates a Widget annotation and initialize it using given Cos/SDF object.
|
Modifier and Type | Method and Description |
---|---|
static Widget |
create(Doc doc,
Rect pos,
Field field)
Creates a new Widget annotation, in the specified document.
|
Action |
getAction()
Get the action of the Widget annotation.
|
ColorPt |
getBackgroundColor()
Get the background color of the Widget annotation.
|
int |
getBackgroundColorCompNum()
Get the number indicating background color space of the Widget annotation.
|
ColorPt |
getBorderColor()
Get the border color of the Widget annotation.
|
int |
getBorderColorCompNum()
Get the number indicating border color space of the Widget annotation.
|
Field |
getField()
Get the field corresponding to the Widget annotation.
|
boolean |
getFitFull()
Get the fit full option being used.
|
double |
getHIconLeftOver()
Get the horizontal leftover of the icon within the annotatin.
|
int |
getHighlightingMode()
Get the HighlightingMode of the Widget Annotation.
|
int |
getIconCaptionRelation()
Get the Icon and caption relationship of the Widget annotation.
|
java.lang.String |
getMouseDownCaptionText()
Get the button down caption text of the Widget annotation.
|
Obj |
getMouseDownIcon()
Get the Mouse Down icon associated with the Widget annotation.
|
java.lang.String |
getRolloverCaptionText()
Get the roll over caption text of the Widget annotation.
|
Obj |
getRolloverIcon()
Get the rollover icon associated with the Widget annotation.
|
int |
getScaleCondition()
Get the condition under which the icon should be scaled.
|
int |
getScaleType()
Get the Scale Type of the Widget annotation.
|
java.lang.String |
getStaticCaptionText()
Get static caption text of the Widget annotation.
|
Obj |
getStaticIcon()
Get the static icon associated with the Widget annotation.
|
double |
getVIconLeftOver()
Get the vertical leftover of the icon within the annotatin.
|
void |
setAction(Action action)
Set the action of the Widget annotation
(Optional; PDF 1.2 )
|
void |
setBackgroundColor(ColorPt c,
int CompNum)
Set the background color of the Widget.
|
void |
setBorderColor(ColorPt c,
int CompNum)
Set the border color of the Widget.
|
void |
setFitFull(boolean ff)
Set the fit full option being used.
|
void |
setHIconLeftOver(double hl)
Set the horizontal leftover of the icon within the annotatin.
|
void |
setHighlightingMode(int mode)
Set the HighlightingMode of the Widget Annotation.
|
void |
setIconCaptionRelation(int icr)
Set the Icon and caption relationship of the Widget annotation.
|
void |
setMouseDownCaptionText(java.lang.String ct)
Set the button down caption text of the Widget annotation.
|
void |
setMouseDownIcon(Obj ic)
Set the Mouse Down icon associated with the Widget annotation.
|
void |
setRolloverCaptionText(java.lang.String ct)
Set the roll over caption text of the Widget annotation.
|
void |
setRolloverIcon(Obj ic)
Set the rollover icon associated with the Widget annotation.
|
void |
SetScaleCondition(int sd)
Set the condition under which the icon should be scaled.
|
void |
setScaleType(int st)
Set the Scale Type of the Widget annotation.
|
void |
setStaticCaptionText(java.lang.String ct)
Set static caption text of the Widget annotation.
|
void |
setStaticIcon(Obj ic)
Set the static icon associated with the Widget annotation.
|
void |
setVIconLeftOver(double vl)
Set the vertical leftover of the icon within the annotatin.
|
__Create, __GetHandle, __GetRefHandle, create, equals, flatten, getActiveAppearanceState, getAppearance, getAppearance, getAppearance, getBorderStyle, getColorAsCMYK, getColorAsGray, getColorAsRGB, getColorCompNum, getContents, getDate, getFlag, getOptionalContent, getPage, getRect, getRotation, getSDFObj, GetStructParent, getTriggerAction, getType, getUniqueID, getVisibleContentBox, isMarkup, isValid, refreshAppearance, removeAppearance, resize, setActiveAppearanceState, setAppearance, setAppearance, setAppearance, setBorderStyle, setColor, setContents, setDate, setFlag, setOptionalContent, setPage, setRect, setRotation, setStructParent, setUniqueID
public static final int e_none
public static final int e_invert
public static final int e_outline
public static final int e_push
public static final int e_toggle
public static final int e_Anamorphic
public static final int e_Proportional
public static final int e_NoIcon
public static final int e_NoCaption
public static final int e_CBelowI
public static final int e_CAboveI
public static final int e_CRightILeft
public static final int e_CLeftIRight
public static final int e_COverlayI
public static final int e_Always
public static final int e_WhenBigger
public static final int e_WhenSmaller
public static final int e_Never
public Widget(Obj d)
Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.
d
- the input Cos/SDF objectpublic Widget()
public Widget(Annot annot) throws PDFNetException
Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.
annot
- the annotPDFNetException
public static Widget create(Doc doc, Rect pos, Field field) throws PDFNetException
doc
- A document to which the annotation is added.pos
- A rectangle specifying the annotation's bounds, specified in
user space coordinates.field
- the fieldPDFNetException
public Field getField() throws PDFNetException
PDFNetException
public int getHighlightingMode() throws PDFNetException
Note: The annotation's highlighting mode is the visual effect that shall be used when the mouse button is pressed or held down inside its active area: e_none - No highlighting. e_invert - Invert the contents of the annotation rectangle. e_outline - Invert the annotation's border. e_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 being pushed below the surface of the page. e_toggle - Same as e_push (which is preferred). A highlighting mode other than e_push shall override any down appearance defined for the annotation. Default value: e_invert.
PDFNetException
public void setHighlightingMode(int mode) throws PDFNetException
Note: The annotation's highlighting mode is the visual effect that shall be used when the mouse button is pressed or held down inside its active area: e_none - No highlighting. e_invert - Invert the contents of the annotation rectangle. e_outline - Invert the annotation's border. e_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 being pushed below the surface of the page. e_toggle - Same as e_push (which is preferred). A highlighting mode other than e_push shall override any down appearance defined for the annotation. Default value: e_invert.
mode
- - an entry of the enum "HighlightingMode", specifying the highlighting
mode of the widget annotation.PDFNetException
public Action getAction() throws PDFNetException
PDFNetException
- * Note: The action is an action that shall be performed when the annotation is activated
public void setAction(Action action) throws PDFNetException
Note: The action is an action that shall be performed when the annotation is activated
action
- An action object representing the action of the Widget annotation.PDFNetException
public int getBorderColorCompNum() throws PDFNetException
Note: This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.
PDFNetException
public ColorPt getBorderColor() throws PDFNetException
Note: that the color can be in different color spaces: Gray, RGB, or CMYK. Call "GetBorderColorCompNum" to access the color space information corresponding to the border color.
This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.
PDFNetException
public void setBorderColor(ColorPt c, int CompNum) throws PDFNetException
Note: it is necessary to make sure the consistancy between the ColorPt type and the ColorSpace::Type value. e_device_gray corresponds to an array of two numbers; e_device_rgb corresponds to an array of 3 numbers, e_device_cmyk corresponds to an array of 4 numnbers, while e_null correspons to an arry of 0 number. Entries out of the specified color space array length will be desgarded. However, missing entries for a specified color space will throw exception either when setting the color or when later retrieving color(colorspace) information.
This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.
c
- A ColorPt object that denotes the color of the wdget border.CompNum
- An int whose value implies the color space used for the parameter c.PDFNetException
public int getBackgroundColorCompNum() throws PDFNetException
Note: This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.
PDFNetException
public ColorPt getBackgroundColor() throws PDFNetException
Note: that the color can be in different color spaces: Gray, RGB, or CMYK. Call "GetBackgroundColorCompNum" to access the color space information corresponding to the border color. This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.
PDFNetException
public void setBackgroundColor(ColorPt c, int CompNum) throws PDFNetException
Note: This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.
c
- A ColorPt object that denotes the color of the wdget background.CompNum
- An int whose value implies the color space used for the parameter c.PDFNetException
- * Note: it is necessary to make sure the consistancy between the ColorPt type and the ColorSpace::Type value. e_device_gray corresponds to an array of two numbers; e_device_rgb corresponds to an array of 3 numbers, e_device_cmyk corresponds to an array of 4 numnbers, while e_null correspons to an arry of 0 number. Entries out of the specified color space array length will be desgarded. However, missing entries for a specified color space will throw exception either when setting the color or when later retrieving color(colorspace) information.
public java.lang.String getStaticCaptionText() throws PDFNetException
Note: The static caption is the widget annotation's normal caption, which shall be displayed when it is not interacting with the user. Unlike the remaining entries with the captions, which apply only to widget annotations associated with pushbutton fields, the Static Caption(CA) entry may be used with any type of button field, including check boxes.
This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.
PDFNetException
public void setStaticCaptionText(java.lang.String ct) throws PDFNetException
Note: The static caption is the widget annotation's normal caption, which shall be displayed when it is not interacting with the user. Unlike entries "RC, AC, I, RI, IX, IF, TP", which apply only to widget annotations associated with pushbutton fields, the Static Caption(CA) entry may be used with any type of button field, including check boxes.
This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.
ct
- A string containing the static caption text of the Widget annotation.PDFNetException
public java.lang.String getRolloverCaptionText() throws PDFNetException
Note: The rollover caption shall be displayed when the user rolls the cursor into its active area without pressing the mouse button.
This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.
PDFNetException
public void setRolloverCaptionText(java.lang.String ct) throws PDFNetException
Note: The rollover caption shall be displayed when the user rolls the cursor into its active area without pressing the mouse button.
ct
- A string containing the roll over caption text of the Widget annotation.PDFNetException
public java.lang.String getMouseDownCaptionText() throws PDFNetException
Note: The button down caption shall be displayed when the mouse button is pressed within its active area.
This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.
PDFNetException
public void setMouseDownCaptionText(java.lang.String ct) throws PDFNetException
Note: The button down caption shall be displayed when the mouse button is pressed within its active area.
This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.
ct
- A string containing the button down text of the Widget annotation.PDFNetException
public Obj getStaticIcon() throws PDFNetException
Note: The static icon object is a form XObject defining the widget annotation's normal icon, which shall be displayed when it is not interacting with the user.
This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.
PDFNetException
public void setStaticIcon(Obj ic) throws PDFNetException
Note: The static icon object is a form XObject defining the widget annotation's normal icon, which shall be displayed when it is not interacting with the user.
This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.
ic
- An SDF object that represents the static icon
associated with the Widget annotation.PDFNetException
public Obj getRolloverIcon() throws PDFNetException
Note: The rollover icon object is a form XObject defining the widget annotation's rollover icon, which shall be displayed when the user rolls the cursor into its active area without pressing the mouse button.
This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.
PDFNetException
public void setRolloverIcon(Obj ic) throws PDFNetException
Note: The rollover icon object is a form XObject defining the widget annotation's rollover icon, which shall be displayed when the user rolls the cursor into its active area without pressing the mouse button.
This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.
ic
- An SDF object that represents the rollover icon
associated with the Widget annotation.PDFNetException
public Obj getMouseDownIcon() throws PDFNetException
Note: The Mouse Down icon object is a form XObject defining the widget annotation's alternate (down) icon, which shall be displayed when the mouse button is pressed within its active area.
This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.
PDFNetException
public void setMouseDownIcon(Obj ic) throws PDFNetException
Note: The Mouse Down icon object is a form XObject defining the widget annotation's alternate (down) icon, which shall be displayed when the mouse button is pressed within its active area.
This property is part of the Widget appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.
ic
- An SDF object that represents the Mouse Down icon
associated with the Widget annotation.PDFNetException
public int getScaleType() throws PDFNetException
Note: The type of scaling that shall be used: e_Anamorphic - Anamorphic scaling: Scale the icon to fill the annotation rectangle exactly, without regard to its original aspect ratio (ratio of width to height). e_Proportional - Proportional scaling: Scale the icon to fit the width or height of the annotation rectangle while maintaining the icon's original aspect ratio. If the required horizontal and vertical scaling factors are different, use the smaller of the two, centering the icon within the annotation rectangle in the other dimension. Default value: P.
This property is part of the Icon Fit dictionary, where the Icon Fit dictionary specifys how to display the button's icon within the annotation rectangle of its widget annotation(Optional; pushbutton fields only) If present, the icon fit dictionary shall apply to all of the annotation's icons (normal, rollover, and alternate).
PDFNetException
public void setScaleType(int st) throws PDFNetException
Note: The type of scaling that shall be used: e_Anamorphic - Anamorphic scaling: Scale the icon to fill the annotation rectangle exactly, without regard to its original aspect ratio (ratio of width to height). e_Proportional - Proportional scaling: Scale the icon to fit the width or height of the annotation rectangle while maintaining the icon's original aspect ratio. If the required horizontal and vertical scaling factors are different, use the smaller of the two, centering the icon within the annotation rectangle in the other dimension. Default value: P.
This property is part of the Icon Fit dictionary, where the Icon Fit dictionary specifys how to display the button's icon within the annotation rectangle of its widget annotation(Optional; pushbutton fields only) If present, the icon fit dictionary shall apply to all of the annotation's icons (normal, rollover, and alternate).
st
- - an entry of the "ScaleType" enum which represents the
Scale Type of the Widget annotation.PDFNetException
public int getIconCaptionRelation() throws PDFNetException
Note: the IconCaptionRelation entry indicates where to position the text of the widget annotation's caption relative to its icon, the options are as follows: e_NoIcon - No icon; caption only e_NoCaption - No caption; icon only e_CBelowI - Caption below the icon e_CAboveI - Caption above the icon e_CRightILeft - Caption to the right of the icon e_CLeftIRight - Caption to the left of the icon e_CoverlayI - Caption overlaid directly on the icon Default value: e_NoIcon.
PDFNetException
public void setIconCaptionRelation(int icr) throws PDFNetException
Note: the IconCaptionRelation entry indicates where to position the text of the widget annotation's caption relative to its icon. The options are as follows: e_NoIcon - No icon; caption only e_NoCaption - No caption; icon only e_CBelowI - Caption below the icon e_CAboveI - Caption above the icon e_CRightILeft - Caption to the right of the icon e_CLeftIRight - Caption to the left of the icon e_CoverlayI - Caption overlaid directly on the icon Default value: e_NoIcon.
icr
- An entry of the "IconCaptionRelation" enum which
represents the relationship between the icon and the caption of the
Widget annotation.PDFNetException
public int getScaleCondition() throws PDFNetException
Note: the ScaleCondition spedifies the circumstances under which the icon shall be scaled inside the annotation rectangle. The options are as follows: e_Always - Always scale. e_WhenBigger - Scale only when the icon is bigger than the annotation rectangle. e_WhenSmaller - Scale only when the icon is smaller than the annotation rectangle. e_Never - Never scale. Default value: e_Always.
This property is part of the Icon Fit dictionary, where the Icon Fit dictionary specifys how to display the button's icon within the annotation rectangle of its widget annotation(Optional; pushbutton fields only) If present, the icon fit dictionary shall apply to all of the annotation's icons (normal, rollover, and alternate).
PDFNetException
public void SetScaleCondition(int sd) throws PDFNetException
Note: the ScaleCondition spedifies the circumstances under which the icon shall be scaled inside the annotation rectangle. The options are as follows: e_Always - Always scale. e_WhenBigger - Scale only when the icon is bigger than the annotation rectangle. e_WhenSmaller - Scale only when the icon is smaller than the annotation rectangle. e_Never - Never scale. Default value: e_Always.
This property is part of the Icon Fit dictionary, where the Icon Fit dictionary specifys how to display the button's icon within the annotation rectangle of its widget annotation(Optional; pushbutton fields only) If present, the icon fit dictionary shall apply to all of the annotation's icons (normal, rollover, and alternate).
sd
- An entry of the "ScaleCondition" enum which the icon should
be scaled.PDFNetException
public double getHIconLeftOver() throws PDFNetException
Note: the horizontal leftover is a number that shall be between 0.0 and 1.0 indicating the fraction of leftover space to allocate at the left. A value of 0.0 shall position the icon at the left of the annotation rectangle. A value of 0.5 shall center it in the horizontal direction within the rectangle. This entry shall be used only if the icon is scaled proportionally. Default value: 0.5.
PDFNetException
public void setHIconLeftOver(double hl) throws PDFNetException
Note: the horizontal leftover is a number that shall be between 0.0 and 1.0 indicating the fraction of leftover space to allocate at the left. A value of 0.0 shall position the icon at the left of the annotation rectangle. A value of 0.5 shall center it in the horizontal direction within the rectangle. This entry shall be used only if the icon is scaled proportionally. Default value: 0.5.
hl
- A number indicating the horizontal
leftover of the icon within the annotation.PDFNetException
public double getVIconLeftOver() throws PDFNetException
Note: the vertical leftover is a number that shall be between 0.0 and 1.0 indicating the fraction of leftover space to allocate at the bottom of the icon. A value of 0.0 shall position the icon at the bottom of the annotation rectangle. A value of 0.5 shall center it in the vertical direction within the rectangle. This entry shall be used only if the icon is scaled proportionally. Default value: 0.5.
PDFNetException
public void setVIconLeftOver(double vl) throws PDFNetException
Note: the vertical leftover is a number that shall be between 0.0 and 1.0 indicating the fraction of leftover space to allocate at the bottom of the icon. A value of 0.0 shall position the icon at the bottom of the annotation rectangle. A value of 0.5 shall center it in the vertical direction within the rectangle. This entry shall be used only if the icon is scaled proportionally. Default value: 0.5.
vl
- A number indicating the vertical
leftover of the icon within the annotation.PDFNetException
public boolean getFitFull() throws PDFNetException
Note: the FitFull value, if true, indicates that the button appearance shall be scaled to fit fully within the bounds of the annotation without taking into consideration the line width of the border. Default value: false.
PDFNetException
public void setFitFull(boolean ff) throws PDFNetException
Note: the FitFull value, if true, indicates that the button appearance shall be scaled to fit fully within the bounds of the annotation without taking into consideration the line width of the border. Default value: false.
ff
- A boolean value indicating the fit full option being used.PDFNetException