Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

coltginy
Class ColtGraphPerspective  view ColtGraphPerspective download ColtGraphPerspective.java

java.lang.Object
  extended bycoltginy.ColtGraphPerspective
All Implemented Interfaces:
java.util.EventListener, giny.model.GraphPerspective, giny.model.RootGraphChangeListener

public class ColtGraphPerspective
extends java.lang.Object
implements giny.model.GraphPerspective, giny.model.RootGraphChangeListener


Nested Class Summary
(package private)  class ColtGraphPerspective.ChangeEvent
           
(package private)  class ColtGraphPerspective.ContiguityEnsuringProcedure
          Colt provides an interface, IntProcedure, for mapping procedures onto the values of an IntArrayList.
(package private)  class ColtGraphPerspective.NewEdgeMapProcedure
          Colt provides an interface, IntIntProcedure, for mapping procedures onto OpenIntIntMap (key, value) pairs.
(package private)  class ColtGraphPerspective.NewNodeMapProcedure
          Colt provides an interface, IntIntProcedure, for mapping procedures onto OpenIntIntMap (key, value) pairs.
(package private)  class ColtGraphPerspective.OldEdgeMapProcedure
          Colt provides an interface, IntIntProcedure, for mapping procedures onto OpenIntIntMap (key, value) pairs.
protected  class ColtGraphPerspective.OldNodeMapProcedure
          Colt provides an interface, IntIntProcedure, for mapping procedures onto OpenIntIntMap (key, value) pairs.
 
Field Summary
protected  ObjectMatrix2D coltEdgeDataPerspective
          The ObjectMatrix2D from colt that stores Edges and identifies MetaParent->MetaChild relationships between Nodes and Edges.
protected  ColtGraphPerspective.ChangeEvent coltGraphPerspectiveChangeEvent
          The event that we fire when this ColtGraphPerspective changes.
protected  boolean coltGraphPerspectiveInitialized
          True iff the initializer method has begun.
protected  ObjectMatrix2D coltNodeDataPerspective
          The ObjectMatrix2D from colt that stores the Nodes and arrays of indices of Edges between them and identifies MetaParent->MetaChild relationships between Nodes.
protected  ColtGraphPerspective.ContiguityEnsuringProcedure contiguityEnsuringProcedure
          A helper Procedure object for the ensureValuesAreContiguousFrom1( OpenIntIntHashMap ) 55 method.
protected  int edgeCount
          The value of edgeCount must at all times be equivalent to coltEdgeDataPerspective.columns() - 1.
(package private)  javax.swing.event.EventListenerList listenerList
          All event listeners are stored here.
protected  ColtGraphPerspective.NewEdgeMapProcedure newEdgeMapProcedure
          A helper Procedure object for the #rootEdgeIndexToPerspectiveEdgeIndexMapChanged( OpenIntIntHashMap, OpenIntIntHashMap, boolean, ChangeEvent ) method.
protected  ColtGraphPerspective.NewNodeMapProcedure newNodeMapProcedure
          A helper Procedure object for the #rootNodeIndexToPerspectiveNodeIndexMapChanged( OpenIntIntHashMap, OpenIntIntHashMap, boolean, ChangeEvent ) method.
protected  int nodeCount
          The value of nodeCount must at all times be equivalent to ( coltNodeDataPerspective.columns() - 1 ) and ( coltNodeDataPerspective.rows() - 1 ) and ( coltEdgeDataPerspective.rows() - 1 ).
protected static java.lang.String NOT_INITIALIZED_EXCEPTION_STRING
           
protected  ColtGraphPerspective.OldEdgeMapProcedure oldEdgeMapProcedure
          A helper Procedure object for the #rootEdgeIndexToPerspectiveEdgeIndexMapChanged( OpenIntIntHashMap, OpenIntIntHashMap, boolean, ChangeEvent ) method.
protected  ColtGraphPerspective.OldNodeMapProcedure oldNodeMapProcedure
          A helper Procedure object for the #rootNodeIndexToPerspectiveNodeIndexMapChanged( OpenIntIntHashMap, OpenIntIntHashMap, boolean, ChangeEvent ) method.
protected  java.beans.PropertyChangeSupport pcs
           
protected  int[] perspectiveEdgeIndexToRootEdgeIndexArray
          local Edge index (int) -> RootGraph Edge index (int) map (as an int array).
protected  int[] perspectiveNodeIndexToRootNodeIndexArray
          local Node index (int) -> RootGraph Node index (int) map (as an int array).
protected  OpenIntIntHashMap rootEdgeIndexToPerspectiveEdgeIndexMap
          RootGraph Edge index (int) -> local perspective Edge index (int) map.
protected  ColtRootGraph rootGraph
          The ColtRootGraph on which this is a GraphPerspective.
protected  OpenIntIntHashMap rootNodeIndexToPerspectiveNodeIndexMap
          RootGraph Node index (int) -> local perspective Node index (int) map.
 
Constructor Summary
ColtGraphPerspective()
          Default constructor delegates to the RootGraph, OpenIntIntHashMap, OpenIntIntHashMap constructor with null arguments.
ColtGraphPerspective(giny.model.RootGraph root_graph, OpenIntIntHashMap r_node_i_to_p_node_i_map, OpenIntIntHashMap r_edge_i_to_p_edge_i_map)
          RootGraph, OpenIntIntHashMap, OpenIntIntHashMap constructor sets the rootGraph, rootNodeIndexToPerspectiveNodeIndexMap, and rootEdgeIndexToPerspectiveEdgeIndexMap to those given.
 
Method Summary
 void addGraphPerspectiveChangeListener(giny.model.GraphPerspectiveChangeListener listener)
           
 java.lang.Object clone()
          Create a new ColtGraphPerspective with the same RootGraph and a new copy of the rootNodeIndexToPerspectiveNodeIndexMap and rootEdgeIndexToPerspectiveEdgeIndexMap of this one.
