amber.client
Interface RContainer

All Known Implementing Classes:
RBase, BasePanel, PMenu

public interface RContainer

This interface is used by all classes which contain other components (i.e. typically Panel Controls). This is used to allow the Panel Controls to have a valid parent to attach to which will handle certain functions (such as forwarding packets) and processing incoming packets.

Version:
1.0.0
Author:
Dr. David J. Knowles
See Also:
ApplicationHandler, ComponentHandler, BaseComponent, BasePanel

Method Summary
 void addComponent(Packet packet)
          This function is used to add a component to the panel.
 BaseComponent findBaseComponent()
          This function is used to find the parent applet at the top of the chain.
 void forwardPacket(Packet packet)
          Called by the ReceiveThread and any internal functions when a packet is to be sent to its required destination.
 java.awt.Container getContainer()
          This function returns the container which holds the child objects.
 short getId()
          This is a function which spoofs the ID so that the ID of the component which originally sent the message is returned rather than this id.
 java.lang.Object getNonVisualObject()
          This function returns any non visual element associated with this container.
 java.awt.Component getVisualObject()
          This function returns the visual element associated with this container.
 void internalProcessPacket(Packet packet)
          This function is to directly process the commands.
 boolean isMyId(int id)
          This function returns true if the id handed to it is to be handled here.
 void processPacket(Packet packet)
          This function takes incoming packets and processes them passing them onto the component which needs it.
 void removeAllComponents()
          This function is used to remove all sub components from the panel.
 void removeComponent(Packet packet)
          This function is used to remove a component from the panel.
 void setComponentBounds(Packet packet)
          This function sets the location or size of the component.
 void setEnabled(boolean enabled)
          This function is called to enable or disable the control.
 void setVisible(boolean visible)
          This function is called to show or hide the control.
 

Method Detail

processPacket

public void processPacket(Packet packet)
This function takes incoming packets and processes them passing them onto the component which needs it. It also processes incoming packets which relate to this component.
Parameters:
packet - Incoming Packet containing the command and all required parameters.

internalProcessPacket

public void internalProcessPacket(Packet packet)
This function is to directly process the commands. No redirection will take place and the destination ID is considered irrelevant.
Parameters:
packet - Incoming Packet containing the command and all required parameters.

forwardPacket

public void forwardPacket(Packet packet)
                   throws AmberException
Called by the ReceiveThread and any internal functions when a packet is to be sent to its required destination. This function examines the packet and passes it to the appropriate applet.
Parameters:
packet - Packet containing the information to send to the specified component.

getId

public short getId()
This is a function which spoofs the ID so that the ID of the component which originally sent the message is returned rather than this id.
Returns:
short containing the ID.

isMyId

public boolean isMyId(int id)
This function returns true if the id handed to it is to be handled here.
Parameters:
id - int containing the ID to check for.
Returns:
boolean true if this component handles this ID.

addComponent

public void addComponent(Packet packet)
This function is used to add a component to the panel. Packet structure: int id, int eventmask, int x, int y, int w, int h, string class, string parameters
Parameters:
packet - Packet containing the required information.

removeComponent

public void removeComponent(Packet packet)
This function is used to remove a component from the panel. Packet structure: int id
Parameters:
packet - Packet containing the required information.

setComponentBounds

public void setComponentBounds(Packet packet)
This function sets the location or size of the component. Packet structure: int id, int type, int x (width), int y (height), (int width, int height) bracketed objects optional types which are dependant on the type field.
Parameters:
packet - Packet containing the required information.

removeAllComponents

public void removeAllComponents()
This function is used to remove all sub components from the panel.

setVisible

public void setVisible(boolean visible)
This function is called to show or hide the control.

setEnabled

public void setEnabled(boolean enabled)
This function is called to enable or disable the control.

findBaseComponent

public BaseComponent findBaseComponent()
This function is used to find the parent applet at the top of the chain.
Returns:
findBaseComponent if found or null if not.

getVisualObject

public java.awt.Component getVisualObject()
This function returns the visual element associated with this container.
Returns:
Component which is the visual component.

getNonVisualObject

public java.lang.Object getNonVisualObject()
This function returns any non visual element associated with this container.
Returns:
Object which is the non visual component.

getContainer

public java.awt.Container getContainer()
This function returns the container which holds the child objects.
Returns:
Container which holds the child objects.


Copyright © 2002 Clearfield Research Ltd. All Rights Reserved.