ks.client.interfaces
Interface IClientComponent


public interface IClientComponent

Interface representing common behavior expected for any client-side GUI component capable of receiving messages from the server. Also contains capability to convert text commands into actual commands to be delivered to the server.

Since:
V2.2 this interface has a reduced counterpart IProcessMessage

Method Summary
 Command interpretCommandString(java.lang.String action, java.util.Iterator args)
          Given action String and Iterator of String arguments, return a Command object representing Command (or null if unable to interpret).
 void makeVisible(java.awt.Frame parent, java.lang.String name, boolean show)
          Make GUI component visible.
 boolean processMessage(Message m)
          Process the given message which was received from the server.
 

Method Detail

makeVisible

public void makeVisible(java.awt.Frame parent,
                        java.lang.String name,
                        boolean show)
Make GUI component visible. Note that the component may be modal, in which case, this makeVisible is a blocking operation. A bit of a hack with regards to the CMI component model. Specifically, if component C1 requires an interface that can be provided by more than one component (i.e., Ca and Cb), then there is no way that we can differentiate these two 'targets' when C1 wishes to make an invocation on the provided interface of Ca and Cb. Thus we will, at times, need to pass a parameter that can be used to determine which target is to process the actual method request. Note that this is ad hoc, and I don't like it! For now, require that source component C1 to be properly customized to "know" the name of the target components, and require each target component to also be customized so that only the proper receiving one actually does anything! Finally, since modal dialogs are an important part of the client interface, we need to pass in parent frame. Ugghh. Lots of java-specificness here that is hard to explain...

Parameters:
parent - Parent Frame from which a modal dialog can be constructed.
name - Name of the component to be made visible.
show - Determine whether component is to be shown.

processMessage

public boolean processMessage(Message m)
Process the given message which was received from the server. Note that this message is sent to all possible target components that are required. Perhaps multiple components will respond, but we expect that only one will be properly configured to process the message.

Parameters:
m - Message
Returns:
boolean

interpretCommandString

public Command interpretCommandString(java.lang.String action,
                                      java.util.Iterator args)
Given action String and Iterator of String arguments, return a Command object representing Command (or null if unable to interpret). Useful for interpreting commands typed in from some GUI widget.

Parameters:
action - Base action for the command
args - arguments for the command
Returns:
Command object as interpreted (or null if unable to interpret).