このインスタンスで管理をしているラジオボタンの配列を取得する。
選択済みのボタンを取得する。 選択されていない場合はnullを返す。
ボタンを選択する。 nullを引数に取ると全ての選択を解除する。
現在選択されているボタンのbuttonValueを取得する。 選択されたボタンがない場合はnullを返す。
Optional
context: any管理下の全てのボタンの選択を解除する。
Protected
deselect指定されたボタン以外の選択を解除し、BasicRadioButtonManagerからSELECTEDイベントを発行する。
Calls each of the listeners registered for a given event.
Return an array listing the events for which the emitter has registered listeners.
buttonValueを検索キーとして、該当するボタンを取得する。 該当するボタンがない場合はnullを返す。
Return the number of listeners listening to a given event.
Return the listeners registered for a given event.
Optional
fn: (Optional
context: anyOptional
once: booleanAdd a listener for a given event.
Optional
context: anyAdd a one-time listener for a given event.
Optional
context: anyRemove all listeners, or those of the specified event.
Optional
event: keyof BasicButtonSelectionEventType<any>Remove the listeners of a given event.
Optional
fn: (Optional
context: anyOptional
once: boolean
排他的に選択されるボタンを制御するクラスです。
メンバーのBasicRadioButtonが変更されると、このクラスに変更内容が通知されます。 このクラスは変更通知に応じ、他のBasicRadioButtonオブジェクトの選択状態を変更します。 また、このクラスは変更内容をEventとして発信します。
利用する際には以下のような手順でインスタンス化してください。
const btn:BasicRadioButton = new BasicRadioButton(...); const manager:BasicRadioButtonManager = new BasicRadioButtonManager(); //インスタンス化 manager.addButton(btn); manager.selected = btn; //デフォルトで選択されているボタンを指定