|
Spring Quarter 1996 Document Author: Project Sponsors: Gregory Abowd |
Jason Pierce (Manager) |
Click here to see the full Project Description.
High-level architecture
The Scooby2BeDue system is divided up into 5 major
components, as depicted in the following diagram. This high-level
architecture depiction represents a decomposition of the system
into components or subsystems:
Data and control among the four components of the Applet are further described in the Design Specification section of this document below.
The fifth significant component depicted below is the Telnet Server through which all interaction with the File System occurs. The Files component handles all file read/write interaction from the ToDo Applet to the Telnet Server.
The following is a high-level architecture depiction of the Scooby2BeDue system:
Since the Scooby2beDue To-Do List Manager is divided up into 4
sections, the internal wokings of each section will be described
seperately, and the interactions will be described throughout.
Figure 1: High-Level Architecture Design
Interface
Everything that happens inside the List Manager is driven by the
main applet class, ToDo. The rest of the Interface objects
are all dialog boxes. The majority of the data processing and
interface management is done by ToDo's handleEvent method. This
method is called every time the user clicks on anything in the main
screen (shown below). This method then does
any required processing in response to the user's input.
The way dialog boxes are handled in the Scooby2beDue To-Do List
Manager is somewhat unusual. All of the dialog box classes have
constructors that display the dialog window and shift the input
focus to that dialog box. All of these dialog boxes are modal,
so, the user cannot interact with the main screen while the
dialog is displayed. Also, while displayed, the dialog's
handleEvent method recieves any user events, rather than the
main applet handleEvent. This method does any processing for
user interactions with the dialog box. When the user dismisses
a dialog box (by pressing OK, Cancel, etc.), an event is generated
in the main applet event handler that notifies the applet that the
dialog box has been closed and returns any data collected. The
dialog boxes remove themselves from the screen.
The handleEvent methods of the applet and the dialog boxes do all
of the high level processing and call methods in the other objects.

Figure 2: Object-Oriented Design of Scooby2BeDue Applet
Detailed Class Interface Specification
public class ToDo extends java.applet.Applet {
public final static int FILENAME = ".todolist";
protected List mainList;
protected Choice primarySort;
protected Choice secondarySort;
protected TextField description;
protected TextField dueMonth;
protected TextField dueDay;
protected TextField dueYear;
protected TextField startMonth;
protected TextField startDay;
protected TextField startYear;
protected Choice priority;
protected Choice group;
protected ItemList itemList;
protected GroupList groupList;
protected boolean initDone;
public void init();
public void start();
public void stop();
public boolean handleEvent( Event evt );
}
public class LoginDlg extends java.awt.Dialog {
protected TextField userName;
protected TextField password;
protected Applet app;
public LoginDlg( Applet app );
public boolean handleEvent( Event evt );
}
public class GroupsDlg extends java.awt.Dialog {
protected TextField groupName;
protected Choice groupList;
protected Applet app;
protected GroupList groups;
public GroupsDlg( Applet app, GroupList tGroups );
public boolean handleEvent( Event evt );
}
public class NewDlg extends java.awt.Dialog {
protected TextField description;
protected TextField dueMonth;
protected TextField dueDay;
protected TextField dueYear;
protected TextField startMonth;
protected TextField startDay;
protected TextField startYear;
protected Choice priority;
protected Choice group;
protected Applet app;
protected GroupList groups;
public NewDlg( Applet app, GroupList tGroups );
public boolean handleEvent( Event evt );
}
public class MsgDlg extends java.awt.Dialog {
protected Applet app;
public MsgDlg( Applet app, String str );
public boolean handleEvent( Event evt );
}
public class YesNoDlg extends java.awt.Dialog {
protected Applet app;
public YesNoDlg( Applet tApp, String str );
public boolean handleEvent( Event evt );
}
public class ItemList {
public final static int SORT_PRIORITY = 0;
public final static int SORT_ENDDATE = 1;
public final static int SORT_GROUP = 2;
public final static int SORT_STARTDATE = 3;
protected final static int SORT_DONE = 4;
protected int sort1;
protected int sort2;
protected ItemRec head;
protected ItemRec tail;
protected ItemRec mru;
protected RemoteFile file;
protected GroupList groups;
public ItemList( RemoteFile tFile );
public void readFile() throws IOException;
public void saveFile() throws IOException;
public GroupList getGroups();
public int getNumItems();
public Item getItem()
throws IndexOutOfBoundsException;
public Item getNextItem()
throws IndexOutOfBoundsException;
public void addItem( Item newItem );
public void deleteItem( int pos )
throws IndexOutOfBoundsException;
public void sort( int tSort1, int tSort2 );
protected void sort( ItemRec head, ItemRec tail,
int sort1, int sort2 );
}
public class Item {
public String description;
public Date startDate;
public Date endDate;
public byte priority;
public String group;
public Item( String tDescription, Date tStartDate,
Date tEndDate, byte tPriority,
String tGroup );
}
class ItemRec {
public ItemRec next;
public ItemRec prev;
public Item item;
public ItemRec( Item tItem );
}
public class GroupList {
protected GroupRec head;
protected GroupRec mru;
public int getNumGroups();
public String getGroup( int pos )
throws IndexOutOfBoundsException;
public String getNextGroup()
throws IndexOutOfBoundsException;
public void addGroup( String tStr );
public void deleteGroup( String tStr )
throws IndexOutOfBoundsException;
}
class GroupRec {
public GroupRec next;
public String name;
public GroupRec( String tName );
}
public class Connection {
protected Socket sock;
protected InputStream in;
protected OutputStream out;
public Connection( String host, int port )
throws UnknownHostException,
IOException;
public int available()
throws IOException;
public int receive( byte[] data )
throws IOException;
public void send( byte[] data )
throws IOException;
protected int getchar()
throws IOException;
}
public class RemoteFile {
protected Connection conn;
public RemoteFile( String host );
public boolean login( String userName, String password );
public void openRead( String filename )
throws IOException;
public void closeRead()
throws IOException;
public void openWrite( String filename )
throws IOException;
public void closeWrite()
throws IOException;
public int available();
public int read( byte[] data )
throws IOException;
public void write( byte[] data )
throws IOException;
}





