com.qoppa.pdf.annotations
Class FreeText

java.lang.Object
  extended bycom.qoppa.pdf.annotations.Annotation
      extended bycom.qoppa.pdf.annotations.FreeText

public class FreeText
extends Annotation

Class representing a FreeText annotation in a PDF document. FreeText annotations are displayed as a text box on the PDF document.

Author:
Qoppa Software

Field Summary
static int ALIGN_BOTTOM
           
static int ALIGN_CENTER
           
static int ALIGN_LEFT
           
static int ALIGN_RIGHT
           
static int ALIGN_TOP
           
 
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
FreeText(String contents)
          Constructs a free text annotation with the give content.
 
Method Summary
 JComponent createComponent(Point2D cropOrigin, IPDFActionHandler actionHandler)
          Creates a JComponent object capable of displaying this annotation.
 int getAlignHorizontal()
           
 int getAlignVertical()
           
 Color getBorderColor()
           
 Rectangle2D.Double getBorderRect()
           
 String getContents()
          Returns the string contents for this annotation.
 Vector getDrawLines()
           
 Font getFont()
           
 int getRotation()
           
 String getSubtype()
          Returns this annotations subtype: "FreeText"
 Color getTextColor()
           
 boolean isChanged()
           
 void paintImpl(Graphics g, boolean hasFocus)
           
 void revalidate()
          Revalidates this annotation.
 void setAlignHorizontal(int align)
           
 void setAlignVertical(int align)
           
 void setBorderColor(Color borderColor)
           
 void setBorderRect(Rectangle2D.Double borderRect)
           
 void setBorderWidth(double borderWidth)
          Sets the annotation's border width.
 void setChanged(boolean changed)
           
 void setColor(Color c)
          Sets the annotation's color.
 void setContents(String contents)
          Sets the string contents for this annotation.
 void setFont(Font font)
           
 void setRotation(int rotation)
           
 void setTextColor(Color textColor)
           
 
Methods inherited from class com.qoppa.pdf.annotations.Annotation
getActions, getAppearStream, getBorderStyle, getBorderWidth, getColor, getComponent, getCreationDate, getCreator, getFlags, getName, getOpacity, getPopup, getRectangle, getTriggerActions, isHidden, isInvisible, isLocked, isNoRotate, isNoView, isNoZoom, isPrintable, isReadOnly, paint, paintAppearStream, print, setActions, setAppearStream, setBorderStyle, setComponent, setComponentVisible, setCreationDate, setCreator, setFlags, setHidden, setInvisible, setLocked, setName, setNoRotate, setNoView, setNoZoom, setOpacity, setPopup, setPrintable, setReadOnly, setRectangle, setTriggerActions, shiftRectangle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALIGN_LEFT

public static final int ALIGN_LEFT
See Also:
Constant Field Values

ALIGN_CENTER

public static final int ALIGN_CENTER
See Also:
Constant Field Values

ALIGN_RIGHT

public static final int ALIGN_RIGHT
See Also:
Constant Field Values

ALIGN_TOP

public static final int ALIGN_TOP
See Also:
Constant Field Values

ALIGN_BOTTOM

public static final int ALIGN_BOTTOM
See Also:
Constant Field Values
Constructor Detail

FreeText

public FreeText(String contents)
Constructs a free text annotation with the give content. Use setBounds() to set the position and size of the text box on the page.

Parameters:
contents - The text content.
Method Detail

getSubtype

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

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.

getContents

public String getContents()
Returns the string contents for this annotation.

Overrides:
getContents in class Annotation
Returns:
The annotation's contents.

setContents

public void setContents(String contents)
Sets the string contents for this annotation.


getAlignHorizontal

public int getAlignHorizontal()

setAlignHorizontal

public void setAlignHorizontal(int align)

getAlignVertical

public int getAlignVertical()

setAlignVertical

public void setAlignVertical(int align)

revalidate

public void revalidate()
Description copied from class: Annotation
Revalidates this annotation.

Specified by:
revalidate in class Annotation

paintImpl

public void paintImpl(Graphics g,
                      boolean hasFocus)

getFont

public Font getFont()

setFont

public void setFont(Font font)

getTextColor

public Color getTextColor()

setTextColor

public void setTextColor(Color textColor)

getBorderColor

public Color getBorderColor()

setBorderColor

public void setBorderColor(Color borderColor)

getBorderRect

public Rectangle2D.Double getBorderRect()

setBorderRect

public void setBorderRect(Rectangle2D.Double borderRect)

setColor

public void setColor(Color c)
Description copied from class: Annotation
Sets the annotation's color.

Overrides:
setColor in class Annotation
Parameters:
c - The new color.

setBorderWidth

public void setBorderWidth(double borderWidth)
Description copied from class: Annotation
Sets the annotation's border width.

Overrides:
setBorderWidth in class Annotation
Parameters:
borderWidth - Width of the border.

getDrawLines

public Vector getDrawLines()

isChanged

public boolean isChanged()

setChanged

public void setChanged(boolean changed)

getRotation

public int getRotation()

setRotation

public void setRotation(int rotation)