com.qoppa.pdf.annotations
Class Square

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

public class Square
extends ShapeAnnotation

Class representing a Square annotation in a PDF document. Square annotations are displayed as a square box on the PDF document and can be double-clicked to display their contents.

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
Square(String contents)
          Constructs a square annotation with the given content.
 
Method Summary
 JComponent createComponent(Point2D cropOrigin, IPDFActionHandler actionHandler)
          Creates a JComponent object capable of displaying this annotation.
 String getSubtype()
          Returns this annotation's subtype: "Square"
 void revalidate()
          Revalidate the shape drawn by this annotation.
 void setRectangle(Rectangle2D rectangle)
          Sets the annotation's rectangle.
 
Methods inherited from class com.qoppa.pdf.annotations.ShapeAnnotation
getBorderWidth, getContents, getInternalColor, getStroke, paintImpl, setBorderWidth, setContents, setInternalColor, setStroke
 
Methods inherited from class com.qoppa.pdf.annotations.Annotation
getActions, getAppearStream, getBorderStyle, getColor, getComponent, getCreationDate, getCreator, getFlags, getName, getOpacity, getPopup, getRectangle, getTriggerActions, isHidden, isInvisible, isLocked, isNoRotate, isNoView, isNoZoom, isPrintable, isReadOnly, paint, paintAppearStream, print, setActions, setAppearStream, setBorderStyle, setColor, setComponent, setComponentVisible, setCreationDate, setCreator, setFlags, setHidden, setInvisible, setLocked, setName, setNoRotate, setNoView, setNoZoom, setOpacity, setPopup, setPrintable, setReadOnly, setTriggerActions, shiftRectangle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Square

public Square(String contents)
Constructs a square annotation with the given content. Call Square.setBounds() to set the bounds of the square.

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

getSubtype

public String getSubtype()
Returns this annotation's subtype: "Square"

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

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

setRectangle

public void setRectangle(Rectangle2D rectangle)
Description copied from class: Annotation
Sets the annotation's rectangle. The annotation's rectangle is in MediaBox coordinates.

Overrides:
setRectangle in class Annotation
Parameters:
rectangle - The new location of the annotation on the page.