protected  void coltEdgeDataPerspectiveChanged(ObjectMatrix2D old_colt_edge_data_perspective, ObjectMatrix2D new_colt_edge_data_perspective)
          Handler for changes to the coltEdgeDataPerspective ObjectMatrix2D.
protected  void coltNodeDataPerspectiveChanged(ObjectMatrix2D old_colt_node_data_perspective, ObjectMatrix2D new_colt_node_data_perspective)
          Handler for changes to the coltNodeDataPerspective ObjectMatrix2D.
 boolean containsEdge(giny.model.Edge edge)
          Return true if the given Edge is in this GraphPerspective.
 boolean containsEdge(giny.model.Edge edge, boolean recurse)
          Return true if the given Edge is in this GraphPerspective.
 boolean containsNode(giny.model.Node node)
          Return true if the given Node is in this GraphPerspective.
 boolean containsNode(giny.model.Node node, boolean recurse)
          Return true if the given Node is in this GraphPerspective.
protected  ColtGraphPerspective.ChangeEvent createChangeEvent()
           
protected  ColtGraphPerspective.ContiguityEnsuringProcedure createContiguityEnsuringProcedure()
           
 giny.model.GraphPerspective createGraphPerspective(giny.filter.Filter filter)
          Create a new GraphPerspective with all of the Nodes from this one that pass the given filter and all of the Edges from this one that pass the filter (and all Nodes incident on those edges).
 giny.model.GraphPerspective createGraphPerspective(int[] node_indices)
          Create a GraphPerspective given a list of nodes.
 giny.model.GraphPerspective createGraphPerspective(int[] node_indices, int[] edge_indices)
          Create a new GraphPerspective with just the Nodes with the given node_indices and just the Edges with the given edge_indices (and all Nodes incident on the given Edges).
 giny.model.GraphPerspective createGraphPerspective(giny.model.Node[] nodes, giny.model.Edge[] edges)
          Create a new GraphPerspective with just the given Nodes and Edges (and all Nodes incident on the given Edges).
protected  ColtGraphPerspective.NewEdgeMapProcedure createNewEdgeMapProcedure()
           
protected  ColtGraphPerspective.NewNodeMapProcedure createNewNodeMapProcedure()
           
protected  ColtGraphPerspective.OldEdgeMapProcedure createOldEdgeMapProcedure()
           
protected  ColtGraphPerspective.OldNodeMapProcedure createOldNodeMapProcedure()
           
 boolean edgeExists(int from_node_index, int to_node_index)
          Determine if there are any Edges in this GraphPerspective from the Node with the first of the given indices to the Node with the second of the given indices.
 boolean edgeExists(giny.model.Node from, giny.model.Node to)
          Determine if there are any Edges in this GraphPerspective from the first given Node to the second.
 java.util.List edgeMetaChildrenList(int node_index)
          Nodes and Edges comprise an additional directed-acyclic-graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 java.util.List edgeMetaChildrenList(giny.model.Node node)
          Nodes and Edges comprise an additional directed-acyclic-graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 java.util.List edgeMetaParentsList(int edge_index)
          Nodes and Edges comprise an additional directed-acyclic-graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 java.util.Iterator edgesIterator()
           
 java.util.List edgesList()
           
 java.util.List edgesList(int from_node_index, int to_node_index, boolean include_undirected_edges)
          Return an array of the indices in this GraphPerspective of all Edges from the Node with the first given index to the Node with the second given index.
 java.util.List edgesList(giny.model.Node from, giny.model.Node to)
          Return a new List of the Edges in this GraphPerspective from the first given Node to the second given Node.
 void ensureValuesAreContiguousFrom1(OpenIntIntHashMap map)
          This handy utility method takes an int -> int map and alters it if necessary to guarantee that the values of the map are contiguous from 1.
protected  void fireGraphPerspectiveChanged(ColtGraphPerspective.ChangeEvent event)
           
 int[] getAdjacentEdgeIndicesArray(int node_index, boolean include_undirected_edges, boolean include_both_directions)
          Returns all Adjacent Edges to the given node.
 java.util.List getAdjacentEdgesList(giny.model.Node node, boolean include_undirected_edges, boolean include_both_directions)
          Returns all Adjacent Edges to the given node.
protected  ColtGraphPerspective.ChangeEvent getChangeEvent()
           
 int[] getConnectingEdgeIndicesArray(int[] node_indices)
          This will return an array of edge indices that are the edges between nodes
 java.util.List getConnectingEdges(java.util.List nodes)
          This will return an array of edge indices that are the edges between nodes
protected  ColtGraphPerspective.ContiguityEnsuringProcedure getContiguityEnsuringProcedure()
           
 int getDegree(int node_index)
          Return the number of distinct Edges in this GraphPerspective incident on the Node with the given index.
 int getDegree(giny.model.Node node)
          Return the number of distinct Edges in this GraphPerspective incident on the given Node.
 giny.model.Edge getEdge(int index)
          Return the Edge with the given index in this GraphPerspective.
 int getEdgeCount()
          Returns number of active edges in this perspective.
 int getEdgeCount(int from_node_index, int to_node_index, boolean count_undirected_edges)
          Count the number of edges from the Node with index from_index to the Node with index to_index (where this.getIndex( to_node ) == to_index).
 int getEdgeCount(giny.model.Node from, giny.model.Node to, boolean count_undirected_edges)
          Count the number of edges from the first Node to the second.
 int getEdgeIndex(int root_graph_edge_index)
          Return the index in this GraphPerspective of the Edge with the given index in the RootGraph.
 int[] getEdgeIndicesArray()
          Return an array containing the indices in the RootGraph of all Edges in this GraphPerspective, with each index in the array corresponding to the index in this GraphPerspective; the first cell's value will always be 0.
 int[] getEdgeIndicesArray(int from_node_index, int to_node_index, boolean include_undirected_edges)
          Return an array of the indices in this GraphPerspective of all Edges from the Node with the first given index to the Node with the second given index.
 int[] getEdgeIndicesArray(int from_node_index, int to_node_index, boolean include_undirected_edges, boolean include_both_directions)
          Return an array of the indices in this GraphPerspective of all edges between the two nodes given, this will result in three types of edges: Undirected Edges Directed Edges from the Source Node to the Target Node Directed Edges from the Target Node to the Source Node Depending on the parameters passed, this can be coonfigured.
 int[] getEdgeMetaChildIndicesArray(int node_index)
          Nodes and Edges comprise an additional directed-acyclic-graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 int[] getEdgeMetaParentIndicesArray(int edge_index)
          Nodes and Edges comprise an additional directed-acyclic-graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 int getEdgeSourceIndex(int edge_index)
          Retrieve the index of the Node that is the source of the Edge with the given index in this GraphPerspective.
 int getEdgeTargetIndex(int edge_index)
          Retrieve the index of the Node that is the target of the Edge with the given index in this GraphPerspective.
 int getInDegree(int node_index)
          Return the number of Edges e in this GraphPerspective such that e.getTarget().equals( node ).
 int getInDegree(int node_index, boolean count_undirected_edges)
          Return the number of Edges e in this GraphPerspective such that e.getSource().equals( node ).
 int getInDegree(giny.model.Node node)
          Return the number of Edges e in this GraphPerspective such that e.getTarget().equals( node ).
 int getInDegree(giny.model.Node node, boolean count_undirected_edges)
          Return the number of Edges e in this GraphPerspective such that e.getSource().equals( node ).
 int getIndex(giny.model.Edge edge)
          Return the index of the given Edge in this GraphPerspective.
 int getIndex(giny.model.Node node)
          Return the index of the given Node in this GraphPerspective.
