|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--amber.client.panel.BaseControl
|
+--amber.client.panel.BasePanel
Extension to BaseControl that presents the user with very extensible backdrop for a new set of components which do not have to message in any way but get this panel to do the messaging for them. The panel acts like a holding area for a number of components. Each component held in the panel has a unique ID in a similar way to the normal Remote Components. In this case however the component ID is used when generating messages. The panel itself has an ID which is used for messaging to the panel itself. As this appears to be a series of normal components to the server it is important that none of the ID's interfere with the those of any other component or subcomponent. For this reason there is an additional layer of processing for all the events handled by this panel before they are passed onto the Base Component. The panel is capable of instantiating a component which extends the BaseControl class.
ApplicationHandler,
ComponentHandler,
BaseComponent| Field Summary | |
protected java.util.Vector |
components
|
protected int[] |
coordinates
|
protected DrawPanel |
panel
|
protected XYLayout |
xyLayout
|
| Fields inherited from class amber.client.panel.BaseControl |
dataDecoder, dataEncoder, encoderBytes, eventEnabled, mainEventHandler, nonVisualObject, panelParent, visualObject |
| Constructor Summary | |
BasePanel()
|
|
| Method Summary | |
void |
addComponent(Packet packet)
This function is used to add a component to the panel. |
protected void |
addComponentToPanel(BaseControl item,
int[] data,
boolean doTheLayout)
This function adds the instantiated component to the panel in the location and size specified by locationData. |
void |
addListeners(BaseComponent listener)
|
static java.lang.String |
coordToString(int offset,
int[] data)
This function converts the specified int array to the corresponding String form (i.e. |
protected BaseControl |
createAndAddComponent(java.lang.String className,
int[] data,
java.lang.String parameters,
boolean doTheLayout)
Create the component and add to the panel. |
protected int[] |
createArray()
This function reads an int array from the data input stream. |
protected java.lang.Object |
createObject(int[] drawInfo)
This function takes the drawInfo and reads the input stream for a string depending on the operation this function converts it into the correct type. |
BaseControl |
findById(int id)
This function locates a component within the panel. |
java.awt.Container |
getContainer()
This function returns the container which holds the child objects. |
short |
getIdFromInternalObject(java.lang.Object source)
This function returns the ID of an object given the corresponding Visual Object returns -1 if no match. |
void |
init(RContainer mainParent,
int[] data,
java.lang.String parameters)
This is the main initialisation function for this class. |
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 |
parseParameters(java.lang.String parameter)
|
void |
processPacket(Packet packet)
This routine contains the logic to parse a packet and perform actions based on the packet's contents. |
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. |
protected void |
removeControl(BaseControl component)
This function removes the specified component from the screen. |
void |
setComponentBounds(Packet packet)
This function sets the location or size of the component. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface amber.client.RContainer |
findBaseComponent, forwardPacket, getId, getNonVisualObject, getVisualObject, setEnabled, setVisible |
| Field Detail |
protected DrawPanel panel
protected XYLayout xyLayout
protected java.util.Vector components
protected int[] coordinates
| Constructor Detail |
public BasePanel()
| Method Detail |
public void init(RContainer mainParent,
int[] data,
java.lang.String parameters)
init in class BaseControlmainParent - RContainer handle to the panel this is a component of.data - int [6] containing information useful to the component
in the order ID, eventMask, x, y, w, h.parameters - String containing any required parameters separated by '|'public void parseParameters(java.lang.String parameter)
parseParameters in class BaseControlpublic void addListeners(BaseComponent listener)
addListeners in class BaseControl
protected BaseControl createAndAddComponent(java.lang.String className,
int[] data,
java.lang.String parameters,
boolean doTheLayout)
className - String containing the name of the class to add.data - int array [ 6 ] containing the coordinates of the component id, eventmask, x, y, w, hparameters - String containing any parameters.doTheLayout - boolean, true if the layout is to occur after adding the component.
protected void addComponentToPanel(BaseControl item,
int[] data,
boolean doTheLayout)
item - BaseControl to be added to the panel.data - int array [ 6 ] containing the location and size of the
component in the panel. The data is in the form id, eventmask, x,y,w,hdoTheLayout - boolean, true if the layout is to occur after adding the component.
public static java.lang.String coordToString(int offset,
int[] data)
offset - int containing the offset into the array to start.data - int array containing the data to convert.public void processPacket(Packet packet)
processPacket in interface RContainerprocessPacket in class BaseControlamber.client.RContainerpacket - Incoming Packet containing the command and all required parameters.public void internalProcessPacket(Packet packet)
RContainerinternalProcessPacket in interface RContaineramber.client.RContainerpacket - Incoming Packet containing the command and all required parameters.
protected int[] createArray()
throws java.io.IOException,
AmberException
java.io.IOException - with any decoding errors.AmberException - if there is no array.
protected java.lang.Object createObject(int[] drawInfo)
throws java.io.IOException
drawInfo - int array with the drawing information.java.io.IOException - with any decoding errors.public boolean isMyId(int id)
isMyId in interface RContainerisMyId in class BaseControlid - int containing the ID to check for.public BaseControl findById(int id)
id - The component ID to find.public void addComponent(Packet packet)
addComponent in interface RContainerpacket - Packet containing the required information.public void setComponentBounds(Packet packet)
setComponentBounds in interface RContainerpacket - Packet containing the required information.public void removeComponent(Packet packet)
removeComponent in interface RContainerpacket - Packet containing the required information.protected void removeControl(BaseControl component)
component - BaseControl to remove.public void removeAllComponents()
removeAllComponents in interface RContainerpublic short getIdFromInternalObject(java.lang.Object source)
getIdFromInternalObject in class BaseControlsource - Object handle to the object which fired the event.BaseControlpublic java.awt.Container getContainer()
getContainer in interface RContainer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||