|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--nodeNet.Node
This class implements NodeNetElement. It is responsible for the
GUI and maintains its own thread. It relies on a class that
implements NodeBehavior to do anything. It repeatedly calls that
class's act method from within a while(true) {}
loop.
Copyright (c) 1998 Massachusetts Institute of Technology
NodeNetElement
,
NodeBehavior
, Serialized FormField Summary | |
static int |
GUISIZE
Diameter of the circle used to paint nodes. |
static java.awt.Color |
HIGHLIGHT_COLOR
|
Constructor Summary | |
Node(NodeBehavior nb,
java.awt.Color c)
|
Method Summary | |
void |
addInputChannel(InputChannel c)
Adds a new InputChannel. |
void |
addOutputChannel(OutputChannel c)
Adds a new OutputChannel. |
void |
configure()
Nodes cannot currently be configured. |
void |
destroy()
Destroy the Node. |
boolean |
equals(java.lang.Object o)
|
protected void |
finalize()
|
static java.util.Enumeration |
getBehaviors()
Gets an Enumeration of all currently known NodeBehaviors. |
static java.awt.Color |
getColorFromBehavior(java.lang.String behavior)
Returns the current Color associated with the given NodeBehavior. |
java.lang.String |
getName()
|
java.awt.Point |
getPos()
|
boolean |
isDestroyed()
|
boolean |
isEditable()
|
boolean |
isEnabled()
|
boolean |
isInside(int x,
int y)
|
boolean |
isInside(java.awt.Point p)
|
boolean |
isSelected()
|
void |
notifyOfDestruction(NodeNetElement bse)
Notify this that a NodeNetElement has been destroyed. |
void |
paint(java.awt.Graphics g)
|
void |
removeInputChannel(InputChannel c)
Removes an InputChannel. |
void |
removeOutputChannel(OutputChannel c)
Removes an OutputChannel. |
void |
run()
Repeatedly calls the transmitPacket method for the
associated NodeBehavior. |
void |
setEnabled(boolean b)
|
void |
setName(java.lang.String n)
|
void |
setPos(int a,
int b)
|
void |
setPos(java.awt.Point p)
|
void |
setSelected(boolean newState)
|
void |
start()
Starts the node running. |
void |
stop()
Stops the node. |
Methods inherited from class java.lang.Object |
clone,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int GUISIZE
public static final java.awt.Color HIGHLIGHT_COLOR
Constructor Detail |
public Node(NodeBehavior nb, java.awt.Color c)
Method Detail |
public static java.awt.Color getColorFromBehavior(java.lang.String behavior)
behavior
- the NodeBehavior whose Color will be returnedpublic static java.util.Enumeration getBehaviors()
public void setPos(java.awt.Point p)
public void setPos(int a, int b)
public java.awt.Point getPos()
public void setSelected(boolean newState)
public boolean isSelected()
public void setEnabled(boolean b)
public boolean isEnabled()
public void setName(java.lang.String n)
public java.lang.String getName()
public boolean isInside(java.awt.Point p)
public boolean isInside(int x, int y)
public boolean isEditable()
public void configure()
public void addInputChannel(InputChannel c)
equals
method), it is
not added again. This condition is silently ignored.c
- the InputChannel to connectpublic void removeInputChannel(InputChannel c)
equals
method), this method does nothing.c
- the InputChannel to disconnectpublic void addOutputChannel(OutputChannel c)
equals
method), it is
not added again. This condition is silently ignored.c
- the OutputChannel to connectpublic void removeOutputChannel(OutputChannel c)
equals
method), this method does nothing.c
- the OutputChannel to disconnectpublic void destroy()
destroy()
should be called
whenever a Node will no longer be used. When destroyed, Nodes
notify all connected input and output channels of the impending
destruction and remove refrences to those channels. Typically,
this will force their destruction as well. Note:
Node.finalize()
automatically calls
destroy()
.public boolean isDestroyed()
public void notifyOfDestruction(NodeNetElement bse)
public void paint(java.awt.Graphics g)
public void start()
act
method for it's associated
NodeBehavior.public void stop()
public void run()
transmitPacket
method for the
associated NodeBehavior. Note: This method should never be
called directly. Instead, use the start()
method.public boolean equals(java.lang.Object o)
protected void finalize() throws java.io.IOException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |