Synergy Home Page

au.edu.swin.synergy.lib
Class BSelectionListener

java.lang.Object
  |
  +--au.edu.swin.synergy.lib.BSelectionListener

public class BSelectionListener
extends Object
implements ListSelectionListener

This will detect selection events in the group lists and change the state of the given buttons to reflect the available options.

Author:
Tristan Austin Please complete these missing tags
Copyright Belongs To:
 

Constructor Summary
BSelectionListener(ListSelectionModel selectionModel, JButton button)
          This creates a new listener and sets the buttons to change the state of.
BSelectionListener(ListSelectionModel selectionModel, JButton button, boolean selectionState)
          This creates a new listener and sets the buttons to change the state of.
 
Method Summary
 void setSelectedState(boolean selectedState)
          This will set the state the buttons will be set to when an item is selected.
protected  void setStates()
          When this is called it will set the state of the button this selection listener is responsible for.
 void valueChanged(ListSelectionEvent selectionEvent)
          When the user changes the current selection of the registered list of users or groups, this method will be called.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BSelectionListener

public BSelectionListener(ListSelectionModel selectionModel,
                          JButton button)
This creates a new listener and sets the buttons to change the state of.
Parameters:
buttons - The array of JButtons to update Please complete the missing tags for BSelectionListener

BSelectionListener

public BSelectionListener(ListSelectionModel selectionModel,
                          JButton button,
                          boolean selectionState)
This creates a new listener and sets the buttons to change the state of.
Parameters:
buttons - The array of JButtons to update Please complete the missing tags for BSelectionListener
Method Detail

valueChanged

public void valueChanged(ListSelectionEvent selectionEvent)
When the user changes the current selection of the registered list of users or groups, this method will be called. It will run through the list of buttons to enable/disable as required and change their state.

If an item in the registered list is selected, the buttons will all be enabled, if no item is selected, they will all be disabled.

Specified by:
valueChanged in interface ListSelectionListener
Parameters:
-  
Returns:
 
Pre Condition:
 
Post Condition:
 

setStates

protected void setStates()
When this is called it will set the state of the button this selection listener is responsible for.

setSelectedState

public void setSelectedState(boolean selectedState)
This will set the state the buttons will be set to when an item is selected. That is, if you pass in false, the buttons will not be enabled when an item is selected, where as if you set it to true, it will. It is true by default.
Parameters:
selectedState - The state to set the buttons to when items are selected

Synergy Home Page