amber.server.panel
Interface ContainerHandler

All Known Implementing Classes:
BasePanel

public interface ContainerHandler

This interface is the base interface of a container type component handler. This is a component handler which can contain other objects such as a panel.

Version:
1.0.0
Author:
Dr. David J. Knowles

Field Summary
static byte AddComponent
           
static byte AutoDoLayout
           
static byte ForceDoLayout
           
static byte GetInsets
           
static byte GetInsetsResponse
           
static byte NextAvailableCommand
           
static byte RemoveAllComponents
           
static byte RemoveComponent
           
static byte SetBounds
           
 
Method Summary
 void add(ComponentHandler newComponent, java.lang.Object constraints)
          This function adds a specified component to this panel.
 boolean canClose()
          This function determines if the panel can be closed.
 void doPanelLayout()
          This function forces the target remote panel to re-lay itself out.
 void fillControls()
          This function is called at the end of recreatePanel.
 boolean getAutoDoLayout()
          This function returns the automatic doLayout which occurs when a component is added.
 java.util.Vector getComponents()
          Returns the component vector.
 java.awt.Insets getInsets()
          This function gets the inset values for the container.
 PanelComponentInfo getPanelComponent(int index)
          This function finds the control which is located at the specified location
 PanelComponentInfo getPanelComponentAt(int x, int y)
          This function finds the control which is located at the specified location
 PanelComponentInfo getPanelComponentAt(java.awt.Point point)
          This function finds the control which is located at the specified location
 void recreatePanel()
          This function dynamically recreates the panel.
 void remove(ComponentHandler component)
          This function removes the specified component from the corresponding remote Panel.
 void saveData()
          This function is called to save any required information in the panel.
 void setAutoDoLayout(boolean state)
          This function turns off the automatic doLayout which occurs when a component is added.
 

Field Detail

AddComponent

public static final byte AddComponent

RemoveComponent

public static final byte RemoveComponent

RemoveAllComponents

public static final byte RemoveAllComponents

SetBounds

public static final byte SetBounds

AutoDoLayout

public static final byte AutoDoLayout

ForceDoLayout

public static final byte ForceDoLayout

GetInsets

public static final byte GetInsets

GetInsetsResponse

public static final byte GetInsetsResponse

NextAvailableCommand

public static final byte NextAvailableCommand
Method Detail

recreatePanel

public void recreatePanel()
                   throws ComponentHandlerException
This function dynamically recreates the panel. This function is not called the first time the panel is created. It is called the second and subsequent times a panel is added to a parent container. Its specific purpose is to set the controls to a known state once they are created. It builds the panel from the current information stored in the components Vector.

fillControls

public void fillControls()
This function is called at the end of recreatePanel. Its specific purpose is to set the controls to a known state once they are created. It is important to note that this function will be called every time the panel is recreated. For this reason operations which should occur once such as adding listeners should be placed in the constructor or other functions called when the class is instantiated (for BasePanel this would be the function defineComponents()). It is normal to call this function from defineComponents().
See Also:
BasePanel.defineComponents()

canClose

public boolean canClose()
This function determines if the panel can be closed. The derived panels must determine if this panel can close. If this is not possible the function should return false. This function is only called when the panel is used in a PanelTemplateGroup and the selected panel is changed.
Returns:
boolean false if it is not possible to close this panel.
See Also:
PanelTemplateGroup

saveData

public void saveData()
This function is called to save any required information in the panel. This function is called externally when another panel wishes to take over the base panel or when closing the panel. This function need not actually do something. This function is only called when the panel is used in a PanelTemplateGroup and the selected panel is changed.
See Also:
PanelTemplateGroup

add

public void add(ComponentHandler newComponent,
                java.lang.Object constraints)
This function adds a specified component to this panel.
Parameters:
newComponent - ComponentHandler for the created component.
constraints - Object containing the constraints defining where the component will be placed in the panel.

remove

public void remove(ComponentHandler component)
            throws ComponentHandlerException
This function removes the specified component from the corresponding remote Panel. This function will attempt to remove the component from the messaging loop code also. As it is possible that components can be created without appearing in the messaging loop it is not considered an error if the component cannot be removed from the messaging system.
Parameters:
component - ComponentHandler for the created component.
Throws:
ComponentHandlerException - containing error information

getComponents

public java.util.Vector getComponents()
Returns the component vector.
Returns:
Vector which contains the components.

getPanelComponentAt

public PanelComponentInfo getPanelComponentAt(java.awt.Point point)
This function finds the control which is located at the specified location
Parameters:
point - Point containing the location of the control.
Returns:
PanelComponentInfo which matches the specified location or null if there is no match.

getPanelComponentAt

public PanelComponentInfo getPanelComponentAt(int x,
                                              int y)
This function finds the control which is located at the specified location
Parameters:
x - int x coordinate of location.
y - int y coordinate of location.
Returns:
PanelComponentInfo which matches the specified location or null if there is no match.

getPanelComponent

public PanelComponentInfo getPanelComponent(int index)
This function finds the control which is located at the specified location
Parameters:
index - int index of the component to retrieve.
Returns:
PanelComponentInfo which matches the specified index.

setAutoDoLayout

public void setAutoDoLayout(boolean state)
                     throws ComponentHandlerException
This function turns off the automatic doLayout which occurs when a component is added.
Parameters:
state - boolean state to set the automatic laying out of components.
Throws:
ComponentHandlerException - with any messaging errors.

getAutoDoLayout

public boolean getAutoDoLayout()
This function returns the automatic doLayout which occurs when a component is added.
Returns:
boolean state of the automatic laying out of components on a panel.

doPanelLayout

public void doPanelLayout()
                   throws ComponentHandlerException
This function forces the target remote panel to re-lay itself out.
Throws:
ComponentHandlerException - with any messaging errors.

getInsets

public java.awt.Insets getInsets()
                          throws ComponentHandlerException
This function gets the inset values for the container. This is the visual elements which are considered a part of drawing the container. For example, in the case of a frame the top inset is the title bar.
Returns:
Inset value for this container.


Copyright © 2002 Clearfield Research Ltd. All Rights Reserved.