Class ImprovedJGraphAdapter<NodeType,NodeData extends INodeData<NodeType>,EdgeType,EdgeData extends IEdgeData<EdgeType>>

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
org.jgraph.JGraph
de.saar.chorus.jgraph.improvedjgraph.ImprovedJGraph<NodeType,NodeData,EdgeType,EdgeData>
de.saar.chorus.jgraph.improvedjgraph.ImprovedJGraphAdapter<NodeType,NodeData,EdgeType,EdgeData>
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable

public abstract class ImprovedJGraphAdapter<NodeType,NodeData extends INodeData<NodeType>,EdgeType,EdgeData extends IEdgeData<EdgeType>> extends ImprovedJGraph<NodeType,NodeData,EdgeType,EdgeData>
See Also:
  • Field Details

    • graph

      protected org._3pq.jgrapht.Graph graph
    • cellsToNodes

      protected Map<org.jgraph.graph.DefaultGraphCell,Object> cellsToNodes
    • nodesToCells

      protected Map<Object,org.jgraph.graph.DefaultGraphCell> nodesToCells
  • Constructor Details

    • ImprovedJGraphAdapter

      public ImprovedJGraphAdapter(org._3pq.jgrapht.Graph graph, DataFactory<NodeData,EdgeData> factory)
    • ImprovedJGraphAdapter

      public ImprovedJGraphAdapter(org._3pq.jgrapht.Graph graph, Map<Object,NodeData> nodedata, Map<org.jgraph.graph.Edge,EdgeData> edgedata)
  • Method Details

    • convert

      public static <NodeType, NodeData extends INodeData<NodeType>, EdgeType, EdgeData extends IEdgeData<EdgeType>> Map<Object,org.jgraph.graph.DefaultGraphCell> convert(org._3pq.jgrapht.Graph graph, DataFactory<NodeData,EdgeData> factory, ImprovedJGraph<NodeType,NodeData,EdgeType,EdgeData> jgraph)
      Converts a JGraphT graph into an ImprovedJGraph. You can specify the graph and a DataFactory which assigns node data and edge data to the nodes and edges of the graph.

      Using this method is different than creating a new object of class ImprovedJGraphAdapter in that this method can put the information from the graph and data into objects of any subclass of ImprovedJGraph that you like, whereas converting via the constructors of this class just creates objects of a particular subclass (namely ImprovedJGraphAdapter.

      Type Parameters:
      NodeType - a node type class
      NodeData - a class representing node data
      EdgeType - an edge type class
      EdgeData - a class representing edge data
      Parameters:
      graph - a JGraphT graph
      factory - a factory providing data for each node and edge
      jgraph - the ImprovedJGraph object that should be filled with the information in the graph
      Returns:
      a mapping of graph nodes to cells in the ImprovedJGraph.
    • getNodeForCell

      public Object getNodeForCell(org.jgraph.graph.DefaultGraphCell cell)
    • getCellForNode

      public org.jgraph.graph.DefaultGraphCell getCellForNode(Object node)
    • defaultNodeAttributes

      protected org.jgraph.graph.AttributeMap defaultNodeAttributes(NodeType type)
      Specified by:
      defaultNodeAttributes in class ImprovedJGraph<NodeType,NodeData extends INodeData<NodeType>,EdgeType,EdgeData extends IEdgeData<EdgeType>>
    • defaultEdgeAttributes

      protected org.jgraph.graph.AttributeMap defaultEdgeAttributes(EdgeType type)
      Specified by:
      defaultEdgeAttributes in class ImprovedJGraph<NodeType,NodeData extends INodeData<NodeType>,EdgeType,EdgeData extends IEdgeData<EdgeType>>