Logo Search packages:      
Sourcecode: libjgrapht-java version File versions  Download package

org::_3pq::jgrapht::ext::JGraphModelAdapter Class Reference

Inherits org::jgraph::graph::DefaultGraphModel.

List of all members.

Detailed Description

An adapter that reflects a JGraphT graph as a JGraph graph. This adapter is useful when using JGraph in order to visualize JGraphT graphs. For more about JGraph see http://jgraph.sourceforge.net

Modifications made to the underlying JGraphT graph are reflected to this JGraph model if and only if the underlying JGraphT graph is a org._3pq.jgrapht.ListenableGraph. If the underlying JGraphT graph is not ListenableGraph, then this JGraph model represent a snapshot if the graph at the time of its creation.

Changes made to this JGraph model are also reflected back to the underlying JGraphT graph. To avoid confusion, variables are prefixed according to the JGraph/JGraphT object(s) they are referring to.

KNOWN BUGS: There is a small issue to be aware of. JGraph allows 'dangling edges' incident with just one vertex; JGraphT doesn't. Such a configuration can arise when adding an edge or removing a vertex. The code handles this by removing the newly-added dangling edge or removing all edges incident with the vertex before actually removing the vertex, respectively. This works very well, only it doesn't play all that nicely with the undo-manager in the JGraph: for the second situation where you remove a vertex incident with some edges, if you undo the removal, the vertex is 'unremoved' but the edges aren't.

Barak Naveh
Aug 2, 2003

Definition at line 127 of file JGraphModelAdapter.java.

Public Member Functions

void edit (Map attrs)
CellFactory getCellFactory ()
AttributeMap getDefaultEdgeAttributes ()
AttributeMap getDefaultVertexAttributes ()
DefaultEdge getEdgeCell (org._3pq.jgrapht.Edge jGraphTEdge)
DefaultGraphCell getVertexCell (Object jGraphTVertex)
DefaultPort getVertexPort (Object jGraphTVertex)
 JGraphModelAdapter (Graph jGraphTGraph, AttributeMap defaultVertexAttributes, AttributeMap defaultEdgeAttributes, CellFactory cellFactory)
 JGraphModelAdapter (Graph jGraphTGraph, AttributeMap defaultVertexAttributes, AttributeMap defaultEdgeAttributes)
 JGraphModelAdapter (Graph jGraphTGraph)
void setDefaultEdgeAttributes (AttributeMap defaultEdgeAttributes)
void setDefaultVertexAttributes (AttributeMap defaultVertexAttributes)

Static Public Member Functions

static AttributeMap createDefaultEdgeAttributes (Graph jGraphTGraph)
static AttributeMap createDefaultVertexAttributes ()

Package Functions

void handleJGraphChangedEdge (org.jgraph.graph.Edge jEdge)
void handleJGraphInsertedEdge (org.jgraph.graph.Edge jEdge)
void handleJGraphInsertedVertex (GraphCell jVertex)
void handleJGraphRemovedEdge (org.jgraph.graph.Edge jEdge)
void handleJGraphRemovedVertex (GraphCell jVertex)
void handleJGraphTAddedEdge (org._3pq.jgrapht.Edge jtEdge)
void handleJGraphTAddedVertex (Object jtVertex)
void handleJGraphTRemovedEdge (org._3pq.jgrapht.Edge jtEdge)
void handleJGraphTRemoveVertex (Object jtVertex)

Package Attributes

final Set m_jCellsBeingAdded = new HashSet( )
final Set m_jCellsBeingRemoved = new HashSet( )
final Set m_jtElementsBeingAdded = new HashSet( )
final Set m_jtElementsBeingRemoved = new HashSet( )

Private Member Functions

AttributeMap createEdgeAttributeMap (DefaultEdge edgeCell)
AttributeMap createVertexAttributeMap (GraphCell vertexCell)
void internalInsertCell (GraphCell cell, AttributeMap attrs, ConnectionSet cs)
void internalRemoveCell (GraphCell cell)
boolean isDangling (org.jgraph.graph.Edge jEdge)

Private Attributes

final CellFactory m_cellFactory
final Map m_cellToEdge = new HashMap( )
final Map m_cellToVertex = new HashMap( )
AttributeMap m_defaultEdgeAttributes
AttributeMap m_defaultVertexAttributes
final Map m_edgeToCell = new HashMap( )
final ShieldedGraph m_jtGraph
final Map m_vertexToCell = new HashMap( )

Static Private Attributes

static final long serialVersionUID = 3256722883706302515L


interface  CellFactory
class  DefaultCellFactory
class  JGraphListener
class  JGraphTListener
class  ShieldedGraph

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index