|
Gnostice PDFOne
|
||||||||
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.PdfFormRadioButton
public class PdfFormRadioButton
This class represents a radio button form field. A radio button is usually part of a radio button group. On a viewer application, users are usually allowed to select only one radio button in a radio button group.
// Create a PDF page PdfPage page = new PdfPage(); // Create a radio button PdfFormRadioButton rb1 = new PdfFormRadioButton( new PdfRect(200, 100, 15, 10), "isMale"); rb1.setBorderColor(Color.BLACK); rb1.setState(PdfFormField.BUTTON_STATE_ON); // Create another radio button PdfFormRadioButton rb2 = new PdfFormRadioButton( new PdfRect(250, 100, 15, 10), "isFemale"); rb2.setBorderColor(Color.BLACK); // Create a radio button group PdfFormField rbg1 = new PdfFormField(PdfFormField.TYPE_RADIOGROUP, "gender"); // Add radio buttons to the radio button group rbg1.addChildField(rb1); rbg1.addChildField(rb2); // Add the radio button group form field to the page page.addFormField(rbg1); page.writeText("Male", 220, 98); page.writeText("Female", 270, 98);
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 | |
---|---|
PdfFormRadioButton(PdfRect rect)
Constructs a radio button form field with specified bounding box. |
|
PdfFormRadioButton(PdfRect r,
String name)
Constructs a radio button form field with specified bounding box and name. |
|
PdfFormRadioButton(PdfRect r,
String name,
Color borderColor,
Color backgroundColor)
Constructs a radio button form field with specified bounding box, name, border color, and background color. |
|
PdfFormRadioButton(PdfRect r,
String name,
int fieldFlags)
Constructs a radio button form field with specified bounding box, name, alternate name, mapping name, flags, border color, and background color. |
|
PdfFormRadioButton(PdfRect r,
String name,
int fieldFlags,
Color borderColor,
Color backgroundColor)
Constructs a radio button form field with specified bounding box, name, flags, border color, and background color. |
|
PdfFormRadioButton(PdfRect r,
String name,
String alternateName,
String mappingName)
Constructs a radio button form field with specified bounding box, name, alternate name, and mapping name. |
|
PdfFormRadioButton(PdfRect r,
String name,
String alternateName,
String mappingName,
Color borderColor,
Color backgroundColor)
Constructs a radio button form field with specified bounding box, name, alternate name, mapping name, border color, and background color. |
|
PdfFormRadioButton(PdfRect r,
String name,
String alternateName,
String mappingName,
int fieldFlags)
Constructs a radio button form field with specified bounding box, name, alternate name, mapping name, and flags. |
|
PdfFormRadioButton(PdfRect r,
String name,
String alternateName,
String mappingName,
int fieldFlags,
Color borderColor,
Color backgroundColor)
Constructs a radio button form field with specified bounding box, name, alternate name, mapping name, flags, border color, and background color. |
|
PdfFormRadioButton(String name)
Constructs a radio button form field with specified name. |
|
PdfFormRadioButton(String name,
Color borderColor,
Color backgroundColor)
Constructs a radio button form field with specified name, border color, and background color. |
|
PdfFormRadioButton(String name,
int fieldFlags)
Constructs a radio button form field with specified name and flags. |
|
PdfFormRadioButton(String name,
int fieldFlags,
Color borderColor,
Color backgroundColor)
Constructs a radio button form field with specified name, alternate name mapping name, flags, border color, and background color. |
|
PdfFormRadioButton(String name,
String alternateName,
String mappingName)
Constructs a radio button form field with specified name, alternate name, and mapping name. |
|
PdfFormRadioButton(String name,
String alternateName,
String mappingName,
Color borderColor,
Color backgroundColor)
Constructs a radio button form field with specified name, alternate name mapping name, border color, and background color. |
|
PdfFormRadioButton(String name,
String alternateName,
String mappingName,
int fieldFlags)
Constructs a radio button form field with specified name, alternate name mapping name, and flags. |
|
PdfFormRadioButton(String name,
String alternateName,
String mappingName,
int fieldFlags,
Color borderColor,
Color backgroundColor)
Constructs a radio button form field with specified name, alternate name mapping name, flags, border color, and background color. |
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()
Deprecated. No replacement. |
PdfAppearanceStream |
getDownAppearance()
Deprecated. No replacement. |
int |
getHighlightMode()
Returns highlight style used by viewer applications for the form field when the user interacts with the field. |
PdfAppearanceStream |
getNormalAppearance()
Deprecated. No replacement. |
String |
getNormalCaption()
Deprecated. No replacement. |
String |
getOnStateName()
Returns value that will be submitted for the parent radio button group form field
if the radio button is selected. |
PdfAppearanceStream |
getRolloverAppearance()
Deprecated. No replacement. |
int |
getState()
Returns button state for the form field. |
void |
setDownAppearance(PdfAppearanceStream downAppearance)
Deprecated. Instead, use void addDownAppearance(PdfAppearanceStream ap, int state) . |
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 |
setName(String name)
Specifies name for the radio button. |
void |
setNormalAppearance(PdfAppearanceStream normalAppearance)
Deprecated. Instead, use void addNormalAppearance(PdfAppearanceStream ap, int state) . |
void |
setNormalCaption(String normalCaption)
Deprecated. No replacement. |
void |
setRolloverAppearance(PdfAppearanceStream rolloverAppearance)
Deprecated. Instead, use void
addRolloverAppearance(PdfAppearanceStream ap, int state) . |
void |
setState(int appearanceState)
Specifies whether the radio button is checked. |
Methods inherited from class com.gnostice.pdfone.PdfAnnot |
---|
delete, getAnnotName, getBorderStyle, getBorderWidth, getBottom, getColor, getContents, getDashPattern, getFlags, getLeft, getRect, getRight, getSubject, getTitle, getTop, hashCode, isDeleted, 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 PdfFormRadioButton(String name, int fieldFlags)
name
- name for the radio button in the documentfieldFlags
- formfield attributes
public PdfFormRadioButton(String name, String alternateName, String mappingName, int fieldFlags)
name
- name for the radio button in the documentalternateName
- alternate name for the radio button in the documentmappingName
- mapping name for the push button in the documentfieldFlags
- formfield attributes
public PdfFormRadioButton(String name, String alternateName, String mappingName)
name
- name for the radio button in the documentalternateName
- alternate name for the radio button in the documentmappingName
- mapping name for the push button in the documentpublic PdfFormRadioButton(String name)
name
- name for the radio button in the documentpublic PdfFormRadioButton(PdfRect rect)
specify a name
of the radio button.
rect
- bounding box of the radio buttonpublic PdfFormRadioButton(PdfRect r, String name, int fieldFlags)
r
- bounding box of the radio buttonname
- name for the radio button in the documentfieldFlags
- formfield attributes
public PdfFormRadioButton(PdfRect r, String name)
r
- bounding box of the radio buttonname
- name for the radio button in the documentpublic PdfFormRadioButton(PdfRect r, String name, String alternateName, String mappingName, int fieldFlags)
r
- bounding box of the radio buttonname
- name for the radio button in the documentalternateName
- alternate name for the radio button in the documentmappingName
- mapping name for the radio button in the documentfieldFlags
- formfield attributes
public PdfFormRadioButton(PdfRect r, String name, String alternateName, String mappingName)
r
- bounding box of the radio buttonname
- name for the radio button in the documentalternateName
- alternate name for the radio button in the documentmappingName
- mapping name for the radio button in the documentpublic PdfFormRadioButton(String name, int fieldFlags, Color borderColor, Color backgroundColor)
name
- name for the radio button in the documentfieldFlags
- formfield attributes
borderColor
- color of the border of the radio buttonbackgroundColor
- background color of the radio buttonpublic PdfFormRadioButton(String name, String alternateName, String mappingName, int fieldFlags, Color borderColor, Color backgroundColor)
name
- name for the radio button in the documentalternateName
- alternate name for the radio button in the documentmappingName
- mapping name for the push button in the documentfieldFlags
- formfield attributes
borderColor
- color of the border of the radio buttonbackgroundColor
- background color of the radio buttonpublic PdfFormRadioButton(String name, String alternateName, String mappingName, Color borderColor, Color backgroundColor)
name
- name for the radio button in the documentalternateName
- alternate name for the radio button in the documentmappingName
- mapping name for the push button in the documentborderColor
- color of the border of the radio buttonbackgroundColor
- background color of the radio buttonpublic PdfFormRadioButton(String name, Color borderColor, Color backgroundColor)
name
- name for the radio button in the documentborderColor
- color of the border of the radio buttonbackgroundColor
- background color of the radio buttonpublic PdfFormRadioButton(PdfRect r, String name, int fieldFlags, Color borderColor, Color backgroundColor)
r
- bounding box of the radio buttonname
- name for the push button in the documentfieldFlags
- formfield attributes
borderColor
- border color of the radio buttonbackgroundColor
- background color of the radio buttonpublic PdfFormRadioButton(PdfRect r, String name, Color borderColor, Color backgroundColor)
r
- bounding box of the radio buttonname
- name for the radio button in the documentborderColor
- border color of the radio buttonbackgroundColor
- background color of the radio buttonpublic PdfFormRadioButton(PdfRect r, String name, String alternateName, String mappingName, int fieldFlags, Color borderColor, Color backgroundColor)
r
- bounding box of the radio buttonname
- name for the radio button in the documentalternateName
- alternate name for the radio button in the documentmappingName
- mapping name for the radio button in the documentfieldFlags
- formfield attributes
borderColor
- border color of the radio buttonbackgroundColor
- background color of the radio buttonpublic PdfFormRadioButton(PdfRect r, String name, String alternateName, String mappingName, Color borderColor, Color backgroundColor)
r
- bounding box of the radio buttonname
- name for the radio button in the documentalternateName
- alternate name for the radio button in the documentmappingName
- mapping name for the radio button in the documentborderColor
- border color of the radio buttonbackgroundColor
- background color of the radio buttonMethod Detail |
---|
public Object clone()
public void setNormalAppearance(PdfAppearanceStream normalAppearance)
void addNormalAppearance(PdfAppearanceStream ap, int state)
.
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)
void addDownAppearance(PdfAppearanceStream ap, int state)
.
getNormalAppearance()
,
getDownAppearance()
,
getRolloverAppearance()
,
setNormalAppearance(PdfAppearanceStream)
,
setRolloverAppearance(PdfAppearanceStream)
public PdfAppearanceStream getDownAppearance()
getNormalAppearance()
,
getDownAppearance()
,
setNormalAppearance(PdfAppearanceStream)
,
setRolloverAppearance(PdfAppearanceStream)
,
setDownAppearance(PdfAppearanceStream)
public void setRolloverAppearance(PdfAppearanceStream rolloverAppearance)
void
addRolloverAppearance(PdfAppearanceStream ap, int state)
.
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 void setName(String name)
radio button group
form field
, provided that the radio button form field was
selected.
setName
in class PdfFormField
name
- name for the radio buttongetOnStateName()
public void setState(int appearanceState)
appearanceState
- constant
specifying whether the radio button is checkedpublic String getOnStateName()
radio button group form field
if the radio button is selected. When radio button is selected,
its name will be submitted as the value for the parent radio
button group.
radio button group form field
if the radio button is selectedsetName(String)
public List getChildList()
PdfFormField
getChildList
in class PdfFormField
PdfFormField.TYPE_CHECKGROUP
,
PdfFormField.TYPE_RADIOGROUP
,
PdfProDocument.addFormField(PdfFormField, String[])
public int getHighlightMode()
constant
specifying the highlight stylepublic void setHighlightMode(int highlightMode)
highlightMode
- constant
specifying the highlight stylepublic int getState()
constant
specifying the button statepublic 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 statepublic 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 statepublic 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
|
Pro. Ed. v5.4 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |