Documentation of 'org.jgrapht.ext.JGraphXAdapter' Java class
JGraphXAdapter
org.jgrapht.ext

Class JGraphXAdapter<V,E>

  • Type Parameters:
    V - the graph vertex type
    E - the graph edge type
    All Implemented Interfaces:
    java.util.EventListener, GraphListener<V,E>, VertexSetListener<V>


    public class JGraphXAdapter<V,E>
    extends mxGraph
    implements GraphListener<V,E>

    Adapter to draw a JGraphT graph with the JGraphX drawing library.

    This adapter will not convert JGraphX to JGraphT - this should be handled in another class entirely.

    Known Bugs: If this class is used with String-Edges, please note that there is a bug with the method JgraphT.addEdge(vertex1, vertex2); The edge will be created with an empty String "" as value and saved (in JGraphT as well as in this class), which results in the edge not saving correctly. So, if you're using Strings as Edgeclass please use the method addEdge(vertex1, vertex2, "Edgename"); with a unique edgename.

    Since:
    09 July, 2013
    • Constructor Detail

      • JGraphXAdapter

        public JGraphXAdapter(ListenableGraph<V,E> graph)
        Constructs and draws a new ListenableGraph. If the graph changes through as ListenableGraph, the JGraphXAdapter will automatically add/remove the new edge/vertex as it implements the GraphListener interface. Throws a IllegalArgumentException if the graph is null.
        Parameters:
        graph - casted to graph
      • JGraphXAdapter

        public JGraphXAdapter(Graph<V,E> graph)
        Constructs and draws a new mxGraph from a jGraphT graph. Changes on the jgraphT graph will not edit this mxGraph any further; use the constructor with the ListenableGraph parameter instead or use this graph as a normal mxGraph. Throws an IllegalArgumentException if the parameter is null.
        Parameters:
        graph - is a graph

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.