org.zaval.lw
Class LwGroup

java.lang.Object
  |
  +--org.zaval.lw.LwSwitchManager
        |
        +--org.zaval.lw.LwGroup

public class LwGroup
extends LwSwitchManager

This implementation of the switch manager class is used to control state for a set of switching components where only one component can be "on". The library uses the manager to organize radio groups. The example below shows the manager usage for the purpose:

    ...
    LwCheckbox ch1 = new LwCheckbox("Radio 1");
    LwCheckbox ch2 = new LwCheckbox("Radio 3");
    LwCheckbox ch3 = new LwCheckbox("Radio 3");
    LwGroup    group = new LwGroup();
    ch1.setSwitchManager(group);
    ch2.setSwitchManager(group);
    ch3.setSwitchManager(group);
    ...
 


Constructor Summary
LwGroup()
           
 
Method Summary
 Switchable getSelected()
          Gets the switching component that has "on" state for the group.
 boolean getState(Switchable o)
          Gets state for the specified switching component.
 void setSelected(Switchable s)
          Sets the specified switching component as selected component.
 void setState(Switchable o, boolean b)
          Sets the specified state for the switching component.
 
Methods inherited from class org.zaval.lw.LwSwitchManager
addActionListener, install, perform, removeActionListener, uninstall
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LwGroup

public LwGroup()
Method Detail

getSelected

public Switchable getSelected()
Gets the switching component that has "on" state for the group.
Returns:
a selected switching component.

setSelected

public void setSelected(Switchable s)
Sets the specified switching component as selected component. In this case the old selected component will be switched off. Use null if none of the components need to be selected.
Parameters:
s - the specified switching component.

getState

public boolean getState(Switchable o)
Description copied from class: LwSwitchManager
Gets state for the specified switching component.
Overrides:
getState in class LwSwitchManager
Following copied from class: org.zaval.lw.LwSwitchManager
Parameters:
o - the specified switching component.
Returns:
true if the switching component has "on" state, false if it has "off" state.

setState

public void setState(Switchable o,
                     boolean b)
Description copied from class: LwSwitchManager
Sets the specified state for the switching component.
Overrides:
setState in class LwSwitchManager
Following copied from class: org.zaval.lw.LwSwitchManager
Parameters:
o - the specified switching component.
b - the specified state. The true value corresponds to "on" state and false value corresponds to "off" state.


Copyright © Zaval Creative Engineering Group, 2000-2005.
http://www.zaval.org