|
From: <jan...@us...> - 2007-01-15 23:58:58
|
Revision: 511
http://svn.sourceforge.net/magicmap/?rev=511&view=rev
Author: jan_fride
Date: 2007-01-15 15:58:32 -0800 (Mon, 15 Jan 2007)
Log Message:
-----------
MeasurementModel show every client.
one bug: ap for all clients are shown, only after the first selection of a clint!?
Added Paths:
-----------
trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/IModelView.java
trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeSelectionModel.java
Added: trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/IModelView.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/IModelView.java (rev 0)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/IModelView.java 2007-01-15 23:58:32 UTC (rev 511)
@@ -0,0 +1,19 @@
+package net.sf.magicmap.client.gui.views;
+
+import net.sf.magicmap.client.model.node.INodeModel;
+import net.sf.magicmap.client.model.node.INodeModelSelectionListener;
+import net.sf.magicmap.client.model.node.INodeSelectionModel;
+
+/**
+ *
+ */
+public interface IModelView extends INodeModelSelectionListener {
+
+ void setNodeModel(INodeModel newNodeModel);
+ INodeModel getNodeModel();
+
+ void setNodeSelectionModel(INodeSelectionModel newSelectionMode);
+ INodeSelectionModel getNodeSelectionModel();
+
+ // TODO register menus etc....
+}
Added: trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeSelectionModel.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeSelectionModel.java (rev 0)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeSelectionModel.java 2007-01-15 23:58:32 UTC (rev 511)
@@ -0,0 +1,39 @@
+package net.sf.magicmap.client.model.node;
+
+import javax.swing.event.EventListenerList;
+
+/**
+ * @author Jan Friderici
+ */
+public class NodeSelectionModel implements INodeSelectionModel{
+
+ private final EventListenerList listeners;
+ private Node selectedNode;
+
+ public NodeSelectionModel(){
+ listeners = new EventListenerList();
+ selectedNode = Node.EMPTY_NODE;
+ }
+ public void addNodeModelSelectionListener(INodeModelSelectionListener l){
+ listeners.add(INodeModelSelectionListener.class, l);
+ }
+
+ public void removeNodeModelSelectionListener(INodeModelSelectionListener l){
+ listeners.remove(INodeModelSelectionListener.class, l);
+ }
+ /**
+ *
+ * @param newSelectedNode the node to select (NEVER null please)
+ * @return the selected node.
+ */
+ public Node selectNode(Node newSelectedNode){
+ Node oldNode = this.selectedNode;
+ this.selectedNode = newSelectedNode;
+ INodeModelSelectionListener[] currentListenerIs = listeners.getListeners(INodeModelSelectionListener.class);
+ NodeModelSelectionEvent event = new NodeModelSelectionEvent(this, selectedNode, oldNode);
+ for(INodeModelSelectionListener l: currentListenerIs){
+ l.selectionChanged(event);
+ }
+ return selectedNode;
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|