org.faceless.pdf2
Class AnnotationLink

java.lang.Object
  extended by org.faceless.pdf2.PDFAnnotation
      extended by org.faceless.pdf2.AnnotationLink
All Implemented Interfaces:
Cloneable

public final class AnnotationLink
extends PDFAnnotation

A subtype new PDFAnnotation that performs the specified action when clicked. This can be used to create an HTML-style hyperlink, play a sound, or perform some other PDFAction.

Since:
2.0

Constructor Summary
AnnotationLink()
          Create a new Link annotation with a default setStyle(org.faceless.pdf2.PDFStyle) of null
 
Method Summary
 boolean equals(Object o)
           
 PDFAction getAction()
          Return the action performed by this hyperlink
 float[] getCorners()
          Return the four corners of the annotation, as specified by setCorners().
 float[] getRectangle()
          Return the rectangle this annotation applies to on the page, or null if no rectangle applies for this type of annotation.
 void setAction(PDFAction action)
          Set the action for this hyperlink
 void setCorners(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
          Set the four corners (x1,y1) (x2,y2) (x3,y3) (x4,y4) of the quadrilateral that encompasses the text underlying this annotation, specified counter-clockwise.
 void setStyle(PDFStyle style)
           Set the style for this hyperlink annotation.
 String toString()
           
 
Methods inherited from class org.faceless.pdf2.PDFAnnotation
addPropertyChangeListener, addReview, getAuthor, getColor, getContents, getCreationDate, getInReplyTo, getModifyDate, getOpacity, getPage, getPopup, getReplies, getReviews, getSubject, getType, getUniqueID, hasAppearanceState, isPrintable, isReadOnly, isVisible, removePropertyChangeListener, setAuthor, setColor, setContents, setCreationDate, setInReplyTo, setModifyDate, setOpacity, setPage, setPrintable, setReadOnly, setRectangle, setSubject, setUniqueID, setVisible
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AnnotationLink

public AnnotationLink()
Create a new Link annotation with a default setStyle(org.faceless.pdf2.PDFStyle) of null

Method Detail

setAction

public void setAction(PDFAction action)
Set the action for this hyperlink


getAction

public PDFAction getAction()
Return the action performed by this hyperlink


getRectangle

public float[] getRectangle()
Description copied from class: PDFAnnotation
Return the rectangle this annotation applies to on the page, or null if no rectangle applies for this type of annotation. See the setRectangle() method for a discussion on units.

Overrides:
getRectangle in class PDFAnnotation
Returns:
the rectangle for this annotation, in the form of an array (x1, y1, x2, y2)
See Also:
PDFAnnotation.setRectangle(float, float, float, float)

setStyle

public void setStyle(PDFStyle style)

Set the style for this hyperlink annotation. Parameters from the style that are used include LineColor, DashPattern, LineWeighting and FormStyle (although Acrobat 4 and earlier will ignore the FormStyle)

Alternatively the style may be null to prevent this link having any visible appearance on the page

Parameters:
style - the style to draw the link in - may be null

setCorners

public void setCorners(float x1,
                       float y1,
                       float x2,
                       float y2,
                       float x3,
                       float y3,
                       float x4,
                       float y4)
Set the four corners (x1,y1) (x2,y2) (x3,y3) (x4,y4) of the quadrilateral that encompasses the text underlying this annotation, specified counter-clockwise. This method performs a similar function to the AnnotationMarkup.setCorners method. Note that versions of Acrobat prior to 7.0 will not recognise this, and rely on the rectangle set with the setRectangle() method instead. Consequently those wanting non-rectanglur link annotations should set the co-ordinates using both this method and setRectangle()

Parameters:
x1 - the X co-ordinate of the bottom-left corner of the text
y1 - the Y co-ordinate of the bottom-left corner of the text
x2 - the X co-ordinate of the bottom-right corner of the text
y2 - the Y co-ordinate of the bottom-right corner of the text
x3 - the X co-ordinate of the top-left corner of the text
y3 - the Y co-ordinate of the top-left corner of the text
x4 - the X co-ordinate of the top-right corner of the text
y4 - the Y co-ordinate of the top-right corner of the text
Since:
2.4

getCorners

public float[] getCorners()
Return the four corners of the annotation, as specified by setCorners(). Note this feature was added in Acrobat 7.0 only, so many link annotations will return null here - see the getRectangle() method for the most widely used method of defining the area of a Link.

Returns:
an array of 8 points as set by setCorners(), or null if the area is specified by getRectangle()
Since:
2.4

toString

public String toString()

equals

public boolean equals(Object o)
Overrides:
equals in class Object


Copyright © 2001-2008 Big Faceless Organization