|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.clackrouter.router.graph.RouterGraphHelper
public class RouterGraphHelper
Main GUI class to handle the JGraph end of components being added, removed, and connected within Clack.
Every ClackGraphpad has a reference to a ClackGraphHelper
| Constructor Summary | |
|---|---|
RouterGraphHelper(ClackFramework gp)
|
|
| Method Summary | |
|---|---|
ComponentCell |
addRouterComponentCell(Router router,
ClackComponent component,
java.awt.geom.Rectangle2D bounds)
Adds a ComponentCell to the RouterGraph representing the router that was passed to the ClackComponent when it was created. |
void |
addRouterWire(ComponentCell sourceCell,
int src_port_num,
ComponentCell targetCell,
int target_port_num)
Adds a RouterWire to the graph between two component ports that have been connected. |
void |
attemptPortConnection(DefaultPort source_port,
DefaultPort target_port)
Show connection dialog to connect two ports and attempt to make the connection |
void |
cellRemovedFromModel(DefaultGraphCell cell)
Called when ClackDocument.graphChanged(GraphModelEvent) recognizes that something
has been removed from the RouterGraph. |
static void |
showConnectionErrorDialog(java.awt.Component comp,
java.lang.String msg)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RouterGraphHelper(ClackFramework gp)
| Method Detail |
|---|
public ComponentCell addRouterComponentCell(Router router,
ClackComponent component,
java.awt.geom.Rectangle2D bounds)
This keeps the graph in synch with the router when a component is added. Components are added with the specified bounds, or at the location of the last click if no bounds are provided.
component - - component added to the routerbounds - - location in RouterGraph to add componentCell
public void addRouterWire(ComponentCell sourceCell,
int src_port_num,
ComponentCell targetCell,
int target_port_num)
sourceCell - source component cellsrc_port_num - source port numbertargetCell - target component celltarget_port_num - target port number
public void attemptPortConnection(DefaultPort source_port,
DefaultPort target_port)
source_port - target_port - public void cellRemovedFromModel(DefaultGraphCell cell)
ClackDocument.graphChanged(GraphModelEvent) recognizes that something
has been removed from the RouterGraph.
If a RouterWire has been removed, we disconnect the underlying ports
If a component has been removed, we delete all edges connected to this component
cell - - cell that has been removed from the graph
public static void showConnectionErrorDialog(java.awt.Component comp,
java.lang.String msg)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||