org.icepdf.core.pobjects.annotations
Class LineAnnotation

java.lang.Object
  extended by org.icepdf.core.pobjects.Dictionary
      extended by org.icepdf.core.pobjects.annotations.Annotation
          extended by org.icepdf.core.pobjects.annotations.MarkupAnnotation
              extended by org.icepdf.core.pobjects.annotations.LineAnnotation

public class LineAnnotation
extends MarkupAnnotation

The purpose of a line annotation (PDF 1.3) is to display a single straight line on the page. When opened, it shall display a pop-up window containing the text of the associated note. Table 175 shows the annotation dictionary entries specific to this type of annotation.

Since:
5.0

Field Summary
static Name CAP_KEY
          (Optional; PDF 1.6) If true, the text specified by the Contents or RC entries shall be replicated as a caption in the appearance of the line, as shown in Figure 61 and Figure 62.
static Name CO_KEY
          (Optional; meaningful only if Cap is true; PDF 1.7) An array of two numbers that shall specify the offset of the caption text from its normal position.
static Name CP_KEY
          (Optional; meaningful only if Cap is true; PDF 1.7) A name describing the annotation’s caption positioning.
protected  Name endArrow
           
protected  java.awt.geom.Point2D endOfLine
           
static Name IC_KEY
          (Optional; PDF 1.4) An array of numbers in the range 0.0 to 1.0 specifying the interior color that shall be used to fill the annotation’s line endings (see Table 176).
protected  java.awt.Color interiorColor
           
static Name L_KEY
          (Required) An array of four numbers, [x1 y1 x2 y2], specifying the starting and ending coordinates of the line in default user space.
static Name LE_KEY
          (Optional; PDF 1.4) An array of two names specifying the line ending styles that shall be used in drawing the line.
static Name LINE_END_CIRCLE
          A diamond shape filled with the annotation’s interior color, if any
static Name LINE_END_CLOSED_ARROW
          No line ending
static Name LINE_END_DIAMOND
          Two short lines meeting in an acute angle to form an open arrowhead
static Name LINE_END_NONE
          A square filled with the annotation’s interior color, if any
static Name LINE_END_OPEN_ARROW
          Two short lines meeting in an acute angle as in the OpenArrow style and connected by a third line to form a triangular closed arrowhead filled with the annotation’s interior color, if any
static Name LINE_END_SQUARE
          A circle filled with the annotation’s interior color, if any
static Name LL_KEY
          (Required if LLE is present, otherwise optional; PDF 1.6) The length of leader lines in default user space that extend from each endpoint of the line perpendicular to the line itself, as shown in Figure 60.
static Name LLE_KEY
          (Optional; PDF 1.6) A non-negative number that shall represents the length of leader line extensions that extend from the line proper 180 degrees from the leader lines, as shown in Figure 60.
static Name LLO_KEY
          (Optional; PDF 1.7) A non-negative number that shall represent the length of the leader line offset, which is the amount of empty space between the endpoints of the annotation and the beginning of the leader lines.
static Name MEASURE_KEY
          (Optional; PDF 1.7) A measure dictionary (see Table 261) that shall specify the scale and units that apply to the line annotation.
protected  Name startArrow
           
protected  java.awt.geom.Point2D startOfLine
           
 
Fields inherited from class org.icepdf.core.pobjects.annotations.MarkupAnnotation
CA_KEY, CREATION_DATE_KEY, creationDate, EX_DATA_KEY, inReplyToAnnotation, intent, IRT_KEY, IT_KEY, opacity, POPUP_KEY, popupAnnotation, RC_KEY, replyToRelation, richText, RT_KEY, SUBJ_KEY, subject, T_KEY, titleText
 
Fields inherited from class org.icepdf.core.pobjects.annotations.Annotation
ACTION_KEY, APPEARANCE_STATE_KEY, APPEARANCE_STREAM_DOWN_KEY, APPEARANCE_STREAM_KEY, APPEARANCE_STREAM_NORMAL_KEY, APPEARANCE_STREAM_ROLLOVER_KEY, bbox, BBOX_VALUE, border, BORDER_DASH, BORDER_HORIZONTAL_CORNER_RADIUS, BORDER_KEY, BORDER_STYLE_KEY, BORDER_VERTICAL_CORNER_RADIUS, BORDER_WIDTH, borderStyle, canDrawBorder, color, COLOR_KEY, compressAppearanceStream, content, CONTENTS_KEY, FLAG_HIDDEN, FLAG_INVISIBLE, FLAG_KEY, FLAG_LOCKED, FLAG_LOCKED_CONTENTS, FLAG_NO_ROTATE, FLAG_NO_VIEW, FLAG_NO_ZOOM, FLAG_PRINT, FLAG_READ_ONLY, FLAG_TOGGLE_NO_VIEW, hasBlendingMode, INVISIBLE_RECTANGLE, M_KEY, matrix, modifiedDate, NM_KEY, PARENT_KEY, PARENT_PAGE_KEY, RECTANGLE_KEY, RESOURCES_VALUE, securityManager, shapes, subtype, SUBTYPE_CIRCLE, SUBTYPE_FREE_TEXT, SUBTYPE_HIGHLIGHT, SUBTYPE_INK, SUBTYPE_LINE, SUBTYPE_LINK, SUBTYPE_POLYGON, SUBTYPE_POLYLINE, SUBTYPE_POPUP, SUBTYPE_SQUARE, SUBTYPE_TEXT, SUBTYPE_WIDGET, TYPE, TYPE_VALUE, userSpaceRectangle, VISIBLE_RECTANGLE
 
Fields inherited from class org.icepdf.core.pobjects.Dictionary
entries, FORM_TYPE_KEY, inited, isDeleted, isNew, LENGTH_KEY, library, SUBTYPE_KEY, TYPE_KEY
 
Constructor Summary
LineAnnotation(Library l, java.util.HashMap h)
           
 
Method Summary
static void circleDrawOps(Shapes shapes, java.awt.geom.AffineTransform at, java.awt.geom.Point2D point, java.awt.geom.Point2D start, java.awt.geom.Point2D end, java.awt.Color lineColor, java.awt.Color internalColor)
           
static void closedArrowEndDrawOps(Shapes shapes, java.awt.geom.AffineTransform at, java.awt.geom.Point2D start, java.awt.geom.Point2D end, java.awt.Color lineColor, java.awt.Color internalColor)
           
static void closedArrowStartDrawOps(Shapes shapes, java.awt.geom.AffineTransform at, java.awt.geom.Point2D start, java.awt.geom.Point2D end, java.awt.Color lineColor, java.awt.Color internalColor)
           
static void diamondDrawOps(Shapes shapes, java.awt.geom.AffineTransform at, java.awt.geom.Point2D point, java.awt.geom.Point2D start, java.awt.geom.Point2D end, java.awt.Color lineColor, java.awt.Color internalColor)
           
static void drawLineEnd(java.awt.Graphics2D g, Name lineEnding, java.awt.geom.Point2D startOfLine, java.awt.geom.Point2D endOfLine, java.awt.Color lineColor, java.awt.Color interiorColor)
           
static void drawLineStart(java.awt.Graphics2D g, Name lineEnding, java.awt.geom.Point2D startOfLine, java.awt.geom.Point2D endOfLine, java.awt.Color lineColor, java.awt.Color interiorColor)
           
 Name getEndArrow()
           
 java.awt.geom.Point2D getEndOfLine()
           
static LineAnnotation getInstance(Library library, java.awt.Rectangle rect)
          Gets an instance of a LineAnnotation that has valid Object Reference.
 java.awt.Color getInteriorColor()
           
static java.util.logging.Logger getLogger()
           
 Name getStartArrow()
           
 java.awt.geom.Point2D getStartOfLine()
           
 void init()
          Initiate the Dictionary.
