triptracker.client.ui
Class AbstractFormManager

java.lang.Object
  extended by triptracker.client.ui.AbstractFormManager
All Implemented Interfaces:
FormManager

public abstract class AbstractFormManager
extends Object
implements FormManager

An abstract FormManager class to handle adding, removal and displaying of forms. This class implements basic logic for form management and calls addComponent, removeComponent and showComponent so that the sub-class can modify its component container when needed. This class exists as convenience for creating form manager objects.

Extend this class to create a FormManager and override the addComponent, removeComponent and showComponent methods for simplified form component management. If you implement the FormManager interface, you have to write all the form management logic, which can cause code duplication where more than one form manager class exists.


Field Summary
protected  Form currentForm
          The currently activated form.
protected  List<Form> forms
          List of currently registered forms.
 
Constructor Summary
AbstractFormManager()
           
 
Method Summary
abstract  void addComponent(Form form)
          Invoked as a result of a form calling register.
 void deregister(Form form)
          De-register a form from a form manager.
 void register(Form form)
          Register a form on the form manager.
abstract  void removeComponent(Form form)
          Invoked as a result of a form calling deregister.
abstract  void showComponent(Form form)
          Invoked as a result of a call to showForm.
 void showForm(Form form)
          Shows the specified form on the container controlled by the form manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

forms

protected List<Form> forms
List of currently registered forms.


currentForm

protected Form currentForm
The currently activated form.

Constructor Detail

AbstractFormManager

public AbstractFormManager()
Method Detail

register

public void register(Form form)
Register a form on the form manager. The form manager usually inserts the form into a form list and adds the JComponent from the form to its container object.

Specified by:
register in interface FormManager
Parameters:
form - to register

deregister

public void deregister(Form form)
De-register a form from a form manager. The form manager removes the form from the form list and its container object.

Specified by:
deregister in interface FormManager
Parameters:
form - to de-register

showForm

public void showForm(Form form)
Shows the specified form on the container controlled by the form manager.

Specified by:
showForm in interface FormManager
Parameters:
form - to show

addComponent

public abstract void addComponent(Form form)
Invoked as a result of a form calling register. Sub-classes must override this method in order to provide adding of components to their component container.

Parameters:
form - form to add to container
See Also:
register(Form)

removeComponent

public abstract void removeComponent(Form form)
Invoked as a result of a form calling deregister. Sub-classes must override this method in order to provide removal of components from their component container.

Parameters:
form - form to remove from container
See Also:
deregister(Form)

showComponent

public abstract void showComponent(Form form)
Invoked as a result of a call to showForm. Sub-classes must override this method in order to implement show the appropriate forms when needed.

Parameters:
form - form to display
See Also:
showForm(Form)


Copyright © 2006 Team Trip Tracker. All Rights Reserved.