com.qoppa.pdf.annotations
Class RubberStamp

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

public class RubberStamp
extends Annotation

Class representing a Rubber Stamp annotation in a PDF document.

Author:
Qoppa Software

Field Summary
static String APPROVED
           
static String APPROVED_TEXT
           
static String ASIS
           
static String ASIS_TEXT
           
static String CONFIDENTIAL
           
static String CONFIDENTIAL_TEXT
           
static String DEPARTMENTAL
           
static String DEPARTMENTAL_TEXT
           
static String DRAFT
           
static String DRAFT_TEXT
           
static String EXPERIMENTAL
           
static String EXPERIMENTAL_TEXT
           
static String EXPIRED
           
static String EXPIRED_TEXT
           
static String FINAL
           
static String FINAL_TEXT
           
static String FORCOMMENT
           
static String FORCOMMENT_TEXT
           
static String FORPUBLICRELEASE
           
static String FORPUBLICRELEASE_TEXT
           
static String NOTAPPROVED
           
static String NOTAPPROVED_TEXT
           
static String NOTFORPUBLICRELEASE
           
static String NOTFORPUBLICRELEASE_TEXT
           
static String SBAPPROVED
           
static String SBASIS
           
static String SBCONFIDENTIAL
           
static String SBDEPARTMENTAL
           
static String SBDRAFT
           
static String SBEXPERIMENTAL
           
static String SBEXPIRED
           
static String SBFINAL
           
static String SBFORCOMMENT
           
static String SBFORPUBLICRELEASE
           
static String SBNOTAPPROVED
           
static String SBNOTFORPUBLICRELEASE
           
static String SBSOLD
           
static String SBTOPSECRET
           
static String SOLD
           
static String SOLD_TEXT
           
static String TOPSECRET
           
static String TOPSECRET_TEXT
           
 
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
RubberStamp()
          Constructs a rubber stamp annotation
RubberStamp(Image image)
          Constructs a rubber stamp annotation
RubberStamp(String stampType)
          Constructs a rubber stamp annotation as defined in the PDF format.
RubberStamp(String text, Color color)
          Construct a rubber stamp annotation with custom text and custom color.
 
Method Summary
 JComponent createComponent(Point2D cropOrigin, IPDFActionHandler actionHandler)
          Creates a JComponent object capable of displaying this annotation.
 Image createImage(double scale, int maxWidth, int maxHeight)
          Return an image for the current stamp.
 String getContents()
          Returns the annotation's contents.
 String getIconName()
           
 Image getImage()
           
 int getRotation()
          Gets the rotation.
 Hashtable getRunInfo()
           
 String getSubtype()
          Returns this annotation's subtype: "Stamp"
 void paintImpl(Graphics graphics, boolean hasFocus)
          Draws the stamp.
 void revalidate()
          Revalidates this annotation.
 void setContents(String contents)
           
 void setIconName(String iconName)
           
 void setImage(Image image)
           
 void setRotation(int rotation)
          Sets the rotation for standard or image stamps that do not have an appearance stream yet.
 void setRunInfo(Hashtable runInfo)
           
 
Methods inherited from class com.qoppa.pdf.annotations.Annotation
getActions, getAppearStream, getBorderStyle, getBorderWidth, getColor, getComponent, getCreationDate, getCreator, getFlags, getLayer, getName, getOpacity, getPopup, getRectangle, getTriggerActions, isHidden, isInvisible, isLocked, isNoRotate, isNoView, isNoZoom, isPrintable, isReadOnly, paint, print, setActions, setAppearStream, setBorderStyle, setBorderWidth, setColor, setComponent, setComponentVisible, setCreationDate, setCreator, setFlags, setHidden, setInvisible, setLayer, 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

ASIS

public static final String ASIS
See Also:
Constant Field Values

APPROVED

public static final String APPROVED
See Also:
Constant Field Values

CONFIDENTIAL

public static final String CONFIDENTIAL
See Also:
Constant Field Values

DEPARTMENTAL

public static final String DEPARTMENTAL
See Also:
Constant Field Values

DRAFT

public static final String DRAFT
See Also:
Constant Field Values

EXPERIMENTAL

public static final String EXPERIMENTAL
See Also:
Constant Field Values

EXPIRED

public static final String EXPIRED
See Also:
Constant Field Values

FINAL

public static final String FINAL
See Also:
Constant Field Values

FORCOMMENT

public static final String FORCOMMENT
See Also:
Constant Field Values

FORPUBLICRELEASE

public static final String FORPUBLICRELEASE
See Also:
Constant Field Values

NOTAPPROVED

public static final String NOTAPPROVED
See Also:
Constant Field Values

NOTFORPUBLICRELEASE

public static final String NOTFORPUBLICRELEASE
See Also:
Constant Field Values

SOLD

