org.faceless.pdf2
Class AnnotationNote

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

public final class AnnotationNote
extends PDFAnnotation

This class represents the type of PDFAnnotation created by the "Note Tool" in Acrobat. This is normally represented by an icon on screen until the user clicks on it, at which point a window pops up and displays the contents.

Since:
2.0

Constructor Summary
AnnotationNote()
          Create a new Note of the default type - a yellow "Note".
 
Method Summary
 float[] getClosedRectangle()
          Return the Rectangle for this AnnotationNote when it's closed
 float[] getOpenRectangle()
          Return the Rectangle for this AnnotationNote when it's open
 float[] getRectangle()
          Return the rectangle this annotation applies to on the page, or null if no rectangle applies for this type of annotation.
 String getStatus()
          For Note annotations that are reviews of other Annotations, get the status of that review.
 String getType()
          Returns the type of Note.
 boolean isOpen()
          Return whether this Note is open by default
 void rebuild()
          Rebuild the annotation's appearance.
 void setOpen(boolean open)
          Set whether this Note is saved in it's opened or closed state.
 void setRectangle(float x1, float y1, float x2, float y2)
          Set the rectangle for the annotation - where it is on the page.
 void setStatus(String status)
          For Note Annotations that are reviews of other annotations, set the status of the review.
 void setType(String type, Color color)
          Set the type of the note, which affects the type of icon thats used to display it.
 String toString()
           
 
Methods inherited from class org.faceless.pdf2.PDFAnnotation
addPropertyChangeListener, addReview, flatten, getAuthor, getColor, getContents, getCreationDate, getInReplyTo, getMetaData, getModifyDate, getOpacity, getPage, getPopup, getReplies, getReviews, getSubject, getUniqueID, hasAppearanceState, isContentLocked, isPositionLocked, isPrintable, isReadOnly, isVisible, removePropertyChangeListener, setAuthor, setColor, setContents, setCreationDate, setInReplyTo, setLocked, setMetaData, setModifyDate, setOpacity, setPage, setPrintable, setReadOnly, setSubject, setUniqueID, setVisible
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AnnotationNote

public AnnotationNote()
Create a new Note of the default type - a yellow "Note".

Method Detail

setType

public void setType(String type,
                    Color color)
Set the type of the note, which affects the type of icon thats used to display it. In Acrobat 4 and 5, the types that were available are: In Acrobat 6 a large number of new types were added:

Finally in Acrobat 7 the "Circle" type was added. All of these types will work in Acrobat 4.x and later, although attempting to edit the annotation type of an Acrobat 6.x annotation in an earlier release will probably result in the icon reverting to the original "Note" icon.


getType

public String getType()
Returns the type of Note. May be one of the values passed in to the constructor, but not guaranteed to be.

Overrides:
getType in class PDFAnnotation

setRectangle

public void setRectangle(float x1,
                         float y1,
                         float x2,
                         float y2)
Description copied from class: PDFAnnotation
Set the rectangle for the annotation - where it is on the page. Every annotation must have a rectangle set - if it's not set when the document is written, it's forced to (0,0,0,0).

Note that all co-ordinates are in absolute page co-ordinates. This means they are measured in points from the bottom-left hand corner of the page, regardless of any calls to PDFPage.rotate(float, float, double) or PDFPage.setUnits(float, int) that have been made. This restriction is part of the PDF specification.

Overrides:
setRectangle in class PDFAnnotation
Parameters:
x1 - the X co-ordinate of the bottom-left corner of the rectangle
y1 - the Y co-ordinate of the bottom-left corner of the rectangle
x2 - the X co-ordinate of the top-right corner of the rectangle
y2 - the Y co-ordinate of the top-right corner of the rectangle

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)

getOpenRectangle

public float[] getOpenRectangle()
Return the Rectangle for this AnnotationNote when it's open

Since:
2.11.22

getClosedRectangle

public float[] getClosedRectangle()
Return the Rectangle for this AnnotationNote when it's closed

Since:
2.11.22

setOpen

public void setOpen(boolean open)
Set whether this Note is saved in it's opened or closed state. Default is false


isOpen

public boolean isOpen()
Return whether this Note is open by default


setStatus

public void setStatus(String status)
For Note Annotations that are reviews of other annotations, set the status of the review. See the PDFAnnotation.getReviews() method for more information on reviews.

Parameters:
status - the status to set the note to. Must be one of None, Accepted, Rejected, Cancelled, Completed, Marked or Unmarked. If not an IllegalArgumentException is thrown.
Since:
2.4
See Also:
PDFAnnotation.getReviews(), getStatus()

getStatus

public String getStatus()
For Note annotations that are reviews of other Annotations, get the status of that review. See the PDFAnnotation.getReviews() method for more information on reviews. For other Note annotations, this will return null

Returns:
one of the values listed in the setStatus(java.lang.String) method documentation, or null if this is not a review
Since:
2.4
See Also:
PDFAnnotation.getReviews(), setStatus(java.lang.String)

rebuild

public void rebuild()
Description copied from class: PDFAnnotation
Rebuild the annotation's appearance. This will be done automatically when required, usually just before saving the PDF or rasterizing it to a bitmap. However this method can be called explicitly if necessary, usually to ensure the rebuild (which may fire a PropertyChangeEvent) is run on a specific thread.

Overrides:
rebuild in class PDFAnnotation

toString

public String toString()


Copyright © 2001-2013 Big Faceless Organization