org.hprog.code
Class CodeApplication

java.lang.Object
  |
  +--org.hprog.code.CodeApplication

public class CodeApplication
extends java.lang.Object

The main workhorse class for a client program


Field Summary
static int ALIVE_PERIOD
          Number of milliseconds between sending automatic keep-alives to the server
 
Constructor Summary
CodeApplication(java.net.URL base, java.awt.Component _component, javax.swing.JDesktopPane desktop, java.lang.String _host, int _port, java.lang.String _handle, java.lang.String _session, java.lang.String _lang, java.lang.String _desc, boolean local)
          Only constructor
 
Method Summary
 void disableLocalInterrupt()
          Configure menus to disable interrupting the local interpreter
 void enableLocalInterrupt()
          Configure menus to enable interrupting the local interpreter
 javax.swing.JMenuBar getMenuBar()
          Get the menu bar in use
 java.lang.String getText(java.lang.String fname)
          Get the text of a shared source file
 void insertText(java.lang.String fname, int pos, java.lang.String text)
          Insert text into a shared source file
 void logln(java.lang.String text)
          Log a line of text to the chat window
 void remoteBegin()
          Configure menus to begin a remote interpreter query
 void remoteEnd()
          Configure menus to end a remote interpreter query
 void removeText(java.lang.String fname, int pos, int len)
          Remove text from a shares source file
 void resized()
          Call when the desktop has been resized
 void setComponent(java.awt.Component c)
          Set the component considered as the container of the application
 void setDims()
          Update stored information on the dimensions of the desktop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALIVE_PERIOD

public static final int ALIVE_PERIOD
Number of milliseconds between sending automatic keep-alives to the server

See Also:
Constant Field Values
Constructor Detail

CodeApplication

public CodeApplication(java.net.URL base,
                       java.awt.Component _component,
                       javax.swing.JDesktopPane desktop,
                       java.lang.String _host,
                       int _port,
                       java.lang.String _handle,
                       java.lang.String _session,
                       java.lang.String _lang,
                       java.lang.String _desc,
                       boolean local)
Only constructor

Parameters:
base - base URL for locating files needed by interpreters
_component - container component for the application
desktop - container pane for the application
_host - hostname to which to connect
_port - port number on which to connect
_session - name of session to which to connect
_lang - language to be used in the session (ignored if joining existing session)
_desc - description of new session (ignored if joining existing session)
local - load a local interpreter?
Method Detail

setDims

public void setDims()
Update stored information on the dimensions of the desktop


resized

public void resized()
Call when the desktop has been resized


setComponent

public void setComponent(java.awt.Component c)
Set the component considered as the container of the application

Parameters:
c - the container component

getMenuBar

public javax.swing.JMenuBar getMenuBar()
Get the menu bar in use


logln

public void logln(java.lang.String text)
Log a line of text to the chat window

Parameters:
text - text to log

getText

public java.lang.String getText(java.lang.String fname)
Get the text of a shared source file

Parameters:
fname - name of source file
Returns:
text of file, or "" if not found

insertText

public void insertText(java.lang.String fname,
                       int pos,
                       java.lang.String text)
Insert text into a shared source file

Parameters:
fname - name of source file
pos - character index at which to insert
text - text to insert

removeText

public void removeText(java.lang.String fname,
                       int pos,
                       int len)
Remove text from a shares source file

Parameters:
fname - name of source file
pos - character index at which to remove
len - number of characters to remove

enableLocalInterrupt

public void enableLocalInterrupt()
Configure menus to enable interrupting the local interpreter


disableLocalInterrupt

public void disableLocalInterrupt()
Configure menus to disable interrupting the local interpreter


remoteBegin

public void remoteBegin()
Configure menus to begin a remote interpreter query


remoteEnd

public void remoteEnd()
Configure menus to end a remote interpreter query