com.qoppa.pdf.annotations
Class Ink

java.lang.Object
  extended bycom.qoppa.pdf.annotations.Annotation
      extended bycom.qoppa.pdf.annotations.ShapeAnnotation
          extended bycom.qoppa.pdf.annotations.Ink

public class Ink
extends ShapeAnnotation

Class representing an Ink annotation in a PDF document. Ink annotation consist of a list of x,y coordinates that are connected using lines when displayed. The annotation can be double-clicked to display its content.

Author:
Qoppa Software

Field Summary
 
Fields inherited from class com.qoppa.pdf.annotations.ShapeAnnotation
LE_CIRCLE, LE_CIRCLE_STR, LE_CLOSEDARROW, LE_CLOSEDARROW_STR, LE_DIAMOND, LE_DIAMOND_STR, LE_NONE, LE_NONE_STR, LE_OPENARROW, LE_OPENARROW_STR, LE_SQUARE, LE_SQUARE_STR
 
Fields inherited from class com.qoppa.pdf.annotations.Annotation
BORDERSTYLE_BEVELED, BORDERSTYLE_DASHED, BORDERSTYLE_INSETS, BORDERSTYLE_SOLID, BORDERSTYLE_UNDERLINE, FLAGS_HIDDEN, FLAGS_INVISIBLE, FLAGS_LOCKED, FLAGS_NOROTATE, FLAGS_NOVIEW, FLAGS_NOZOOM, FLAGS_PRINTABLE, FLAGS_READONLY
 
Constructor Summary
Ink(String contents)
          Constructs and Ink annotation with no lines.
Ink(String contents, Vector polyLines)
          Constructs and Ink annotation.
 
Method Summary
 Vector addPolyline()
          Creates a new line and returns it to the calling function.
 JComponent createComponent(Point2D cropOrigin, IPDFActionHandler actionHandler)
          Creates a JComponent object capable of displaying this annotation.
 Vector getPolylines()
          Returns a list of polylines.
 String getSubtype()
          Returns this annotations subtype: "Ink"
 void revalidate()
          Revalidate the shape drawn by this annotation.
 void revalidateRectangle()
           
 void shiftRectangle(double deltaX, double deltaY)
           
 
Methods inherited from class com.qoppa.pdf.annotations.ShapeAnnotation
getBorderWidth, getContents, getInternalColor, getStroke, paintImpl, setBorderWidth, setContents, setInternalColor, setRectangle, setStroke
 
Methods inherited from class com.qoppa.pdf.annotations.Annotation
getActions, getAppearStream, getBorderStyle, getColor, getComponent, getCreationDate, getCreator, getFlags, getLayer, getName, getOpacity, getPopup, getRectangle, getTriggerActions, isHidden, isInvisible, isLocked, isNoRotate, isNoView, isNoZoom, isPrintable, isReadOnly, paint, print, setActions, setAppearStream, setBorderStyle, setColor, setComponent, setComponentVisible, setCreationDate, setCreator, setFlags, setHidden, setInvisible, setLayer, setLocked, setName, setNoRotate, setNoView, setNoZoom, setOpacity, setPopup, setPrintable, setReadOnly, setTriggerActions
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Ink

public Ink(String contents)
Constructs and Ink annotation with no lines. The annotation will not be displayed as there is no lines to display.

Parameters:
contents - The text contents to display when the annotation is opened.

Ink

public Ink(String contents,
           Vector polyLines)
Constructs and Ink annotation.

Parameters:
contents - The text contents to display when the annotation is opened.
polyLines - a Vector of polylines. Each element in the Vector is another Vector containing a list of points to compose a polyline.
Method Detail

revalidateRectangle

public void revalidateRectangle()

getSubtype

public String getSubtype()
Returns this annotations subtype: "Ink"

Specified by:
getSubtype in class Annotation
Returns:
The annotation subtype.

getPolylines

public Vector getPolylines()
Returns a list of polylines.

Returns:
An array of polyline arrays.

addPolyline

public Vector addPolyline()
Creates a new line and returns it to the calling function. The returned Vector is the actual Vector used by the annotation, so any changes to the Vector will be reflected in the annotation.

Returns:
A Vector representing the new line.

createComponent

public JComponent createComponent(Point2D cropOrigin,
                                  IPDFActionHandler actionHandler)
Creates a JComponent object capable of displaying this annotation.

Specified by:
createComponent in class Annotation
Returns:
JComponent do display this annotation.

revalidate

public void revalidate()
Description copied from class: ShapeAnnotation
Revalidate the shape drawn by this annotation.

Specified by:
revalidate in class ShapeAnnotation

shiftRectangle

public void shiftRectangle(double deltaX,
                           double deltaY)
Overrides:
shiftRectangle in class Annotation