|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgov.sandia.ccaffeine.dc.user_iface.gui.Connection
public class Connection
This class represents a link between two ComponentInstances.
It holds data fields representing: the source
ComponentInstance, the target ComponentInstance
, and the Ports on each which are connected.
| Constructor Summary | |
|---|---|
Connection(ComponentInstance src,
Port srcPort,
ComponentInstance trg,
Port trgPort,
GlobalData global)
Creates an instance of Connection. |
|
| Method Summary | |
|---|---|
void |
drawPath(java.awt.Graphics g)
Paints a path between the source and the target. |
boolean |
equals(java.lang.Object cobj)
|
ComponentInstance |
getSource()
Returns the ComponentInstance which is the source
of this Connection. |
Port |
getSourcePort()
Returns the Port which is the source-port
of this Connection. |
ComponentInstance |
getTarget()
Returns the ComponentInstance which is the target
of this Connection. |
Port |
getTargetPort()
Returns the Port which is the target-port
of this Connection. |
void |
setPoints()
Recreates path to reflect source and target positions. |
void |
setValidToDraw(boolean tf)
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Connection(ComponentInstance src,
Port srcPort,
ComponentInstance trg,
Port trgPort,
GlobalData global)
Connection. The
Connection connects the specified souceport
on the specified source to the specified targetport on the
specified target. The refearence to Builder
provides access to global variables.
| Method Detail |
|---|
public boolean equals(java.lang.Object cobj)
equals in class java.lang.Objectpublic void setPoints()
Arena whenever an ComponentInstance
is moved.
public void setValidToDraw(boolean tf)
public void drawPath(java.awt.Graphics g)
SetPoints() and
connects them with colored lines to create a path. The path is
drawn on the Arena's Graphics object.
The path is drawn in blue, except for the line-segment extending
from the source-port which is red.
public ComponentInstance getSource()
ComponentInstance which is the source
of this Connection.
ComponentInstancepublic ComponentInstance getTarget()
ComponentInstance which is the target
of this Connection.
ComponentInstancepublic Port getSourcePort()
Port which is the source-port
of this Connection.
Portpublic Port getTargetPort()
Port which is the target-port
of this Connection.
Port
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||