From: <an...@us...> - 2008-01-28 14:01:48
|
Revision: 718 http://magicmap.svn.sourceforge.net/magicmap/?rev=718&view=rev Author: anweiss Date: 2008-01-28 05:18:41 -0800 (Mon, 28 Jan 2008) Log Message: ----------- added hashmap with attributes for every node that can be stored on the server Modified Paths: -------------- trunk/magicmapclient/.project trunk/magicmapclient/.settings/org.eclipse.jdt.core.prefs trunk/magicmapclient/.settings/org.eclipse.jdt.ui.prefs trunk/magicmapclient/inf/PositionFacade.wsdl 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/client/controller/PollHandler.java trunk/magicmapclient/src/net/sf/magicmap/client/controller/SOAPServerManager.java trunk/magicmapclient/src/net/sf/magicmap/client/controller/ServerManager.java trunk/magicmapclient/src/net/sf/magicmap/client/controller/VirtualServerManager.java trunk/magicmapclient/src/net/sf/magicmap/client/delegate/PositionDelegate.java trunk/magicmapclient/src/net/sf/magicmap/client/delegate/interfaces/PositionFacadeInterface.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/MapPanel.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/LoadMapDialog.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/GUIUtils.java trunk/magicmapclient/src/net/sf/magicmap/client/model/measurement/IMeasurementModel.java trunk/magicmapclient/src/net/sf/magicmap/client/model/node/AccessPointSeerNode.java trunk/magicmapclient/src/net/sf/magicmap/client/model/node/Node.java trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeModel.java trunk/magicmapclient/src/net/sf/magicmap/client/net/NetworkInfo.java trunk/magicmapclient/src/net/sf/magicmap/client/utils/DriverInformations.java Modified: trunk/magicmapclient/.project =================================================================== --- trunk/magicmapclient/.project 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/.project 2008-01-28 13:18:41 UTC (rev 718) @@ -11,10 +11,16 @@ <arguments> </arguments> </buildCommand> + <buildCommand> + <name>net.sf.eclipsensis.installoptions.InstallOptionsBuilder</name> + <arguments> + </arguments> + </buildCommand> </buildSpec> <natures> <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> <nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.jem.beaninfo.BeanInfoNature</nature> + <nature>net.sf.eclipsensis.installoptions.InstallOptionsNature</nature> </natures> </projectDescription> Modified: trunk/magicmapclient/.settings/org.eclipse.jdt.core.prefs =================================================================== --- trunk/magicmapclient/.settings/org.eclipse.jdt.core.prefs 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/.settings/org.eclipse.jdt.core.prefs 2008-01-28 13:18:41 UTC (rev 718) @@ -1,4 +1,4 @@ -#Mon Sep 04 16:13:41 CEST 2006 +#Fri Nov 09 15:22:53 CET 2007 eclipse.preferences.version=1 org.eclipse.jdt.core.formatter.align_type_members_on_columns=true org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 Modified: trunk/magicmapclient/.settings/org.eclipse.jdt.ui.prefs =================================================================== --- trunk/magicmapclient/.settings/org.eclipse.jdt.ui.prefs 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/.settings/org.eclipse.jdt.ui.prefs 2008-01-28 13:18:41 UTC (rev 718) @@ -1,4 +1,5 @@ -#Thu Aug 31 15:41:15 CEST 2006 +#Fri Nov 09 15:22:53 CET 2007 eclipse.preferences.version=1 formatter_profile=_MagicMap Coding Conventions formatter_settings_version=10 +internal.default.compliance=default Modified: trunk/magicmapclient/inf/PositionFacade.wsdl =================================================================== (Binary files differ) Modified: trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java 2008-01-28 13:18:41 UTC (rev 718) @@ -4,6 +4,13 @@ package net.sf.magicmap.client.controller; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.HashMap; + import net.sf.magicmap.client.gui.MainGUI; import net.sf.magicmap.client.gui.utils.GUIUtils; import net.sf.magicmap.client.gui.views.MapView; @@ -13,20 +20,22 @@ import net.sf.magicmap.client.measurement.interfaces.AbstractScanner; import net.sf.magicmap.client.measurement.interfaces.AbstractScannerHandler; import net.sf.magicmap.client.meta.MapInfo; -import net.sf.magicmap.client.model.node.*; +import net.sf.magicmap.client.model.node.ClientNode; +import net.sf.magicmap.client.model.node.GeoPos; +import net.sf.magicmap.client.model.node.INodeModel; +import net.sf.magicmap.client.model.node.MapNode; +import net.sf.magicmap.client.model.node.Node; +import net.sf.magicmap.client.model.node.NodeModel; import net.sf.magicmap.client.plugin.PluginManager; +import net.sf.magicmap.client.utils.DriverInformations; import net.sf.magicmap.client.utils.Settings; import net.sf.magicmap.core.model.node.IMagicNodeModel; import net.sf.magicmap.core.model.node.impl.MagicNodeModel; import net.sf.magicmap.server.dto.MapDTO; import net.sf.magicmap.server.exception.SessionException; + import org.apache.log4j.xml.DOMConfigurator; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; - /** * Kann \xC4nderungen an View und am Modell vornehmen und zieht alle F\xE4den * der Anwendung. @@ -42,35 +51,38 @@ MapNamesCallback, MapCallback { - private static int numCalled = 0; - private static int disconnectAttempts = 0; + private static int numCalled = 0; + private static int disconnectAttempts = 0; /** * Die Instanz. */ - private static Controller controller = null; + private static Controller controller = null; /** * Das Knotenmodel. */ + private IMagicNodeModel nodeModel; // Model f\xFCr Graphen private ClientNode client; // Ausgezeichneter Knoten - private ServerPoller poller; // Server st\xE4ndig nach \xC4nderungen fragen + private HashMap<String, String> ClientAttributes = new HashMap<String,String>(); // zus\xE4tzliche Attribute f\xFCr den Clienten - private PollHandler pollhandler; // Klasse zur Verarbeitung der Pollergebnisse + private ServerPoller poller; // Server st\xE4ndig nach \xC4nderungen fragen - private ServerManager serverManager; // Manager f\xFCr die Verbindung zum Server + private PollHandler pollhandler; // Klasse zur Verarbeitung der Pollergebnisse + private ServerManager serverManager; // Manager f\xFCr die Verbindung zum Server + // private CallbackHandler callbackHandler; // S\xE4mtliche callbacks werden dort behandelt - private MapInfo currentMap; + 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; + private ScannerAllocator scannerAllocator; + private PluginManager pluginManager; /** * Private constructor for singleton instance @@ -169,13 +181,13 @@ this.scannerAllocator.startAllScanner(); this.pluginManager.loadMap(); -// if (this.currentMap.realheight > 0 && this.currentMap.realwidth > 0) + // if (this.currentMap.realheight > 0 && this.currentMap.realwidth > 0) // TODO: Interface f\xFCr GUI mit methode setMapTitle() -// ((MapView) MainGUI.getInstance().getJComponent("mapView")).setTitle(GUIUtils.i18n("map", false) + " - " -// + this.currentMap.name + " Gr\xF6\xDFe: " + this.currentMap.realwidth + " X " -// + this.currentMap.realheight + " cm"); + // ((MapView) MainGUI.getInstance().getJComponent("mapView")).setTitle(GUIUtils.i18n("map", false) + " - " + // + this.currentMap.name + " Gr\xF6\xDFe: " + this.currentMap.realwidth + " X " + // + this.currentMap.realheight + " cm"); } } @@ -306,11 +318,12 @@ * Erzeugt einen Referenzpunkt auf der aktuellen Karte mit den aktuellen * Messwerten des Clients mit den angegebenen Koordinaten. */ - public void createLocation(int x, int y, int z, String name, boolean fixed, CreatePositionCallback callback){ + public void createLocation(int x, int y, int z, String name, boolean fixed, HashMap<String, String> attributes, + CreatePositionCallback callback){ if (!isConnected() || !isMapLoaded()) callback.positionCreationError(new Exception("Nicht verbunden oder keine Karte geladen.")); else - this.serverManager.createLocation(x, y, z, fixed, name, callback); + this.serverManager.createLocation(x, y, z, fixed, name, attributes, callback); } /** @@ -389,15 +402,15 @@ } public void setClientPosition(final int x, final int y, final int z, final boolean fixed, final String clientMac, - final PositionCallback callback){ + final HashMap<String, String> attributes, final PositionCallback callback){ - this.serverManager.setClientPosition(x, y, z, fixed, clientMac, callback); + this.serverManager.setClientPosition(x, y, z, fixed, clientMac, attributes, callback); } public void setAccessPointPosition(final int x, final int y, final int z, boolean fixed, - final String accessPointMac, final PositionCallback callback){ + final String accessPointMac, final HashMap<String, String> attributes, final PositionCallback callback){ - this.serverManager.setAccessPointPosition(x, y, z, fixed, accessPointMac, callback); + this.serverManager.setAccessPointPosition(x, y, z, fixed, accessPointMac, attributes, callback); } public void setAccessPointHiddenStatus(String accessPointMac, boolean hidden, PositionCallback callback){ @@ -527,4 +540,21 @@ nodeModel.addNode(node); } catch (MalformedURLException e) {} catch (IOException e) {} } -} + + public HashMap<String, String> getClientAttributes(){ + return ClientAttributes; + } + + public void setClientAttributes(HashMap<String, String> clientAttributes){ + ClientAttributes = clientAttributes; + } + + public void addInterface(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)); + this.ClientAttributes.putAll(intorface); + } + } +} \ 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-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/IController.java 2008-01-28 13:18:41 UTC (rev 718) @@ -1,6 +1,7 @@ package net.sf.magicmap.client.controller; +import java.util.HashMap; import net.sf.magicmap.client.interfaces.*; import net.sf.magicmap.client.measurement.interfaces.AbstractScanResult; import net.sf.magicmap.client.measurement.interfaces.AbstractScanner; @@ -118,7 +119,7 @@ * Erzeugt einen Referenzpunkt auf der aktuellen Karte mit den aktuellen * Messwerten des Clients mit den angegebenen Koordinaten. */ - void createLocation(int x, int y, int z, String name, boolean fixed, CreatePositionCallback callback); + void createLocation(int x, int y, int z, String name, boolean fixed, final HashMap <String, String> attributes, CreatePositionCallback callback); /** * Erzeugt eine Geokoordinate auf der aktuellen Karte mit den angegebenen @@ -157,9 +158,9 @@ */ void deleteGeoPoint(String name, String string, DeletePositionCallback callback); - void setClientPosition(int x, int y, int z, boolean fixed, String clientMac, PositionCallback callback); + void setClientPosition(int x, int y, int z, boolean fixed, String clientMac, HashMap <String, String> attributes, PositionCallback callback); - void setAccessPointPosition(int x, int y, int z, boolean fixed, String accessPointMac, PositionCallback callback); + void setAccessPointPosition(int x, int y, int z, boolean fixed, String accessPointMac, HashMap <String, String> attributes, PositionCallback callback); void setAccessPointHiddenStatus(String accessPointMac, boolean hidden, PositionCallback callback); Modified: trunk/magicmapclient/src/net/sf/magicmap/client/controller/PollHandler.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/controller/PollHandler.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/PollHandler.java 2008-01-28 13:18:41 UTC (rev 718) @@ -313,10 +313,14 @@ // Position \xE4ndern if (!client.isCalculated()) client.setPosition(position.getPosX(), position.getPosY(), position.getPosZ()); // FixierungsStatus setzen - client.setFix(position.isFixed()); + if (position.isFixed()) { + client.setPosition(position.getPosX(), position.getPosY(), position.getPosZ()); + client.setFix(position.isFixed()); + } else + client.setFix(position.isFixed()); - // TODO: ist die id hier wirklich notwendig? - client.setId(position.getId()); + // TODO: ist die id hier wirklich notwendig? + client.setId(position.getId()); // Signalst\xE4rken usw. verwaltet der scannende // Client selbst Modified: trunk/magicmapclient/src/net/sf/magicmap/client/controller/SOAPServerManager.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/controller/SOAPServerManager.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/SOAPServerManager.java 2008-01-28 13:18:41 UTC (rev 718) @@ -7,6 +7,7 @@ import java.io.IOException; import java.rmi.RemoteException; import java.util.Collection; +import java.util.HashMap; import edu.uci.ics.jung.graph.Vertex; import edu.uci.ics.jung.visualization.SpringLayout; @@ -264,7 +265,7 @@ */ @Override public void createLocation(final int x, final int y, final int z, final boolean fixed, final String name, - final CreatePositionCallback callback){ + final HashMap<String, String> attributes, final CreatePositionCallback callback){ if (isConnected()) { final SignalCharacterDTO signalCharacter = currentSignalCharacter(); System.out.println("signalCharacter.getSimpleScanResults() " + signalCharacter.getSimpleScanResults()); @@ -279,7 +280,7 @@ SOAPServerManager.this.positionDelgate.createOrUpdatePosition( SOAPServerManager.this.sessionId, SOAPServerManager.this.controller.getCurrentMap().name, x, y, z, signalCharacter, - name, fixed); + name, fixed, attributes); // TODO: Zus\xE4tzliche Parameter zur Position callback.positionCreated(); } catch (Exception e) { @@ -453,7 +454,7 @@ */ @Override public void setClientPosition(final int x, final int y, final int z, final boolean fixed, final String clientMac, - final PositionCallback callback){ + final HashMap<String, String> attributes, final PositionCallback callback){ if (isConnected()) { Thread positionThread = new Thread() { @@ -465,7 +466,7 @@ SOAPServerManager.this.positionDelgate.createOrUpdateClientPosition( SOAPServerManager.this.sessionId, SOAPServerManager.this.controller.getCurrentMap().name, x, y, z, - currentSignalCharacter(), clientMac, fixed); + currentSignalCharacter(), clientMac, fixed, attributes); // TODO: Zus\xE4tzliche Parameter zur Position callback.positionUpdated(clientMac); } catch (Exception e) { @@ -494,7 +495,7 @@ */ @Override public void setAccessPointPosition(final int x, final int y, final int z, final boolean fixed, - final String accessPointMac, final PositionCallback callback){ + final String accessPointMac, final HashMap<String, String> attributes, final PositionCallback callback){ if (isConnected()) { Thread positionThread = new Thread() { @@ -506,7 +507,7 @@ SOAPServerManager.this.positionDelgate.createOrUpdateAccessPosition( SOAPServerManager.this.sessionId, SOAPServerManager.this.controller.getCurrentMap().name, x, y, z, accessPointMac, - fixed); + fixed, attributes); // TODO: Zus\xE4tzliche Parameter zur Position callback.positionUpdated(accessPointMac); } catch (Exception e) { @@ -619,10 +620,12 @@ synchronized (SOAPServerManager.mutex) { if (!isConnected()) return; try { - // TODO: abfrage ist im moment nicht aus dem Nodemodel m\xF6glich, daher behelfsl\xF6sung direkt aus dem Layout + // TODO: abfrage ist im moment nicht aus dem Nodemodel m\xF6glich, daher behelfsl\xF6sung direkt aus dem Layout ClientNode client = Controller.getInstance().getClient(); - Vertex clientVertex = ((JungNodePlacer) Controller.getInstance().getNodeModel().getNodePlacer()).findVertex(client); - SpringLayout layout = ((JungNodePlacer) Controller.getInstance().getNodeModel().getNodePlacer()).getLayout(); + Vertex clientVertex = ((JungNodePlacer) Controller.getInstance().getNodeModel() + .getNodePlacer()).findVertex(client); + SpringLayout layout = ((JungNodePlacer) Controller.getInstance().getNodeModel() + .getNodePlacer()).getLayout(); int x = (int) layout.getX(clientVertex); int y = (int) layout.getY(clientVertex); int z = SOAPServerManager.this.controller.getClientPosZ(); @@ -642,7 +645,8 @@ SOAPServerManager.this.sessionId, SOAPServerManager.this.controller.getCurrentMap().name, x, y, z, signalCharacter, SOAPServerManager.this.controller.getClient().getMacAddress(), - SOAPServerManager.this.controller.getClient().isFix()); + SOAPServerManager.this.controller.getClient().isFix(), + SOAPServerManager.this.controller.getClientAttributes()); // TODO: Zus\xE4tzliche Parameter zur Position System.out.println("Client info submitted."); } catch (Exception e) { Modified: trunk/magicmapclient/src/net/sf/magicmap/client/controller/ServerManager.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/controller/ServerManager.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/ServerManager.java 2008-01-28 13:18:41 UTC (rev 718) @@ -12,6 +12,7 @@ import java.util.Calendar; import java.util.Collection; import java.util.GregorianCalendar; +import java.util.HashMap; import java.util.Iterator; import net.sf.magicmap.client.interfaces.CreateNewMapCallback; @@ -145,7 +146,7 @@ * @param node * @param callback */ - public abstract void createLocation(final int x, final int y, final int z, final boolean fixed, final String name, + public abstract void createLocation(final int x, final int y, final int z, final boolean fixed, final String name, final HashMap<String, String> attributes, final CreatePositionCallback callback); /** @@ -181,7 +182,7 @@ public void movePosition(long sessionId, long positionId, int newPositionX, int newPositionY) throws RemoteException, public void deletePosition(long sessionId, long positionId) throws RemoteException, MapException, SessionException{ */public abstract void setClientPosition(final int x, final int y, final int z, final boolean fixed, - final String clientMac, final PositionCallback callback); + final String clientMac, final HashMap<String, String> attributes, final PositionCallback callback); /** * Eine Position von (-1,-1) bedeutet, dass der Client nicht fixiert ist sondern @@ -192,7 +193,7 @@ * @param callback Callback */ public abstract void setAccessPointPosition(final int x, final int y, final int z, final boolean fixed, - final String accessPointMac, final PositionCallback callback); + final String accessPointMac, final HashMap<String, String> attributes, final PositionCallback callback); /** * Setzt den Berechnungsstatus des Accesspoint Modified: trunk/magicmapclient/src/net/sf/magicmap/client/controller/VirtualServerManager.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/controller/VirtualServerManager.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/VirtualServerManager.java 2008-01-28 13:18:41 UTC (rev 718) @@ -5,6 +5,7 @@ package net.sf.magicmap.client.controller; import java.util.ArrayList; +import java.util.HashMap; import net.sf.magicmap.client.interfaces.CreateNewMapCallback; import net.sf.magicmap.client.interfaces.CreatePositionCallback; @@ -20,6 +21,7 @@ import net.sf.magicmap.client.interfaces.ServerDisconnectCallback; import net.sf.magicmap.client.meta.MapInfo; import net.sf.magicmap.client.model.node.GeoPos; +import net.sf.magicmap.client.utils.NodeTypes; import net.sf.magicmap.client.utils.Settings; import net.sf.magicmap.client.utils.Version; import net.sf.magicmap.server.Init; @@ -39,7 +41,7 @@ */ public class VirtualServerManager extends ServerManager { - private static String mutex = "net.sf.magicmap.client.controller.Controller"; + private static String mutex = "net.sf.magicmap.client.controller.Controller"; /** * @param controller @@ -230,7 +232,7 @@ * net.sf.magicmap.client.interfaces.CreatePositionCallback) */ public void createLocation(final int x, final int y, final int z, final boolean fixed, final String name, - final CreatePositionCallback callback){ + final HashMap<String, String> attributes, final CreatePositionCallback callback){ if (!isConnected()) return; final SignalCharacterDTO signalCharacter = currentSignalCharacter(); System.out.println("signalCharacter.getSimpleScanResults() " + signalCharacter.getSimpleScanResults()); @@ -240,8 +242,8 @@ synchronized (mutex) { if (!isConnected()) return; try { - positionFacade.createOrUpdatePosition(sessionId, controller.getCurrentMap().name, x, y, z, - signalCharacter, name, fixed); + positionFacade.createOrUpdatePosition(sessionId, NodeTypes.LOCATION, controller.getCurrentMap().name, x, + y, z, signalCharacter, name, fixed, attributes); // TODO: Zus\xE4tzliche Parameter zur Position callback.positionCreated(); } catch (Exception e) { @@ -351,7 +353,7 @@ * net.sf.magicmap.client.interfaces.PositionCallback) */ public void setClientPosition(final int x, final int y, final int z, final boolean fixed, final String clientMac, - final PositionCallback callback){ + final HashMap<String, String> attributes, final PositionCallback callback){ if (!isConnected()) return; Thread thread = new Thread() { @@ -360,8 +362,8 @@ if (!isConnected()) return; try { - positionFacade.createOrUpdateClientPosition(sessionId, controller.getCurrentMap().name, x, y, - z, currentSignalCharacter(), clientMac, fixed); + positionFacade.createOrUpdatePosition(sessionId, NodeTypes.CLIENT, controller.getCurrentMap().name, x, y, + z, currentSignalCharacter(), clientMac, fixed, attributes); // TODO: Zus\xE4tzliche Parameter zur Position callback.positionUpdated(clientMac); } catch (Exception e) { @@ -382,7 +384,7 @@ * net.sf.magicmap.client.interfaces.PositionCallback) */ public void setAccessPointPosition(final int x, final int y, final int z, final boolean fixed, - final String accessPointMac, final PositionCallback callback){ + final String accessPointMac, final HashMap<String, String> attributes, final PositionCallback callback){ if (!isConnected()) return; Thread thread = new Thread() { @@ -390,8 +392,9 @@ synchronized (mutex) { if (!isConnected()) return; try { - positionFacade.createOrUpdateAccessPosition(sessionId, controller.getCurrentMap().name, x, y, - z, accessPointMac, fixed); + //TODO: SignalCharacter for APs? + positionFacade.createOrUpdatePosition(sessionId, NodeTypes.ACCESSPOINT, controller.getCurrentMap().name, + x, y, z, null, accessPointMac, fixed, attributes); // TODO: Zus\xE4tzliche Parameter zur Position callback.positionUpdated(accessPointMac); } catch (Exception e) { @@ -447,13 +450,14 @@ synchronized (mutex) { if (!isConnected()) return; try { + // TODO: use the arraylist and not null! or make null the null the default value to get all types PositionDTO[] positions; if (VirtualServerManager.this.timestamp == -1) positions = positionFacade.getPositionsForMapSince(VirtualServerManager.this.sessionId, - controller.getCurrentMap().name, new Long(3600000), true); + null, controller.getCurrentMap().name, new Long(3600000), true); else positions = positionFacade.getPositionsForMapSince(VirtualServerManager.this.sessionId, - controller.getCurrentMap().name, VirtualServerManager.this.timestamp, false); + null, controller.getCurrentMap().name, VirtualServerManager.this.timestamp, false); for (int i = 0; i < positions.length; i++) { if (positions[i].getLastModified().longValue() > timestamp) { timestamp = positions[i].getLastModified().longValue(); @@ -499,6 +503,7 @@ int y = controller.getClientPosY(); // int z = 0; int z = controller.getClientPosZ(); + HashMap<String, String> attributes = controller.getClientAttributes(); if (x < 0) x = 0; else if (x >= controller.getCurrentMap().width) x = controller.getCurrentMap().width - 1; @@ -509,9 +514,9 @@ if (z < 0) z = 0; // else if (z >= ) z = ;; - positionFacade.createOrUpdateClientPosition(sessionId, controller.getCurrentMap().name, x, y, + positionFacade.createOrUpdatePosition(sessionId, NodeTypes.CLIENT, controller.getCurrentMap().name, x, y, z, signalCharacter, controller.getClient().getMacAddress(), controller.getClient() - .isFix()); + .isFix(), attributes); // TODO: Zus\xE4tzliche Parameter zur Position System.out.println("Client info submitted."); } catch (Exception e) { Modified: trunk/magicmapclient/src/net/sf/magicmap/client/delegate/PositionDelegate.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/delegate/PositionDelegate.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/delegate/PositionDelegate.java 2008-01-28 13:18:41 UTC (rev 718) @@ -4,6 +4,7 @@ import java.net.MalformedURLException; import java.net.URL; import java.rmi.RemoteException; +import java.util.HashMap; import localhost.magicmap.services.PositionFacade.PositionFacade; import localhost.magicmap.services.PositionFacade.PositionFacadeServiceLocator; @@ -54,13 +55,13 @@ * java.lang.String, int, int, * com.saugstation.pacw.generated.SignalCharacter, java.lang.String) */ - public void createOrUpdatePosition(long sessionId, String mapName, int positionX, int positionY, int positionZ, - SignalCharacterDTO character, String positionName, boolean fixed) throws RemoteException, MapException, - SessionException{ + public void createOrUpdatePosition(long sessionId,String mapName, int positionX, int positionY, int positionZ, + SignalCharacterDTO character, String positionName, boolean fixed, HashMap<String, String> attributes) + throws RemoteException, MapException, SessionException{ try { long timeA = System.currentTimeMillis(); - this.binding.createOrUpdatePosition(sessionId, mapName, positionX, positionY, positionZ, character, - positionName, fixed); + this.binding.createOrUpdatePosition(sessionId, "POSITION", mapName, positionX, positionY, positionZ, + character, positionName, fixed, attributes); long timeB = System.currentTimeMillis(); System.out.println("createOrUpdatePosition brauchte: " + (timeB - timeA) + "ms"); } catch (Exception e) { @@ -76,12 +77,12 @@ * com.saugstation.pacw.generated.SignalCharacter, java.lang.String) */ public void createOrUpdateClientPosition(long sessionId, String mapName, int positionX, int positionY, - int positionZ, SignalCharacterDTO character, String clientMac, boolean fixed) throws RemoteException, - MapException, SessionException{ + int positionZ, SignalCharacterDTO character, String clientMac, boolean fixed, + HashMap<String, String> attributes) throws RemoteException, MapException, SessionException{ try { long timeA = System.currentTimeMillis(); - this.binding.createOrUpdateClientPosition(sessionId, mapName, positionX, positionY, positionZ, character, - clientMac, fixed); + this.binding.createOrUpdatePosition(sessionId, "CLIENT", mapName, positionX, positionY, positionZ, + character, clientMac, fixed, attributes); long timeB = System.currentTimeMillis(); System.out.println("createOrUpdateClientPosition brauchte: " + (timeB - timeA) + "ms"); } catch (Exception e) { @@ -97,11 +98,12 @@ * com.saugstation.pacw.generated.SignalCharacter, java.lang.String) */ public void createOrUpdateAccessPosition(long sessionId, String mapName, int positionX, int positionY, - int positionZ, String accessPointMac, boolean fixed) throws RemoteException, MapException, SessionException{ + int positionZ, String accessPointMac, boolean fixed, HashMap<String, String> attributes) + throws RemoteException, MapException, SessionException{ try { long timeA = System.currentTimeMillis(); - this.binding.createOrUpdateAccessPosition(sessionId, mapName, positionX, positionY, positionZ, - accessPointMac, fixed); + this.binding.createOrUpdatePosition(sessionId, "ACCESSPOINT", mapName, positionX, positionY, positionZ, + null, accessPointMac, fixed, attributes); long timeB = System.currentTimeMillis(); System.out.println("createOrUpdateAccessPosition brauchte: " + (timeB - timeA) + "ms"); } catch (Exception e) { @@ -153,7 +155,7 @@ */ public PositionDTO[] getPositionsForMapSince(long sessionId, String mapName, long timeStamp, boolean timeflag) throws RemoteException, MapException, SessionException{ - return this.binding.getPositionsForMapSince(sessionId, mapName, timeStamp, timeflag); + return this.binding.getPositionsForMapSince(sessionId, null, mapName, timeStamp, timeflag); } /* Modified: trunk/magicmapclient/src/net/sf/magicmap/client/delegate/interfaces/PositionFacadeInterface.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/delegate/interfaces/PositionFacadeInterface.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/delegate/interfaces/PositionFacadeInterface.java 2008-01-28 13:18:41 UTC (rev 718) @@ -1,11 +1,11 @@ /* * Created on 15.11.2004 - * */ package net.sf.magicmap.client.delegate.interfaces; import java.rmi.RemoteException; +import java.util.HashMap; import net.sf.magicmap.server.dto.PositionDTO; import net.sf.magicmap.server.dto.SignalCharacterDTO; @@ -32,8 +32,8 @@ * @throws MapException Fehlende Karte, inkosistente Positionsangaben */ public abstract void createOrUpdatePosition(long sessionId, String mapName, int positionX, int positionY, - int positionZ, SignalCharacterDTO character, String positionName, boolean fixed) throws SessionException, - MapException, RemoteException; + int positionZ, SignalCharacterDTO character, String identifier, boolean fixed, + HashMap<String, String> attributes) throws SessionException, MapException, RemoteException; /** * Legt eine Position f�r einen Client fest oder korrigiert diese @@ -48,8 +48,8 @@ * @throws MapException Fehlende Karte, inkosistente Positionsangaben */ public abstract void createOrUpdateClientPosition(long sessionId, String mapName, int positionX, int positionY, - int positionZ, SignalCharacterDTO character, String clientMac, boolean fixed) throws SessionException, - MapException, RemoteException; + int positionZ, SignalCharacterDTO character, String clientMac, boolean fixed, + HashMap<String, String> attribute) throws SessionException, MapException, RemoteException; /** * Legt eine Position f�r einen AccessPoint fest oder korrigiert diese @@ -64,7 +64,8 @@ * @throws MapException Fehlende Karte, inkosistente Positionsangaben */ public abstract void createOrUpdateAccessPosition(long sessionId, String mapName, int positionX, int positionY, - int positionZ, String accessPointMac, boolean fixed) throws SessionException, MapException, RemoteException; + int positionZ, String accessPointMac, boolean fixed, HashMap<String, String> attribute) + throws SessionException, MapException, RemoteException; /** * Verschiebt eine beliebige Position auf der Karte Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/MapPanel.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/MapPanel.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/MapPanel.java 2008-01-28 13:18:41 UTC (rev 718) @@ -397,7 +397,7 @@ * nehmen! */ Controller.getInstance().createLocation(getLastX(), getLastY(), Settings.DEFAULT_HEIGHT, - (r + " (" + Controller.getInstance().getClient().getName() + ") <" + timeAsString + ">"), true, + (r + " (" + Controller.getInstance().getClient().getName() + ") <" + timeAsString + ">"), true, Controller.getInstance().getClientAttributes(), this); } } @@ -425,7 +425,7 @@ this.selectedNode.setUpdate(true); // aktuelles Icon wird auf das // UpdateIcon gesetzt Controller.getInstance() - .createLocation(getLastX(), getLastY(), this.selectedNode.getZ(), r, true, this); // der + .createLocation(getLastX(), getLastY(), this.selectedNode.getZ(), r, true, Controller.getInstance().getClientAttributes(), this); // der // Referenzpunkt neu eingemessen } @@ -481,7 +481,7 @@ Controller.getInstance() .setAccessPointPosition(this.selectedNode.getX(), this.selectedNode.getY(), this.selectedNode.getZ(), true, - ((AccessPointNode) this.selectedNode).getMacAddress(), this); + ((AccessPointNode) this.selectedNode).getMacAddress(), this.selectedNode.getAttributes(), this); else Controller.getInstance().movePosition(this.selectedNode.getId(), Controller.getInstance().getCurrentMap().name, this.selectedNode.getX(), @@ -489,7 +489,7 @@ } else if (this.selectedNode.getType() == NodeModelConstants.NODETYPE_CLIENT) { if (this.selectedNode.getId() == -1) Controller.getInstance().setClientPosition(this.selectedNode.getX(), this.selectedNode.getY(), - this.selectedNode.getZ(), true, ((ClientNode) this.selectedNode).getMacAddress(), this); + this.selectedNode.getZ(), true, ((ClientNode) this.selectedNode).getMacAddress(), this.selectedNode.getAttributes(), this); else Controller.getInstance().movePosition(this.selectedNode.getId(), Controller.getInstance().getCurrentMap().name, this.selectedNode.getX(), @@ -497,7 +497,7 @@ } else if (this.selectedNode.getType() == NodeModelConstants.NODETYPE_LOCATION) if (this.selectedNode.getId() == -1) Controller.getInstance().createLocation(this.selectedNode.getX(), this.selectedNode.getY(), - this.selectedNode.getZ(), this.selectedNode.getName(), true, this); + this.selectedNode.getZ(), this.selectedNode.getName(), true, this.selectedNode.getAttributes(), this); else Controller.getInstance().movePosition(this.selectedNode.getId(), Controller.getInstance().getCurrentMap().name, this.selectedNode.getX(), Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/LoadMapDialog.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/LoadMapDialog.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/LoadMapDialog.java 2008-01-28 13:18:41 UTC (rev 718) @@ -116,6 +116,11 @@ this.list = new JList(mapModel); list.setCellRenderer(new DefaultListCellRenderer() { + /** + * Default serial version UID + */ + private static final long serialVersionUID = 1L; + @Override public Component getListCellRendererComponent(JList list, Object value, int arg2, boolean arg3, boolean arg4){ Component cellRenderer = super.getListCellRendererComponent(list, value, arg2, arg3, arg4); Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/GUIUtils.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/GUIUtils.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/GUIUtils.java 2008-01-28 13:18:41 UTC (rev 718) @@ -5,20 +5,29 @@ package net.sf.magicmap.client.gui.utils; +import java.awt.Dimension; +import java.awt.Window; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.SwingConstants; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.plaf.metal.MetalLookAndFeel; + +import net.sf.magicmap.client.gui.MainGUI; + import com.jgoodies.looks.Options; import com.jgoodies.looks.plastic.Plastic3DLookAndFeel; -import com.jgoodies.looks.plastic.PlasticLookAndFeel; import com.jgoodies.looks.plastic.theme.ExperienceBlue; -import net.sf.magicmap.client.gui.MainGUI; -import javax.swing.*; -import javax.swing.border.EmptyBorder; -import javax.swing.plaf.metal.MetalLookAndFeel; -import java.awt.*; -import java.util.*; -import apple.laf.AquaLookAndFeel; - /** * @author msc * Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/measurement/IMeasurementModel.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/measurement/IMeasurementModel.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/measurement/IMeasurementModel.java 2008-01-28 13:18:41 UTC (rev 718) @@ -2,6 +2,7 @@ package net.sf.magicmap.client.model.measurement; import java.util.Collection; +import java.util.HashMap; import net.sf.magicmap.client.interfaces.MeasurementModelListener; @@ -17,13 +18,24 @@ */ public Collection<SeenAccessPoint> get(); +// /** +// * Add a scanresult. +// * @param apMac the accesspoints mac +// * @param signalLevel the signal level. +// */ +// void updateScanResult(String apMac, double signalLevel); + /** * Add a scanresult. * @param apMac the accesspoints mac * @param signalLevel the signal level. + * @param infos additional informations like type, hardware, drivers etc... + * The keys for "infos" can be found in net.sf.magicmap.client.utils.DriverInformations.java */ void updateScanResult(String apMac, double signalLevel); + + /** * Add a scanresult without using average calculation. * @param apMac the accesspoints mac @@ -44,6 +56,13 @@ * @param signalLevel */ void directUpdateScanResult(String[] apMac, double[] signalLevel); + + /** + * Batch update to avoid event overflow ;-) + * @param apMac + * @param signalLevel + */ + void updateScanResult(String[] apMac, double[] signalLevel, HashMap<String, String>[] infos); /** * Gets the SeenAccessPoint for a given seer. Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/node/AccessPointSeerNode.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/node/AccessPointSeerNode.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/node/AccessPointSeerNode.java 2008-01-28 13:18:41 UTC (rev 718) @@ -17,10 +17,9 @@ import net.sf.magicmap.client.model.measurement.IMeasurementModel; import net.sf.magicmap.client.model.measurement.SeenAccessPoint; - /** * Ein Objekt das Access Points in einer Umgebung mit Signalst\xE4rken sehen kann. - * + * * @author thuebner */ public abstract class AccessPointSeerNode extends Node { @@ -28,7 +27,7 @@ /* * Alle Kanten zu AccessPoints (AccessPointEdge) mit entsprechenden * Informationen \xFCber die Signalst\xE4rke - * + * */ private final Map<String, AccessPointEdge> apEdges = new HashMap<String, AccessPointEdge>(); private IMeasurementModel measurementModel; @@ -56,7 +55,7 @@ * AccessPointer-Seher gemessen wurde oder * net.sf.magicmap.client.measurement.Constants.MIN_SIGNALLEVEL wenn * AccessPoint nicht gesehen wird. - * + * * @param ap * @return */ @@ -67,15 +66,15 @@ /** * Setzt / Aktualisiert die Signalst\xE4rke zu einem Access Point - * + * * @param ap the access point - * @param level the signal strength of the ap + * @param the signal strength of the ap */ public void setSignalLevelForAcessPoint(AccessPointNode ap, double level){ if (!apEdges.containsKey(ap.getMacAddress())) { seesAccessPoint(ap, level); } else { - if(ap.isHidden()){ + if (ap.isHidden()) { notSeesAccessPoint(ap); return; } @@ -86,6 +85,18 @@ } + /** + * Normalisiert die Signalst\xE4rke zu einem Access Point + * + * @param ap the access point + * @param level the signal strength of the ap + */ + public void setSignalLevelForAcessPoint(AccessPointNode ap, double level,HashMap<String, Object> infos){ + // TODO : Normalisierung, Faktor einmal vom Server holen und dann das level umrechnen. + // TODO : Streuung und dergleichen berechnen + setSignalLevelForAcessPoint(ap, level); + } + public void seesAccessPoint(AccessPointNode ap, double signalStrength){ if (!getSeenAccessPoints().contains(ap) && !ap.isHidden()) { AccessPointEdge ae = new AccessPointEdge(); @@ -145,7 +156,7 @@ /** * New Model for measurements. contains all measurement made. - * + * */ public class MeasurementModel implements IMeasurementModel { @@ -157,9 +168,8 @@ } /** - * Adds an access point to the list of seen ap for a - * given client. - * + * Adds an access point to the list of seen ap for a given client. + * * @param client the client seeing the ap * @param ap the seen access point. */ @@ -168,10 +178,11 @@ apMap.put(ap.getMac(), ap); fireAccessPointAdded(ap); } - //client.getModel().updateNode(client, NodeModelConstants.UPDATE_SEESACCESSPOINT, null); + // client.getModel().updateNode(client, + // NodeModelConstants.UPDATE_SEESACCESSPOINT, null); } + public void updateScanResult(String apMac, double signalLevel){ - public void updateScanResult(String apMac, double signalLevel){ SeenAccessPoint accessPoint = getAccessPoint(apMac); final INodeModel nodeModel = AccessPointSeerNode.this.getModel(); @@ -203,7 +214,7 @@ } } } - + public void directUpdateScanResult(String apMac, double signalLevel){ SeenAccessPoint accessPoint = getAccessPoint(apMac); final INodeModel nodeModel = AccessPointSeerNode.this.getModel(); @@ -237,7 +248,6 @@ } } - public void updateScanResult(String[] apMac, double[] signalLevel){ HashSet<String> seenAps = new HashSet<String>(); for (SeenAccessPoint sap : this.get()) { @@ -251,7 +261,7 @@ updateScanResult(mac, Double.NEGATIVE_INFINITY); } } - + public void directUpdateScanResult(String[] apMac, double[] signalLevel){ HashSet<String> seenAps = new HashSet<String>(); for (SeenAccessPoint sap : this.get()) { @@ -265,9 +275,15 @@ directUpdateScanResult(mac, Double.NEGATIVE_INFINITY); } } + + public void updateScanResult(String[] apMac, double[] signalLevel, HashMap<String, String>[] infos){ + // TODO Auto-generated method stub + + } /** * Returns a list of seen access points for a given client. + * * @param forNode * @return */ @@ -325,6 +341,5 @@ mml.clearAccessPoints(); } } - } } \ No newline at end of file Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/node/Node.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/node/Node.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/node/Node.java 2008-01-28 13:18:41 UTC (rev 718) @@ -5,6 +5,7 @@ package net.sf.magicmap.client.model.node; import java.util.ArrayList; +import java.util.HashMap; /** * Einfacher Knoten in unserem Graphen aus Clients, AccessPoints, und @@ -12,78 +13,81 @@ * * @author thuebner */ -public abstract class Node implements INode{ - // Es gibt zwar die sch\xF6ne Methode Collections.emptyList() aber - // Da diese keine ArrayList ist m\xFCessen wir das selber machen :-/ - private static final ArrayList emptyList = new ArrayList(){ - public boolean add(Object o) { - return false; - } +public abstract class Node implements INode { - public void add(int index, Object element) { - } - }; - /** + // Es gibt zwar die sch\xF6ne Methode Collections.emptyList() aber + // Da diese keine ArrayList ist m\xFCessen wir das selber machen :-/ + private static final ArrayList emptyList = new ArrayList() { + + public boolean add(Object o){ + return false; + } + + public void add(int index, Object element){} + }; + /** * Ein leerer Knoten. */ - public static final Node EMPTY_NODE = new Node(null) { + public static final Node EMPTY_NODE = new Node(null) { - @Override - public ArrayList getNeighbors(){ - return emptyList; - } + @Override + public ArrayList getNeighbors(){ + return emptyList; + } - @Override - public int getType(){ - return -1; - } + @Override + public int getType(){ + return -1; + } - }; + }; /** * */ - private static int counter = 0; + private static int counter = 0; /** * */ - private String name; // Beschreibung + private String name; // Beschreibung /** * */ - private String displayName; + private String displayName; /** * */ - private String internal; + private String internal; - protected boolean fix; // Fest oder beweglich + protected boolean fix; // Fest oder beweglich /** * */ - protected boolean update = false; // wenn Referenzpunktupdate = true + protected boolean update = false; // wenn Referenzpunktupdate = true - private int x; // Position (nur wenn fix = true) + private int x; // Position (nur wenn fix = true) - private int y; + private int y; - private int z; + private int z; - private long id; + private long id; - private transient INodeModel model; + private transient INodeModel model; - private Node parentNode; + private Node parentNode; + private HashMap<String, String> attributes = new HashMap<String, String>(); + /** * true wenn der Knoten ein Objekt mit einer r\xE4umlichen * Ausbreitung darstellt. (Infoobjekte haben unter Umst\xE4nden keinen Ort). */ - private boolean physical; + private boolean physical; /** * Erzeugt leeren Knoten. Ein Knoten mu\xDF \xFCber sein NodeModel bescheid @@ -127,7 +131,6 @@ } /** - * TODO what does this mean? * @return */ public boolean isUpdate(){ @@ -135,7 +138,6 @@ } /** - * TODO !? * @param newupdate */ public void setUpdate(boolean newupdate){ @@ -273,4 +275,12 @@ return null; } + public void setAttributes(HashMap<String, String> newAttributes){ + this.attributes = newAttributes; + } + + public HashMap<String, String> getAttributes(){ + return this.attributes; + } + } \ No newline at end of file Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeModel.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeModel.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeModel.java 2008-01-28 13:18:41 UTC (rev 718) @@ -6,6 +6,7 @@ import net.sf.magicmap.client.meta.MapInfo; import net.sf.magicmap.client.model.location.INodePlacer; import net.sf.magicmap.client.model.location.jung.JungNodePlacer; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; Modified: trunk/magicmapclient/src/net/sf/magicmap/client/net/NetworkInfo.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/net/NetworkInfo.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/net/NetworkInfo.java 2008-01-28 13:18:41 UTC (rev 718) @@ -138,7 +138,9 @@ /** Sort of like a factory... */ public static NetworkInfo getNetworkInfo() throws IOException{ String os = System.getProperty("os.name"); - + if(os.contains("Vista")) + return new VistaNetworkInfo(); + else if (os.startsWith("Windows")) return new WindowsNetworkInfo(); else if (os.startsWith("Linux")) Modified: trunk/magicmapclient/src/net/sf/magicmap/client/utils/DriverInformations.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/utils/DriverInformations.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/utils/DriverInformations.java 2008-01-28 13:18:41 UTC (rev 718) @@ -1,13 +1,13 @@ + package net.sf.magicmap.client.utils; +public final class DriverInformations { -public final class DriverInformations { - public final static String DRIVER = "DRIVER"; - public final static String VENDOR = "VENDOR"; - public final static String PROVIDER= "PROVIDER"; - public final static String DATE = "DATE"; - public final static String VERSION = "VERSION"; - public final static String INFFILE = "INFFILE"; - public final static String TYPE = "TYPE"; - public final static String SUPPORTEDTYPES = "SUPPORTEDTYPES"; + public final static String OSNAME = "OSNAME"; //name of the operating system + public final static String RADIOTYPE = "RADIOTYPE"; //wlan, bluetooth, gsm, etc... + public final static String DEVICENAME = "DEVICENAME"; //name of the device + public final static String VENDOR = "VENDOR"; //name of the vendor + public final static String VERSION = "VERSION"; //driver version + public final static String TYPE = "TYPE"; + public final static String SUPPORTEDTYPES = "SUPPORTEDTYPES"; //e.g.: 802.11a 802.11b 802.11g } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |