From: <Jan...@us...> - 2007-02-28 12:58:26
|
Revision: 584 http://svn.sourceforge.net/magicmap/?rev=584&view=rev Author: Jan_fride Date: 2007-02-28 04:58:24 -0800 (Wed, 28 Feb 2007) Log Message: ----------- changed calculateRepulsion. method uses getVisibleVertices() to prevent concurrency problems. Modified Paths: -------------- trunk/magicmapclient/src/edu/uci/ics/jung/visualization/SpringLayout.java Modified: trunk/magicmapclient/src/edu/uci/ics/jung/visualization/SpringLayout.java =================================================================== --- trunk/magicmapclient/src/edu/uci/ics/jung/visualization/SpringLayout.java 2007-02-28 09:55:47 UTC (rev 583) +++ trunk/magicmapclient/src/edu/uci/ics/jung/visualization/SpringLayout.java 2007-02-28 12:58:24 UTC (rev 584) @@ -1,7 +1,7 @@ /* * Copyright (c) 2003, the JUNG Project and the Regents of the University of * California All rights reserved. - * + * * This software is open-source under the BSD license; see either "license.txt" * or http://jung.sourceforge.net/license.txt for a description. */ @@ -23,12 +23,12 @@ /** * Anegpasst an die Magicmac sachen... drum der enue Name! - * + * * The SpringLayout package represents a visualization of a set of nodes. The * SpringLayout, which is initialized with a Graph, assigns X/Y locations to * each node. When called <code>relax()</code>, the SpringLayout moves the * visualization forward one step. - * + * * @author Danyel Fisher * @author Joshua O'Madadhain */ @@ -63,7 +63,7 @@ /** * Constructor for a SpringLayout for a raw graph with associated component. - * + * * @param g * the input Graph * @param f @@ -75,13 +75,13 @@ /** * Constructor for a SpringLayout for a raw graph with associated component. - * + * * @param g * the input Graph * @param f * the length function - * @param r - * the repulsion function + * @param r + * the repulsion function */ public SpringLayout(Graph g, LengthFunction f, RepulsionFunction r) { super(g); @@ -105,14 +105,14 @@ } /** - * <p>Sets the stretch parameter for this instance. This value + * <p>Sets the stretch parameter for this instance. This value * specifies how much the degrees of an edge's incident vertices * should influence how easily the endpoints of that edge * can move (that is, that edge's tendency to change its length).</p> - * + * * <p>The default value is 0.70. Positive values less than 1 cause - * high-degree vertices to move less than low-degree vertices, and - * values > 1 cause high-degree vertices to move more than + * high-degree vertices to move less than low-degree vertices, and + * values > 1 cause high-degree vertices to move more than * low-degree vertices. Negative values will have unpredictable * and inconsistent results.</p> * @param stretch @@ -150,7 +150,7 @@ /** * (non-Javadoc) - * + * * @see edu.uci.ics.jung.visualization.AbstractLayout#initialize_local_vertex(edu.uci.ics.jung.graph.Vertex) */ protected void initialize_local_vertex(Vertex v){ @@ -252,7 +252,7 @@ } protected void calculateRepulsion(){ - for (Iterator iter = getGraph().getVertices().iterator(); iter.hasNext();){ + for (Iterator iter = getVisibleVertices().iterator(); iter.hasNext();){ Vertex v = (Vertex) iter.next(); if (dontMove(v)) continue; @@ -261,7 +261,7 @@ double repulsion_range = 0; - for (Iterator iter2 = getGraph().getVertices().iterator(); iter2.hasNext();){ + for (Iterator iter2 = getVisibleVertices().iterator(); iter2.hasNext();){ Vertex v2 = (Vertex) iter2.next(); if (v == v2) continue; @@ -355,8 +355,8 @@ /** * Extension for PACW: Make the Repulsion configurable. - * - * + * + * * @author thuebner */ public static interface RepulsionFunction { @@ -370,14 +370,14 @@ }; /** * Extension for PACW: Make the Repulsion configurable. - * - * + * + * * @author thuebner */ public static interface ForceFunction { /** - * Sets the force multiplier for this instance. This value is used to + * Sets the force multiplier for this instance. This value is used to * specify how strongly an edge "wants" to be its default length * (higher values indicate a greater attraction for the default length), * which affects how much its endpoints move at each timestep. @@ -399,8 +399,8 @@ }; /** * Extension for PACW: Make the Repulsion configurable. - * - * + * + * * @author thuebner */ public static interface CanLeaveMapFunction { @@ -418,7 +418,7 @@ /** * If the edge is weighted, then override this method to show what the * visualized length is. - * + * * @author Danyel Fisher */ public static interface LengthFunction { @@ -534,7 +534,7 @@ public void setForceFunction(ForceFunction forceFunction){ this.forceFunction = forceFunction; } - + public LengthFunction getLengthFunction(){ return lengthFunction; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |