Commit b546ffec authored by Alex Bowen's avatar Alex Bowen

removed concurrent maps in favor of regular hash/tree maps

parent 7f4c4af4
......@@ -31,6 +31,15 @@
*/
package org.graphstream.ui.graphicGraph;
import java.io.IOException;
import java.util.AbstractCollection;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.graphstream.graph.Edge;
import org.graphstream.graph.EdgeFactory;
import org.graphstream.graph.Element;
......@@ -55,16 +64,6 @@ import org.graphstream.ui.graphicGraph.stylesheet.Value;
import org.graphstream.ui.graphicGraph.stylesheet.Values;
import org.graphstream.util.GraphListeners;
import java.io.IOException;
import java.util.AbstractCollection;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
* Graph representation used in display classes.
*
......@@ -218,7 +217,7 @@ public class GraphicGraph extends AbstractElement implements Graph,
listeners = new GraphListeners(this);
styleSheet = new StyleSheet();
styleGroups = new StyleGroupSet(styleSheet);
connectivity = new ConcurrentHashMap<GraphicNode, List<GraphicEdge>>();
connectivity = new HashMap<GraphicNode, List<GraphicEdge>>();
styleGroups.addListener(this);
styleGroups.addElement(this); // Add style to this graph.
......
......@@ -31,6 +31,13 @@
*/
package org.graphstream.ui.graphicGraph;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.TreeMap;
import org.graphstream.graph.Edge;
import org.graphstream.graph.Element;
import org.graphstream.graph.Graph;
......@@ -41,14 +48,6 @@ import org.graphstream.ui.graphicGraph.stylesheet.StyleConstants.ShadowMode;
import org.graphstream.ui.graphicGraph.stylesheet.StyleSheet;
import org.graphstream.ui.graphicGraph.stylesheet.StyleSheetListener;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
* A set of style groups.
*
......@@ -71,27 +70,27 @@ public class StyleGroupSet implements StyleSheetListener {
/**
* All the groups indexed by their unique identifier.
*/
protected final Map<String, StyleGroup> groups = new ConcurrentHashMap<String, StyleGroup>();
protected final Map<String, StyleGroup> groups = new TreeMap<String, StyleGroup>();
/**
* Allows to retrieve the group containing a node knowing the node id.
*/
protected final Map<String, String> byNodeIdGroups = new ConcurrentHashMap<String, String>();
protected final Map<String, String> byNodeIdGroups = new TreeMap<String, String>();
/**
* Allows to retrieve the group containing an edge knowing the node id.
*/
protected final Map<String, String> byEdgeIdGroups = new ConcurrentHashMap<String, String>();
protected final Map<String, String> byEdgeIdGroups = new TreeMap<String, String>();
/**
* Allows to retrieve the group containing a sprite knowing the node id.
*/
protected final Map<String, String> bySpriteIdGroups = new ConcurrentHashMap<String, String>();
protected final Map<String, String> bySpriteIdGroups = new TreeMap<String, String>();
/**
* Allows to retrieve the group containing a graph knowing the node id.
*/
protected final Map<String, String> byGraphIdGroups = new ConcurrentHashMap<String, String>();
protected final Map<String, String> byGraphIdGroups = new TreeMap<String, String>();
/**
* Virtual set of nodes. This set provides fake methods to make it appear as
......@@ -669,7 +668,6 @@ public class StyleGroupSet implements StyleSheetListener {
{
return;
}
StyleGroup group = groups.get(gid);
if (group != null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment