|
From: <jan...@us...> - 2007-02-16 12:39:27
|
Revision: 537
http://svn.sourceforge.net/magicmap/?rev=537&view=rev
Author: jan_fride
Date: 2007-02-16 04:39:13 -0800 (Fri, 16 Feb 2007)
Log Message:
-----------
made OutlineModel accessable through OutlineView
Modified Paths:
--------------
trunk/magicmapclient/plugins/udpplugin-plugin.jar
trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineView.java
trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java
trunk/magicmapclient/src/net/sf/magicmap/client/model/outline/OutlineModel.java
Modified: trunk/magicmapclient/plugins/udpplugin-plugin.jar
===================================================================
(Binary files differ)
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineView.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineView.java 2007-02-16 10:37:27 UTC (rev 536)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineView.java 2007-02-16 12:39:13 UTC (rev 537)
@@ -79,7 +79,6 @@
return panel;
}
-
public void selectionChanged(NodeModelSelectionEvent selectEvent){
Node selectedNode = selectEvent.getSelectedNode();
if (selectedNode != Node.EMPTY_NODE) tree.setSelectionPath(getOutlineNodePath(selectedNode));
@@ -227,4 +226,8 @@
public void collapseRPs(boolean b){
collapseCategory(NodeModelConstants.NODETYPE_LOCATION, b);
}
+
+ public OutlineModel getOutlineModel(){
+ return this.outlineModel;
+ }
}
\ No newline at end of file
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-16 10:37:27 UTC (rev 536)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java 2007-02-16 12:39:13 UTC (rev 537)
@@ -96,7 +96,7 @@
}
/**
- *
+ *
* @return
*/
public NodeMetricManager getMetricManager() {
@@ -159,14 +159,15 @@
* F\xFCgt einen neuen Knoten ein.
*/
public void insertNode(Node node){
- Vertex v = null;
int type = node.getType();
- // TODO das hier ist wahrlich haesslich....
+ if (node.getClass().equals(MapNode.class)) return;
- if (type == NodeModelConstants.NODETYPE_CLIENT || type == NodeModelConstants.NODETYPE_LOCATION
- || type == NodeModelConstants.NODETYPE_ACCESSPOINT || type == NodeModelConstants.NODETYPE_GEOPOS
- || type == NodeModelConstants.NODETYPE_INFO || type == NodeModelConstants.NODETYPE_RFID_ANTENNA)
- v = addVertex(node);
+// if (type == NodeModelConstants.NODETYPE_CLIENT || type == NodeModelConstants.NODETYPE_LOCATION
+// || type == NodeModelConstants.NODETYPE_ACCESSPOINT || type == NodeModelConstants.NODETYPE_GEOPOS
+// || type == NodeModelConstants.NODETYPE_INFO || type == NodeModelConstants.NODETYPE_RFID_ANTENNA)
+//
+ Vertex v = addVertex(node);
+
if (v != null) if (node.isFix())
this.layout.setFix(v);
else
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/outline/OutlineModel.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/model/outline/OutlineModel.java 2007-02-16 10:37:27 UTC (rev 536)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/model/outline/OutlineModel.java 2007-02-16 12:39:13 UTC (rev 537)
@@ -15,7 +15,7 @@
/**
* A TreeModel for the NodeModel.
- *
+ *
* @author Jan
*
*/
@@ -27,7 +27,7 @@
private final Map<Node, OutlineTreeNode> nodes;
/**
- *
+ *
* @param nodeModel
*/
public OutlineModel(INodeModel nodeModel) {
@@ -42,10 +42,9 @@
addCategory(NodeModelConstants.NODETYPE_CLIENT, GUIUtils.i18n("clients"));
addCategory(NodeModelConstants.NODETYPE_LOCATION, GUIUtils.i18n("locations"));
addCategory(NodeModelConstants.NODETYPE_GEOPOS, GUIUtils.i18n("Geokoordinaten"));
- addCategory(NodeModelConstants.NODETYPE_INFO, GUIUtils.i18n("Infoobjekte"));
+ //addCategory(NodeModelConstants.NODETYPE_INFO, GUIUtils.i18n("Infoobjekte"));
nodeModel.addNodeModelListener(this);
-
}
public OutlineTreeNode getCategoryNode(int category){
@@ -53,20 +52,21 @@
}
/**
- *
+ *
* @param category
* @param title
*/
public void addCategory(int category, String title){
if (this.categories.containsKey(category)) return;
OutlineTreeNode outlineTreeNode = new OutlineTreeNode(title);
- this.rootNode.add(outlineTreeNode);
+
this.categories.put(category, outlineTreeNode);
+ this.insertNodeInto(outlineTreeNode, rootNode, 0);
}
/**
- *
+ *
*/
public void nodeAddedEvent(Node node){
OutlineTreeNode parent = this.categories.get(node.getType());
@@ -87,7 +87,7 @@
}
/**
- *
+ *
*/
public void nodeUpdatedEvent(Node node, int type, Object data){
if (type == NodeModelConstants.UPDATE_CLEAR) {
@@ -101,7 +101,7 @@
/**
* Find OutlineNode for given Node and root OutlineNode
* @param node - the Node to find
- * @return the OutlineNode if exists, else null
+ * @return the OutlineNode if exists, else null
*/
public OutlineTreeNode findOutlineNode(Node node){
if (this.nodes.containsKey(node)) return this.nodes.get(node);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|