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

org::_3pq::jgrapht::ext::JGraphModelAdapter::JGraphModelAdapter ( Graph  jGraphTGraph,
AttributeMap  defaultVertexAttributes,
AttributeMap  defaultEdgeAttributes,
CellFactory  cellFactory 
) [inline]

Constructs a new JGraph model adapter for the specified JGraphT graph.

Parameters:
jGraphTGraph the JGraphT graph for which JGraph model adapter to be created. null is NOT permitted.
defaultVertexAttributes a default map of JGraph attributes to format vertices. null is NOT permitted.
defaultEdgeAttributes a default map of JGraph attributes to format edges. null is NOT permitted.
cellFactory a CellFactory to be used to create the JGraph cells. null is NOT permitted.
Exceptions:
IllegalArgumentException 

Definition at line 227 of file JGraphModelAdapter.java.

References org::_3pq::jgrapht::ListenableGraph::addGraphListener(), org::_3pq::jgrapht::Graph::edgeSet(), handleJGraphTAddedEdge(), handleJGraphTAddedVertex(), setDefaultEdgeAttributes(), setDefaultVertexAttributes(), and org::_3pq::jgrapht::Graph::vertexSet().

                                                                      {
        super(  );

        if( jGraphTGraph == null || defaultVertexAttributes == null
                || defaultEdgeAttributes == null || cellFactory == null ) {
            throw new IllegalArgumentException( "null is NOT permitted" );
        }

        m_jtGraph = new ShieldedGraph( jGraphTGraph );
        setDefaultVertexAttributes( defaultVertexAttributes );
        setDefaultEdgeAttributes( defaultEdgeAttributes );
        m_cellFactory = cellFactory;

        if( jGraphTGraph instanceof ListenableGraph ) {
            ListenableGraph g = (ListenableGraph) jGraphTGraph;
            g.addGraphListener( new JGraphTListener(  ) );
        }

        for( Iterator i = jGraphTGraph.vertexSet(  ).iterator(  );
                i.hasNext(  ); ) {
            handleJGraphTAddedVertex( i.next(  ) );
        }

        for( Iterator i = jGraphTGraph.edgeSet(  ).iterator(  ); i.hasNext(  ); ) {
            handleJGraphTAddedEdge( (org._3pq.jgrapht.Edge) i.next(  ) );
        }

        this.addGraphModelListener( new JGraphListener(  ) );
    }


Generated by  Doxygen 1.6.0   Back to index