Tomscop Development Procedure

Last update 2003/10/29

We defined rules to develop Shared Application for TOMSCOP
A Shared Application consists of GUI(JPanel in the current system),
Manager, EventListener and Utilities

Example In the case of developping Shared application called Test.
At first, make TestPanel.java TestManager.java TestListener.java
TestUtilities.java. Developer should make folder test at tomscop
\application and save created classes

Example:tomscop\application\test\TestPanel.java
New Shared Application is added on the tabbedpane in TOMSCOP

[How to add]
In TOMSCOP class RightPanel.java
TestPanel testpanel = new TestPanel();
Addtab(testpanel);

[Each classes details]
[GUI]
GUI is defined at TestPanel.java. The GUI must extend JPanel.

Example: public class TestPanel extends Jpanel

[Listener]
TestListener processes a event at TestPanel.java.
A peer send messages in this process

Example:
if( e.getSource()==shareButton){
  sendRoomMsg(file);
}
Message Transportation will discuss in the next section.

[Manager]
Manager is mainly process a message from GroupMsgReceiver.java
A message from a peer in the same room is processed in this class.
Developer need to define methods to get and process messages.

In the case Shared Application Test uses method1 in GroupMsgSender.java
(using sendMsg(source, ApplicationID, ObjectID)), developer should define
a method in TestManager.java like below.

public void setTestMessage( String source, int applicationID, int objectID )

If Test uses method2
Public void setTestMessage( String source, int applicationID, int objectID, int x, int y)

Developer classifies attribute of a message element using objectID.
If there are two methods using method2 in Shared Application Test,
one's objectID is defined as 1 and another is 2. In case of Share
Application Joint Drawing Pad, it sends coordinates(x,y) using method2.
When a peer get the message, a peer compares the objectID and
understand that the coordinates is mouse moving or mouse dragging.

Example
public class TestManager {
  public void setTestMessage( String source, int applicationID, int objectID ) {
    switch( objectID ){
      case 1:
      Process
      break;
      case 2:
      break;
    }
  }
}

TOMSCOP developer regists setTestMessage in RoomMsgReceiver.

Example
public class RoomMsgReceiver{
  //
  switch( codingID ){
  //
    switch( applicationID ){
      case 1:
      setTestMessage( source, applicationID, objectID, string );
      break;
    }
  }
}

[Utilities]
This class is created to save variables for shared application.
These variables are refered by Listener.java and Manager.java.

[Message transportation]
shared applications exchange messages using I/O pipes(Propagate-
Type) for group. Therefore a peer can not exchange message with
peers in another room using shared application. On the contrary,
developer need to design shared applications that can be used by
all peer in the same room.

[How to message Transportation]
Shared Application can exchange messages using sendRoomMsg
methods in RoomMsgSender. There are four version at sendRoomMsg
method

1.sendRoomMsg(source, ApplicationID, ObjectID )
2.sendRoomMsg(source, ApplicationID, ObjectID, String)
3.sendRoomMsg(source, ApplicationID, ObjectID, String, String)
4.sendRoomMsg(source, ApplicationID, ObjectID, String, String, File)

source is my peer name(String). ApplicationID is to classify some
Shared Application and is registered at class Definition.java.
ObjectID classifies message attributes in same Shared Application
mentioned at previous chapter and is registered Utilities.java.

Developer can define ObjectID in the Utilities.java freely.
ApplicationID is defined by TOMSCOP developer in Definition.java
Developer must apply for permission to add created Shared Application.

It becomes easy by making based on such specifications to add application to TOMSCOP.

Copyright(c) 2003 Tomomi Kawashima All Rights Reserved.