protected  ColtGraphPerspective.NewEdgeMapProcedure getNewEdgeMapProcedure()
           
protected  ColtGraphPerspective.NewNodeMapProcedure getNewNodeMapProcedure()
           
 giny.model.Node getNode(int index)
          Return the Node with the given index in this GraphPerspective.
 int getNodeCount()
          Returns number of active nodes in this perspective.
 int getNodeIndex(int root_graph_node_index)
          Return the index in this GraphPerspective of the Node with the given index in the RootGraph.
 int[] getNodeIndicesArray()
          Return an array containing the indices in the RootGraph of all Nodes in this GraphPerspective, with each index in the array corresponding to the index in this GraphPerspective; the first cell's value will always be 0.
 int[] getNodeMetaChildIndicesArray(int node_index)
          Nodes and Edges comprise an additional directed-acyclic-graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 int[] getNodeMetaParentIndicesArray(int node_index)
          Nodes and Edges comprise an additional directed-acyclic-graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
protected  ColtGraphPerspective.OldEdgeMapProcedure getOldEdgeMapProcedure()
           
protected  ColtGraphPerspective.OldNodeMapProcedure getOldNodeMapProcedure()
           
 int getOutDegree(int node_index)
          Return the number of Edges e in this GraphPerspective such that e.getSource().equals( node ).
 int getOutDegree(int node_index, boolean count_undirected_edges)
          Return the number of Edges e in this GraphPerspective such that e.getSource().equals( node ).
 int getOutDegree(giny.model.Node node)
          Return the number of Edges e in this GraphPerspective such that e.getSource().equals( node ).
 int getOutDegree(giny.model.Node node, boolean count_undirected_edges)
          Return the number of Edges e in this GraphPerspective such that e.getSource().equals( node ).
 giny.model.RootGraph getRootGraph()
          Return the root Graph for this GraphPerspective
 int getRootGraphEdgeIndex(int perspective_edge_index)
          Return the index in the RootGraph of the Edge with the given index in this GraphPerspective.
 int getRootGraphNodeIndex(int perspective_node_index)
          Return the index in the RootGraph of the Node with the given index in this GraphPerspective.
protected  void hideAllIncidentEdges(int[] node_indices, int[][] edge_index_exceptions, ColtGraphPerspective.ChangeEvent event)
          Hide all edges incident on the Nodes with the given indices, with the exception of the Edges with indices in the corresponding row of the given int matrix (restore these edges if necessary).
protected  void hideAllIncidentEdges(giny.model.Node[] nodes, giny.model.Edge[][] edge_exceptions, ColtGraphPerspective.ChangeEvent event)
          Hide all edges incident on the given Nodes, with the exception of the Edges in the corresponding row of the given Edges matrix (restore these if necessary).
 giny.model.Edge hideEdge(giny.model.Edge edge)
          If this GraphPerspective does not hide the given Edge, change it so that it does hide the edge.
 int hideEdge(int edge_index)
          If this GraphPerspective does not hide the Edge with the given index in this GraphPerspective, change it so that it does hide the edge.
 int[] hideEdges(int[] edge_indices)
          If this GraphPerspective does not hide any of the Edges corresponding to the indices in the given array, change it so that it does hide those edges.
 java.util.List hideEdges(java.util.List edges)
          If this GraphPerspective does not hide any of the Edges in the given List, change it so that it does hide those edges.
 int hideNode(int node_index)
          If this GraphPerspective does not hide the Node with the given index in this GraphPerspective, change it so that it does hide the node and all of its incident edges.
 giny.model.Node hideNode(giny.model.Node node)
          If this GraphPerspective does not hide the given Node, change it so that it does hide the node and all of its incident edges.
 int[] hideNodes(int[] node_indices)
          If this GraphPerspective does not hide any of the Nodes corresponding to the indices in the given array, change it so that it does hide those nodes and all Edges incident on them.
 java.util.List hideNodes(java.util.List nodes)
          If this GraphPerspective does not hide any of the Nodes in the given List, change it so that it does hide those nodes and all Edges incident on them.
protected  void initializeColtGraphPerspective()
          Initialize this ColtGraphPerspective object.
 boolean isEdgeDirected(int edge_index)
          Retrieve the directedness of the Edge with the given index in this GraphPerspective.
 boolean isEdgeMetaChild(int parent_index, int child_edge_index)
          Nodes and Edges comprise an additional directed-acyclic-graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 boolean isEdgeMetaParent(int child_edge_index, int parent_index)
          Nodes and Edges comprise an additional directed-acyclic-graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 boolean isMetaChild(giny.model.Node parent, giny.model.Edge child)
          Nodes and Edges comprise an additional directed-acyclic-graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 boolean isMetaChild(giny.model.Node parent, giny.model.Node child)
          Nodes and Edges comprise an additional directed-acyclic-graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 boolean isMetaParent(giny.model.Edge child, giny.model.Node parent)
          Nodes and Edges comprise an additional directed-acyclic-graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 boolean isMetaParent(giny.model.Node child, giny.model.Node parent)
          Nodes and Edges comprise an additional directed-acyclic-graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 boolean isNeighbor(int a_node_index, int another_node_index)
          Determine if there are any Edges in this GraphPerspective between the two Nodes with the given indices.
 boolean isNeighbor(giny.model.Node a_node, giny.model.Node another_node)
          Determine if there are any Edges in this GraphPerspective between the two given Nodes.
 boolean isNodeMetaChild(int parent_index, int child_node_index)
          Nodes and Edges comprise an additional directed-acyclic-graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 boolean isNodeMetaParent(int child_node_index, int parent_index)
          Nodes and Edges comprise an additional directed-acyclic-graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 giny.model.GraphPerspective join(giny.model.GraphPerspective peer)
          Creates a union GraphPerspective.
 java.util.List metaParentsList(giny.model.Edge edge)
          Nodes and Edges comprise an additional directed-acyclic-graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 java.util.List metaParentsList(giny.model.Node node)
          Nodes and Edges comprise an additional directed-acyclic-graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 int[] neighborsArray(int node_index)
           
 java.util.List neighborsList(giny.model.Node node)
          Return a new List of the neighbors of the given Node.
 java.util.List nodeMetaChildrenList(int parent_index)
          Nodes and Edges comprise an additional directed-acyclic-graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 java.util.List nodeMetaChildrenList(giny.model.Node node)
          Nodes and Edges comprise an additional directed-acyclic-graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 java.util.List nodeMetaParentsList(int node_index)
          Nodes and Edges comprise an additional directed-acyclic-graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 java.util.Iterator nodesIterator()
           
 java.util.List nodesList()
           
 void removeGraphPerspectiveChangeListener(giny.model.GraphPerspectiveChangeListener listener)
           
protected  void restoreAllIncidentNodes(giny.model.Edge[] edges, giny.model.Node[][] node_exceptions, ColtGraphPerspective.ChangeEvent event)
          Restore all Nodes on which the given Edges are incident, with the exception of the Nodes in the corresponding row of the given Nodes matrix (hide these if necessary).
protected  void restoreAllIncidentNodes(int[] edge_indices, int[][] node_exceptions, ColtGraphPerspective.ChangeEvent event)
          Restore all Nodes on which the Edges with the given indices are incident, with the exception of the Nodes with indices in the corresponding row of the given int matrix (hide these nodes if necessary).
 giny.model.Edge restoreEdge(giny.model.Edge edge)
          If this GraphPerspective hides the given Edge, change it so that it does not hide the edge or the Nodes on which the edge is incident.
 int restoreEdge(int edge_index)
          If this GraphPerspective hides the Edge with the given index in this GraphPerspective, change it so that it does not hide the edge or the Nodes on which the edge is incident.
 int[] restoreEdges(int[] edge_indices)
          If this GraphPerspective hides any of the Edges corresponding to the indices in the given array, change it so that it does not hide those edges or any of the Nodes on which they are incident.
 java.util.List restoreEdges(java.util.List edges)
          If this GraphPerspective hides any of the Edges in the given List, change it so that it does not hide those edges and all Nodes on which they are incident.
 int restoreNode(int node_index)
          If this GraphPerspective hides the Node with the given index in this GraphPerspective, change it so that it does not hide the node.
 giny.model.Node restoreNode(giny.model.Node node)
          If this GraphPerspective hides the given Node, change it so that it does not hide the node.
 int[] restoreNodes(int[] node_indices)
          If this GraphPerspective hides any of the Nodes corresponding to the indices in the given array, change it so that it does not hide those nodes.
 java.util.List restoreNodes(java.util.List nodes)
          If this GraphPerspective hides any of the Nodes in the given List, change it so that it does not hide those nodes and all Edges incident on them.
protected  void rootEdgeIndexToPerspectiveEdgeIndexMapChanged(OpenIntIntHashMap old_r_edge_i_to_p_edge_i_map, OpenIntIntHashMap new_r_edge_i_to_p_edge_i_map, boolean restore_all_incident_nodes, ColtGraphPerspective.ChangeEvent event)
          Handler for changes to the rootEdgeIndexToPerspectiveEdgeIndexMap OpenIntIntHashMap.
 void rootGraphChanged(giny.model.RootGraphChangeEvent root_event)
          Invoked when a RootGraph to which this RootGraphChangeListener listens changes.
protected  void rootNodeIndexToPerspectiveNodeIndexMapChanged(OpenIntIntHashMap old_r_node_i_to_p_node_i_map, OpenIntIntHashMap new_r_node_i_to_p_node_i_map, boolean hide_all_incident_edges, ColtGraphPerspective.ChangeEvent event)
          Handler for changes to the rootNodeIndexToPerspectiveNodeIndexMap OpenIntIntHashMap.
protected  void setColtEdgeDataPerspective(ObjectMatrix2D matrix_view)
          Setter for the coltEdgeDataPerspective.
protected  void setColtNodeDataPerspective(ObjectMatrix2D matrix_view)
          Setter for the coltNodeDataPerspective.
protected  void setRootEdgeIndexToPerspectiveEdgeIndexMap(OpenIntIntHashMap r_edge_i_to_p_edge_i_map)
          Setter for the rootEdgeIndexToPerspectiveEdgeIndexMap OpenIntIntHashMap.
protected  void setRootEdgeIndexToPerspectiveEdgeIndexMap(OpenIntIntHashMap r_edge_i_to_p_edge_i_map, boolean restore_all_incident_nodes, ColtGraphPerspective.ChangeEvent event)
          Setter for the rootEdgeIndexToPerspectiveEdgeIndexMap OpenIntIntHashMap.
protected  void setRootGraph(ColtRootGraph root_graph)
          Setter for the rootGraph.
protected  void setRootNodeIndexToPerspectiveNodeIndexMap(OpenIntIntHashMap r_node_i_to_p_node_i_map)
          Setter for the rootNodeIndexToPerspectiveNodeIndexMap OpenIntIntHashMap.
protected  void setRootNodeIndexToPerspectiveNodeIndexMap(OpenIntIntHashMap r_node_i_to_p_node_i_map, boolean hide_all_incident_edges, ColtGraphPerspective.ChangeEvent event)
          Setter for the rootNodeIndexToPerspectiveNodeIndexMap OpenIntIntHashMap.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOT_INITIALIZED_EXCEPTION_STRING

protected static java.lang.String NOT_INITIALIZED_EXCEPTION_STRING

rootGraph

protected ColtRootGraph rootGraph
The ColtRootGraph on which this is a GraphPerspective.


coltNodeDataPerspective

protected ObjectMatrix2D coltNodeDataPerspective
The ObjectMatrix2D from colt that stores the Nodes and arrays of indices of Edges between them and identifies MetaParent->MetaChild relationships between Nodes.
NOTE: You must not directly alter the coltNodeDataPerspective matrix after setting it!

See Also:
rootNodeIndexToPerspectiveNodeIndexMap 55 , perspectiveNodeIndexToRootNodeIndexArray 55 , nodeCount 55

coltEdgeDataPerspective

protected ObjectMatrix2D coltEdgeDataPerspective
The ObjectMatrix2D from colt that stores Edges and identifies MetaParent->MetaChild relationships between Nodes and Edges.
NOTE: You must not directly alter the coltEdgeDataPerspective matrix after setting it!

See Also:
rootEdgeIndexToPerspectiveEdgeIndexMap 55 , perspectiveEdgeIndexToRootEdgeIndexArray 55 , edgeCount 55

nodeCount

protected int nodeCount
The value of nodeCount must at all times be equivalent to ( coltNodeDataPerspective.columns() - 1 ) and ( coltNodeDataPerspective.rows() - 1 ) and ( coltEdgeDataPerspective.rows() - 1 ).


edgeCount

protected int edgeCount
The value of edgeCount must at all times be equivalent to coltEdgeDataPerspective.columns() - 1.


rootNodeIndexToPerspectiveNodeIndexMap

protected OpenIntIntHashMap rootNodeIndexToPerspectiveNodeIndexMap
RootGraph Node index (int) -> local perspective Node index (int) map.


perspectiveNodeIndexToRootNodeIndexArray

protected int[] perspectiveNodeIndexToRootNodeIndexArray
local Node index (int) -> RootGraph Node index (int) map (as an int array).


rootEdgeIndexToPerspectiveEdgeIndexMap

protected OpenIntIntHashMap rootEdgeIndexToPerspectiveEdgeIndexMap
RootGraph Edge index (int) -> local perspective Edge index (int) map.


perspectiveEdgeIndexToRootEdgeIndexArray

protected int[] perspectiveEdgeIndexToRootEdgeIndexArray
local Edge index (int) -> RootGraph Edge index (int) map (as an int array).


oldNodeMapProcedure

protected ColtGraphPerspective.OldNodeMapProcedure oldNodeMapProcedure
A helper Procedure object for the #rootNodeIndexToPerspectiveNodeIndexMapChanged( OpenIntIntHashMap, OpenIntIntHashMap, boolean, ChangeEvent ) method.


newNodeMapProcedure

protected ColtGraphPerspective.NewNodeMapProcedure newNodeMapProcedure
A helper Procedure object for the #rootNodeIndexToPerspectiveNodeIndexMapChanged( OpenIntIntHashMap, OpenIntIntHashMap, boolean, ChangeEvent ) method.


oldEdgeMapProcedure

protected ColtGraphPerspective.OldEdgeMapProcedure oldEdgeMapProcedure
A helper Procedure object for the #rootEdgeIndexToPerspectiveEdgeIndexMapChanged( OpenIntIntHashMap, OpenIntIntHashMap, boolean, ChangeEvent ) method.


newEdgeMapProcedure

protected ColtGraphPerspective.NewEdgeMapProcedure newEdgeMapProcedure
A helper Procedure object for the #rootEdgeIndexToPerspectiveEdgeIndexMapChanged( OpenIntIntHashMap, OpenIntIntHashMap, boolean, ChangeEvent ) method.


contiguityEnsuringProcedure

protected ColtGraphPerspective.ContiguityEnsuringProcedure contiguityEnsuringProcedure
A helper Procedure object for the ensureValuesAreContiguousFrom1( OpenIntIntHashMap ) 55 method.


coltGraphPerspectiveChangeEvent

protected ColtGraphPerspective.ChangeEvent coltGraphPerspectiveChangeEvent
The event that we fire when this ColtGraphPerspective changes.


listenerList

javax.swing.event.EventListenerList listenerList
All event listeners are stored here.


coltGraphPerspectiveInitialized

protected boolean coltGraphPerspectiveInitialized
True iff the initializer method has begun.


pcs

protected java.beans.PropertyChangeSupport pcs
Constructor Detail

ColtGraphPerspective

public ColtGraphPerspective()
Default constructor delegates to the RootGraph, OpenIntIntHashMap, OpenIntIntHashMap constructor with null arguments.


ColtGraphPerspective

public ColtGraphPerspective(giny.model.RootGraph root_graph,
                            OpenIntIntHashMap r_node_i_to_p_node_i_map,
                            OpenIntIntHashMap r_edge_i_to_p_edge_i_map)
