net.clackrouter.topology.core
Class TopoGraph
java.lang.Object
JGraph
net.clackrouter.topology.core.TopoGraph
- Direct Known Subclasses:
- CreateTopologyGraph
public class TopoGraph
- extends JGraph
Main graph class to resresent a topology, which has hosts as different nodes
and ethernet links as edges.
Method Summary |
TopoWire |
connectInterfaces(TopologyView view,
TopologyModel model,
TopologyModel.Link link,
java.util.Hashtable ifaceMap)
|
protected EdgeView |
createEdgeView(JGraph graph,
CellMapper cm,
java.lang.Object v)
|
protected PortView |
createPortView(JGraph graph,
CellMapper mapper,
java.lang.Object cell)
|
protected VertexView |
createVertexView(JGraph graph,
CellMapper cm,
java.lang.Object v)
Creates a view to represent either a physical or virtual host
in the topology ( if mIsReservable is true, the host is virtual). |
java.awt.geom.Point2D.Double |
getIntersectionPoint(java.awt.geom.Line2D.Double line1,
java.awt.geom.Line2D.Double line2)
|
CellView |
getNextSelectableViewAt(CellView c,
double x,
double y)
|
protected java.lang.String |
getToolTipForCell(java.lang.Object cell)
|
java.lang.String |
getToolTipText(java.awt.event.MouseEvent event)
|
java.lang.Object[] |
getVertices(java.lang.Object[] cells)
|
void |
graphChanged(GraphModelEvent event)
|
void |
insertHostIntoGraph(TopologyModel.Host host,
java.util.Hashtable ifaceMap,
java.awt.geom.Rectangle2D bounds)
|
boolean |
isGroup(java.lang.Object cell)
|
boolean |
isVertex(java.lang.Object object)
|
void |
placePorts()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IFACE_LIST_OFFSET
public static int IFACE_LIST_OFFSET
TopoGraph
public TopoGraph(GraphModel model,
ClackDocument doc)
createPortView
protected PortView createPortView(JGraph graph,
CellMapper mapper,
java.lang.Object cell)
createEdgeView
protected EdgeView createEdgeView(JGraph graph,
CellMapper cm,
java.lang.Object v)
createVertexView
protected VertexView createVertexView(JGraph graph,
CellMapper cm,
java.lang.Object v)
- Creates a view to represent either a physical or virtual host
in the topology ( if mIsReservable is true, the host is virtual).
- Returns:
- the default
GraphView
insertHostIntoGraph
public void insertHostIntoGraph(TopologyModel.Host host,
java.util.Hashtable ifaceMap,
java.awt.geom.Rectangle2D bounds)
connectInterfaces
public TopoWire connectInterfaces(TopologyView view,
TopologyModel model,
TopologyModel.Link link,
java.util.Hashtable ifaceMap)
placePorts
public void placePorts()
getNextSelectableViewAt
public CellView getNextSelectableViewAt(CellView c,
double x,
double y)
getToolTipText
public java.lang.String getToolTipText(java.awt.event.MouseEvent event)
getToolTipForCell
protected java.lang.String getToolTipForCell(java.lang.Object cell)
getVertices
public java.lang.Object[] getVertices(java.lang.Object[] cells)
isVertex
public boolean isVertex(java.lang.Object object)
isGroup
public boolean isGroup(java.lang.Object cell)
getIntersectionPoint
public java.awt.geom.Point2D.Double getIntersectionPoint(java.awt.geom.Line2D.Double line1,
java.awt.geom.Line2D.Double line2)
graphChanged
public void graphChanged(GraphModelEvent event)