Class CPDFRadiobuttonWidget
java.lang.Object
com.compdfkit.core.annotation.CPDFAnnotation
com.compdfkit.core.annotation.form.CPDFWidget
com.compdfkit.core.annotation.form.CPDFRadiobuttonWidget
RadioButton widgets in forms, click event trigger to switch selected state of RadioButton.
Multiple RadioButton controls can be a list, when clicking a RadioButton, it is set as selected, others in the list set as unselected.
Method to set multiple RadioButton in the same list: Set the fieldName of multiple RadioButton to the same value, such as:
radiobutton1.setFieldName("xxx");
radiobutton2.setFieldName("xxx");
radiobutton3.setFieldName("xxx");
Refer to :CPDFWidget.setFieldName(String)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.compdfkit.core.annotation.form.CPDFWidget
CPDFWidget.BorderStyle, CPDFWidget.CheckStyle, CPDFWidget.WidgetTypeNested classes/interfaces inherited from class com.compdfkit.core.annotation.CPDFAnnotation
CPDFAnnotation.AppearanceType, CPDFAnnotation.PSOAnnotationState, CPDFAnnotation.Type -
Method Summary
Modifier and TypeMethodDescriptionintgetColor()Gets check color of Radiobutton.booleanWhether Radiobutton is selected, true means selected, false otherwise.booleanResets Radiobutton.booleansetChecked(boolean isChecked) Sets whether Radiobutton is selected, true means selected, false otherwise.booleansetColor(int color) Sets check color of Radiobutton.booleanupdateAp()Updates annotation appearance.Methods inherited from class com.compdfkit.core.annotation.form.CPDFWidget
clearBorderColor, clearFillColor, getBorderColor, getBorderStyles, getBorderWidth, getCheckStyle, getFieldFlag, getFieldName, getFieldType, getFillAlpha, getFillColor, getRect, getWidgetType, isReadOnly, setBorderColor, setBorderStyles, setBorderWidth, setCheckStyle, setFieldFlag, setFieldName, setFieldType, setFillAlpha, setFillColor, setReadOnly, setRect, updateApMethods inherited from class com.compdfkit.core.annotation.CPDFAnnotation
addToPage, close, createReplyAnnotation, createReplyStateAnnotation, getContent, getCreationDate, getFlags, getMainAnnotNM, getName, getRecentlyModifyDate, getReplies, getState, getTitle, getType, hasAp, isAllowCorrectAnnotationAp, isExitMainAnnot, isHidden, isLocked, isMarkedStateAnnot, isReplyAnnot, isReviewStateAnnot, isValid, removeFromPage, removeFromPageIncludeReplyAnnot, setAllowCorrectAnnotationAp, setContent, setCreationDate, setFlags, setHidden, setLocked, setMarkedAnnotState, setName, setRecentlyModifyDate, setReviewAnnotState, setState, setTitle
-
Method Details
-
isChecked
public boolean isChecked()Whether Radiobutton is selected, true means selected, false otherwise.- Returns:
- Returns whether Radiobutton is selected, true means selected, false otherwise.
-
setChecked
public boolean setChecked(boolean isChecked) Sets whether Radiobutton is selected, true means selected, false otherwise.- Parameters:
isChecked- Whether it is selected.- Returns:
- Returns whether Radiobutton is selected.
-
setColor
public boolean setColor(int color) Sets check color of Radiobutton.- Parameters:
color- check color value of Radiobutton.- Returns:
- Returns whether to successfully set fill color of Radiobutton.
-
getColor
public int getColor()Gets check color of Radiobutton.- Returns:
- Returns check color of Radiobutton.
-
resetForm
public boolean resetForm()Resets Radiobutton.- Overrides:
resetFormin classCPDFWidget- Returns:
- Returns whether to successfully reset Radiobutton.
-
updateAp
public boolean updateAp()Updates annotation appearance. Call this function to update annotation appearance after modifying annotation attribute.- Overrides:
updateApin classCPDFWidget- Returns:
- Returns whether to successfully update annotation appearance.
-