RootGraph, OpenIntIntHashMap, OpenIntIntHashMap constructor sets the rootGraph, rootNodeIndexToPerspectiveNodeIndexMap, and rootEdgeIndexToPerspectiveEdgeIndexMap to those given. If all are non-null then this will result in the method initializeColtGraphPerspective() 55 being called.
Note that although the arguments may be null, this object will not be initialized, and must not be used, until the rootGraph, the rootNodeIndexToPerspectiveNodeIndexMap, and the rootEdgeIndexToPerspectiveEdgeIndexMap have all been set to non-null values.

Method Detail

initializeColtGraphPerspective

protected void initializeColtGraphPerspective()
Initialize this ColtGraphPerspective object. Note that this initialization cannot happen until the rootGraph, rootNodeIndexToPerspectiveNodeIndexMap, rootEdgeIndexToPerspectiveEdgeIndexMap, coltNodeDataPerspective, and coltEdgeDataPerspective are all set. The object will not be initialized until all of those are set to non-null values. If this method is called before these values are set it will throw an IllegalStateException.


setRootGraph

protected void setRootGraph(ColtRootGraph root_graph)
Setter for the rootGraph. Once set, the rootGraph may not be changed. This also adds this ColtGraphPerspective as a RootGraphChangeListener to the given rootGraph.


setColtNodeDataPerspective

protected void setColtNodeDataPerspective(ObjectMatrix2D matrix_view)
Setter for the coltNodeDataPerspective. This method calls initializeColtGraphPerspective() 55 if the given value is non-null and the rootGraph, rootNodeIndexToPerspectiveNodeIndexMap, rootEdgeIndexToPerspectiveEdgeIndexMap, and coltEdgeDataPerspective are also non-null. This method should not be called directly; use setRootNodeIndexToPerspectiveNodeIndexMap( OpenIntIntHashMap ) 55 instead.
NOTE: You must not directly alter the coltNodeDataPerspective matrix after setting it!


coltNodeDataPerspectiveChanged

protected void coltNodeDataPerspectiveChanged(ObjectMatrix2D old_colt_node_data_perspective,
                                              ObjectMatrix2D new_colt_node_data_perspective)
Handler for changes to the coltNodeDataPerspective ObjectMatrix2D. This method should not be called directly; use setColtNodeDataPerspective( ObjectMatrix2D ) 55 instead.


setRootNodeIndexToPerspectiveNodeIndexMap

protected void setRootNodeIndexToPerspectiveNodeIndexMap(OpenIntIntHashMap r_node_i_to_p_node_i_map)
Setter for the rootNodeIndexToPerspectiveNodeIndexMap OpenIntIntHashMap. This method calls #setRootNodeIndexToPerspectiveNodeIndexMap( OpenIntIntHashMap, boolean, ChangeEvent ) with a true hide_all_incident_edges boolean argument, then notifies listeners of the changes iff coltGraphPerspectiveInitialized. This method must not be called before the rootGraph has been set to a non-null value.
NOTE: You must not directly alter the rootNodeIndexToPerspectiveNodeIndexMap list after setting it!


setRootNodeIndexToPerspectiveNodeIndexMap

protected void setRootNodeIndexToPerspectiveNodeIndexMap(OpenIntIntHashMap r_node_i_to_p_node_i_map,
                                                         boolean hide_all_incident_edges,
                                                         ColtGraphPerspective.ChangeEvent event)
Setter for the rootNodeIndexToPerspectiveNodeIndexMap OpenIntIntHashMap. This method calls #rootNodeIndexToPerspectiveNodeIndexMapChanged( OpenIntIntHashMap, OpenIntIntHashMap, boolean, ChangeEvent ) if the given value is different (by equals) from the existing rootNodeIndexToPerspectiveNodeIndexMap value. This method must not be called before the rootGraph has been set to a non-null value.
NOTE: If the hide_all_incident_edges flag is false, then it is the caller's responsibility to ensure that the rootEdgeIndexToPerspectiveEdgeIndexMap and coltEdgeDataPerspective objects are kept in synch with rootNodeIndexToPerspectiveNodeIndexMap and coltNodeDataPerspective; all Edges incident on any newly-hidden Nodes should also become hidden in this GraphPerspective (and this is only the responsibility of this method when hide_all_incident_edges is true).
NOTE: You must not directly alter the rootNodeIndexToPerspectiveNodeIndexMap list after setting it!


rootNodeIndexToPerspectiveNodeIndexMapChanged

protected void rootNodeIndexToPerspectiveNodeIndexMapChanged(OpenIntIntHashMap old_r_node_i_to_p_node_i_map,
                                                             OpenIntIntHashMap new_r_node_i_to_p_node_i_map,
                                                             boolean hide_all_incident_edges,
                                                             ColtGraphPerspective.ChangeEvent event)
Handler for changes to the rootNodeIndexToPerspectiveNodeIndexMap OpenIntIntHashMap. This method replaces the perspectiveNodeIndexToRootNodeIndexArray and calls setColtNodeDataPerspective( ObjectMatrix2D ) 55 with the new perspective corresponding to the new rootNodeIndexToPerspectiveNodeIndexMap array. This method uses an instantiation of each of two inner classes, ColtGraphPerspective$OldNodeMapProcedure and ColtGraphPerspective$NewNodeMapProcedure, which are clever Colt tricks that act like a perl (or lisp, etc.) 'map function', applying the same routine to each element in an OpenIntIntHashMap; see them for more information. Iff hide_all_incident_edges is true then this method will also call #hideAllIncidentEdges( int[], int[][], ChangeEvent ) on the newly hidden node indices. This method should not be called directly; use #setRootNodeIndexToPerspectiveNodeIndexMap( OpenIntIntHashMap, boolean, ChangeEvent ) instead.


setColtEdgeDataPerspective

protected void setColtEdgeDataPerspective(ObjectMatrix2D matrix_view)
Setter for the coltEdgeDataPerspective. This method calls initializeColtGraphPerspective() 55 if the given value is non-null and the rootGraph, rootEdgeIndexToPerspectiveEdgeIndexMap, rootNodeIndexToPerspectiveNodeIndexMap, and coltNodeDataPerspective are also non-null. This method should not be called directly; use setRootEdgeIndexToPerspectiveEdgeIndexMap( OpenIntIntHashMap ) 55 instead.
NOTE: You must not directly alter the coltEdgeDataPerspective matrix after setting it!


