From: <Jan...@us...> - 2007-02-22 13:16:14
|
Revision: 555 http://svn.sourceforge.net/magicmap/?rev=555&view=rev Author: Jan_fride Date: 2007-02-22 05:16:13 -0800 (Thu, 22 Feb 2007) Log Message: ----------- synchronization Modified Paths: -------------- trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java 2007-02-22 13:04:01 UTC (rev 554) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java 2007-02-22 13:16:13 UTC (rev 555) @@ -322,8 +322,10 @@ JungEdge edge = new JungEdge(v1, v2); this.worker.suspend(); // stopGraph(); addEdge(edge); - this.layout.update(); + //this.layout.update(); + ((SpringLayout) this.worker.getGraphLayout()).update(); this.worker.unsuspend(); // resumeGraph(); + return edge; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Jan...@us...> - 2007-02-23 15:28:20
|
Revision: 556 http://svn.sourceforge.net/magicmap/?rev=556&view=rev Author: Jan_fride Date: 2007-02-23 07:27:57 -0800 (Fri, 23 Feb 2007) Log Message: ----------- synchronization, this time without new bugs ;-) Modified Paths: -------------- trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java 2007-02-22 13:16:13 UTC (rev 555) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java 2007-02-23 15:27:57 UTC (rev 556) @@ -314,6 +314,7 @@ * @return */ private IMagicEdge addEdge(Vertex v1, Vertex v2){ + log.info("Adding Edge : " + v1 + " -> " + v2); if (v1 == v2) return null; Edge e = v1.findEdge(v2); if (e != null) @@ -322,7 +323,7 @@ JungEdge edge = new JungEdge(v1, v2); this.worker.suspend(); // stopGraph(); addEdge(edge); - //this.layout.update(); + this.layout.update(); ((SpringLayout) this.worker.getGraphLayout()).update(); this.worker.unsuspend(); // resumeGraph(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jan...@us...> - 2007-02-23 18:35:35
|
Revision: 558 http://svn.sourceforge.net/magicmap/?rev=558&view=rev Author: jan_fride Date: 2007-02-23 10:35:32 -0800 (Fri, 23 Feb 2007) Log Message: ----------- Added mutex for adding edge added mutex for adding certex Modified Paths: -------------- trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java 2007-02-23 17:26:24 UTC (rev 557) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java 2007-02-23 18:35:32 UTC (rev 558) @@ -105,6 +105,10 @@ private final NodeMetricManager metricManager; + private final Object edgeLock = new Object(); + private final Object vertexLock = new Object(); + + public JungNodePlacer() { this(JungNodePlacer.DEFAULT_SETTINGS, new MagicMetric()); } @@ -234,10 +238,10 @@ private Vertex addVertex(Node node){ if (findVertex(node) == null) { - System.out.println("Adding " + node.getDisplayName()); + log.info("Adding " + node.getDisplayName()); Vertex v = new DirectedSparseVertex(); - synchronized (this) { + synchronized (vertexLock) { this.worker.suspend(); this.nodeVertexMapping.put(node, v); v.addUserDatum(LayoutSettings.NODE_KEY, node, UserData.SHARED); @@ -249,6 +253,7 @@ this.worker.unsuspend(); } + log.info("Added " + node.getDisplayName()); return v; } else { System.err.print("Vertex exists:"); @@ -316,18 +321,21 @@ private IMagicEdge addEdge(Vertex v1, Vertex v2){ log.info("Adding Edge : " + v1 + " -> " + v2); if (v1 == v2) return null; - Edge e = v1.findEdge(v2); - if (e != null) - return (IMagicEdge) e; - else { - JungEdge edge = new JungEdge(v1, v2); - this.worker.suspend(); // stopGraph(); - addEdge(edge); - this.layout.update(); - ((SpringLayout) this.worker.getGraphLayout()).update(); - this.worker.unsuspend(); // resumeGraph(); - - return edge; + synchronized (edgeLock) { + Edge e = v1.findEdge(v2); + if (e != null) + return (IMagicEdge) e; + else { + JungEdge edge = new JungEdge(v1, v2); + this.worker.suspend(); // stopGraph(); + addEdge(edge); + this.layout.update(); + ((SpringLayout) this.worker.getGraphLayout()).update(); + this.worker.unsuspend(); // resumeGraph(); + + return edge; + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fle...@us...> - 2007-03-01 18:25:57
|
Revision: 587 http://svn.sourceforge.net/magicmap/?rev=587&view=rev Author: flederohr Date: 2007-03-01 10:25:55 -0800 (Thu, 01 Mar 2007) Log Message: ----------- set loglevel to debug Modified Paths: -------------- trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java 2007-03-01 13:20:14 UTC (rev 586) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java 2007-03-01 18:25:55 UTC (rev 587) @@ -238,7 +238,7 @@ private Vertex addVertex(Node node){ if (findVertex(node) == null) { - log.info("Adding " + node.getDisplayName()); + log.debug("Adding " + node.getDisplayName()); Vertex v = new DirectedSparseVertex(); synchronized (vertexLock) { @@ -253,7 +253,7 @@ this.worker.unsuspend(); } - log.info("Added " + node.getDisplayName()); + log.debug("Added " + node.getDisplayName()); return v; } else { System.err.print("Vertex exists:"); @@ -319,7 +319,7 @@ * @return */ private IMagicEdge addEdge(Vertex v1, Vertex v2){ - log.info("Adding Edge : " + v1 + " -> " + v2); + log.debug("Adding Edge : " + v1 + " -> " + v2); if (v1 == v2) return null; synchronized (edgeLock) { Edge e = v1.findEdge(v2); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |