コード例 #1
0
		/// <summary> Constructs a new JGraph model adapter for the specified JGraphT graph.
		/// 
		/// </summary>
		/// <param name="jGraphTGraph">the JGraphT graph for which JGraph model adapter to
		/// be created. <code>null</code> is NOT permitted.
		/// </param>
		/// <param name="defaultVertexAttributes">a default map of JGraph attributes to
		/// format vertices. <code>null</code> is NOT permitted.
		/// </param>
		/// <param name="defaultEdgeAttributes">a default map of JGraph attributes to
		/// format edges. <code>null</code> is NOT permitted.
		/// </param>
		/// <param name="cellFactory">a {@link CellFactory} to be used to create the JGraph
		/// cells. <code>null</code> is NOT permitted.
		/// 
		/// </param>
		/// <throws>  IllegalArgumentException </throws>
		public JGraphModelAdapter(Graph jGraphTGraph, AttributeMap defaultVertexAttributes, AttributeMap defaultEdgeAttributes, JGraphModelAdapter.CellFactory cellFactory):base()
		{
			
			if (jGraphTGraph == null || defaultVertexAttributes == null || defaultEdgeAttributes == null || cellFactory == null)
			{
				throw new System.ArgumentException("null is NOT permitted");
			}
			
			m_jtGraph = new ShieldedGraph(this, jGraphTGraph);
			DefaultVertexAttributes = defaultVertexAttributes;
			DefaultEdgeAttributes = defaultEdgeAttributes;
			m_cellFactory = cellFactory;
			
			if (jGraphTGraph is ListenableGraph)
			{
				ListenableGraph g = (ListenableGraph) jGraphTGraph;
				g.GraphListenerDelegateVar += new org._3pq.jgrapht.event.GraphListenerDelegate(new JGraphTListener(this).edgeAdded);
コード例 #2
0
		/// <summary> Constructs a new JGraph model adapter for the specified JGraphT graph.
		/// 
		/// </summary>
		/// <param name="jGraphTGraph">the JGraphT graph for which JGraph model adapter to
		/// be created. <code>null</code> is NOT permitted.
		/// </param>
		/// <param name="defaultVertexAttributes">a default map of JGraph attributes to
		/// format vertices. <code>null</code> is NOT permitted.
		/// </param>
		/// <param name="defaultEdgeAttributes">a default map of JGraph attributes to
		/// format edges. <code>null</code> is NOT permitted.
		/// </param>
		public JGraphModelAdapter(Graph jGraphTGraph, AttributeMap defaultVertexAttributes, AttributeMap defaultEdgeAttributes):this(jGraphTGraph, defaultVertexAttributes, defaultEdgeAttributes, new DefaultCellFactory())
		{
		}