coltEdgeDataPerspectiveChanged

protected void coltEdgeDataPerspectiveChanged(ObjectMatrix2D old_colt_edge_data_perspective,
                                              ObjectMatrix2D new_colt_edge_data_perspective)
Handler for changes to the coltEdgeDataPerspective ObjectMatrix2D. This method should not be called directly; use setColtEdgeDataPerspective( ObjectMatrix2D ) 55 instead.


setRootEdgeIndexToPerspectiveEdgeIndexMap

protected void setRootEdgeIndexToPerspectiveEdgeIndexMap(OpenIntIntHashMap r_edge_i_to_p_edge_i_map)
Setter for the rootEdgeIndexToPerspectiveEdgeIndexMap OpenIntIntHashMap. This method calls #setRootEdgeIndexToPerspectiveEdgeIndexMap( OpenIntIntHashMap, boolean, ChangeEvent ) with a true restore_all_incident_nodes boolean argument, then notifies listeners of the changes iff coltGraphPerspectiveInitialized. This method must not be called before the rootGraph has been set to a non-null value.
NOTE: You must not directly alter the rootEdgeIndexToPerspectiveEdgeIndexMap list after setting it!


setRootEdgeIndexToPerspectiveEdgeIndexMap

protected void setRootEdgeIndexToPerspectiveEdgeIndexMap(OpenIntIntHashMap r_edge_i_to_p_edge_i_map,
                                                         boolean restore_all_incident_nodes,
                                                         ColtGraphPerspective.ChangeEvent event)
Setter for the rootEdgeIndexToPerspectiveEdgeIndexMap OpenIntIntHashMap. This method calls #rootEdgeIndexToPerspectiveEdgeIndexMapChanged( OpenIntIntHashMap, OpenIntIntHashMap, boolean, ChangeEvent ) if the given value is different (by equals) from the existing rootEdgeIndexToPerspectiveEdgeIndexMap value. This method must not be called before the rootGraph has been set to a non-null value.
NOTE: If the restore_all_incident_nodes flag is false, then it is the caller's responsibility to ensure that the rootNodeIndexToPerspectiveEdgeIndexMap and coltNodeDataPerspective objects are kept in synch with rootEdgeIndexToPerspectiveEdgeIndexMap and coltEdgeDataPerspective; all Nodes on which any newly-restored Edges are incident should also become restored in this GraphPerspective (and this is only the responsibility of this method when restore_all_incident_nodes is true).
NOTE: You must not directly alter the rootEdgeIndexToPerspectiveEdgeIndexMap list after setting it!


rootEdgeIndexToPerspectiveEdgeIndexMapChanged

protected void rootEdgeIndexToPerspectiveEdgeIndexMapChanged(OpenIntIntHashMap old_r_edge_i_to_p_edge_i_map,
                                                             OpenIntIntHashMap new_r_edge_i_to_p_edge_i_map,
                                                             boolean restore_all_incident_nodes,
                                                             ColtGraphPerspective.ChangeEvent event)
Handler for changes to the rootEdgeIndexToPerspectiveEdgeIndexMap OpenIntIntHashMap. This method replaces the perspectiveEdgeIndexToRootEdgeIndexArray and calls setColtEdgeDataPerspective( ObjectMatrix2D ) 55 with the new perspective corresponding to the new rootEdgeIndexToPerspectiveEdgeIndexMap array. This method uses an instantiation of each of two inner classes, ColtGraphPerspective$OldEdgeMapProcedure and ColtGraphPerspective$NewEdgeMapProcedure, which are clever Colt tricks that act like a perl (or lisp, etc.) 'map function', applying the same routine to each element in an OpenIntIntHashMap; see them for more information. Iff restore_all_incident_nodes is true then this method will also call #hideAllIncidentEdges( int[], int[][], ChangeEvent ) on the newly hidden edge indices. This method should not be called directly; use #setRootEdgeIndexToPerspectiveEdgeIndexMap( OpenIntIntHashMap, boolean, ChangeEvent ) instead.


clone

public java.lang.Object clone()
Create a new ColtGraphPerspective with the same RootGraph and a new copy of the rootNodeIndexToPerspectiveNodeIndexMap and rootEdgeIndexToPerspectiveEdgeIndexMap of this one.

Specified by:
clone in interface giny.model.GraphPerspective

getRootGraph

public giny.model.RootGraph getRootGraph()
Return the root Graph for this GraphPerspective

Specified by:
getRootGraph in interface giny.model.GraphPerspective

getNodeCount

public int getNodeCount()
Returns number of active nodes in this perspective.

Specified by:
getNodeCount in interface giny.model.GraphPerspective

getEdgeCount

public int getEdgeCount()
Returns number of active edges in this perspective.

Specified by:
getEdgeCount in interface giny.model.GraphPerspective

nodesIterator

public java.util.Iterator nodesIterator()
Specified by:
nodesIterator in interface giny.model.GraphPerspective

nodesList

public java.util.List nodesList()
Specified by:
nodesList in interface giny.model.GraphPerspective

getNodeIndicesArray

public int[] getNodeIndicesArray()
Return an array containing the indices in the RootGraph of all Nodes in this GraphPerspective, with each index in the array corresponding to the index in this GraphPerspective; the first cell's value will always be 0.
The result should be considered final; it must not be modified by the receiver.

Specified by:
getNodeIndicesArray in interface giny.model.GraphPerspective

edgesIterator

public java.util.Iterator edgesIterator()
Specified by:
edgesIterator in interface giny.model.GraphPerspective

edgesList

public java.util.List edgesList()
Specified by:
edgesList in interface giny.model.GraphPerspective

getEdgeIndicesArray

public int[] getEdgeIndicesArray()
Return an array containing the indices in the RootGraph of all Edges in this GraphPerspective, with each index in the array corresponding to the index in this GraphPerspective; the first cell's value will always be 0.
The result should be considered final; it must not be modified by the receiver.

