[graphl-cvs] graphl/src/org/mediavirus/graphl/selection DefaultSelectionModel.java
Status: Pre-Alpha
Brought to you by:
flo1
From: Flo L. <fl...@us...> - 2006-06-08 13:15:38
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/selection In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv17343/src/org/mediavirus/graphl/selection Modified Files: DefaultSelectionModel.java Log Message: a lot of changes done a long time ago... changelog has to be updated another time :( Index: DefaultSelectionModel.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/selection/DefaultSelectionModel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DefaultSelectionModel.java 18 Dec 2005 11:11:41 -0000 1.2 --- DefaultSelectionModel.java 8 Jun 2006 13:14:59 -0000 1.3 *************** *** 3,6 **** --- 3,7 ---- import java.util.Collection; import java.util.Collections; + import java.util.List; import java.util.Set; import java.util.HashSet; *************** *** 222,234 **** */ protected class GraphHandler implements GraphListener { public void graphLayoutUpdated(Graph graph) { } public void graphUpdated(Graph graph) { } public void graphContentsChanged(Graph graph) { ! clear(); } public void elementsAdded(Graph graph,Collection nodes,Collection edges) { } public void elementsRemoved(Graph graph,Collection nodes,Collection edges) { if (nodes!=null) { --- 223,254 ---- */ protected class GraphHandler implements GraphListener { + public void graphLayoutUpdated(Graph graph) { } + public void graphUpdated(Graph graph) { } + public void graphContentsChanged(Graph graph) { ! List<Node> allNodes = graph.getNodes(); ! for (Iterator<Node> nodesI = getSelectedNodes().iterator(); nodesI.hasNext();) { ! Node node = nodesI.next(); ! if (!allNodes.contains(node)) { ! removeNode(node); ! } ! ! } ! List<Edge> allEdges = graph.getEdges(); ! for (Iterator<Edge> edgesI = getSelectedEdges().iterator(); edgesI.hasNext();) { ! Edge edge = edgesI.next(); ! if (!allEdges.contains(edge)) { ! removeEdge(edge); ! } ! } } + public void elementsAdded(Graph graph,Collection nodes,Collection edges) { } + public void elementsRemoved(Graph graph,Collection nodes,Collection edges) { if (nodes!=null) { |