public static final String SOLD
See Also:
Constant Field Values

TOPSECRET

public static final String TOPSECRET
See Also:
Constant Field Values

ASIS_TEXT

public static final String ASIS_TEXT

APPROVED_TEXT

public static final String APPROVED_TEXT

CONFIDENTIAL_TEXT

public static final String CONFIDENTIAL_TEXT

DEPARTMENTAL_TEXT

public static final String DEPARTMENTAL_TEXT

DRAFT_TEXT

public static final String DRAFT_TEXT

EXPERIMENTAL_TEXT

public static final String EXPERIMENTAL_TEXT

EXPIRED_TEXT

public static final String EXPIRED_TEXT

FINAL_TEXT

public static final String FINAL_TEXT

FORCOMMENT_TEXT

public static final String FORCOMMENT_TEXT

FORPUBLICRELEASE_TEXT

public static final String FORPUBLICRELEASE_TEXT

NOTAPPROVED_TEXT

public static final String NOTAPPROVED_TEXT

NOTFORPUBLICRELEASE_TEXT

public static final String NOTFORPUBLICRELEASE_TEXT

SOLD_TEXT

public static final String SOLD_TEXT

TOPSECRET_TEXT

public static final String TOPSECRET_TEXT

SBASIS

public static final String SBASIS
See Also:
Constant Field Values

SBAPPROVED

public static final String SBAPPROVED
See Also:
Constant Field Values

SBCONFIDENTIAL

public static final String SBCONFIDENTIAL
See Also:
Constant Field Values

SBDEPARTMENTAL

public static final String SBDEPARTMENTAL
See Also:
Constant Field Values

SBDRAFT

public static final String SBDRAFT
See Also:
Constant Field Values

SBEXPERIMENTAL

public static final String SBEXPERIMENTAL
See Also:
Constant Field Values

SBEXPIRED

public static final String SBEXPIRED
See Also:
Constant Field Values

SBFINAL

public static final String SBFINAL
See Also:
Constant Field Values

SBFORCOMMENT

public static final String SBFORCOMMENT
See Also:
Constant Field Values

SBFORPUBLICRELEASE

public static final String SBFORPUBLICRELEASE
See Also:
Constant Field Values

SBNOTAPPROVED

public static final String SBNOTAPPROVED
See Also:
Constant Field Values

SBNOTFORPUBLICRELEASE

public static final String SBNOTFORPUBLICRELEASE
See Also:
Constant Field Values

SBSOLD

public static final String SBSOLD
See Also:
Constant Field Values

SBTOPSECRET

public static final String SBTOPSECRET
See Also:
Constant Field Values
Constructor Detail

RubberStamp

public RubberStamp()
Constructs a rubber stamp annotation


RubberStamp

public RubberStamp(String stampType)
Constructs a rubber stamp annotation as defined in the PDF format. Possible types of stamps are: AsIs, Approved, Confidential, Departmental, Draft, Experimental, Expired, Final, ForComment, ForPublicRelease, NotApproved, NotForPublicRelease, Sold, TopSecret.


RubberStamp

public RubberStamp(String text,
                   Color color)
Construct a rubber stamp annotation with custom text and custom color.


RubberStamp

public RubberStamp(Image image)
Constructs a rubber stamp annotation

Method Detail

getRunInfo

public Hashtable getRunInfo()

setRunInfo

public void setRunInfo(Hashtable runInfo)

getSubtype

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

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.

createImage

public Image createImage(double scale,
                         int maxWidth,
                         int maxHeight)
Return an image for the current stamp. If width and height are set to 0, the default stamp width and height are used. If width and height are > 0, the image is scaled to fit in (maxWidth, maxWeight) while preserving the original ratio width / height

Parameters:
maxWidth - Maximum width desired for the image. If the natural image is larger than this, the image will be rescaled.
maxHeight - Maximum height desired for the image. If the natural image is larger than this, the image will be rescaled.
Returns:
An Image object of the current stamp.

paintImpl

public void paintImpl(Graphics graphics,
                      boolean hasFocus)
Draws the stamp.

Parameters:
graphics - The graphics object to use when drawing.
hasFocus - Flag indicating whether the annotation should be painted with or without focus.

revalidate

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

Specified by:
revalidate in class Annotation

getIconName

public String getIconName()

getContents

public String getContents()
Description copied from class: Annotation
Returns the annotation's contents.

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

setContents

public void setContents(String contents)

setIconName

public void setIconName(String iconName)

getImage

public Image getImage()

setImage

public void setImage(Image image)

getRotation

public int getRotation()
Gets the rotation.

Returns:
rotation.

setRotation

public void setRotation(int rotation)
Sets the rotation for standard or image stamps that do not have an appearance stream yet. Once the appearance stream is generated, this parameter is ignored and will not be saved in the pdf document. * @param rotation the rotation.