static void openArrowEndDrawOps(Shapes shapes, java.awt.geom.AffineTransform at, java.awt.geom.Point2D start, java.awt.geom.Point2D end, java.awt.Color lineColor, java.awt.Color internalColor)
           
static void openArrowStartDrawOps(Shapes shapes, java.awt.geom.AffineTransform at, java.awt.geom.Point2D start, java.awt.geom.Point2D end, java.awt.Color lineColor, java.awt.Color internalColor)
           
 void resetAppearanceStream(double dx, double dy, java.awt.geom.AffineTransform pageTransform)
          Resets the annotations appearance stream.
 void setEndArrow(Name endArrow)
           
 void setEndOfLine(java.awt.geom.Point2D endOfLine)
           
 void setInteriorColor(java.awt.Color interiorColor)
           
 void setStartArrow(Name startArrow)
           
 void setStartOfLine(java.awt.geom.Point2D startOfLine)
           
static void squareDrawOps(Shapes shapes, java.awt.geom.AffineTransform at, java.awt.geom.Point2D point, java.awt.geom.Point2D start, java.awt.geom.Point2D end, java.awt.Color lineColor, java.awt.Color internalColor)
           
 
Methods inherited from class org.icepdf.core.pobjects.annotations.MarkupAnnotation
getCreationDate, getInReplyToAnnotation, getIntent, getOpacity, getPopupAnnotation, getReplyToRelation, getRichText, getSubject, getTitleText, setCreationDate, setInReplyToAnnotation, setPopupAnnotation, setRichText, setSubject, setTitleText, toString
 
Methods inherited from class org.icepdf.core.pobjects.annotations.Annotation
addAction, allowAlterProperties, allowPrintNormalMode, allowScreenDownMode, allowScreenNormalMode, allowScreenOrPrintRenderingOrInteraction, allowScreenRolloverMode, buildAnnotation, deleteAction, deriveDrawingRectangle, getAction, getAppearanceStream, getBbox, getBorder, getBorderStyle, getBorderStyleStroke, getBorderType, getColor, getContents, getFlagHidden, getFlagInvisible, getFlagLocked, getFlagLockedContents, getFlagNoRotate, getFlagNoView, getFlagNoZoom, getFlagPrint, getFlagReadOnly, getFlagToggleNoView, getLineStyle, getLineThickness, getPage, getParentAnnotation, getShapes, getSubType, getUserSpaceRectangle, hasAppearanceStream, isBorder, isSupportedAnnotationType, render, renderAppearanceStream, renderBorder, renderBorderTabSelected, resetAppearanceStream, setBBox, setBorderStyle, setColor, setCompressAppearanceStream, setContents, setFlag, setModifiedDate, setSubtype, setUserSpaceRectangle, syncBBoxToUserSpaceRectangle, updateAction
 
Methods inherited from class org.icepdf.core.pobjects.Dictionary
getEntries, getFloat, getInt, getLibrary, getNumber, getObject, getPObjectReference, isDeleted, isNew, setDeleted, setNew, setPObjectReference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

L_KEY

public static final Name L_KEY
(Required) An array of four numbers, [x1 y1 x2 y2], specifying the starting and ending coordinates of the line in default user space.

If the LL entry is present, this value shall represent the endpoints of the leader lines rather than the endpoints of the line itself; see Figure 60.


LE_KEY

public static final Name LE_KEY
(Optional; PDF 1.4) An array of two names specifying the line ending styles that shall be used in drawing the line. The first and second elements of the array shall specify the line ending styles for the endpoints defined, respectively, by the first and second pairs of coordinates, (x1, y1) and (x2, y2), in the L array. Table 176 shows the possible values.

Default value: [/None /None].


LL_KEY

public static final Name LL_KEY
(Required if LLE is present, otherwise optional; PDF 1.6) The length of leader lines in default user space that extend from each endpoint of the line perpendicular to the line itself, as shown in Figure 60. A positive value shall mean that the leader lines appear in the direction that is clockwise when traversing the line from its starting point to its ending point (as specified by L); a negative value shall indicate the opposite direction.

