Class EnumRadioButtonGroupBean<E extends java.lang.Enum<E>>
- java.lang.Object
-
- de.alpharogroup.swing.radio.model.EnumRadioButtonGroupBean<E>
-
- Type Parameters:
E- the generic enum type
public class EnumRadioButtonGroupBean<E extends java.lang.Enum<E>> extends java.lang.ObjectThe classEnumRadioButtonGroupBeanrepresents a model object that can be used withJRadioButton's that are assosiated with an Enum.
-
-
Constructor Summary
Constructors Constructor Description EnumRadioButtonGroupBean()Instantiates a newEnumRadioButtonGroupBean.EnumRadioButtonGroupBean(de.alpharogroup.model.api.Model<E> selected)Instantiates a newEnumRadioButtonGroupBean.EnumRadioButtonGroupBean(java.util.Map<E,javax.swing.JRadioButton> radioButtonMap, de.alpharogroup.model.api.Model<E> selected)Instantiates a newEnumRadioButtonGroupBean.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassociate(E enumValue, javax.swing.JRadioButton radioButton)Associate the given enum value with the givenJRadioButton.voidassociateMap(java.util.Map<E,javax.swing.JRadioButton> map)Associate the given Map with the JRadioButton objects as values and the enum values as keys and associates them.de.alpharogroup.model.api.Model<E>getSelected()Gets the selected.EgetSelectedEnum()Gets the selected enum.protected EgetSelectedEnumFromRadioButtons()Resolves the selected enum from the radio buttons.EgetValue()Gets the value.voidsetValue(E enumValue)Sets the value.
-
-
-
Constructor Detail
-
EnumRadioButtonGroupBean
public EnumRadioButtonGroupBean()
Instantiates a newEnumRadioButtonGroupBean.
-
EnumRadioButtonGroupBean
public EnumRadioButtonGroupBean(java.util.Map<E,javax.swing.JRadioButton> radioButtonMap, de.alpharogroup.model.api.Model<E> selected)
Instantiates a newEnumRadioButtonGroupBean.- Parameters:
radioButtonMap- The map with the mapped JRadioButton objects.selected- the model where the selected enum is kept.
-
EnumRadioButtonGroupBean
public EnumRadioButtonGroupBean(de.alpharogroup.model.api.Model<E> selected)
Instantiates a newEnumRadioButtonGroupBean.- Parameters:
selected- the model where the selected enum is kept.
-
-
Method Detail
-
associate
public void associate(E enumValue, javax.swing.JRadioButton radioButton)
Associate the given enum value with the givenJRadioButton.- Parameters:
enumValue- the enum valueradioButton- the radio button
-
associateMap
public void associateMap(java.util.Map<E,javax.swing.JRadioButton> map)
Associate the given Map with the JRadioButton objects as values and the enum values as keys and associates them.- Parameters:
map- the map
-
getSelected
public de.alpharogroup.model.api.Model<E> getSelected()
Gets the selected.- Returns:
- the selected
-
getSelectedEnum
public E getSelectedEnum()
Gets the selected enum.- Returns:
- the selected enum
-
getSelectedEnumFromRadioButtons
protected E getSelectedEnumFromRadioButtons()
Resolves the selected enum from the radio buttons.- Returns:
- the selected enum or null if none is selected.
-
getValue
public E getValue()
Gets the value.- Returns:
- the value
-
setValue
public void setValue(E enumValue)
Sets the value.- Parameters:
enumValue- the new enum value to set
-
-