From: <an...@us...> - 2008-02-01 13:41:10
|
Revision: 728 http://magicmap.svn.sourceforge.net/magicmap/?rev=728&view=rev Author: anweiss Date: 2008-02-01 05:41:00 -0800 (Fri, 01 Feb 2008) Log Message: ----------- added interface functions to edit the attributes hashmap for every node Modified Paths: -------------- trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java trunk/magicmapclient/src/net/sf/magicmap/client/controller/IController.java trunk/magicmapclient/src/net/sf/magicmap/core/model/node/impl/MagicNode.java Modified: trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java 2008-02-01 13:35:17 UTC (rev 727) +++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java 2008-02-01 13:41:00 UTC (rev 728) @@ -4,7 +4,6 @@ package net.sf.magicmap.client.controller; - import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; @@ -14,7 +13,15 @@ import net.sf.magicmap.client.gui.MainGUI; import net.sf.magicmap.client.gui.utils.GUIUtils; import net.sf.magicmap.client.gui.views.MapView; -import net.sf.magicmap.client.interfaces.*; +import net.sf.magicmap.client.interfaces.CreateNewMapCallback; +import net.sf.magicmap.client.interfaces.CreatePositionCallback; +import net.sf.magicmap.client.interfaces.DeletePositionCallback; +import net.sf.magicmap.client.interfaces.MapCallback; +import net.sf.magicmap.client.interfaces.MapNamesCallback; +import net.sf.magicmap.client.interfaces.MovePositionCallback; +import net.sf.magicmap.client.interfaces.PositionCallback; +import net.sf.magicmap.client.interfaces.ServerConnectCallback; +import net.sf.magicmap.client.interfaces.ServerDisconnectCallback; import net.sf.magicmap.client.measurement.ScannerAllocator; import net.sf.magicmap.client.measurement.interfaces.AbstractScanResult; import net.sf.magicmap.client.measurement.interfaces.AbstractScanner; @@ -63,23 +70,23 @@ * Das Knotenmodel. */ - private IMagicNodeModel nodeModel; // Model f\xFCr Graphen + private IMagicNodeModel nodeModel; // Model f\xFCr Graphen - private ClientNode client; // Ausgezeichneter Knoten + private ClientNode client; // Ausgezeichneter Knoten - private HashMap<String, String> ClientAttributes = new HashMap<String,String>(); // zus\xE4tzliche Attribute f\xFCr den Clienten + private HashMap<String, String> ClientAttributes = new HashMap<String, String>(); // zus\xE4tzliche Attribute f\xFCr den Clienten - private ServerPoller poller; // Server st\xE4ndig nach \xC4nderungen fragen + private ServerPoller poller; // Server st\xE4ndig nach \xC4nderungen fragen - private PollHandler pollhandler; // Klasse zur Verarbeitung der Pollergebnisse + private PollHandler pollhandler; // Klasse zur Verarbeitung der Pollergebnisse - private ServerManager serverManager; // Manager f\xFCr die Verbindung zum Server + private ServerManager serverManager; // Manager f\xFCr die Verbindung zum Server // private CallbackHandler callbackHandler; // S\xE4mtliche callbacks werden dort behandelt private MapInfo currentMap; - private boolean invisble; // Invisible-Modus (keine Daten an Server) + private boolean invisble; // Invisible-Modus (keine Daten an Server) private ScannerAllocator scannerAllocator; private PluginManager pluginManager; @@ -541,20 +548,44 @@ } catch (MalformedURLException e) {} catch (IOException e) {} } + /* + * (non-Javadoc) + * @see net.sf.magicmap.client.controller.IController#getClientAttributes() + */ public HashMap<String, String> getClientAttributes(){ return ClientAttributes; } - public void setClientAttributes(HashMap<String, String> clientAttributes){ + /* + * (non-Javadoc) + * @see net.sf.magicmap.client.controller.IController#setClientInterfaceAttributes(java.util.HashMap) + */ + public void setClientInterfaceAttributes(HashMap<String, String> clientAttributes){ ClientAttributes = clientAttributes; } - public void addInterface(HashMap<String, String> intorface){ -// int count = Integer.parseInt(this.getClientAttributes().get(DriverInformations.NUMBEROFINTERFACES)); + /* + * (non-Javadoc) + * @see net.sf.magicmap.client.controller.IController#addClientInterface(java.util.HashMap) + */ + public void addClientInterface(HashMap<String, String> intorface){ + // int count = Integer.parseInt(this.getClientAttributes().get(DriverInformations.NUMBEROFINTERFACES)); if (!(this.getClientAttributes().containsValue(intorface.get(DriverInformations.DEVICENAME)))) { -// count++; -// this.ClientAttributes.put(DriverInformations.NUMBEROFINTERFACES, String.valueOf(count)); + // count++; + // this.ClientAttributes.put(DriverInformations.NUMBEROFINTERFACES, String.valueOf(count)); this.ClientAttributes.putAll(intorface); } } + + /* + * (non-Javadoc) + * @see net.sf.magicmap.client.controller.IController#addAttributeForSelected(java.lang.String, java.lang.String) + */ + public void addAttributeForSelected(String key, String value){ + MainGUI.getInstance().getNodeSelectionModel().getSelectedNode().addAttribute(key, value); + } + + public void removeAttributeForSelected(String key){ + MainGUI.getInstance().getNodeSelectionModel().getSelectedNode().removeAttribute(key); + } } \ No newline at end of file Modified: trunk/magicmapclient/src/net/sf/magicmap/client/controller/IController.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/controller/IController.java 2008-02-01 13:35:17 UTC (rev 727) +++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/IController.java 2008-02-01 13:41:00 UTC (rev 728) @@ -2,7 +2,15 @@ package net.sf.magicmap.client.controller; import java.util.HashMap; -import net.sf.magicmap.client.interfaces.*; + +import net.sf.magicmap.client.interfaces.CreateNewMapCallback; +import net.sf.magicmap.client.interfaces.CreatePositionCallback; +import net.sf.magicmap.client.interfaces.DeletePositionCallback; +import net.sf.magicmap.client.interfaces.MapCallback; +import net.sf.magicmap.client.interfaces.MapNamesCallback; +import net.sf.magicmap.client.interfaces.MovePositionCallback; +import net.sf.magicmap.client.interfaces.PositionCallback; +import net.sf.magicmap.client.interfaces.ServerConnectCallback; import net.sf.magicmap.client.measurement.interfaces.AbstractScanResult; import net.sf.magicmap.client.measurement.interfaces.AbstractScanner; import net.sf.magicmap.client.measurement.interfaces.AbstractScannerHandler; @@ -190,4 +198,18 @@ * */ void initializePlugins(); + + HashMap<String, String> getClientAttributes(); + + /* + * Fills a hashmap with informations about the clients interface. + * + */ + void setClientInterfaceAttributes(HashMap<String, String> clientAttributes); + + void addClientInterface(HashMap<String, String> intorface); + + void addAttributeForSelected(String key, String value); + + void removeAttributeForSelected(String key); } Modified: trunk/magicmapclient/src/net/sf/magicmap/core/model/node/impl/MagicNode.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/core/model/node/impl/MagicNode.java 2008-02-01 13:35:17 UTC (rev 727) +++ trunk/magicmapclient/src/net/sf/magicmap/core/model/node/impl/MagicNode.java 2008-02-01 13:41:00 UTC (rev 728) @@ -8,6 +8,7 @@ import net.sf.magicmap.core.model.node.IMagicNodeModel; import java.util.ArrayList; +import java.util.HashMap; /** * <p> @@ -151,4 +152,28 @@ public Node asNode() { return delegate; } + + + public void addAttribute(String key, String value){ + this.delegate.addAttribute(key, value); + + } + + + public HashMap<String, String> getAttributes(){ + return this.delegate.getAttributes(); + } + + + public void removeAttribute(String key){ + this.delegate.removeAttribute(key); + + } + + + public void setAttributes(HashMap<String, String> newAttributes){ + this.delegate.setAttributes(newAttributes); + + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |