|
J-Sim v1.2.1-p7 API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectdrcl.DrclObj
drcl.comp.Component
drcl.comp.lib.Talk
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):
| 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
|
| 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.DrclObj |
clone |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final java.lang.String INOUT_PORT_ID
protected Port port
protected java.awt.TextArea taDisplay
protected java.awt.TextArea taInput
| Constructor Detail |
public Talk()
public Talk(java.lang.String id_)
| Method Detail |
public void process(java.lang.Object data_,
Port inPort_)
data_ arrives this component at the inPort_ port.
process in class Componentdata_ - the arrival data.inPort_ - the port where the data arrives.public void reset()
super.reset() in the beginning.
reset in class Componentpublic void duplicate(java.lang.Object source_)
source_ to this component.
Must call super.duplicate() in the beginning.
duplicate in interface ObjectDuplicableduplicate in class Componentprotected void _start()
run()ed.
_start in class Componentpublic java.lang.String info()
info in class Componentpublic void setAnonymous(boolean v_)
public boolean isAnonymous()
public void setEchoEnabled(boolean v_)
public boolean isEchoEnabled()
public void setDisplaySize(int rows_,
int cols_)
rows_ - number of rows; no effect if nonpositive value is given.cols_ - number of columns; no effect if nonpositive value is given.
public void setInputSize(int rows_,
int cols_)
rows_ - number of rows; no effect if nonpositive value is given.cols_ - number of columns; no effect if nonpositive value is given.protected void processLine(java.lang.String line_)
|
J-Sim v1.2.1-p7 API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||