J-Sim v1.2.1-p7 API

drcl.comp.lib
Class Talk

java.lang.Object
  extended bydrcl.DrclObj
      extended bydrcl.comp.Component
          extended bydrcl.comp.lib.Talk
All Implemented Interfaces:
ActiveComponent, java.lang.Cloneable, ObjectDuplicable, java.io.Serializable

public class Talk
extends Component
implements ActiveComponent

A simple chat client component. It is a frame with two areas inside: a display area and an input area. Whenever a line is formed in the input area, the line is sent out from the "inout" port. And whenever a message is received from the port, it is displayed in the display area. Ports (in addition to those defined in drcl.comp.Component):

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class drcl.comp.Component
Component.Locks
 
Field Summary
static java.lang.String INOUT_PORT_ID
           
protected  Port port
           
protected  java.awt.TextArea taDisplay
           
protected  java.awt.TextArea taInput
           
 
Fields inherited from class drcl.comp.Component
FLAG_COMPONENT_NOTIFICATION, FLAG_DEBUG_ENABLED, FLAG_DIRECT_OUTPUT_ENABLED, FLAG_ENABLED, FLAG_ERROR_ENABLED, FLAG_EVENT_ENABLED, FLAG_EXPOSED, FLAG_GARBAGE_DISPLAY_ENABLED, FLAG_GARBAGE_ENABLED, FLAG_HAS_EXPOSED_CHILD, FLAG_PORT_NOTIFICATION, FLAG_STARTED, FLAG_STOPPED, FLAG_TRACE_ENABLED, FLAG_UNDEFINED_START, id, infoPort, locks, name, parent, PortGroup_DEFAULT_GROUP, PortGroup_EVENT, PortGroup_SERVICE, Root, Trace_DATA, Trace_SEND
 
Constructor Summary
Talk()
          Constructor.
Talk(java.lang.String id_)
          Constructor.
 
Method Summary
protected  void _start()
          Invoked when the component is run()ed.
 void duplicate(java.lang.Object source_)
          Copies the content from the source_ to this component.
 java.lang.String info()
          Script interface which reveals the internal states of the component.
 boolean isAnonymous()
           
 boolean isEchoEnabled()
           
 void process(java.lang.Object data_, Port inPort_)
          Invoked when data_ arrives this component at the inPort_ port.
protected  void processLine(java.lang.String line_)
           
 void reset()
          Resets this component to the initial state for use anew.
 void setAnonymous(boolean v_)
           
 void setDisplaySize(int rows_, int cols_)
          Sets the number of rows and columns of the display text area.
 void setEchoEnabled(boolean v_)
           
 void setInputSize(int rows_, int cols_)
          Sets the number of rows and columns of the input text area.
 
Methods inherited from class drcl.comp.Component
_resume, _stop, addComponent, addComponent, addEventPort, addEventPort, addForkPort, addPort, addPort, addPort, addPort, addPort, addPort, addPort, addPort, addServerPort, addServerPort, cancelFork, componentAdded, componentRemoved, connect, containsComponent, containsComponent, containsPort, debug, disconnectAll, disconnectAllPeers, disconnectAllPorts, drop, drop, error, error, expose, exposeEventPorts, exposePort, exposePort, exposePort, exposePort, exposePort, findAvailable, findAvailable, findAvailable, finishing, fork, forkAt, getAllComponents, getAllPorts, getAllPorts, getAllWiresInside, getAllWiresInsideOut, getAllWiresOut, getComponent, getComponentFlag, getComponentFlag, getContract, getContractHT, getContractHT, getDebugFlagsInBinary, getDebugLevelNames, getForkManager, getID, getName, getParent, getPort, getPort, getRoot, getRuntime, getTime, iduplicate, isAncestorOf, isComponentNotificationEnabled, isContainer, isDebugEnabled, isDebugEnabledAt, isDirectlyRelatedTo, isDirectOutputEnabled, isEnabled, isErrorNoticeEnabled, isEventExportEnabled, isGarbageDisplayEnabled, isGarbageEnabled, isPortNotificationEnabled, isPortRemovable, isStarted, isStopped, isTraceEnabled, lock, notify, notifyAll, operate, portAdded, portRemoved, reboot, removeAll, removeAllComponents, removeAllPorts, removeAllPorts, removeComponent, removeComponent, removePort, removePort, removePort, resume, run, sduplicate, send, sendAt, setComponentFlag, setComponentFlag, setComponentNotificationEnabled, setContract, setDebugEnabled, setDebugEnabled, setDebugEnabledAt, setDebugEnabledAt, setDebugEnabledAt, setDirectOutputEnabled, setDirectOutputEnabled, setEnabled, setErrorNoticeEnabled, setErrorNoticeEnabled, setEventExportEnabled, setEventExportEnabled, setExecutionBoundary, setGarbageDisplayEnabled, setGarbageDisplayEnabled, setGarbageEnabled, setGarbageEnabled, setID, setID, setName, setPort, setPort, setPortNotificationEnabled, setPortRemovable, setRuntime, setTraceEnabled, setTraceEnabled, sleepFor, sleepUntil, stop, toString, unexpose, unlock, useLocalForkManager, useLocalForkManager, wait, yield
 
Methods inherited from class drcl.DrclObj
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INOUT_PORT_ID

public static final java.lang.String INOUT_PORT_ID
See Also:
Constant Field Values

port

protected Port port

taDisplay

protected java.awt.TextArea taDisplay

taInput

protected java.awt.TextArea taInput
Constructor Detail

Talk

public Talk()
Constructor.


Talk

public Talk(java.lang.String id_)
Constructor.

Method Detail

process

public void process(java.lang.Object data_,
                    Port inPort_)
Invoked when data_ arrives this component at the inPort_ port.

Overrides:
process in class Component
Parameters:
data_ - the arrival data.
inPort_ - the port where the data arrives.

reset

public void reset()
Resets this component to the initial state for use anew. Must call super.reset() in the beginning.

Overrides:
reset in class Component

duplicate

public void duplicate(java.lang.Object source_)
Copies the content from the source_ to this component. Must call super.duplicate() in the beginning.

Specified by:
duplicate in interface ObjectDuplicable
Overrides:
duplicate in class Component

_start

protected void _start()
Invoked when the component is run()ed.

Overrides:
_start in class Component

info

public java.lang.String info()
Script interface which reveals the internal states of the component. It is for debugging and demonstration purpose.

Overrides:
info in class Component

setAnonymous

public void setAnonymous(boolean v_)

isAnonymous

public boolean isAnonymous()

setEchoEnabled

public void setEchoEnabled(boolean v_)

isEchoEnabled

public boolean isEchoEnabled()

setDisplaySize

public void setDisplaySize(int rows_,
                           int cols_)
Sets the number of rows and columns of the display text area. The number of columns also affects that of the input text area.

Parameters:
rows_ - number of rows; no effect if nonpositive value is given.
cols_ - number of columns; no effect if nonpositive value is given.

setInputSize

public void setInputSize(int rows_,
                         int cols_)
Sets the number of rows and columns of the input text area. The number of columns also affects that of the display text area.

Parameters:
rows_ - number of rows; no effect if nonpositive value is given.
cols_ - number of columns; no effect if nonpositive value is given.

processLine

protected void processLine(java.lang.String line_)

J-Sim v1.2.1-p7 API

Copyright © 1998-2003 Distributed Real-time Computing Lab (DRCL). All Rights Reserved.     ~ To J-Sim Home ~