Summary: Ctors | Methods | Inherited Methods | [Expand All]
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
boolean | equals(Object arg0)
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()
From interface java.lang.AutoCloseable
abstract void | close()

## 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.

##### Throws

PDFNetException |

#### 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.

##### Throws

PDFNetException |

#### public void addGroupButtonsToPage (Page page)

Add all group buttons to the page

##### Parameters

page | The page in which to add the buttons.

##### Throws

PDFNetException |

#### 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.

##### Throws

PDFNetException |

#### 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.

##### Throws

PDFNetException |

#### 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.

##### Throws

PDFNetException |

#### public void destroy ()

##### Throws

PDFNetException |

#### 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

##### Throws

PDFNetException |

#### public Field getField ()

Gets the field associated with this RadioButtonGroup

##### Returns

- The Field associated with this RadioButtonGroup

##### Throws

PDFNetException |

#### public int getNumButtons ()

Gets the number of buttons in this RadioButtonGroup

##### Returns

- The number of buttons in this RadioButtonGroup

##### Throws

PDFNetException |