|
From: <jan...@us...> - 2007-02-08 18:42:00
|
Revision: 527
http://svn.sourceforge.net/magicmap/?rev=527&view=rev
Author: jan_fride
Date: 2007-02-08 10:41:51 -0800 (Thu, 08 Feb 2007)
Log Message:
-----------
MetricManager is accassable through NodePlacer
Modified Paths:
--------------
trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java
trunk/magicmapclient/src/net/sf/magicmap/client/model/location/INodePlacer.java
trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java 2007-02-08 15:34:37 UTC (rev 526)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java 2007-02-08 18:41:51 UTC (rev 527)
@@ -19,9 +19,6 @@
import edu.uci.ics.jung.graph.event.GraphEventType;
import edu.uci.ics.jung.graph.impl.DirectedSparseGraph;
import edu.uci.ics.jung.visualization.SpringLayout;
-import net.sf.magicmap.client.algorithms.InfoNodeMetric;
-import net.sf.magicmap.client.algorithms.MagicMetric;
-import net.sf.magicmap.client.algorithms.NodeMetricManager;
import net.sf.magicmap.client.gui.PACWGraphDraw;
import net.sf.magicmap.client.gui.utils.GUIBuilder;
import net.sf.magicmap.client.gui.utils.GUIConstants;
@@ -232,18 +229,8 @@
*
*/
public void initializeGraph(){
-
- // Das Layout
- // TEST-GRAPH
- // INodeModel model = Controller.getInstance().getNodeModel();
-
- // TODO Hier kann eine andere Metrik verwendet werden
-
- MagicMetric magicMetric = new MagicMetric();
- NodeMetricManager metrics = new NodeMetricManager(magicMetric);
- metrics.addMetric(InfoObjectNode.class, InfoObjectNode.class, new InfoNodeMetric());
layoutModel = (JungNodePlacer) getModel().getNodePlacer();
- graph = layoutModel;// new DirectedSparseGraph();
+ graph = layoutModel;// new DirectedSparseGraph();
graphdraw = new PACWGraphDraw(layoutModel);
graphdraw.setVisible(false);
labeller = StringLabeller.getLabeller(graph);
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/location/INodePlacer.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/model/location/INodePlacer.java 2007-02-08 15:34:37 UTC (rev 526)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/model/location/INodePlacer.java 2007-02-08 18:41:51 UTC (rev 527)
@@ -1,6 +1,7 @@
package net.sf.magicmap.client.model.location;
+import net.sf.magicmap.client.algorithms.NodeMetricManager;
import net.sf.magicmap.client.model.node.IMagicEdge;
import net.sf.magicmap.client.model.node.Node;
@@ -87,6 +88,8 @@
*/
public void addNodeUpdateHandler(NodeUpdateHandler handler);
+ public NodeMetricManager getMetricManager();
+
public void updateNode(Node node, int type, Object data);
static final class NodeHandlerFactory {
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-08 15:34:37 UTC (rev 526)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java 2007-02-08 18:41:51 UTC (rev 527)
@@ -10,6 +10,7 @@
import edu.uci.ics.jung.utils.UserData;
import edu.uci.ics.jung.visualization.SpringLayout;
import net.sf.magicmap.client.algorithms.MagicMetric;
+import net.sf.magicmap.client.algorithms.NodeMetricManager;
import net.sf.magicmap.client.algorithms.NodeModelMetric;
import net.sf.magicmap.client.interfaces.NodeModelListener;
import net.sf.magicmap.client.model.location.INodePlacer;
@@ -88,21 +89,31 @@
*/
private final NodeHandlerFactory nodeHandler = new NodeHandlerFactory();
- public JungNodePlacer() {
+ private final NodeMetricManager metricManager;
+
+ public JungNodePlacer() {
this(JungNodePlacer.DEFAULT_SETTINGS, new MagicMetric());
}
- /**
+ /**
+ *
+ * @return
+ */
+ public NodeMetricManager getMetricManager() {
+ return metricManager;
+ }
+
+ /**
*
* @param settings
* @param metric
*/
public JungNodePlacer(LayoutSettings settings, NodeModelMetric metric) {
super();
-
+ this.metricManager = new NodeMetricManager(metric);
this.clientLocationMap = new HashMap<ClientNode, HashSet<LocationNode>>();
this.locationLocationMap = new HashMap<LocationNode, HashSet<LocationNode>>();
- this.layout = new MagicLayout(this, metric, settings);
+ this.layout = new MagicLayout(this, metricManager, settings);
this.worker = new LayoutWorker(this.layout, new Dimension(800, 600));
this.workerRunning = false;
this.workerPaused = false;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|