amber.server.panel
Class PanelTemplateGroup

java.lang.Object
  |
  +--amber.server.panel.PanelTemplateGroup
All Implemented Interfaces:
java.io.Serializable

public class PanelTemplateGroup
extends java.lang.Object
implements java.io.Serializable

This class is concerned with stitching several panel templates derived from BasePanel and overlaid onto one panel into a group of sharing templates for that panel. It functions in a similar way to java.awt.CheckboxGroup.

Version:
1.0.0
Author:
Dr. David John Knowles
See Also:
BasePanel, CheckboxGroup, Serialized Form

Constructor Summary
PanelTemplateGroup()
          Default constructor.
PanelTemplateGroup(int groupId)
          Initialising constructor.
 
Method Summary
 int getGroupId()
          This function returns the current value of the group ID.
 int getGroupId(BasePanel template)
          This function is a rather bizare one which clients of the template group can use to request the group ID of all the panels in the group.
 BasePanel getSelectedPanelHandler()
          Returns the currently enabled panel handler.
 void setGroupId(int id)
          This function is used to set the group ID.
 void setSelectedPanelHandler(BasePanel template)
          Sets the currently selected panel handler.
 void setSelectedPanelHandlerAndCreate(BasePanel template)
          Sets the currently selected panel handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PanelTemplateGroup

public PanelTemplateGroup()
Default constructor.

PanelTemplateGroup

public PanelTemplateGroup(int groupId)
Initialising constructor. This is used where the group shares a common ID which is statically defined in the HTML.
Parameters:
groupId - int containing the group panel ID.
Method Detail

setSelectedPanelHandler

public void setSelectedPanelHandler(BasePanel template)
                             throws PanelHandlerException
Sets the currently selected panel handler.
Parameters:
template - BasePanel which is to be the new enabled template.
Throws:
amber.server.panelException - if there is a problem.

setSelectedPanelHandlerAndCreate

public void setSelectedPanelHandlerAndCreate(BasePanel template)
                                      throws PanelHandlerException,
                                             ComponentHandlerException
Sets the currently selected panel handler. This function also forces the panel to recreate itself.
Parameters:
template - BasePanel which is to be the new enabled template.
Throws:
PanelHandlerException - if there is a problem.
ComponentHandlerException - if there is a problem creating the panel.

getSelectedPanelHandler

public BasePanel getSelectedPanelHandler()
Returns the currently enabled panel handler.
Returns:
BasePanel which is the currently enabled template.

getGroupId

public int getGroupId()
This function returns the current value of the group ID.
Returns:
int containing the ID for the panel to use.

getGroupId

public int getGroupId(BasePanel template)
This function is a rather bizare one which clients of the template group can use to request the group ID of all the panels in the group. This function works differently depending on the requesting panel is the first panel or one of the subsequent panels. The first panel actually sets the group ID. Subsequent panels get the ID of the first panel.
Parameters:
template - BasePanel to query should this be the first time.
Returns:
int containing the ID for the panel to use.

setGroupId

public void setGroupId(int id)
This function is used to set the group ID. This is the ID which all members of the group can use when messaging. This is the ID of the remote panel which will respond to panel messages.
Parameters:
id - int ID to set the group to.


Copyright © 2002 Clearfield Research Ltd. All Rights Reserved.