Default value: 0 (no leader lines).


LLE_KEY

public static final Name LLE_KEY
(Optional; PDF 1.6) A non-negative number that shall represents the length of leader line extensions that extend from the line proper 180 degrees from the leader lines, as shown in Figure 60.

Default value: 0 (no leader line extensions).


IC_KEY

public static final Name IC_KEY
(Optional; PDF 1.4) An array of numbers in the range 0.0 to 1.0 specifying the interior color that shall be used to fill the annotation’s line endings (see Table 176). The number of array elements shall determine the colour space in which the colour is defined: 0 - No colour; transparent 1 - DeviceGray 3 - DeviceRGB 4 - DeviceCMYK


CAP_KEY

public static final Name CAP_KEY
(Optional; PDF 1.6) If true, the text specified by the Contents or RC entries shall be replicated as a caption in the appearance of the line, as shown in Figure 61 and Figure 62. The text shall be rendered in a manner appropriate to the content, taking into account factors such as writing direction.

Default value: false.


LLO_KEY

public static final Name LLO_KEY
(Optional; PDF 1.7) A non-negative number that shall represent the length of the leader line offset, which is the amount of empty space between the endpoints of the annotation and the beginning of the leader lines.


CP_KEY

public static final Name CP_KEY
(Optional; meaningful only if Cap is true; PDF 1.7) A name describing the annotation’s caption positioning. Valid values are Inline, meaning the caption shall be centered inside the line, and Top, meaning the caption shall be on top of the line.

Default value: Inline


MEASURE_KEY

public static final Name MEASURE_KEY
(Optional; PDF 1.7) A measure dictionary (see Table 261) that shall specify the scale and units that apply to the line annotation.


CO_KEY

public static final Name CO_KEY
(Optional; meaningful only if Cap is true; PDF 1.7) An array of two numbers that shall specify the offset of the caption text from its normal position. The first value shall be the horizontal offset along the annotation line from its midpoint, with a positive value indicating offset to the right and a negative value indicating offset to the left. The second value shall be the vertical offset perpendicular to the annotation line, with a positive value indicating a shift up and a negative value indicating a shift down.

Default value: [0, 0] (no offset from normal positioning)


LINE_END_NONE

public static final Name LINE_END_NONE
A square filled with the annotation’s interior color, if any


LINE_END_SQUARE

public static final Name LINE_END_SQUARE
A circle filled with the annotation’s interior color, if any


LINE_END_CIRCLE

public static final Name LINE_END_CIRCLE
A diamond shape filled with the annotation’s interior color, if any


LINE_END_DIAMOND

public static final Name LINE_END_DIAMOND
Two short lines meeting in an acute angle to form an open arrowhead


LINE_END_OPEN_ARROW

public static final Name LINE_END_OPEN_ARROW
Two short lines meeting in an acute angle as in the OpenArrow style and connected by a third line to form a triangular closed arrowhead filled with the annotation’s interior color, if any


LINE_END_CLOSED_ARROW

public static final Name LINE_END_CLOSED_ARROW
No line ending


startOfLine

protected java.awt.geom.Point2D startOfLine

endOfLine

protected java.awt.geom.Point2D endOfLine

interiorColor

protected java.awt.Color interiorColor

startArrow

protected Name startArrow

endArrow

protected Name endArrow
Constructor Detail

LineAnnotation

public LineAnnotation(Library l,
                      java.util.HashMap h)
Method Detail

init

public void init()
Description copied from class: Dictionary
Initiate the Dictionary. Retrieve any needed attributes.

Overrides:
init in class MarkupAnnotation

getInstance

public static LineAnnotation getInstance(Library library,
                                         java.awt.Rectangle rect)
Gets an instance of a LineAnnotation that has valid Object Reference.

