public class Line extends Markup
Line
represents the line annotation.
It offers specific properties get/set method for line annotation.
Before call all methods in this class,
please note to call
at first.PDFPage.loadAnnots()
Annot.Border, Annot.QuadpointsF
INTENTNAME_FREETEXT_CALLOUT, INTENTNAME_FREETEXT_TYPEWRITER, INTENTNAME_LINE_ARROW, INTENTNAME_LINE_DIMENSION, INTENTNAME_POLYGON_CLOUD, INTENTNAME_POLYGON_DIMENSION, INTENTNAME_POLYLINE_DIMENSION, LINEENDINGSTYLE_BUTT, LINEENDINGSTYLE_CIRCLE, LINEENDINGSTYLE_CLOSEDARROW, LINEENDINGSTYLE_DIAMOND, LINEENDINGSTYLE_NONE, LINEENDINGSTYLE_OPENARROW, LINEENDINGSTYLE_REVERSECLOSEDARROW, LINEENDINGSTYLE_REVERSEOPENARROW, LINEENDINGSTYLE_SLASH, LINEENDINGSTYLE_SQUARE, STATE_MARKED_MARKED, STATE_MARKED_UNMARKED, STATE_REVIEW_ACCEPTED, STATE_REVIEW_CANCELLED, STATE_REVIEW_COMPLETED, STATE_REVIEW_NONE, STATE_REVIEW_REJECTED, STATEMODEL_MARKED, STATEMODEL_REVIEW
BORDERSTYLE_BEVELED, BORDERSTYLE_CLOUDY, BORDERSTYLE_DASHED, BORDERSTYLE_INSET, BORDERSTYLE_SOLID, BORDERSTYLE_UNDERLINE, FLAG_HIDDEN, FLAG_INVISIBLE, FLAG_LOCKED, FLAG_LOCKEDCONTENTS, FLAG_NOROTATE, FLAG_NOVIEW, FLAG_NOZOOM, FLAG_PRINT, FLAG_READONLY, FLAG_TOGGLENOVIEW, HIGHLIGHTINGMODE_INVERT, HIGHLIGHTINGMODE_NONE, HIGHLIGHTINGMODE_OUTLINE, HIGHLIGHTINGMODE_PUSH, HIGHLIGHTINGMODE_TOGGLE, MKENTRY_BACKGROUNDCOLOR, MKENTRY_BORDERCOLOR, MKENTRY_DOWNCAPTION, MKENTRY_DOWNICON, MKENTRY_ICONFIT, MKENTRY_NORMALCAPTION, MKENTRY_NORMALICON, MKENTRY_ROLLOVERCAPTION, MKENTRY_ROLLOVERICON, MKENTRY_ROTATION, MKENTRY_TEXTPOSITION, TRIGGER_ANNOT_CE, TRIGGER_ANNOT_CX, TRIGGER_ANNOT_FL, TRIGGER_ANNOT_FO, TRIGGER_ANNOT_MD, TRIGGER_ANNOT_MU, TRIGGER_ANNOT_PC, TRIGGER_ANNOT_PI, TRIGGER_ANNOT_PO, TRIGGER_ANNOT_PV, TYPE_3D, TYPE_CARET, TYPE_CIRCLE, TYPE_FILEATTACHMENT, TYPE_FREETEXT, TYPE_HIGHLIGHT, TYPE_INK, TYPE_LINE, TYPE_LINK, TYPE_MOVIE, TYPE_POLYGON, TYPE_POLYLINE, TYPE_POPUP, TYPE_PRINTERMARK, TYPE_PSI, TYPE_SCREEN, TYPE_SOUND, TYPE_SQUARE, TYPE_SQUIGGLY, TYPE_STAMP, TYPE_STRIKEOUT, TYPE_TEXT, TYPE_TRAPNET, TYPE_UNDERLINE, TYPE_WATERMARK, TYPE_WIDGET
Modifier and Type | Method and Description |
---|---|
float[] |
getCaptionOffset()
Get caption offset of current line annotation.
|
java.lang.String |
getCaptionPosition()
Get caption position of current line annotation.
|
float |
getLeaderLineExtension()
Get leader line extension of current line annotation.
|
float |
getLeaderLineLength()
Get leader line length of current line annotation.
|
float |
getLeaderLineOffset()
Get leader line offset of current line annotation.
|
java.lang.String[] |
getLineEndingStyles()
Get line ending styles of current line annotation.
|
java.awt.geom.Point2D.Float[] |
getLinePosition()
Get line position of current line annotation.
|
Popup |
getPopup()
Get the associated popup annotation of current line annotation.
|
boolean |
hasCaptionContents()
Checks if there's a caption to current line annotation.
|
void |
resetAppearance()
Reset(regenerate) appearance of current line annotation.
|
void |
setCaptionOffset(float offsetX,
float offsetY)
Set caption offset of current line annotation.
|
void |
setCaptionPosition(java.lang.String captionPos)
Set caption position of current line annotation.
|
void |
setCaptionVisibility(boolean isVisible)
Set flag which decides whether to set a caption to the annotation or not.
|
void |
setLeaderLineExtension(float extLength)
Set leader line extension of current line annotation.
|
void |
setLeaderLineLength(float length)
Set leader line length of current line annotation.
|
void |
setLeaderLineOffset(float offset)
Set leader line offset of current line annotation.
|
void |
setLineEndingStyle(java.lang.String startingStyle,
java.lang.String endingStyle)
Set line ending styles of current line annotation.
|
void |
setLinePosition(java.awt.geom.Point2D.Float start,
java.awt.geom.Point2D.Float end)
Set line position of current line annotation.
|
addState, countReplies, countStateAnnots, getCreationDateTime, getGroupElements, getGroupHeader, getIntent, getOpacity, getReply, getState, getStateAnnot, getSubject, getTitle, insertReply, isGrouped, isTextMarkup, removeAllReplies, removeAllStates, removeReply, setCreationDateTime, setGroup, setIntent, setOpacity, setState, setSubject, setTitle, unGroup
getBorder, getBorderColor, getContents, getDeviceRect, getFlags, getHandle, getIndex, getModifiedDateTime, getName, getRect, getType, isMarkup, move, setBorder, setBorderColor, setContents, setFlags, setIconProvider, setModifiedDateTime, setName
public java.lang.String[] getLineEndingStyles() throws PDFException
String
objects array with two elements that receives values
of line ending style property. The first element is the value of
starting style property, and the second element is the value of
ending style property. LINEENDINGSTYLE_XXX
and each of the two
elements should be one of these constants. null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
Markup
public void setLineEndingStyle(java.lang.String startingStyle, java.lang.String endingStyle) throws PDFException
startingStyle
- A String
object that specifies value of starting
property. Please refer to constants definitions
LINEENDINGSTYLE_XXX
and this should be one of these constants.endingStyle
- A String
object that specifies value of ending
property. Please refer to constants definitions
LINEENDINGSTYLE_XXX
and this should be one of these constants.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public java.awt.geom.Point2D.Float[] getLinePosition() throws PDFException
Point2D.Float
objects array with two elements that receives the
line points. The first element is the value of starting point,
and the second element is the value of ending point.null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setLinePosition(java.awt.geom.Point2D.Float start, java.awt.geom.Point2D.Float end) throws PDFException
start
- A Point2D.Float
object that specified the new starting
point.end
- A Point2D.Float
object that specified the new ending
point.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public float getLeaderLineLength() throws PDFException
The length of leader lines in PDF page coordination extends from each end point of the line perpendicular to the line itself. A positive value means that the leader lines appear in the direction that is clockwise when traversing the line from its starting point to its ending point, while a negative value indicates the opposite direction.
float
value that represents the leader line length.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setLeaderLineLength(float length) throws PDFException
The length of leader lines in PDF page coordination extends from each end point of the line perpendicular to the line itself. A positive value means that the leader lines appear in the direction that is clockwise when traversing the line from its starting point to its ending point, while a negative value indicates the opposite direction.
length
- A float
value that represents the leader line length.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public float getLeaderLineExtension() throws PDFException
float
value that represents the leader line extension.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setLeaderLineExtension(float extLength) throws PDFException
extLength
- A float
value to specify new value of leader line extension
property.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public float getLeaderLineOffset() throws PDFException
float
value that represents the leader line offset.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setLeaderLineOffset(float offset) throws PDFException
offset
- A float
value to specify new value of leader line offset
property.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public boolean hasCaptionContents() throws PDFException
boolean
value that specifies whether there's a caption to line
annotation or not.false
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setCaptionVisibility(boolean isVisible) throws PDFException
isVisible
- A boolean
value that specifies whether to set a caption to the
annotation or not.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public java.lang.String getCaptionPosition() throws PDFException
Caption position is meaningful only when key "Cap" is true, which can be
checked by function
. Valid values for
caption position are:hasCaptionContents()
String
object that receives the value of caption
position.null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setCaptionPosition(java.lang.String captionPos) throws PDFException
Caption position is meaningful only when key "Cap" is true, which can be
checked by function
. Valid values for
caption position are:hasCaptionContents()
captionPos
- A String
object that specifies the value of
caption position.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public float[] getCaptionOffset() throws PDFException
float
array with two elements that receives both
horizontal and vertical offset along annotation line from its
midpoint.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setCaptionOffset(float offsetX, float offsetY) throws PDFException
Caption offset is the offset of caption from its normal position. It is
meaningful only when key "Cap" is true, which can be checked by function
hasCaptionContents
. Value of horizontal offset:
offsetX
- A float
value that specifies the new horizontal
offset along the annotation line from its midpoint. offsetY
- A float
value that specifies the new vertical
offset perpendicular to the annotation line. PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void resetAppearance() throws PDFException
PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public Popup getPopup() throws PDFException
Popup
object that receives the popup annotation.
If no popup annotation is found, this function will return null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
Popup