|
Gnostice PDFOne Java
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.gnostice.pdfone.PdfAnnot
com.gnostice.pdfone.PdfFormField
com.gnostice.pdfone.PdfFormCheckBox
public class PdfFormCheckBox
This class represents a check box form field. Viewer applications allow users to select or deselect a check box form field. When the check box is selected, it is supposed to be in an on state. When it is selected, the field is supposed to be in an off state. When the form is submitted, a check box in an onstate submits its name as the value. If the check box is not selected, then the field's value will be "off" and it will not be among the fields that are submitted by the users.
A set of check box form fields can be added to an
PdfFormField object of type
PdfFormField.TYPE_CHECKGROUP.
// Create a PDF page PdfPage page = new PdfPage(); // Create a check box PdfFormCheckBox cb1 = new PdfFormCheckBox( new PdfRect(200, 100, 10, 10), "isMarried"); cb1.setBorderColor(Color.BLACK); cb1.setState(PdfFormField.BUTTON_STATE_OFF); // Create another check box PdfFormCheckBox cb2 = new PdfFormCheckBox( new PdfRect(200, 120, 10, 10), "isEmployed"); cb2.setBorderColor(Color.BLACK); cb2.setState(PdfFormField.BUTTON_STATE_OFF); // Add the check box form fields to the page page.addFormField(cb1); page.addFormField(cb2); page.writeText("Married", 220, 98); page.writeText("Employed", 220, 118);
| Field Summary | |
|---|---|
static int |
SCALE_ALWAYS
Constant specifying that the viewer application should always scale the icon within the bounding box of the push button. |
static int |
SCALE_NEVER
Constant specifying that the viewer application should never scale the icon within the bounding box of the push button. |
static int |
SCALE_TYPE_ANAMORPHIC
Constant for specifying scaling the icon within the bounding box of a push button without maintaining the aspect ratio (width-height ratio). |
static int |
SCALE_TYPE_PROPORTIONAL
Constant for specifying scaling the icon within the bounding box of a push button while maintaining the aspect ratio (width-height ratio). |
static int |
SCALE_WHEN_ICON_IS_BIGGER
Constant specifying that the viewer application should scale the icon within the bounding box of the push button when the icon is bigger than the bounding box. |
static int |
SCALE_WHEN_ICON_IS_SMALLER
Constant specifying that the viewer application should scale the icon within the bounding box of the push button when the icon is smaller than the bounding box. |
| Constructor Summary | |
|---|---|
PdfFormCheckBox(PdfRect rect)
|
|
PdfFormCheckBox(PdfRect r,
String name)
|
|
PdfFormCheckBox(PdfRect r,
String name,
Color borderColor,
Color backgroundColor)
|
|
PdfFormCheckBox(PdfRect r,
String name,
int fieldFlags)
|
|
PdfFormCheckBox(PdfRect r,
String name,
int fieldFlags,
Color borderColor,
Color backgroundColor)
|
|
PdfFormCheckBox(PdfRect r,
String name,
String alternateName,
String mappingName)
|
|
PdfFormCheckBox(PdfRect r,
String name,
String alternateName,
String mappingName,
Color borderColor,
Color backgroundColor)
|
|
PdfFormCheckBox(PdfRect r,
String name,
String alternateName,
String mappingName,
int fieldFlags)
|
|
PdfFormCheckBox(PdfRect r,
String name,
String alternateName,
String mappingName,
int fieldFlags,
Color borderColor,
Color backgroundColor)
|
|
PdfFormCheckBox(String name)
|
|
PdfFormCheckBox(String name,
Color borderColor,
Color backgroundColor)
|
|
PdfFormCheckBox(String name,
int fieldFlags)
|
|
PdfFormCheckBox(String name,
int fieldFlags,
Color borderColor,
Color backgroundColor)
|
|
PdfFormCheckBox(String name,
String alternateName,
String mappingName)
|
|
PdfFormCheckBox(String name,
String alternateName,
String mappingName,
Color borderColor,
Color backgroundColor)
|
|
PdfFormCheckBox(String name,
String alternateName,
String mappingName,
int fieldFlags)
|
|
PdfFormCheckBox(String name,
String alternateName,
String mappingName,
int fieldFlags,
Color borderColor,
Color backgroundColor)
|
|
| Method Summary | |
|---|---|
void |
addDownAppearance(PdfAppearanceStream ap,
int state)
Adds an appearance stream for specified button state of the form field that the viewer applications should use when the user presses the mouse pointer over the field. |
void |
addNormalAppearance(PdfAppearanceStream ap,
int state)
Adds an appearance stream for specified button state of the form field that the viewer applications should use when the user is not interacting with the field. |
void |
addRolloverAppearance(PdfAppearanceStream ap,
int state)
Adds an appearance stream for specified button state of the form field that the viewer applications should use when the user hovers the mouse pointer over the field. |
Object |
clone()
|
List |
getChildList()
|
PdfAppearanceStream |
getDownAppearance()
Returns the appearance stream that needs to be used by a viewer application to display the annotation/form field when the user places the mouse pointer over the annotation/form field and holds down the mouse button. |
int |
getHighlightMode()
Returns highlight style used by viewer applications for the form field when the user interacts with the field. |
PdfAppearanceStream |
getNormalAppearance()
Returns the default appearance stream that needs to be used by a viewer application to display the annotation/form field (that is, when the user is not interacting with the annotation/form field). |
String |
getNormalCaption()
Returns text that viewer applications display on the form field when the user is not interacting with the field. |
PdfAppearanceStream |
getRolloverAppearance()
Returns the appearance stream that needs to be used by a viewer application to display the annotation when the user places the mouse pointer over the annotation (and does not hold down the mouse button). |
int |
getState()
Returns button state for the form field. |
void |
setDownAppearance(PdfAppearanceStream downAppearance)
Deprecated. Use addDownAppearance(PdfAppearanceStream, int) method instead. |
void |
setHighlightMode(int highlightMode)
Specifies highlight style for the form field that viewer applications need to use when the user interacts with the field. |
void |
setNormalAppearance(PdfAppearanceStream normalAppearance)
Deprecated. Use addNormalAppearance(PdfAppearanceStream, int) method instead. |
void |
setNormalCaption(String normalCaption)
Specifies text that viewer applications should display on the form field when the user is not interacting with the field. |
void |
setRolloverAppearance(PdfAppearanceStream rolloverAppearance)
Deprecated. Use addRolloverAppearance(PdfAppearanceStream, int) method instead. |
void |
setState(int appearanceState)
|
| Methods inherited from class com.gnostice.pdfone.PdfAnnot |
|---|
getAnnotName, getBorderStyle, getBorderWidth, getBottom, getColor, getContents, getDashPattern, getFlags, getLeft, getRect, getRight, getSubject, getTitle, getTop, hashCode, isShowRect, setAnnotName, setBorderStyle, setBorderWidth, setColor, setContents, setDashPattern, setFlags, setRect, setRect, setRect, setRect, setRect, setShowRect, setSubject, setTitle |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int SCALE_ALWAYS
public static final int SCALE_NEVER
public static final int SCALE_WHEN_ICON_IS_BIGGER
public static final int SCALE_WHEN_ICON_IS_SMALLER
public static final int SCALE_TYPE_PROPORTIONAL
public static final int SCALE_TYPE_ANAMORPHIC
| Constructor Detail |
|---|
public PdfFormCheckBox(String name,
int fieldFlags)
public PdfFormCheckBox(String name,
String alternateName,
String mappingName,
int fieldFlags)
public PdfFormCheckBox(String name,
String alternateName,
String mappingName)
public PdfFormCheckBox(String name)
public PdfFormCheckBox(PdfRect rect)
public PdfFormCheckBox(PdfRect r,
String name,
int fieldFlags)
public PdfFormCheckBox(PdfRect r,
String name)
public PdfFormCheckBox(PdfRect r,
String name,
String alternateName,
String mappingName,
int fieldFlags)
public PdfFormCheckBox(PdfRect r,
String name,
String alternateName,
String mappingName)
public PdfFormCheckBox(String name,
int fieldFlags,
Color borderColor,
Color backgroundColor)
public PdfFormCheckBox(String name,
String alternateName,
String mappingName,
int fieldFlags,
Color borderColor,
Color backgroundColor)
public PdfFormCheckBox(String name,
String alternateName,
String mappingName,
Color borderColor,
Color backgroundColor)
public PdfFormCheckBox(String name,
Color borderColor,
Color backgroundColor)
public PdfFormCheckBox(PdfRect r,
String name,
int fieldFlags,
Color borderColor,
Color backgroundColor)
public PdfFormCheckBox(PdfRect r,
String name,
Color borderColor,
Color backgroundColor)
public PdfFormCheckBox(PdfRect r,
String name,
String alternateName,
String mappingName,
int fieldFlags,
Color borderColor,
Color backgroundColor)
public PdfFormCheckBox(PdfRect r,
String name,
String alternateName,
String mappingName,
Color borderColor,
Color backgroundColor)
| Method Detail |
|---|
public Object clone()
public void setNormalAppearance(PdfAppearanceStream normalAppearance)
normalAppearance - the specified appearance streamsetDownAppearance(PdfAppearanceStream),
setRolloverAppearance(PdfAppearanceStream),
getNormalAppearance(),
getDownAppearance(),
getRolloverAppearance()public PdfAppearanceStream getNormalAppearance()
getDownAppearance(),
getRolloverAppearance(),
setNormalAppearance(PdfAppearanceStream),
setDownAppearance(PdfAppearanceStream),
setRolloverAppearance(PdfAppearanceStream)public void setDownAppearance(PdfAppearanceStream downAppearance)
getNormalAppearance(),
getDownAppearance(),
getRolloverAppearance(),
setNormalAppearance(PdfAppearanceStream),
setRolloverAppearance(PdfAppearanceStream)public PdfAppearanceStream getDownAppearance()
getNormalAppearance(),
getDownAppearance(),
setNormalAppearance(PdfAppearanceStream),
setRolloverAppearance(PdfAppearanceStream),
setDownAppearance(PdfAppearanceStream)public void setRolloverAppearance(PdfAppearanceStream rolloverAppearance)
rolloverAppearance - the specified appearance streamsetNormalAppearance(PdfAppearanceStream),
setDownAppearance(PdfAppearanceStream),
getNormalAppearance(),
getDownAppearance(),
getRolloverAppearance()public PdfAppearanceStream getRolloverAppearance()
getNormalAppearance(),
getDownAppearance(),
setNormalAppearance(PdfAppearanceStream),
setDownAppearance(PdfAppearanceStream),
setRolloverAppearance(PdfAppearanceStream)public void setNormalCaption(String normalCaption)
normalCaption - text that viewer applications should display on
the form field when the user is not interacting with
the fieldgetNormalCaption()public String getNormalCaption()
setNormalCaption(String)public List getChildList()
getChildList in class PdfFormFieldpublic void setState(int appearanceState)
public int getHighlightMode()
constant
specifying the highlight stylepublic void setHighlightMode(int highlightMode)
highlightMode - constant
specifying the highlight stylepublic int getState()
constant
specifying the button state
public void addNormalAppearance(PdfAppearanceStream ap,
int state)
ap - appearance stream for specified button state of the
form field that the viewer applications should use
when the user is not interacting with the fieldstate - constant
specifying the button state
public void addRolloverAppearance(PdfAppearanceStream ap,
int state)
ap - appearance stream for specified button state of the
form field that the viewer applications should use
when the user hovers the mouse pointer over the
fieldstate - constant
specifying the button state
public void addDownAppearance(PdfAppearanceStream ap,
int state)
ap - appearance stream for specified button state of the
form field that the viewer applications should use
when the user presses the mouse pointer over the
fieldstate - constant
specifying the button state
|
Std. Ed. v2.10 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||