Parameters:
library - document library
rect - bounding rectangle in user space
Returns:
new LineAnnotation Instance.

resetAppearanceStream

public void resetAppearanceStream(double dx,
                                  double dy,
                                  java.awt.geom.AffineTransform pageTransform)
Resets the annotations appearance stream.

Specified by:
resetAppearanceStream in class Annotation

getLogger

public static java.util.logging.Logger getLogger()

getStartOfLine

public java.awt.geom.Point2D getStartOfLine()

getEndOfLine

public java.awt.geom.Point2D getEndOfLine()

getInteriorColor

public java.awt.Color getInteriorColor()

getStartArrow

public Name getStartArrow()

getEndArrow

public Name getEndArrow()

setStartOfLine

public void setStartOfLine(java.awt.geom.Point2D startOfLine)

setEndArrow

public void setEndArrow(Name endArrow)

setStartArrow

public void setStartArrow(Name startArrow)

setInteriorColor

public void setInteriorColor(java.awt.Color interiorColor)

setEndOfLine

public void setEndOfLine(java.awt.geom.Point2D endOfLine)

drawLineStart

public static void drawLineStart(java.awt.Graphics2D g,
                                 Name lineEnding,
                                 java.awt.geom.Point2D startOfLine,
                                 java.awt.geom.Point2D endOfLine,
                                 java.awt.Color lineColor,
                                 java.awt.Color interiorColor)

drawLineEnd

public static void drawLineEnd(java.awt.Graphics2D g,
                               Name lineEnding,
                               java.awt.geom.Point2D startOfLine,
                               java.awt.geom.Point2D endOfLine,
                               java.awt.Color lineColor,
                               java.awt.Color interiorColor)

circleDrawOps

public static void circleDrawOps(Shapes shapes,
                                 java.awt.geom.AffineTransform at,
                                 java.awt.geom.Point2D point,
                                 java.awt.geom.Point2D start,
                                 java.awt.geom.Point2D end,
                                 java.awt.Color lineColor,
                                 java.awt.Color internalColor)

diamondDrawOps

public static void diamondDrawOps(Shapes shapes,
                                  java.awt.geom.AffineTransform at,
                                  java.awt.geom.Point2D point,
                                  java.awt.geom.Point2D start,
                                  java.awt.geom.Point2D end,
                                  java.awt.Color lineColor,
                                  java.awt.Color internalColor)

squareDrawOps

public static void squareDrawOps(Shapes shapes,
                                 java.awt.geom.AffineTransform at,
                                 java.awt.geom.Point2D point,
                                 java.awt.geom.Point2D start,
                                 java.awt.geom.Point2D end,
                                 java.awt.Color lineColor,
                                 java.awt.Color internalColor)

openArrowEndDrawOps

public static void openArrowEndDrawOps(Shapes shapes,
                                       java.awt.geom.AffineTransform at,
                                       java.awt.geom.Point2D start,
                                       java.awt.geom.Point2D end,
                                       java.awt.Color lineColor,
                                       java.awt.Color internalColor)

openArrowStartDrawOps

public static void openArrowStartDrawOps(Shapes shapes,
                                         java.awt.geom.AffineTransform at,
                                         java.awt.geom.Point2D start,
                                         java.awt.geom.Point2D end,
                                         java.awt.Color lineColor,
                                         java.awt.Color internalColor)

closedArrowStartDrawOps

public static void closedArrowStartDrawOps(Shapes shapes,
                                           java.awt.geom.AffineTransform at,
                                           java.awt.geom.Point2D start,
                                           java.awt.geom.Point2D end,
                                           java.awt.Color lineColor,
                                           java.awt.Color internalColor)

closedArrowEndDrawOps

public static void closedArrowEndDrawOps(Shapes shapes,
                                         java.awt.geom.AffineTransform at,
                                         java.awt.geom.Point2D start,
                                         java.awt.geom.Point2D end,
                                         java.awt.Color lineColor,
                                         java.awt.Color internalColor)