public abstract class AnnotIconProvider
extends java.lang.Object
AnnotIconProvider
represents an abstract class.
It offers callback methods for application to implement the custom annotation
icon for annotations like "Text", "FileAttachment", "Stamp", "Sound". It can
be set into annotation module by calling
Annot.setIconProvider(AnnotIconProvider)
Annot
Modifier and Type | Class and Description |
---|---|
class |
AnnotIconProvider.ShadingColor
Class for shading color.
|
Modifier and Type | Field and Description |
---|---|
java.lang.Object |
clientData
User-defined data.
|
Constructor and Description |
---|
AnnotIconProvider() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
canChangeColor(java.lang.Object clientData,
java.lang.String iconType,
java.lang.String iconID)
Callback function to determine whether supports to change the icon color
of specific annotation type.
|
abstract SizeF |
getDisplaySize(java.lang.Object clientData,
java.lang.String iconType,
java.lang.String iconID)
Callback function to retrieve icon size when display, in device
size(pixel normally).
|
abstract PDFPage |
getIcon(java.lang.Object clientData,
java.lang.String iconType,
java.lang.String iconID,
long color)
Callback function to retrieve icon, which is as PDF page contents.
|
abstract java.lang.String |
getProviderIDName(java.lang.Object clientData)
Callback function to retrieve identity information of icon provider.
|
abstract int |
getProviderVersion(java.lang.Object clientData)
Callback function to retrieve the version number of icon provider.
|
abstract boolean |
hasIcon(java.lang.Object clientData,
java.lang.String iconType,
java.lang.String iconID)
Callback function to determine whether icon provider supports icon for
specific annotation type.
|
abstract void |
release(java.lang.Object clientData)
Callback function to release current
AnnotIconProvider
object. |
abstract AnnotIconProvider.ShadingColor |
setShadingColor(java.lang.Object clientData,
java.lang.String iconType,
java.lang.String iconID,
long refColor,
int shadingIndex)
Callback function to set shading colors if an icon supports shading.
|
public java.lang.Object clientData
public abstract void release(java.lang.Object clientData) throws PDFException
AnnotIconProvider
object.clientData
- The user-defined data.PDFException
PDFException
public abstract java.lang.String getProviderIDName(java.lang.Object clientData) throws PDFException
This callback function should return valid identity name string.
clientData
- The user-supplied data.String
object that receives a string which
indicates the identity name string of icon provider.PDFException
public abstract int getProviderVersion(java.lang.Object clientData) throws PDFException
This callback function should return valid version number.
clientData
- The user-supplied data.integer
value that receives the version number of
icon provider.PDFException
public abstract boolean hasIcon(java.lang.Object clientData, java.lang.String iconType, java.lang.String iconID) throws PDFException
clientData
- The user-supplied data.iconType
- A String
object that indicates the type string of
icon. Support types: "Text", "FileAttachment", and "Stamp".iconID
- A String
object that indicates the identity
string of icon. For Text
annotation, valid icon
identity strings should be one of
ICONNAME_XXX
. For
FileAttachment
annotation, valid icon identity
strings should be one of
ICONNAME_XXX
.
For Stamp
annotation, valid icon identity
strings should be one of constant definitions
ICONNAME_XXX
.boolean
value which indicates whether icon
provider supports icon for specific annotation type.PDFException
public abstract boolean canChangeColor(java.lang.Object clientData, java.lang.String iconType, java.lang.String iconID) throws PDFException
clientData
- The user-supplied data.iconType
- A String
object that indicates the type string of
icon. Support types: "Text", "FileAttachment", and "Stamp".iconID
- A String
object that indicates the identity
string of icon. Please refer to note part in function
hasIcon(Object, String, String)
for more information.boolean
value which indicates whether supports to
change the icon color of specific annotation type.PDFException
public abstract PDFPage getIcon(java.lang.Object clientData, java.lang.String iconType, java.lang.String iconID, long color) throws PDFException
clientData
- The user-supplied data.iconType
- A String
object that indicates the type string of
icon. Support types: "Text", "FileAttachment", and "Stamp".iconID
- A String
object that indicates the identity
string of icon. Please refer to note part in function
hasIcon(Object, String, String)
for more information.color
- Color value if icon needs. Format: 0xAARRGGBB and alpha value
is ignored.PDFPage
object that receives a page object,
contents of which is the icon.PDFException
PDFPage
public abstract AnnotIconProvider.ShadingColor setShadingColor(java.lang.Object clientData, java.lang.String iconType, java.lang.String iconID, long refColor, int shadingIndex) throws PDFException
Currently, we support only Type-2 shading settings with two color values.
clientData
- The user-supplied data.iconType
- A String
object that indicates the type string of
icon. Support types: "Text", "FileAttachment", and "Stamp".iconID
- A String
object that indicates the identity
string of icon. Please refer to note part in function
hasIcon(Object, String, String)
for more information.refColor
- Value of referenced color to set, alpha component is ignored.shadingIndex
- Index color of shading. If shading colors are more than one,
this function will be called multiple times.ShadingColor
object that receives the shading
color.PDFException
AnnotIconProvider.ShadingColor
public abstract SizeF getDisplaySize(java.lang.Object clientData, java.lang.String iconType, java.lang.String iconID) throws PDFException
clientData
- The user-supplied data.iconType
- A String
object that indicates the type string of
icon. Support types: "Text", "FileAttachment", and "Stamp".iconID
- A String
object that indicates the identity
string of icon. Please refer to note part in function
hasIcon(java.lang.Object, java.lang.String, java.lang.String)
for more
information.SizeF
object that receives the icon size for
displaying.PDFException
SizeF