cdx.scorebot.util.swing.binding
Class ButtonGroupBound<FROM,TO>

java.lang.Object
  extended by javax.swing.ButtonGroup
      extended by cdx.scorebot.util.swing.binding.ButtonGroupBound<FROM,TO>
All Implemented Interfaces:
BoundComponent, java.io.Serializable

public class ButtonGroupBound<FROM,TO>
extends javax.swing.ButtonGroup
implements BoundComponent

Describes a group of JRadioButtonBound's whose selection value of type TO maps to the bound value of type FROM.

Author:
David Underhill
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.ButtonGroup
buttons
 
Constructor Summary
ButtonGroupBound()
          Instantiates an unbound ButtonGroup
ButtonGroupBound(java.lang.Object boundItem, java.lang.String varName)
          Instantiates a bound ButtonGroup; generic types MUST be the same
ButtonGroupBound(java.lang.Object boundItem, java.lang.String getterName, java.lang.String setterName)
          Instantiates a bound ButtonGroup; generic types MUST be the same
ButtonGroupBound(java.lang.Object boundItem, java.lang.String getterName, java.lang.String setterName, int indexAt)
          Instantiates a bound ButtonGroup; generic types MUST be the same
ButtonGroupBound(java.lang.String varName)
          Instantiates an unbound ButtonGroup; generic types MUST be the same
ButtonGroupBound(TypeTranslator<FROM,TO> translator, java.lang.Object boundItem, java.lang.String varName)
          Instantiates a bound ButtonGroup
ButtonGroupBound(TypeTranslator<FROM,TO> translator, java.lang.Object boundItem, java.lang.String getterName, java.lang.String setterName)
          Instantiates a bound ButtonGroup
ButtonGroupBound(TypeTranslator<FROM,TO> translator, java.lang.Object boundItem, java.lang.String getterName, java.lang.String setterName, int indexAt)
          Instantiates a bound ButtonGroup
ButtonGroupBound(TypeTranslator<FROM,TO> translator, java.lang.String varName)
          Instantiates an unbound ButtonGroup
ButtonGroupBound(TypeTranslator<FROM,TO> translator, java.lang.String getterName, java.lang.String setterName)
          Instantiates an unbound ButtonGroup
 
Method Summary
 void add(JRadioButtonBound<TO> b)
          Adds the button to the group.
 ButtonGroupDelegate<FROM,TO> getBindingDelegate()
          gets the delete which controls the binding
 
Methods inherited from class javax.swing.ButtonGroup
add, clearSelection, getButtonCount, getElements, getSelection, isSelected, remove, setSelected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ButtonGroupBound

public ButtonGroupBound()
Instantiates an unbound ButtonGroup


ButtonGroupBound

public ButtonGroupBound(TypeTranslator<FROM,TO> translator,
                        java.lang.String varName)
Instantiates an unbound ButtonGroup

Parameters:
translator - how to translate between the value in the boundItem (type FROM) a another value of type TO
varName - the name of the variable; assumes the getter and setter name will be get and set followed by varName with its first letter capitalized (ex: if varName is "value" then the getter will be getValue).

ButtonGroupBound

public ButtonGroupBound(TypeTranslator<FROM,TO> translator,
                        java.lang.Object boundItem,
                        java.lang.String varName)
Instantiates a bound ButtonGroup

Parameters:
translator - how to translate between the value in the boundItem (type FROM) a another value of type TO
boundItem - the object this is bound to (contains the value to be modified as specified by varName)
varName - the name of the variable; assumes the getter and setter name will be get and set followed by varName with its first letter capitalized (ex: if varName is "value" then the getter will be getValue).

ButtonGroupBound

public ButtonGroupBound(TypeTranslator<FROM,TO> translator,
                        java.lang.String getterName,
                        java.lang.String setterName)
Instantiates an unbound ButtonGroup

Parameters:
translator - how to translate between the value in the boundItem (type FROM) a another value of type TO
getterName - how to get the bound value from the bound object
setterName - how to set the bound value from the bound object

ButtonGroupBound

public ButtonGroupBound(TypeTranslator<FROM,TO> translator,
                        java.lang.Object boundItem,
                        java.lang.String getterName,
                        java.lang.String setterName)
Instantiates a bound ButtonGroup

Parameters:
translator - how to translate between the value in the boundItem (type FROM) a another value of type TO
boundItem - the object this is bound to (contains the value to be modified as specified by the getter and setter name)
getterName - how to get the bound value from the bound object
setterName - how to set the bound value from the bound object

ButtonGroupBound

public ButtonGroupBound(TypeTranslator<FROM,TO> translator,
                        java.lang.Object boundItem,
                        java.lang.String getterName,
                        java.lang.String setterName,
                        int indexAt)
Instantiates a bound ButtonGroup

Parameters:
translator - how to translate between the value in the boundItem (type FROM) a another value of type TO
boundItem - the object this is bound to (contains the value to be modified as specified by the getter and setter name)
getterName - how to get the bound value from the bound object
setterName - how to set the bound value from the bound object
indexAt - if bound value is stored within a container with get(index) and set(index, Object) methods, then indexAt should be the index to use; otherwise, indexAt should be -1

ButtonGroupBound

public ButtonGroupBound(java.lang.String varName)
Instantiates an unbound ButtonGroup; generic types MUST be the same

Parameters:
varName - the name of the variable; assumes the getter and setter name will be get and set followed by varName with its first letter capitalized (ex: if varName is "value" then the getter will be getValue).

ButtonGroupBound

public ButtonGroupBound(java.lang.Object boundItem,
                        java.lang.String varName)
Instantiates a bound ButtonGroup; generic types MUST be the same

Parameters:
boundItem - the object this is bound to (contains the value to be modified as specified by varName)
varName - the name of the variable; assumes the getter and setter name will be get and set followed by varName with its first letter capitalized (ex: if varName is "value" then the getter will be getValue).

ButtonGroupBound

public ButtonGroupBound(java.lang.Object boundItem,
                        java.lang.String getterName,
                        java.lang.String setterName)
Instantiates a bound ButtonGroup; generic types MUST be the same

Parameters:
boundItem - the object this is bound to (contains the value to be modified as specified by the getter and setter name)
getterName - how to get the bound value from the bound object
setterName - how to set the bound value from the bound object

ButtonGroupBound

public ButtonGroupBound(java.lang.Object boundItem,
                        java.lang.String getterName,
                        java.lang.String setterName,
                        int indexAt)
Instantiates a bound ButtonGroup; generic types MUST be the same

Parameters:
boundItem - the object this is bound to (contains the value to be modified as specified by the getter and setter name)
getterName - how to get the bound value from the bound object
setterName - how to set the bound value from the bound object
indexAt - if bound value is stored within a container with get(index) and set(index, Object) methods, then indexAt should be the index to use; otherwise, indexAt should be -1
Method Detail

add

public void add(JRadioButtonBound<TO> b)
Adds the button to the group.

Parameters:
b - the button to be added

getBindingDelegate

public ButtonGroupDelegate<FROM,TO> getBindingDelegate()
gets the delete which controls the binding

Specified by:
getBindingDelegate in interface BoundComponent