Specified by:
getEdgeIndicesArray in interface giny.model.GraphPerspective

hideNode

public giny.model.Node hideNode(giny.model.Node node)
If this GraphPerspective does not hide the given Node, change it so that it does hide the node and all of its incident edges. If the given Node is not already hidden, this calls #setRootNodeIndexToPerspectiveNodeIndexMap( OpenIntIntHashMap, boolean, ChangeEvent ) and #hideAllIncidentEdges( Node[], Edge[][], ChangeEvent ) and then returns the given Node after firing the event.

Specified by:
hideNode in interface giny.model.GraphPerspective

hideNode

public int hideNode(int node_index)
If this GraphPerspective does not hide the Node with the given index in this GraphPerspective, change it so that it does hide the node and all of its incident edges. If the Node is not already hidden, this calls #setRootNodeIndexToPerspectiveNodeIndexMap( OpenIntIntHashMap, boolean, ChangeEvent ) and #hideAllIncidentEdges( int[], int[][], ChangeEvent ) and then returns the given index after firing the event.
This method is implemented to operate without accessing any Node or Edge objects, and is thus likely to offer the greater efficiency compared to its non-index counterpart in highly optimized environments.

Specified by:
hideNode in interface giny.model.GraphPerspective

hideNodes

public java.util.List hideNodes(java.util.List nodes)
If this GraphPerspective does not hide any of the Nodes in the given List, change it so that it does hide those nodes and all Edges incident on them. This calls #setRootNodeIndexToPerspectiveNodeIndexMap( OpenIntIntHashMap, boolean, ChangeEvent ) and #hideAllIncidentEdges( Node[], Edge[][], ChangeEvent ) with those of the given nodes that are not already hidden, and then returns them in a List after firing the event.

Specified by:
hideNodes in interface giny.model.GraphPerspective

hideNodes

public int[] hideNodes(int[] node_indices)
If this GraphPerspective does not hide any of the Nodes corresponding to the indices in the given array, change it so that it does hide those nodes and all Edges incident on them. This calls #setRootNodeIndexToPerspectiveNodeIndexMap( OpenIntIntHashMap, boolean, ChangeEvent ) and #hideAllIncidentEdges( Node[], Edge[][], ChangeEvent ) with those nodes that are not already hidden, and then, after firing the event, returns an array of equal length to the one given, in which each corresponding position is either the same as in the argument array or is 0, indicating that the node with that index was already hidden.
This method is implemented to operate without accessing any Node or Edge objects, and is thus likely to offer the greater efficiency compared to its non-index counterpart in highly optimized environments.

Specified by:
hideNodes in interface giny.model.GraphPerspective

restoreNode

public giny.model.Node restoreNode(giny.model.Node node)
If this GraphPerspective hides the given Node, change it so that it does not hide the node. If the given Node is presently hidden, this calls #setRootNodeIndexToPerspectiveNodeIndexMap( OpenIntIntHashMap, boolean, ChangeEvent ) and then returns the given Node after firing the event.

Specified by:
restoreNode in interface giny.model.GraphPerspective

restoreNode

public int restoreNode(int node_index)
If this GraphPerspective hides the Node with the given index in this GraphPerspective, change it so that it does not hide the node. If the Node is presently hidden, this calls #setRootNodeIndexToPerspectiveNodeIndexMap( OpenIntIntHashMap, boolean, ChangeEvent ) and then returns the given index after firing the event.
This method is implemented to operate without accessing any Node or Edge objects, and is thus likely to offer the greater efficiency compared to its non-index counterpart in highly optimized environments.

Specified by:
restoreNode in interface giny.model.GraphPerspective

restoreNodes

public java.util.List restoreNodes(java.util.List nodes)
If this GraphPerspective hides any of the Nodes in the given List, change it so that it does not hide those nodes and all Edges incident on them. This calls #setRootNodeIndexToPerspectiveNodeIndexMap( OpenIntIntHashMap, boolean, ChangeEvent ) with those of the given nodes that are not already hidden, and then returns them in a List after firing the event.

Specified by:
restoreNodes in interface giny.model.GraphPerspective

restoreNodes

public int[] restoreNodes(int[] node_indices)
If this GraphPerspective hides any of the Nodes corresponding to the indices in the given array, change it so that it does not hide those nodes. This calls #setRootNodeIndexToPerspectiveNodeIndexMap( OpenIntIntHashMap, boolean, ChangeEvent ) with those nodes that are presently hidden, and then, after firing the event, returns an array of equal length to the one given, in which each corresponding position is either the same as in the argument array or is 0, indicating that the node with that index was already restored.
This method is implemented to operate without accessing any Node or Edge objects, and is thus likely to offer the greater efficiency compared to its non-index counterpart in highly optimized environments.

Specified by:
restoreNodes in interface giny.model.GraphPerspective

hideEdge

public giny.model.Edge hideEdge(giny.model.Edge edge)
If this GraphPerspective does not hide the given Edge, change it so that it does hide the edge. If the given Edge is not already hidden, this calls #setRootEdgeIndexToPerspectiveEdgeIndexMap( OpenIntIntHashMap, boolean, ChangeEvent ) and then returns the given Edge after firing the event.

Specified by:
hideEdge in interface giny.model.GraphPerspective

hideEdge

public int hideEdge(int edge_index)
If this GraphPerspective does not hide the Edge with the given index in this GraphPerspective, change it so that it does hide the edge. If the Edge is not already hidden, this calls #setRootEdgeIndexToPerspectiveEdgeIndexMap( OpenIntIntHashMap, boolean, ChangeEvent ) and then returns the given index after firing the event.
This method is implemented to operate without accessing any Edge or Edge objects, and is thus likely to offer the greater efficiency compared to its non-index counterpart in highly optimized environments.

Specified by:
hideEdge in interface giny.model.GraphPerspective

hideEdges

public java.util.List hideEdges(java.util.List edges)
If this GraphPer