org.apache.pdfbox.pdmodel.interactive.annotation

## Class PDAnnotationSquareCircle

- java.lang.Object
- - org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation
  - - org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationMarkup
    - - org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationSquareCircle

All Implemented Interfaces:
  COSObjectable

    public class PDAnnotationSquareCircle
    extends PDAnnotationMarkup

This is the class that represents a rectangular or eliptical annotation Introduced in PDF 1.3 specification .

Author:
  Paul King

### Field Summary

Fields
`static String` `SUB_TYPE_CIRCLE` Constant for an elliptical type of annotation.
`static String` `SUB_TYPE_SQUARE` Constant for a Rectangular type of annotation.

### Fields inherited from class org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationMarkup

`IT_FREE_TEXT, IT_FREE_TEXT_CALLOUT, IT_FREE_TEXT_TYPE_WRITER, RT_GROUP, RT_REPLY, SUB_TYPE_CARET, SUB_TYPE_FREETEXT, SUB_TYPE_INK, SUB_TYPE_POLYGON, SUB_TYPE_POLYLINE, SUB_TYPE_SOUND`

### Constructor Summary

Constructors
Constructor and Description
`PDAnnotationSquareCircle(COSDictionary field)` Creates a Line annotation from a COSDictionary, expected to be a correct object definition.
`PDAnnotationSquareCircle(String subType)` Creates a Circle or Square annotation of the specified sub type.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `constructAppearances()` Create the appearance entry for this annotation.
`void` `constructAppearances(PDDocument document)` Create the appearance entry for this annotation.
`PDBorderEffectDictionary` `getBorderEffect()` This will retrieve the border effect dictionary, specifying effects to be applied used in drawing the line.
`PDBorderStyleDictionary` `getBorderStyle()` This will retrieve the border style dictionary, specifying the width and dash pattern used in drawing the line.
`PDColor` `getInteriorColor()` This will retrieve the interior color of the drawn area color is in DeviceRGB color space.
`PDRectangle` `getRectDifference()` This will get the rectangle difference rectangle.
`float[]` `getRectDifferences()` This will get the differences between the annotations "outer" rectangle defined by /Rect and the border.
`String` `getSubtype()` This will retrieve the sub type (and hence appearance, AP taking precedence) For this annotation.
`void` `setBorderEffect(PDBorderEffectDictionary be)` This will set the border effect dictionary, specifying effects to be applied when drawing the line.
`void` `setBorderStyle(PDBorderStyleDictionary bs)` This will set the border style dictionary, specifying the width and dash pattern used in drawing the line.
`void` `setCustomAppearanceHandler(PDAppearanceHandler appearanceHandler)` Set a custom appearance handler for generating the annotations appearance streams.
`void` `setInteriorColor(PDColor ic)` This will set interior color of the drawn area color is in DeviceRGB colo rspace.
`void` `setRectDifference(PDRectangle rd)` This will set the rectangle difference rectangle.
`void` `setRectDifferences(float difference)` This will set the difference between the annotations "outer" rectangle defined by /Rect and the border.
`void` `setRectDifferences(float differenceLeft, float differenceTop, float differenceRight, float differenceBottom)` This will set the difference between the annotations "outer" rectangle defined by /Rect and the border.
`void` `setSubtype(String subType)` This will set the sub type (and hence appearance, AP taking precedence) For this annotation.

### Methods inherited from class org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationMarkup

`getCallout, getConstantOpacity, getCreationDate, getDefaultAppearance, getDefaultStyleString, getEndPointEndingStyle, getExternalData, getInkList, getInReplyTo, getIntent, getLineEndingStyle, getPath, getPopup, getQ, getReplyType, getRichContents, getStartPointEndingStyle, getSubject, getTitlePopup, getVertices, setCallout, setConstantOpacity, setCreationDate, setDefaultAppearance, setDefaultStyleString, setEndPointEndingStyle, setExternalData, setInkList, setInReplyTo, setIntent, setLineEndingStyle, setPopup, setQ, setReplyType, setRichContents, setStartPointEndingStyle, setSubject, setTitlePopup, setVertices`

### Methods inherited from class org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation

`createAnnotation, equals, getAnnotationFlags, getAnnotationName, getAppearance, getAppearanceState, getBorder, getColor, getColor, getContents, getCOSObject, getModifiedDate, getNormalAppearanceStream, getOptionalContent, getPage, getRectangle, getStructParent, hashCode, isHidden, isInvisible, isLocked, isLockedContents, isNoRotate, isNoView, isNoZoom, isPrinted, isReadOnly, isToggleNoView, setAnnotationFlags, setAnnotationName, setAppearance, setAppearanceState, setAppearanceState, setBorder, setColor, setContents, setHidden, setInvisible, setLocked, setLockedContents, setModifiedDate, setModifiedDate, setNoRotate, setNoView, setNoZoom, setOptionalContent, setPage, setPrinted, setReadOnly, setRectangle, setStructParent, setToggleNoView`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### SUB_TYPE_SQUARE

    public static final String SUB_TYPE_SQUARE

Constant for a Rectangular type of annotation.

See Also:
  Constant Field Values

#### SUB_TYPE_CIRCLE

    public static final String SUB_TYPE_CIRCLE

Constant for an elliptical type of annotation.

See Also:
  Constant Field Values

### Constructor Detail

#### PDAnnotationSquareCircle

    public PDAnnotationSquareCircle(String subType)

Creates a Circle or Square annotation of the specified sub type.

