public class

RadioButtonGroup

extends Object
implements AutoCloseable
java.lang.Object
   ↳ com.pdftron.pdf.annots.RadioButtonGroup

Class Overview

An object representing a Group of Radio Buttons that can be used to create new Radio Buttons. If a group contains multiple buttons they will be connected.

Summary

Public Constructors
RadioButtonGroup(Field field)
Creates a RadioButtonGroup and initialize it using given Field object.
RadioButtonGroup()
Creates a null (non-valid) RadioButtonGroup.
Public Methods
RadioButtonWidget add(Rect pos, String onstate)
Adds a new RadioButtonWidget to the RadioButtonGroup
RadioButtonWidget add(Rect pos)
Adds a new RadioButtonWidget to the RadioButtonGroup
void addGroupButtonsToPage(Page page)
Add all group buttons to the page
void close()
Frees the native memory of the object.
static RadioButtonGroup create(Doc doc)
Creates a new RadioButtonGroup in the specified document.
static RadioButtonGroup create(Doc doc, String field_name)
Creates a new RadioButtonGroup in the specified document.
void destroy()
RadioButtonWidget getButton(int index)
Retrieves the button at a given index.
Field getField()
Gets the field associated with this RadioButtonGroup
int getNumButtons()
Gets the number of buttons in this RadioButtonGroup
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.lang.AutoCloseable

Public Constructors

public RadioButtonGroup (Field field)

Creates a RadioButtonGroup and initialize it using given Field object.

Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.

Parameters
field The field with which to initialize the RadioButtonGroup

public RadioButtonGroup ()

Creates a null (non-valid) RadioButtonGroup.

Public Methods

public RadioButtonWidget add (Rect pos, String onstate)

Adds a new RadioButtonWidget to the RadioButtonGroup

Parameters
pos A rectangle specifying the annotation's bounds, specified in user space coordinates.
onstate The onstate for this button. This will rarely need to be explicitly set. However, it can be used to allow multiple radiobuttons in a group to be on at once if they have the same onstate.
Returns
  • A newly created default RadioButtonWidget.

public RadioButtonWidget add (Rect pos)

Adds a new RadioButtonWidget to the RadioButtonGroup

Parameters
pos A rectangle specifying the annotation's bounds, specified in user space coordinates.
Returns
  • A newly created default RadioButtonWidget.

public void addGroupButtonsToPage (Page page)

Add all group buttons to the page

Parameters
page The page in which to add the buttons.

public void close ()

Frees the native memory of the object. This can be explicity called to control the deallocation of native memory and avoid situations where the garbage collector does not free the object in a timely manner.

public static RadioButtonGroup create (Doc doc)

Creates a new RadioButtonGroup in the specified document.

Parameters
doc The document in which the RadioButtonGroup is created.
Returns
  • A newly created RadioButtonGroup.

public static RadioButtonGroup create (Doc doc, String field_name)

Creates a new RadioButtonGroup in the specified document.

Parameters
doc The document in which the RadioButtonGroup is created.
field_name The name of the field to create and use in this RadioButtonGroup.
Returns
  • A newly created RadioButtonGroup.

public void destroy ()

public RadioButtonWidget getButton (int index)

Retrieves the button at a given index.

Parameters
index The index to use.
Returns
  • The RadioButtonWidget at the given index

public Field getField ()

Gets the field associated with this RadioButtonGroup

Returns
  • The Field associated with this RadioButtonGroup

public int getNumButtons ()

Gets the number of buttons in this RadioButtonGroup

Returns
  • The number of buttons in this RadioButtonGroup