com.qoppa.pdf.annotations
Class ShapeAnnotation

java.lang.Object
  extended bycom.qoppa.pdf.annotations.Annotation
      extended bycom.qoppa.pdf.annotations.ShapeAnnotation
Direct Known Subclasses:
Circle, Ink, Line, Polyline, Square

public abstract class ShapeAnnotation
extends Annotation

Abstract class to be extended by annotations that contain textual content.

Author:
Qoppa Software

Field Summary
static int LE_CIRCLE
           
static String LE_CIRCLE_STR
           
static int LE_CLOSEDARROW
           
static String LE_CLOSEDARROW_STR
           
static int LE_DIAMOND
           
static String LE_DIAMOND_STR
           
static int LE_NONE
           
static String LE_NONE_STR
           
static int LE_OPENARROW
           
static String LE_OPENARROW_STR
           
static int LE_SQUARE
           
static String 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
 
Method Summary
 double getBorderWidth()
          Gets this annotation's border width.
 String getContents()
          Returns the string contents for this annotation.
 Color getInternalColor()
          Gets the fill color for this annotation.
 BasicStroke getStroke()
          Gets the stroke to use when drawing the ink annotation.
 void paintImpl(Graphics g, boolean hasFocus)
          Draws the shape.
abstract  void revalidate()
          Revalidate the shape drawn by this annotation.
 void setBorderWidth(double borderWidth)
          Sets the annotation's border width.
 void setContents(String contents)
          Sets the string contents for this annotation.
 void setInternalColor(Color internalColor)
          Sets the fill color for this annotation.
 void setRectangle(Rectangle2D rectangle)
          Sets the annotation's rectangle.
 void setStroke(BasicStroke stroke)
          Sets the stroke used when drawing the ink annotation.
 
Methods inherited from class com.qoppa.pdf.annotations.Annotation
createComponent, getActions, getAppearStream, getBorderStyle, getColor, getComponent, getCreationDate, getCreator, getFlags, getLayer, getName, getOpacity, getPopup, getRectangle, getSubtype, 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, shiftRectangle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LE_NONE

public static final int LE_NONE
See Also:
Constant Field Values

LE_SQUARE

public static final int LE_SQUARE
See Also:
Constant Field Values

LE_CIRCLE

public static final int LE_CIRCLE
See Also:
Constant Field Values

LE_DIAMOND

public static final int LE_DIAMOND
See Also:
Constant Field Values

LE_OPENARROW

public static final int LE_OPENARROW
See Also:
Constant Field Values

LE_CLOSEDARROW

public static final int LE_CLOSEDARROW
See Also:
Constant Field Values

LE_NONE_STR

public static final String LE_NONE_STR
See Also:
Constant Field Values

LE_SQUARE_STR

public static final String LE_SQUARE_STR
See Also:
Constant Field Values

LE_CIRCLE_STR

public static final String LE_CIRCLE_STR
See Also:
Constant Field Values

LE_DIAMOND_STR

public static final String LE_DIAMOND_STR
See Also:
Constant Field Values

LE_OPENARROW_STR

public static final String LE_OPENARROW_STR
See Also:
Constant Field Values

LE_CLOSEDARROW_STR

public static final String LE_CLOSEDARROW_STR
See Also:
Constant Field Values
Method Detail

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.


getStroke

public BasicStroke getStroke()
Gets the stroke to use when drawing the ink annotation.

Returns:
The stroke used in drawing.

setStroke

public void setStroke(BasicStroke stroke)
Sets the stroke used when drawing the ink annotation.

Parameters:
stroke - The stroke to use when drawing the annotation.

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.

getBorderWidth

public double getBorderWidth()
Description copied from class: Annotation
Gets this annotation's border width.

Overrides:
getBorderWidth in class Annotation
Returns:
The border width.

getInternalColor

public Color getInternalColor()
Gets the fill color for this annotation.

Returns:
The fill color, null if it is not defined.

setInternalColor

public void setInternalColor(Color internalColor)
Sets the fill color for this annotation. If the value is set to null, the square will leave it's interior transparent.

Parameters:
internalColor - The color to use to fill the rectangle. If null, the interior will be transparent.

paintImpl

public void paintImpl(Graphics g,
                      boolean hasFocus)
Draws the shape.

Parameters:
g - The graphics object to use when drawing.

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.

revalidate

public abstract void revalidate()
Revalidate the shape drawn by this annotation.

Specified by:
revalidate in class Annotation