Parameters:
  `subType` - the subtype the annotation represents.

#### PDAnnotationSquareCircle

    public PDAnnotationSquareCircle(COSDictionary field)

Creates a Line annotation from a COSDictionary, expected to be a correct object definition.

Parameters:
  `field` - the PDF object to represent as a field.

### Method Detail

#### setInteriorColor

    public void setInteriorColor(PDColor ic)

This will set interior color of the drawn area color is in DeviceRGB colo rspace.

Overrides:
  `setInteriorColor` in class `PDAnnotationMarkup`
Parameters:
  `ic` - color in the DeviceRGB color space.

#### getInteriorColor

    public PDColor getInteriorColor()

This will retrieve the interior color of the drawn area color is in DeviceRGB color space.

Overrides:
  `getInteriorColor` in class `PDAnnotationMarkup`
Returns:
  object representing the color.

#### setBorderEffect

    public void setBorderEffect(PDBorderEffectDictionary be)

This will set the border effect dictionary, specifying effects to be applied when drawing the line.

Overrides:
  `setBorderEffect` in class `PDAnnotationMarkup`
Parameters:
  `be` - The border effect dictionary to set.

#### getBorderEffect

    public PDBorderEffectDictionary getBorderEffect()

This will retrieve the border effect dictionary, specifying effects to be applied used in drawing the line.

Overrides:
  `getBorderEffect` in class `PDAnnotationMarkup`
Returns:
  The border effect dictionary

#### setRectDifference

    public void setRectDifference(PDRectangle rd)

This will set the rectangle difference rectangle. Giving the difference between the annotations rectangle and where the drawing occurs. (To take account of any effects applied through the BE entry forexample)

Overrides:
  `setRectDifference` in class `PDAnnotationMarkup`
Parameters:
  `rd` - the rectangle difference

#### getRectDifference

    public PDRectangle getRectDifference()

This will get the rectangle difference rectangle. Giving the difference between the annotations rectangle and where the drawing occurs. (To take account of any effects applied through the BE entry forexample)

Overrides:
  `getRectDifference` in class `PDAnnotationMarkup`
Returns:
  the rectangle difference

#### setSubtype

    public void setSubtype(String subType)

This will set the sub type (and hence appearance, AP taking precedence) For this annotation. See the SUB_TYPE_XXX constants for valid values.

Parameters:
  `subType` - The subtype of the annotation

#### getSubtype

    public String getSubtype()

This will retrieve the sub type (and hence appearance, AP taking precedence) For this annotation.

Overrides:
  `getSubtype` in class `PDAnnotation`
Returns:
  The subtype of this annotation, see the SUB_TYPE_XXX constants.

#### setBorderStyle

    public void setBorderStyle(PDBorderStyleDictionary bs)

This will set the border style dictionary, specifying the width and dash pattern used in drawing the line.

Overrides:
  `setBorderStyle` in class `PDAnnotationMarkup`
Parameters:
  `bs` - the border style dictionary to set. TODO not all annotations may have a BS entry

#### getBorderStyle

    public PDBorderStyleDictionary getBorderStyle()

This will retrieve the border style dictionary, specifying the width and dash pattern used in drawing the line.

Overrides:
  `getBorderStyle` in class `PDAnnotationMarkup`
Returns:
  the border style dictionary. TODO not all annotations may have a BS entry

#### setRectDifferences

    public void setRectDifferences(float difference)

This will set the difference between the annotations "outer" rectangle defined by /Rect and the border.

This will set an equal difference for all sides

Overrides:
  `setRectDifferences` in class `PDAnnotationMarkup`
Parameters:
  `difference` - from the annotations /Rect entry

#### setRectDifferences

    public void setRectDifferences(float differenceLeft,
                                   float differenceTop,
                                   float differenceRight,
                                   float differenceBottom)

This will set the difference between the annotations "outer" rectangle defined by /Rect and the border.

Overrides:
  `setRectDifferences` in class `PDAnnotationMarkup`
Parameters:
  `differenceLeft` - left difference from the annotations /Rect entry
  `differenceTop` - top difference from the annotations /Rect entry
  `differenceRight` - right difference from the annotations /Rect entry
  `differenceBottom` - bottom difference from the annotations /Rect entry

#### getRectDifferences

    public float[] getRectDifferences()

This will get the differences between the annotations "outer" rectangle defined by /Rect and the border.

Overrides:
  `getRectDifferences` in class `PDAnnotationMarkup`
Returns:
  the differences. If the entry hasn't been set am empty array is returned.

#### setCustomAppearanceHandler

    public void setCustomAppearanceHandler(PDAppearanceHandler appearanceHandler)

Set a custom appearance handler for generating the annotations appearance streams.

Overrides:
  `setCustomAppearanceHandler` in class `PDAnnotationMarkup`
Parameters:
  `appearanceHandler` -

#### constructAppearances

    public void constructAppearances()

Description copied from class: `PDAnnotation`
Create the appearance entry for this annotation. Not having it may prevent display in some viewers. This method is for overriding in subclasses, the default implementation does nothing.

Overrides:
  `constructAppearances` in class `PDAnnotationMarkup`

#### constructAppearances

    public void constructAppearances(PDDocument document)

Description copied from class: `PDAnnotation`
Create the appearance entry for this annotation. Not having it may prevent display in some viewers. This method is for overriding in subclasses, the default implementation does nothing.

Overrides:
  `constructAppearances` in class `PDAnnotationMarkup`