/** * DOCUMENT ME! * * @return DOCUMENT ME! */ public final Edge[] getRestoredEdges() { final Edge[] returnThis = new Edge[m_restoredEdgeInx.length]; for (int i = 0; i < returnThis.length; i++) returnThis[i] = m_persp.getRootGraph().getEdge(m_restoredEdgeInx[i]); return returnThis; }
/** * DOCUMENT ME! * * @return DOCUMENT ME! */ public final Node[] getRestoredNodes() { final Node[] returnThis = new Node[m_restoredNodeInx.length]; for (int i = 0; i < returnThis.length; i++) returnThis[i] = m_persp.getRootGraph().getNode(m_restoredNodeInx[i]); return returnThis; }
public boolean setGraphPerspective(GraphPerspective gp) { if (gp.getRootGraph() != m_rootGraph) return false; final int[] nodeInx = gp.getNodeIndicesArray(); final int[] edgeInx = gp.getEdgeIndicesArray(); for (int i = 0; i < nodeInx.length; i++) m_rootGraph.addNodeMetaChild(m_rootGraphIndex, nodeInx[i]); for (int i = 0; i < edgeInx.length; i++) m_rootGraph.addEdgeMetaChild(m_rootGraphIndex, edgeInx[i]); return true; }
public final void rootGraphChanged(RootGraphChangeEvent evt) { if ((evt.getType() & RootGraphChangeEvent.NODES_REMOVED_TYPE) != 0) { m_weeder.hideNodes(evt.getSource(), evt.getRemovedNodes()); } if ((evt.getType() & RootGraphChangeEvent.EDGES_REMOVED_TYPE) != 0) { m_weeder.hideEdges(evt.getSource(), evt.getRemovedEdges()); } } }
/** * DOCUMENT ME! * * @param node DOCUMENT ME! * * @return DOCUMENT ME! */ public int getIndex(Node node) { if (node.getRootGraph() == this) return node.getRootGraphIndex(); else return 0; }
private static void printme(RootGraph root, GraphPerspective persp) { System.out.println("in RootGraph: " + root.getNodeCount() + " nodes and " + root.getEdgeCount() + " edges"); System.out.println("in GraphPerspective: " + persp.getNodeCount() + " nodes and " + persp.getEdgeCount() + " edges"); System.out.println(); }
/** * DOCUMENT ME! * * @return DOCUMENT ME! */ public GraphPerspective getGraphPerspective() { return m_rootGraph.createGraphPerspective(m_rootGraph.getNodeMetaChildIndicesArray(m_rootGraphIndex), m_rootGraph.getEdgeMetaChildIndicesArray(m_rootGraphIndex)); }
/** * DOCUMENT ME! * * @return DOCUMENT ME! */ public Node getSource() { return m_rootGraph.getNode(m_rootGraph.getEdgeSourceIndex(m_rootGraphIndex)); }
/** * DOCUMENT ME! * * @return DOCUMENT ME! */ public Node getTarget() { return m_rootGraph.getNode(m_rootGraph.getEdgeTargetIndex(m_rootGraphIndex)); }
/** * DOCUMENT ME! * * @param root DOCUMENT ME! * @param nodes DOCUMENT ME! */ public static final void testNodeNeighbors(RootGraph root, int[] nodes) { for (int j = 1; j < nodes.length; j++) { root.neighborsList(root.getNode(nodes[j])); } }
GraphPerspectiveEdgesHiddenEvent(Object source, Edge[] hiddenEdges) { super(source); m_hiddenEdges = hiddenEdges; m_hiddenEdgeInx = new int[m_hiddenEdges.length]; for (int i = 0; i < m_hiddenEdgeInx.length; i++) m_hiddenEdgeInx[i] = m_hiddenEdges[i].getRootGraphIndex(); }
GraphPerspectiveNodesHiddenEvent(Object source, Node[] hiddenNodes) { super(source); m_hiddenNodes = hiddenNodes; m_hiddenNodeInx = new int[m_hiddenNodes.length]; for (int i = 0; i < m_hiddenNodeInx.length; i++) m_hiddenNodeInx[i] = m_hiddenNodes[i].getRootGraphIndex(); }
/** * DOCUMENT ME! * * @return DOCUMENT ME! */ public boolean isDirected() { return m_rootGraph.isEdgeDirected(m_rootGraphIndex); }
/** * Standard Constructor. The argument is the graph that this filter will * apply to; it cannot be null. * * @throws NullPointerException * if the argument is null. */ public SelectFilter(final GraphPerspective graph) { this.graph = graph; // this throws a NullPointerException if the graph is null graph.addGraphPerspectiveChangeListener(this); }
/** * DOCUMENT ME! * * @param edge DOCUMENT ME! */ public void recycleEdge(Edge edge) { edge.setIdentifier(null); } }
/** * DOCUMENT ME! * * @param evt DOCUMENT ME! */ public void graphPerspectiveChanged(GraphPerspectiveChangeEvent evt) { a.graphPerspectiveChanged(evt); b.graphPerspectiveChanged(evt); }
private static final int[] createNodes(RootGraph root, int numNodes) { final int[] returnThis = new int[numNodes]; for (int i = 0; i < returnThis.length; i++) returnThis[i] = root.createNode(); return returnThis; }
/** * DOCUMENT ME! * * @param node DOCUMENT ME! */ public void recycleNode(Node node) { node.setIdentifier(null); } }
/** * DOCUMENT ME! * * @param evt DOCUMENT ME! */ public void rootGraphChanged(RootGraphChangeEvent evt) { a.rootGraphChanged(evt); b.rootGraphChanged(evt); }
public GraphPerspective getGraphPerspective() { return m_rootGraph.createGraphPerspective(m_rootGraph.getNodeMetaChildIndicesArray(m_rootGraphIndex), m_rootGraph.getEdgeMetaChildIndicesArray(m_rootGraphIndex)); }