You can subscribe to this list here.
2005 |
Jan
|
Feb
(14) |
Mar
|
Apr
(4) |
May
(57) |
Jun
(14) |
Jul
(15) |
Aug
(5) |
Sep
(29) |
Oct
(13) |
Nov
(44) |
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(14) |
Feb
(78) |
Mar
(55) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
(12) |
Dec
(9) |
2007 |
Jan
(21) |
Feb
(67) |
Mar
(39) |
Apr
(28) |
May
(7) |
Jun
|
Jul
(6) |
Aug
(2) |
Sep
(1) |
Oct
(18) |
Nov
(8) |
Dec
(11) |
2008 |
Jan
(16) |
Feb
(12) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Johannes Z. <jza...@us...> - 2006-02-23 18:34:50
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/model/node In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4028/src/net/sf/magicmap/client/model/node Added Files: GeoPosNode.java InfoObject.java InfoObjectNode.java GeoPos.java Log Message: implemented routines for geo positions --- NEW FILE: GeoPosNode.java --- /** * */ package net.sf.magicmap.client.model.node; import java.util.ArrayList; /** * @author Johannes Zapotoczky (joh...@za...) * */ public class GeoPosNode extends Node { /** * @param model */ public GeoPosNode(NodeModel model) { super(model); } /* (non-Javadoc) * @see net.sf.magicmap.client.model.node.Node#getNeighbors() */ @Override public ArrayList getNeighbors() { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see net.sf.magicmap.client.model.node.Node#getType() */ @Override public int getType() { // TODO Auto-generated method stub return 0; } } --- NEW FILE: InfoObject.java --- /** * */ package net.sf.magicmap.client.model.node; /** * @author Johannes Zapotoczky (joh...@za...) * */ public class InfoObject { } --- NEW FILE: GeoPos.java --- /** * */ package net.sf.magicmap.client.model.node; /** * Data structure for geo positions. Provides transformation * facilities to * * @author Johannes Zapotoczky (joh...@za...) */ public class GeoPos { /** * standard deviation (1m), most likely too optimistic */ public static final int GEO_STD_DEVIATION = 1000; /** * factor to transform ms into degrees */ private static final int GEO_MS2DEGREES_FACTOR = 3600000; /** * factor to transfrom internal resolution to displayed values */ private static final int GEO_M2N_FACTOR = 1000; /** * longitude in milliseconds */ private int longitude; /** * latitude in milliseconds */ private int latitude; /** * altitude in mm */ private int altitude; /** * accuracy in mm */ private int exactitude; /** * Constructor (with standard deviation for accuracy) * @param longitude - longitude in ms * @param latitude - latitude in ms * @param altitude - altitude in mm */ public GeoPos(int longitude, int latitude, int altitude) { this(longitude, latitude, altitude, GEO_STD_DEVIATION); } /** * Constructor * @param longitude - longitude in ms * @param latitude - latitude in ms * @param altitude - altitude in mm * @param exactitude - accuracy in mm */ public GeoPos(int longitude, int latitude, int altitude, int exactitude) { this.longitude = longitude; this.latitude = latitude; this.altitude = altitude; this.exactitude = exactitude; } /** * Constructor * @param east - <code>true</code> if the longitude is east, <code>false</code> if it is west * @param longDegrees - the longitude's degrees * @param longMinutes - the longitude's minutes * @param longSeconds - the longitude's seconds * @param north - <code>true</code> if the latitude is north, <code>false</code> if it is south * @param latDegrees - the latitude's degrees * @param latMinutes - the latitude's minutes * @param latSeconds - the latitude's seconds * @param altitude - the altitude in m * @param exactitude - the exactitude in m */ public GeoPos(boolean east, Integer longDegrees, Integer longMinutes, Double longSeconds, boolean north, Integer latDegrees, Integer latMinutes, Double latSeconds, Integer altitude, Integer exactitude) { // calculate and set longitude int tmpLongMs = longDegrees.intValue() * 3600000; tmpLongMs += longMinutes.intValue() * 60000; tmpLongMs += longSeconds.doubleValue() * 1000; if (east) { this.longitude = tmpLongMs; } else { this.longitude = -tmpLongMs; } // calculate and set latitude int tmpLatMs = latDegrees.intValue() * 3600000; tmpLatMs += latMinutes.intValue() * 60000; tmpLatMs += latSeconds.doubleValue() * GEO_M2N_FACTOR; if (north) { this.latitude = tmpLatMs; } else { this.latitude = -tmpLatMs; } this.altitude = altitude.intValue() * GEO_M2N_FACTOR; this.exactitude = exactitude.intValue() * GEO_M2N_FACTOR; } /** * Constructor * @param longitude - longitude in degrees * @param latitude - latitude in degrees * @param altitude - altitude in m * @param exactitude - exactitude in m */ public GeoPos(Double longitude, Double latitude, Integer altitude, Integer exactitude) { this.longitude = (int) longitude.doubleValue() * GEO_MS2DEGREES_FACTOR; this.latitude = (int) latitude.doubleValue() * GEO_MS2DEGREES_FACTOR; this.altitude = altitude.intValue() * GEO_M2N_FACTOR; this.exactitude = exactitude.intValue() * GEO_M2N_FACTOR; } /** * Constructor * @param longitude - longitude in degrees * @param latitude - latitude in degrees * @param altitude - altitude in m * @param exactitude - exactitude in m */ public GeoPos(double longitude, double latitude, double altitude, double exactitude) { this.longitude = (int) (longitude * GEO_MS2DEGREES_FACTOR); this.latitude = (int) (latitude * GEO_MS2DEGREES_FACTOR); this.altitude = (int) (altitude * GEO_M2N_FACTOR); this.exactitude = (int) (exactitude * GEO_M2N_FACTOR); } /** * Get the whole longitude in degrees * @return - the longitude in degrees */ public Double getWholeLongitudeInDegrees() { return new Double(longitude / (double) GEO_MS2DEGREES_FACTOR); } /** * Get the whole latitude in degrees * @return - the latitude in degrees */ public Double getWholeLatitudeInDegrees() { return new Double(latitude / (double) GEO_MS2DEGREES_FACTOR); } /** * Get the altitude in m * @return altitude in m */ public Double getAltitudeInM() { return new Double(altitude / (double) GEO_M2N_FACTOR); } /** * Get the accuracy in m * @return accuracy in m */ public Double getExactitude() { return new Double(exactitude / (double) GEO_M2N_FACTOR); } public Integer getLongitudeDegrees() { return new Integer(longitude % GEO_MS2DEGREES_FACTOR); } public Integer getLongitudeMinutes() { return new Integer(longitude % (GEO_MS2DEGREES_FACTOR / 60)); } public Integer getLongitudeSeconds() { return new Integer(0); } public String toString() { return "longitude: " + this.longitude + ", latitude: " + this.latitude + ", altitude: " + this.altitude + ", exactitude: " + this.exactitude; } public int getLatitude() { return latitude; } public int getLongitude() { return longitude; } public int getAltitude() { return altitude; } } --- NEW FILE: InfoObjectNode.java --- /** * */ package net.sf.magicmap.client.model.node; import java.util.ArrayList; /** * @author Johannes Zapotoczky (joh...@za...) * */ public class InfoObjectNode extends Node { /** * @param model */ public InfoObjectNode(NodeModel model) { super(model); } /* (non-Javadoc) * @see net.sf.magicmap.client.model.node.Node#getNeighbors() */ @Override public ArrayList getNeighbors() { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see net.sf.magicmap.client.model.node.Node#getType() */ @Override public int getType() { // TODO Auto-generated method stub return 0; } } |
From: Johannes Z. <jza...@us...> - 2006-02-23 18:34:44
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/gui/dialogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4028/src/net/sf/magicmap/client/gui/dialogs Added Files: GeoPosDialog.java Log Message: implemented routines for geo positions --- NEW FILE: GeoPosDialog.java --- /** * */ package net.sf.magicmap.client.gui.dialogs; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.JTextField; import com.brunchboy.util.swing.relativelayout.RelativeLayout; import net.sf.magicmap.client.gui.utils.GUIConstants; import net.sf.magicmap.client.gui.utils.GUIUtils; import net.sf.magicmap.client.gui.utils.RelativePanelBuilder; import net.sf.magicmap.client.model.node.GeoPos; /** * @author Johannes Zapotoczky (joh...@za...) * */ public class GeoPosDialog extends JDialog implements ActionListener { /** * serial version id */ private static final long serialVersionUID = 8649270165378117129L; /** * the currently set geopos */ private GeoPos geoPos; /** * simple parameters */ private JTextField longitude; private JTextField latitude; private JTextField altitude; private JTextField exactitude; public static GeoPos showDialog(JFrame owner) { GeoPosDialog dialog = new GeoPosDialog(owner); GUIUtils.locateOnScreen(dialog); dialog.setModal(true); dialog.setVisible(true); return dialog.getValues(); } /** * @return */ private GeoPos getValues() { return geoPos; } public GeoPosDialog(JFrame owner) { super(owner, GUIUtils.i18n("geopos")); this.setSize(300, 300); this.setResizable(false); RelativeLayout layout = new RelativeLayout(); RelativePanelBuilder builder = new RelativePanelBuilder(layout); JButton okButton = builder.createButton(GUIUtils.i18n("set"), "OK", this); JButton cancelButton = builder.createButton(GUIUtils.i18n("cancel"), "CANCEL", this); // ok/cancel area builder.addOKCancelButtonBar(okButton, cancelButton, "okcancel"); builder.setLeftLeftDistance("okcancel", null, 10); builder.setRightRightDistance("okcancel", null, -10); builder.setBottomBottomDistance("okcancel", null, -10); // Kopf builder.addDialogHeader("<html><b>" + GUIUtils.i18n("setgeopos") + "</b><br>" + GUIUtils.i18n("setgeoposhint") + "</html>", GUIConstants.ICON_GEOPOS_BIG, "header"); builder.setTop("header", 0); builder.setLeft("header", 0); builder.setRightRightDistance("header", null, 0); setContentPane(builder.getPanel()); getRootPane().setDefaultButton(okButton); //longitude longitude = builder.addTextField("longitude"); builder.addLabel("Longitude", "longitudelabel", longitude); builder.setLeft("longitudelabel", 20); builder.setRightRightDistance("longitude", null, -20); builder.setTopBottomDistance("longitudelabel", "header", 20); builder.setTopBottomDistance("longitude", "header", 20); //latitude latitude = builder.addTextField("latitude"); builder.addLabel("Latitude", "latitudelabel", latitude); builder.setLeft("latitudelabel", 20); builder.setRightRightDistance("latitude", null, -20); builder.setTopBottomDistance("latitudelabel", "longitudelabel, longitude", 5); builder.setTopBottomDistance("latitude", "longitudelabel, longitude", 5); //altitude altitude = builder.addTextField("altitude"); builder.addLabel("Altitude", "altitudelabel", altitude); builder.setLeft("altitudelabel", 20); builder.setRightRightDistance("altitude", null, -20); builder.setTopBottomDistance("altitudelabel", "latitudelabel, latitude", 5); builder.setTopBottomDistance("altitude", "latitudelabel, latitude", 5); //altitude exactitude = builder.addTextField("exactitude"); builder.addLabel("Genauigkeit", "exactitudelabel", exactitude); builder.setLeft("exactitudelabel", 20); builder.setRightRightDistance("exactitude", null, -20); builder.setTopBottomDistance("exactitudelabel", "altitudelabel, altitude", 5); builder.setTopBottomDistance("exactitude", "altitudelabel, altitude", 5); } /* (non-Javadoc) * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */ public void actionPerformed(ActionEvent e) { if ("OK".equals(e.getActionCommand())){ // System.setProperty("http.proxyHost", this.proxyHost.getText()); // System.setProperty("http.proxyPort", this.proxyPort.getText()); this.geoPos = new GeoPos(Double.parseDouble(longitude.getText()), Double.parseDouble(latitude.getText()), Double.parseDouble(altitude.getText()), Double.parseDouble(exactitude.getText())); this.setVisible(false); } else if ("CANCEL".equals(e.getActionCommand())){ this.setVisible(false); } } } |
From: Johannes Z. <jza...@us...> - 2006-02-23 18:33:36
|
Update of /cvsroot/magicmap/magicmapclient/res In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3345/res Modified Files: screentext_en_US.properties screentext_de_DE.properties Log Message: implemented routines for geo positions Index: screentext_de_DE.properties =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/res/screentext_de_DE.properties,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** screentext_de_DE.properties 15 Feb 2006 21:19:32 -0000 1.8 --- screentext_de_DE.properties 23 Feb 2006 18:33:28 -0000 1.9 *************** *** 17,20 **** --- 17,23 ---- disconnect_from_server=Vom Server trennen createlocation=Neuer Referenzpunkt + creategeopos=Neue Geokoordinate + createinfoobject=Neues Infoobjekt + createrfidantenna=Neue RFID-Antenne namelocation=Benenne Referenzpunkt fetchlocations=Hole alle Orte vom Server *************** *** 99,102 **** --- 102,108 ---- setanhttpproxyhint=Geben Sie bitte die Daten ihres Proxy-Servers an setproxytooltip=Proxy-Server einstellen + geopos=Geokoordinate setzen + setgeopos=Eine Geokoordinate setzen + setgeoposhint=Geben Sie bitte eine Geokoordinate an nonserverconnect=Kein Server (Standalone) showedgesforselectednode=Zeige nur die Kanten für den selektierten Knoten Index: screentext_en_US.properties =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/res/screentext_en_US.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** screentext_en_US.properties 15 Feb 2006 21:19:31 -0000 1.2 --- screentext_en_US.properties 23 Feb 2006 18:33:28 -0000 1.3 *************** *** 9,12 **** --- 9,19 ---- connect_to_server=Connect to server disconnect_from_server=Disconnect from server + createlocation=New reference point + creategeopos=New geo position + createinfoobject=New info object + createrfidantenna=New RFID antenna + geopos=Set a geo position + setgeopos=Set a geo position + setgeoposhint=Please enter a geo position scanlocation=Scan location namelocation=Name location |
From: Johannes Z. <jza...@us...> - 2006-02-23 17:01:58
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/delegate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7758/src/net/sf/magicmap/client/delegate Modified Files: MapDelegate.java Log Message: implemented routines for geo positions Index: MapDelegate.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/delegate/MapDelegate.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MapDelegate.java 20 Feb 2006 15:18:28 -0000 1.5 --- MapDelegate.java 23 Feb 2006 17:01:43 -0000 1.6 *************** *** 93,109 **** } ! public GeoPointDTO[] getGeoPointsForMap(long sessionId, String mapName) throws MapException, SessionException, RemoteException{ ! // TODO Auto-generated method stub ! return null; } public MapDTO createGeoPoint(long sessionId, String mapName, int xPos, int yPos, int longitude, int latitude, int altitude) throws SessionException, MapException, RemoteException{ ! // TODO Auto-generated method stub ! return null; } public void deleteGeoPoint(long sessionId, long id) throws MapException, SessionException, RemoteException{ ! // TODO Auto-generated method stub ! } --- 93,118 ---- } ! public GeoPointDTO[] getGeoPointsForMap(long sessionId, String mapName) throws MapException, SessionException, RemoteException { ! try { ! return this.binding.getGeoPointsForMap(sessionId, mapName); ! } catch (Exception e) { ! throw ExceptionHandler.checkException(e); ! } } public MapDTO createGeoPoint(long sessionId, String mapName, int xPos, int yPos, int longitude, int latitude, int altitude) throws SessionException, MapException, RemoteException{ ! try { ! return this.binding.createGeoPoint(sessionId, mapName, xPos, yPos, longitude, latitude, altitude); ! } catch (Exception e) { ! throw ExceptionHandler.checkException(e); ! } } public void deleteGeoPoint(long sessionId, long id) throws MapException, SessionException, RemoteException{ ! try { ! this.deleteGeoPoint(sessionId, id); ! } catch (Exception e) { ! throw ExceptionHandler.checkException(e); ! } } |
From: Florian L. <fle...@us...> - 2006-02-22 16:28:26
|
Update of /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/facade In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1364/src/net/sf/magicmap/server/facade Modified Files: MapFacade.java Log Message: createMap bug fixed Index: MapFacade.java =================================================================== RCS file: /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/facade/MapFacade.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** MapFacade.java 20 Feb 2006 15:21:47 -0000 1.10 --- MapFacade.java 22 Feb 2006 16:28:21 -0000 1.11 *************** *** 127,130 **** --- 127,161 ---- result.setImageWidth(map.getImageWidth()); result.setImageURL(map.getImageURL()); + + Collection geoPoints = map.getGeoPositions(); + int i = 1; + while (geoPoints.iterator().hasNext()) { + GeoPosition geoPosition = (GeoPosition) geoPoints.iterator() + .next(); + switch (i) { + case 1: + result.setGeoPoint1X(geoPosition.getPosX()); + result.setGeoPoint1Y(geoPosition.getPosY()); + result.setGeoPoint1Long(geoPosition.getLongitude()); + result.setGeoPoint1Lat(geoPosition.getLatitude()); + result.setGeoPoint1Alt(geoPosition.getAltitude()); + break; + case 2: + result.setGeoPoint2X(geoPosition.getPosX()); + result.setGeoPoint2Y(geoPosition.getPosY()); + result.setGeoPoint2Long(geoPosition.getLongitude()); + result.setGeoPoint2Lat(geoPosition.getLatitude()); + result.setGeoPoint2Alt(geoPosition.getAltitude()); + break; + case 3: + result.setGeoPoint3X(geoPosition.getPosX()); + result.setGeoPoint3Y(geoPosition.getPosY()); + result.setGeoPoint3Long(geoPosition.getLongitude()); + result.setGeoPoint3Lat(geoPosition.getLatitude()); + result.setGeoPoint3Alt(geoPosition.getAltitude()); + break; + } + ++i; + } JDOUtil.commit(tx); } finally { *************** *** 165,170 **** result.setImageWidth(map.getImageWidth()); result.setImageURL(map.getImageURL()); ! // ToDo : Statische Werte durch die tatsächlichen ersetzen ! Collection geoPoints = map.getGeoPositions(); int i = 1; while (geoPoints.iterator().hasNext()) { --- 196,201 ---- result.setImageWidth(map.getImageWidth()); result.setImageURL(map.getImageURL()); ! ! Collection geoPoints = map.getGeoPositions(); int i = 1; while (geoPoints.iterator().hasNext()) { |
From: Andreas W. <an...@us...> - 2006-02-20 15:21:54
|
Update of /cvsroot/magicmap//magicmapserver/dblayer/src/net/sf/magicmap/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32749/dblayer/src/net/sf/magicmap/db Modified Files: GeoPosition.java Log Message: geoposition-functions and table for database added Index: GeoPosition.java =================================================================== RCS file: /cvsroot/magicmap//magicmapserver/dblayer/src/net/sf/magicmap/db/GeoPosition.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** GeoPosition.java 20 Feb 2006 11:07:42 -0000 1.5 --- GeoPosition.java 20 Feb 2006 15:21:47 -0000 1.6 *************** *** 103,107 **** * @param altitude */ ! public GeoPosition(Map map, Integer posX, Integer posY, Integer latitude, Integer longitude, Integer altitude) { super(); --- 103,107 ---- * @param altitude */ ! public GeoPosition(Map map, Integer posX, Integer posY, Integer longitude, Integer latitude, Integer altitude) { super(); |
From: Andreas W. <an...@us...> - 2006-02-20 15:21:51
|
Update of /cvsroot/magicmap//magicmapserver/src/net/sf/magicmap/server/facade In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32749/src/net/sf/magicmap/server/facade Modified Files: MapFacade.java Log Message: geoposition-functions and table for database added Index: MapFacade.java =================================================================== RCS file: /cvsroot/magicmap//magicmapserver/src/net/sf/magicmap/server/facade/MapFacade.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** MapFacade.java 17 Feb 2006 16:15:28 -0000 1.9 --- MapFacade.java 20 Feb 2006 15:21:47 -0000 1.10 *************** *** 1,3 **** - package net.sf.magicmap.server.facade; --- 1,2 ---- *************** *** 12,16 **** --- 11,17 ---- import javax.jdo.Transaction; + import net.sf.magicmap.db.GeoPosition; import net.sf.magicmap.db.Map; + import net.sf.magicmap.db.Position; import net.sf.magicmap.db.Session; import net.sf.magicmap.server.dto.GeoPointDTO; *************** *** 25,250 **** /** ! * author schweige ! * date 03.12.2004 ! * copyright (C) 2004 Martin Schweigert, Tobias Hübner * * ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License, or ! * (at your option) any later version. */ public class MapFacade implements MapFacadeInterface { ! protected transient Category logger = Category.getInstance(this.getClass()); ! /* (non-Javadoc) ! * @see net.sf.magicmap.server.facade.interfaces.MapFacadeInterface#getMapNames() ! */ ! public StringReplacementDTO[] getMapNames(){ ! ArrayList result = new ArrayList(); ! PersistenceManager pm = null; ! Transaction tx = null; ! try{ ! pm = JDOUtil.pmfactory.getPersistenceManager(); ! tx = pm.currentTransaction(); ! tx.begin(); ! Extent e = pm.getExtent(Map.class, true); ! Query query = pm.newQuery(e); ! Collection results = (Collection) query.execute(); ! if (results != null){ ! Iterator it = results.iterator(); ! while (it.hasNext()){ ! Map map = (Map) it.next(); ! StringReplacementDTO dto = new StringReplacementDTO(); ! dto.setWrappedString(map.getName()); ! result.add(dto); ! } ! } ! JDOUtil.commit(tx); ! } finally{ ! JDOUtil.closePM(pm); ! } ! return (StringReplacementDTO[]) result.toArray(new StringReplacementDTO[0]); ! } ! /* (non-Javadoc) ! * @see net.sf.magicmap.server.facade.interfaces.MapFacadeInterface#createNewMap(long, java.lang.String, java.lang.String, int, int) ! */ ! public MapDTO createNewMap(long sessionId, String name, String URL, int width, int height) throws SessionException, ! MapException{ ! this.logger.info("createNewMap()"); ! MapDTO result = null; ! assertNotEmpty(name, "Name der Karte"); ! assertNotEmpty(name, "URL der Karte"); ! if (name.length() > 255){ ! throw new MapException("Name der Karte zu lang"); ! } ! if (URL.length() > 255){ ! throw new MapException("URL der Karte zu lang"); ! } ! try{ ! new URL(URL); ! } catch (Exception e){ ! throw new MapException("URL nicht gültig", e); ! } ! if (sessionId < 0){ ! throw new SessionException("Ungültige session id"); ! } ! if (width < 1 || height < 1){ ! throw new MapException("Breite oder Höhe stimmen nicht"); ! } ! PersistenceManager pm = null; ! Transaction tx = null; ! try{ ! pm = JDOUtil.pmfactory.getPersistenceManager(); ! tx = pm.currentTransaction(); ! tx.begin(); ! Collection sessions = getSessions(sessionId, pm); ! if (sessions.size() == 0){ ! JDOUtil.rollBack(tx); ! throw new SessionException("Session existiert nicht"); ! } ! Collection results = getMaps(name, pm); ! if (results.size() != 0){ ! JDOUtil.rollBack(tx); ! throw new MapException("Karte schon vorhanden"); ! } ! Map map = new Map(name, URL, new Integer(10), new Integer(10), new Integer(width), new Integer(height)); ! pm.makePersistent(map); ! result = new MapDTO(); ! result.setId(new Long(map.getId())); ! result.setName(map.getName()); ! result.setImageHeight(map.getImageHeight()); ! result.setImageWidth(map.getImageWidth()); ! result.setImageURL(map.getImageURL()); ! JDOUtil.commit(tx); ! } finally{ ! JDOUtil.closePM(pm); ! } ! this.logger.info("createNewMap() - done result: " + result); ! return result; ! } ! /* (non-Javadoc) ! * @see net.sf.magicmap.server.facade.interfaces.MapFacadeInterface#getMap(java.lang.String) ! */ ! public MapDTO getMap(String name) throws MapException{ ! logger.info("Hole Karte: " + name); ! assertNotEmpty(name, "Name der Karte"); ! PersistenceManager pm = null; ! MapDTO result = null; ! Transaction tx = null; ! try{ ! pm = JDOUtil.pmfactory.getPersistenceManager(); ! tx = pm.currentTransaction(); ! tx.begin(); ! Collection results = getMaps(name, pm); ! if (results.size() == 0){ ! JDOUtil.rollBack(tx); ! throw new MapException("Karte nicht vorhanden"); ! } ! Map map = (Map) results.iterator().next(); ! result = new MapDTO(); ! result.setId(new Long(map.getId())); ! result.setName(map.getName()); ! result.setImageHeight(map.getImageHeight()); ! result.setImageWidth(map.getImageWidth()); ! result.setImageURL(map.getImageURL()); ! ! // ToDo : Statische Werte durch die tatsächlichen ersetzen ! result.setGeoPoint1X(0); ! result.setGeoPoint1Y(0); ! result.setGeoPoint1Long(188767800); ! result.setGeoPoint1Lat(48660000); ! result.setGeoPoint1Alt(0); ! result.setGeoPoint2X(650); ! result.setGeoPoint2Y(498); ! result.setGeoPoint2Long(188720399); ! result.setGeoPoint2Lat(48759599); ! result.setGeoPoint2Alt(0); ! result.setGeoPoint3X(1); ! result.setGeoPoint3Y(1); ! result.setGeoPoint3Long(0); ! result.setGeoPoint3Lat(0); ! result.setGeoPoint3Alt(0); ! JDOUtil.commit(tx); ! } finally{ ! JDOUtil.closePM(pm); ! } ! return result; ! } ! ! public GeoPointDTO [] getGeoPointsForMap(String mapName){ ! //TODO: implement method ! return null; ! } ! /** ! * ! * @param mapName ! * @param xPos ! * @param yPos ! * @param longitude ! * @param latitude ! * @param altitude ! * @return ! */ ! public MapDTO createGeoPoint(String mapName, int xPos, int yPos, int longitude, int latitude, int altitude){ ! //TODO: implement method ! return null; ! } ! ! /** ! * ! * @param mapName ! * @param xPos ! * @param yPos ! */ ! public void deleteGeoPoint(String mapName, int xPos, int yPos){ ! //TODO: implement method ! } ! ! /** ! * @param mac ! */ ! private void assertNotEmpty(String string, String message) throws MapException{ ! if (string == null || "".equals(string.trim())){ ! throw new MapException(message + " darf nicht leer sein!"); ! } ! } - /** - * @param mac - * @param pm - * @return - */ - private Collection getMaps(String name, PersistenceManager pm){ - Collection results; - Extent e = pm.getExtent(Map.class, true); - Query query = pm.newQuery(e, "name == myname"); - query.declareImports("import java.lang.String"); - query.declareParameters("String myname"); - results = (Collection) query.execute(name); - return results; - } ! /** ! * @param mac ! * @param pm ! * @return ! */ ! private Collection getSessions(long id, PersistenceManager pm){ ! Collection results; ! Extent e = pm.getExtent(Session.class, true); ! Query query = pm.newQuery(e, "id == myId"); ! query.declareParameters("java.lang.Long myId"); ! results = (Collection) query.execute(new Long(id)); ! return results; ! } } \ No newline at end of file --- 26,401 ---- /** ! * author schweige date 03.12.2004 copyright (C) 2004 Martin Schweigert, Tobias ! * Hübner * * ! * This program is free software; you can redistribute it and/or modify it under ! * the terms of the GNU General Public License as published by the Free Software ! * Foundation; either version 2 of the License, or (at your option) any later ! * version. */ public class MapFacade implements MapFacadeInterface { ! protected transient Category logger = Category.getInstance(this.getClass()); ! /* ! * (non-Javadoc) ! * ! * @see net.sf.magicmap.server.facade.interfaces.MapFacadeInterface#getMapNames() ! */ ! public StringReplacementDTO[] getMapNames() { ! ArrayList result = new ArrayList(); ! PersistenceManager pm = null; ! Transaction tx = null; ! try { ! pm = JDOUtil.pmfactory.getPersistenceManager(); ! tx = pm.currentTransaction(); ! tx.begin(); ! Extent e = pm.getExtent(Map.class, true); ! Query query = pm.newQuery(e); ! Collection results = (Collection) query.execute(); ! if (results != null) { ! Iterator it = results.iterator(); ! while (it.hasNext()) { ! Map map = (Map) it.next(); ! StringReplacementDTO dto = new StringReplacementDTO(); ! dto.setWrappedString(map.getName()); ! result.add(dto); ! } ! } ! JDOUtil.commit(tx); ! } finally { ! JDOUtil.closePM(pm); ! } ! return (StringReplacementDTO[]) result ! .toArray(new StringReplacementDTO[0]); ! } ! /* ! * (non-Javadoc) ! * ! * @see net.sf.magicmap.server.facade.interfaces.MapFacadeInterface#createNewMap(long, ! * java.lang.String, java.lang.String, int, int) ! */ ! public MapDTO createNewMap(long sessionId, String name, String URL, ! int width, int height) throws SessionException, MapException { ! this.logger.info("createNewMap()"); ! MapDTO result = null; ! assertNotEmpty(name, "Name der Karte"); ! assertNotEmpty(name, "URL der Karte"); ! if (name.length() > 255) { ! throw new MapException("Name der Karte zu lang"); ! } ! if (URL.length() > 255) { ! throw new MapException("URL der Karte zu lang"); ! } ! try { ! new URL(URL); ! } catch (Exception e) { ! throw new MapException("URL nicht gültig", e); ! } ! if (sessionId < 0) { ! throw new SessionException("Ungültige session id"); ! } ! if (width < 1 || height < 1) { ! throw new MapException("Breite oder Höhe stimmen nicht"); ! } ! PersistenceManager pm = null; ! Transaction tx = null; ! try { ! pm = JDOUtil.pmfactory.getPersistenceManager(); ! tx = pm.currentTransaction(); ! tx.begin(); ! Collection sessions = getSessions(sessionId, pm); ! if (sessions.size() == 0) { ! JDOUtil.rollBack(tx); ! throw new SessionException("Session existiert nicht"); ! } ! Collection results = getMaps(name, pm); ! if (results.size() != 0) { ! JDOUtil.rollBack(tx); ! throw new MapException("Karte schon vorhanden"); ! } ! Map map = new Map(name, URL, new Integer(10), new Integer(10), ! new Integer(width), new Integer(height)); ! pm.makePersistent(map); ! result = new MapDTO(); ! result.setId(new Long(map.getId())); ! result.setName(map.getName()); ! result.setImageHeight(map.getImageHeight()); ! result.setImageWidth(map.getImageWidth()); ! result.setImageURL(map.getImageURL()); ! JDOUtil.commit(tx); ! } finally { ! JDOUtil.closePM(pm); ! } ! this.logger.info("createNewMap() - done result: " + result); ! return result; ! } ! /* ! * (non-Javadoc) ! * ! * @see net.sf.magicmap.server.facade.interfaces.MapFacadeInterface#getMap(java.lang.String) ! */ ! public MapDTO getMap(String name) throws MapException { ! logger.info("Hole Karte: " + name); ! assertNotEmpty(name, "Name der Karte"); ! PersistenceManager pm = null; ! MapDTO result = null; ! Transaction tx = null; ! try { ! pm = JDOUtil.pmfactory.getPersistenceManager(); ! tx = pm.currentTransaction(); ! tx.begin(); ! Collection results = getMaps(name, pm); ! if (results.size() == 0) { ! JDOUtil.rollBack(tx); ! throw new MapException("Karte nicht vorhanden"); ! } ! Map map = (Map) results.iterator().next(); ! result = new MapDTO(); ! result.setId(new Long(map.getId())); ! result.setName(map.getName()); ! result.setImageHeight(map.getImageHeight()); ! result.setImageWidth(map.getImageWidth()); ! result.setImageURL(map.getImageURL()); ! // ToDo : Statische Werte durch die tatsächlichen ersetzen ! Collection geoPoints = map.getGeoPositions(); ! int i = 1; ! while (geoPoints.iterator().hasNext()) { ! GeoPosition geoPosition = (GeoPosition) geoPoints.iterator() ! .next(); ! switch (i) { ! case 1: ! result.setGeoPoint1X(geoPosition.getPosX()); ! result.setGeoPoint1Y(geoPosition.getPosY()); ! result.setGeoPoint1Long(geoPosition.getLongitude()); ! result.setGeoPoint1Lat(geoPosition.getLatitude()); ! result.setGeoPoint1Alt(geoPosition.getAltitude()); ! break; ! case 2: ! result.setGeoPoint2X(geoPosition.getPosX()); ! result.setGeoPoint2Y(geoPosition.getPosY()); ! result.setGeoPoint2Long(geoPosition.getLongitude()); ! result.setGeoPoint2Lat(geoPosition.getLatitude()); ! result.setGeoPoint2Alt(geoPosition.getAltitude()); ! break; ! case 3: ! result.setGeoPoint3X(geoPosition.getPosX()); ! result.setGeoPoint3Y(geoPosition.getPosY()); ! result.setGeoPoint3Long(geoPosition.getLongitude()); ! result.setGeoPoint3Lat(geoPosition.getLatitude()); ! result.setGeoPoint3Alt(geoPosition.getAltitude()); ! break; ! } ! ++i; ! } ! JDOUtil.commit(tx); ! } finally { ! JDOUtil.closePM(pm); ! } ! return result; ! } ! /* (non-Javadoc) ! * @see net.sf.magicmap.server.interfaces.MapFacadeInterface#getGeoPointsForMap(long, java.lang.String) ! */ ! public GeoPointDTO[] getGeoPointsForMap(long sessionId, String mapName) throws MapException,SessionException { ! logger.info("Hole GeoPoints für Map: " + mapName); ! assertNotEmpty(mapName, "Name der Karte"); ! if (sessionId < 0) { ! throw new SessionException("Ungültige session id"); ! } ! PersistenceManager pm = null; ! GeoPointDTO[] result = null; ! Transaction tx = null; ! try { ! pm = JDOUtil.pmfactory.getPersistenceManager(); ! tx = pm.currentTransaction(); ! tx.begin(); ! Collection sessions = getSessions(sessionId, pm); ! if (sessions.size() == 0) { ! JDOUtil.rollBack(tx); ! throw new SessionException("Session existiert nicht"); ! } ! Collection results = getGeoPoints(mapName, pm); ! result = new GeoPointDTO[results.size()]; ! for (int i = 0; i < results.size(); ++i) { ! GeoPosition geoPosition = (GeoPosition) results.iterator() ! .next(); ! GeoPointDTO geoPoint = new GeoPointDTO(); ! geoPoint.setGeoPointAlt(geoPosition.getAltitude()); ! geoPoint.setGeoPointLat(geoPosition.getLatitude()); ! geoPoint.setGeoPointLong(geoPosition.getLongitude()); ! geoPoint.setGeoPointX(geoPosition.getPosX()); ! geoPoint.setGeoPointY(geoPosition.getPosY()); ! geoPoint.setId(geoPosition.getId()); ! result[i] = geoPoint; ! } ! JDOUtil.commit(tx); ! } finally { ! JDOUtil.closePM(pm); ! } ! return result; ! } ! /* (non-Javadoc) ! * @see net.sf.magicmap.server.interfaces.MapFacadeInterface#createGeoPoint(long, java.lang.String, int, int, int, int, int) ! */ ! public MapDTO createGeoPoint(long sessionId, String mapName, int xPos, ! int yPos, int longitude, int latitude, int altitude) ! throws SessionException, MapException { ! this.logger.info("createNewGeoPoint()"); ! MapDTO result = null; ! assertNotEmpty(mapName, "Name der Karte"); ! if (sessionId < 0) { ! throw new SessionException("Ungültige session id"); ! } ! PersistenceManager pm = null; ! Transaction tx = null; ! try { ! pm = JDOUtil.pmfactory.getPersistenceManager(); ! tx = pm.currentTransaction(); ! tx.begin(); ! Collection sessions = getSessions(sessionId, pm); ! if (sessions.size() == 0) { ! JDOUtil.rollBack(tx); ! throw new SessionException("Session existiert nicht"); ! } ! Collection maps = getMaps(mapName, pm); ! if (maps.size() == 0) { ! JDOUtil.rollBack(tx); ! throw new MapException("Karte " + mapName + " existiert nicht"); ! } ! ! // vorläufige Beschränkung auf 3 Punkte ! // TODO: durch Berechnung der besten drei Positionen ersetzen ! Collection geoPoints = getGeoPoints(mapName, pm); ! if (geoPoints.size() > 2) { ! JDOUtil.rollBack(tx); ! throw new MapException( ! "Es existieren bereits 3 Geo-Refferenzpunkte"); ! } ! Map map = (Map) maps.iterator().next(); ! GeoPosition geoPosition = new GeoPosition(map, xPos, yPos, ! longitude, latitude, altitude); ! pm.makePersistent(geoPosition); ! ! map.addGeoPosition(geoPosition); ! pm.makePersistent(map); ! ! result = getMap(mapName); ! JDOUtil.commit(tx); ! } finally { ! JDOUtil.closePM(pm); ! } ! this.logger.info("createGeoPoint() - done result: " + result); ! ! return result; ! } ! ! ! ! /* (non-Javadoc) ! * @see net.sf.magicmap.server.interfaces.MapFacadeInterface#deleteGeoPoint(long, long) ! */ ! public void deleteGeoPoint(long sessionId, long id) throws MapException, ! SessionException { ! ! this.logger.info("deleteGeoPoint()"); ! if (sessionId < 0) { ! throw new SessionException("Ungültige session id"); ! } ! PersistenceManager pm = null; ! Transaction tx = null; ! try { ! pm = JDOUtil.pmfactory.getPersistenceManager(); ! tx = pm.currentTransaction(); ! tx.begin(); ! Collection sessions = getSessions(sessionId, pm); ! if (sessions.size() == 0) { ! JDOUtil.rollBack(tx); ! throw new SessionException("Session existiert nicht"); ! } ! Extent e = pm.getExtent(GeoPosition.class, true); ! Query query = pm.newQuery(e, "id == myId"); ! query.declareImports("import java.lang.Long"); ! query.declareParameters("String myId"); ! ! Collection results = (Collection) query.execute(new Long(id)); ! if (results != null && !results.isEmpty()) { ! pm.deletePersistent((GeoPosition) results.iterator().next()); ! } else { ! pm.currentTransaction().rollback(); ! throw new MapException("GeoPosition mit der id:" + id ! + " existiert nicht"); ! } ! } finally { ! JDOUtil.closePM(pm); ! } ! this.logger.info("deleteGeoPoint() - done"); ! } ! ! /** ! * @param mac ! */ ! private void assertNotEmpty(String string, String message) ! throws MapException { ! if (string == null || "".equals(string.trim())) { ! throw new MapException(message + " darf nicht leer sein!"); ! } ! } ! ! ! ! /** ! * @param mapName ! * @param pm ! * @return ! */ ! private Collection getGeoPoints(String mapName, PersistenceManager pm) { ! Collection results; ! Extent e = pm.getExtent(GeoPosition.class, true); ! Query query = pm.newQuery(e, "map == myname"); ! query.declareImports("import java.lang.String"); ! query.declareParameters("String myname"); ! results = (Collection) query.execute(mapName); ! return results; ! } ! ! /** ! * @param mac ! * @param pm ! * @return ! */ ! private Collection getMaps(String name, PersistenceManager pm) { ! Collection results; ! Extent e = pm.getExtent(Map.class, true); ! Query query = pm.newQuery(e, "name == myname"); ! query.declareImports("import java.lang.String"); ! query.declareParameters("String myname"); ! results = (Collection) query.execute(name); ! return results; ! } ! ! /** ! * @param mac ! * @param pm ! * @return ! */ ! private Collection getSessions(long id, PersistenceManager pm) { ! Collection results; ! Extent e = pm.getExtent(Session.class, true); ! Query query = pm.newQuery(e, "id == myId"); ! query.declareParameters("java.lang.Long myId"); ! results = (Collection) query.execute(new Long(id)); ! return results; ! } } \ No newline at end of file |
From: Andreas W. <an...@us...> - 2006-02-20 15:21:51
|
Update of /cvsroot/magicmap//magicmapserver/src/net/sf/magicmap/server/interfaces In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32749/src/net/sf/magicmap/server/interfaces Modified Files: MapFacadeInterface.java Log Message: geoposition-functions and table for database added Index: MapFacadeInterface.java =================================================================== RCS file: /cvsroot/magicmap//magicmapserver/src/net/sf/magicmap/server/interfaces/MapFacadeInterface.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MapFacadeInterface.java 11 May 2005 15:46:30 -0000 1.2 --- MapFacadeInterface.java 20 Feb 2006 15:21:47 -0000 1.3 *************** *** 3,11 **** --- 3,21 ---- import java.rmi.RemoteException; + import java.util.Collection; + + import javax.jdo.Extent; + import javax.jdo.PersistenceManager; + import javax.jdo.Query; + import javax.jdo.Transaction; + import net.sf.magicmap.db.GeoPosition; + import net.sf.magicmap.db.Map; + import net.sf.magicmap.server.dto.GeoPointDTO; import net.sf.magicmap.server.dto.StringReplacementDTO; import net.sf.magicmap.server.dto.MapDTO; import net.sf.magicmap.server.exception.MapException; import net.sf.magicmap.server.exception.SessionException; + import net.sf.magicmap.server.utils.JDOUtil; /** *************** *** 54,57 **** --- 64,100 ---- */ public abstract MapDTO getMap(String name) throws MapException, RemoteException; + + + /** + * @param sessionId session id des angemeldeten Clients + * @param mapName name der zugehörigen Karte + * @return alle GeoPositionen zu der angegeben Karte + * @throws MapException + * @throws SessionException + */ + public abstract GeoPointDTO[] getGeoPointsForMap(long sessionId, String mapName) throws MapException,SessionException,RemoteException; + + + /** + * @param sessionId session id des angemeldeten Clients + * @param mapName name der zugehörigen Karte + * @param xPos + * @param yPos + * @param longitude + * @param latitude + * @param altitude + * @return + * @throws SessionException + * @throws MapException + */ + public abstract MapDTO createGeoPoint(long sessionId, String mapName, int xPos, int yPos, int longitude, int latitude, int altitude) + throws SessionException, MapException,RemoteException; + /** + * @param sessionId session id des angemeldeten Clients + * @param id + * @throws MapException + * @throws SessionException + */ + public abstract void deleteGeoPoint(long sessionId, long id) throws MapException, SessionException,RemoteException; } \ No newline at end of file |
From: Andreas W. <an...@us...> - 2006-02-20 15:18:54
|
Update of /cvsroot/magicmap//magicmapclient/src/net/sf/magicmap/client/delegate/interfaces In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31175/src/net/sf/magicmap/client/delegate/interfaces Modified Files: MapFacadeInterface.java Log Message: geoposition-functions added Index: MapFacadeInterface.java =================================================================== RCS file: /cvsroot/magicmap//magicmapclient/src/net/sf/magicmap/client/delegate/interfaces/MapFacadeInterface.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MapFacadeInterface.java 12 Feb 2005 16:00:28 -0000 1.2 --- MapFacadeInterface.java 20 Feb 2006 15:18:29 -0000 1.3 *************** *** 7,10 **** --- 7,11 ---- import java.rmi.RemoteException; + import net.sf.magicmap.server.dto.GeoPointDTO; import net.sf.magicmap.server.dto.MapDTO; import net.sf.magicmap.server.exception.MapException; *************** *** 27,38 **** * gültiger Session id) Clients angelegt werden * ! * @param sessionId session id des angemeldeten Clients ! * @param name Name der zu erstellenenden Karte (eindeutig) ! * @param URL URL für das Bild der Karte ! * @param width Breite des Rasters der Karte ! * @param height Höhe des Rasters der Karte * @return Object, dass die neu erstellte Karte repräsentiert ! * @throws SessionException Falls die Session des Clients ungültih ist ! * @throws MapException Falls eine Karte mit diesem Namen schon existiert */ public abstract MapDTO createNewMap(long sessionId, String name, String URL, int width, int height) --- 28,46 ---- * gültiger Session id) Clients angelegt werden * ! * @param sessionId ! * session id des angemeldeten Clients ! * @param name ! * Name der zu erstellenenden Karte (eindeutig) ! * @param URL ! * URL für das Bild der Karte ! * @param width ! * Breite des Rasters der Karte ! * @param height ! * Höhe des Rasters der Karte * @return Object, dass die neu erstellte Karte repräsentiert ! * @throws SessionException ! * Falls die Session des Clients ungültih ist ! * @throws MapException ! * Falls eine Karte mit diesem Namen schon existiert */ public abstract MapDTO createNewMap(long sessionId, String name, String URL, int width, int height) *************** *** 42,51 **** * Holt eine Karte anhand ihres Namens * ! * @param name Name der Karte * @return Object, dass die Karte repräsentiert ! * @throws MapException Falls unter dem angegebenen Namen keine Karte ! * existiert */ public abstract MapDTO getMap(String name) throws MapException, RemoteException; } \ No newline at end of file --- 50,98 ---- * Holt eine Karte anhand ihres Namens * ! * @param name ! * Name der Karte * @return Object, dass die Karte repräsentiert ! * @throws MapException ! * Falls unter dem angegebenen Namen keine Karte existiert */ public abstract MapDTO getMap(String name) throws MapException, RemoteException; + /** + * @param sessionId + * session id des angemeldeten Clients + * @param mapName + * name der zugehörigen Karte + * @return alle GeoPositionen zu der angegeben Karte + * @throws MapException + * @throws SessionException + */ + public abstract GeoPointDTO[] getGeoPointsForMap(long sessionId, String mapName) throws MapException, + SessionException, RemoteException; + + /** + * @param sessionId + * session id des angemeldeten Clients + * @param mapName + * name der zugehörigen Karte + * @param xPos + * @param yPos + * @param longitude + * @param latitude + * @param altitude + * @return + * @throws SessionException + * @throws MapException + */ + public abstract MapDTO createGeoPoint(long sessionId, String mapName, int xPos, int yPos, int longitude, + int latitude, int altitude) throws SessionException, MapException, RemoteException; + + /** + * @param sessionId + * session id des angemeldeten Clients + * @param id + * @throws MapException + * @throws SessionException + */ + public abstract void deleteGeoPoint(long sessionId, long id) throws MapException, SessionException, RemoteException; + } \ No newline at end of file |
From: Andreas W. <an...@us...> - 2006-02-20 15:18:35
|
Update of /cvsroot/magicmap//magicmapclient/src/net/sf/magicmap/client/delegate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31175/src/net/sf/magicmap/client/delegate Modified Files: MapDelegate.java Log Message: geoposition-functions added Index: MapDelegate.java =================================================================== RCS file: /cvsroot/magicmap//magicmapclient/src/net/sf/magicmap/client/delegate/MapDelegate.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MapDelegate.java 11 May 2005 15:45:02 -0000 1.4 --- MapDelegate.java 20 Feb 2006 15:18:28 -0000 1.5 *************** *** 16,19 **** --- 16,20 ---- import net.sf.magicmap.client.delegate.interfaces.MapFacadeInterface; import net.sf.magicmap.client.utils.Settings; + import net.sf.magicmap.server.dto.GeoPointDTO; import net.sf.magicmap.server.dto.MapDTO; import net.sf.magicmap.server.dto.StringReplacementDTO; *************** *** 92,94 **** --- 93,110 ---- } + public GeoPointDTO[] getGeoPointsForMap(long sessionId, String mapName) throws MapException, SessionException, RemoteException{ + // TODO Auto-generated method stub + return null; + } + + public MapDTO createGeoPoint(long sessionId, String mapName, int xPos, int yPos, int longitude, int latitude, int altitude) throws SessionException, MapException, RemoteException{ + // TODO Auto-generated method stub + return null; + } + + public void deleteGeoPoint(long sessionId, long id) throws MapException, SessionException, RemoteException{ + // TODO Auto-generated method stub + + } + } \ No newline at end of file |
From: Andreas W. <an...@us...> - 2006-02-20 15:14:51
|
Update of /cvsroot/magicmap//magicmapclient/inf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29517/inf Modified Files: MapFacade.wsdl Log Message: MapFacade updated Index: MapFacade.wsdl =================================================================== RCS file: /cvsroot/magicmap//magicmapclient/inf/MapFacade.wsdl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MapFacade.wsdl 14 Feb 2006 16:03:22 -0000 1.3 --- MapFacade.wsdl 20 Feb 2006 15:14:47 -0000 1.4 *************** *** 1,4 **** <?xml version="1.0" encoding="UTF-8"?> ! <wsdl:definitions targetNamespace="http://localhost:8080/magicmap/services/MapFacade" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://localhost:8080/magicmap/services/MapFacade" xmlns:intf="http://localhost:8080/magicmap/services/MapFacade" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="urn:dto.server.magicmap.sf.net" xmlns:tns2="http://exception.server.magicmap.sf.net" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <!--WSDL created by Apache Axis version: 1.2 Built on May 03, 2005 (02:20:24 EDT)--> --- 1,4 ---- <?xml version="1.0" encoding="UTF-8"?> ! <wsdl:definitions targetNamespace="http://localhost:8080/magicmap/services/MapFacade" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://localhost:8080/magicmap/services/MapFacade" xmlns:intf="http://localhost:8080/magicmap/services/MapFacade" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="urn:dto.server.magicmap.sf.net" xmlns:tns2="http://exception.server.magicmap.sf.net" xmlns:tns3="http://dto.server.magicmap.sf.net" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <!--WSDL created by Apache Axis version: 1.2 Built on May 03, 2005 (02:20:24 EDT)--> *************** *** 7,10 **** --- 7,11 ---- <import namespace="http://exception.server.magicmap.sf.net"/> <import namespace="http://localhost:8080/magicmap/services/MapFacade"/> + <import namespace="http://dto.server.magicmap.sf.net"/> <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> <complexType name="MapDTO"> *************** *** 41,44 **** --- 42,46 ---- <import namespace="http://localhost:8080/magicmap/services/MapFacade"/> <import namespace="urn:dto.server.magicmap.sf.net"/> + <import namespace="http://dto.server.magicmap.sf.net"/> <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> <complexType name="MapException"> *************** *** 52,55 **** --- 54,58 ---- <import namespace="http://exception.server.magicmap.sf.net"/> <import namespace="urn:dto.server.magicmap.sf.net"/> + <import namespace="http://dto.server.magicmap.sf.net"/> <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> <complexType name="ArrayOf_tns1_StringReplacementDTO"> *************** *** 60,63 **** --- 63,89 ---- </complexContent> </complexType> + <complexType name="ArrayOf_tns3_GeoPointDTO"> + <complexContent> + <restriction base="soapenc:Array"> + <attribute ref="soapenc:arrayType" wsdl:arrayType="tns3:GeoPointDTO[]"/> + </restriction> + </complexContent> + </complexType> + </schema> + <schema targetNamespace="http://dto.server.magicmap.sf.net" xmlns="http://www.w3.org/2001/XMLSchema"> + <import namespace="http://exception.server.magicmap.sf.net"/> + <import namespace="http://localhost:8080/magicmap/services/MapFacade"/> + <import namespace="urn:dto.server.magicmap.sf.net"/> + <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> + <complexType name="GeoPointDTO"> + <sequence> + <element name="geoPointAlt" nillable="true" type="soapenc:int"/> + <element name="geoPointLat" nillable="true" type="soapenc:int"/> + <element name="geoPointLong" nillable="true" type="soapenc:int"/> + <element name="geoPointX" nillable="true" type="soapenc:int"/> + <element name="geoPointY" nillable="true" type="soapenc:int"/> + <element name="id" nillable="true" type="soapenc:long"/> + </sequence> + </complexType> </schema> </wsdl:types> *************** *** 67,83 **** </wsdl:message> ! <wsdl:message name="deleteGeoPointRequest"> ! ! <wsdl:part name="mapName" type="soapenc:string"/> ! ! <wsdl:part name="xPos" type="xsd:int"/> ! ! <wsdl:part name="yPos" type="xsd:int"/> ! ! </wsdl:message> ! <wsdl:message name="getMapNamesResponse"> ! <wsdl:part name="getMapNamesReturn" type="impl:ArrayOf_tns1_StringReplacementDTO"/> </wsdl:message> --- 93,101 ---- </wsdl:message> ! <wsdl:message name="getGeoPointsForMapRequest"> ! <wsdl:part name="sessionId" type="xsd:long"/> ! <wsdl:part name="mapName" type="soapenc:string"/> </wsdl:message> *************** *** 97,109 **** </wsdl:message> ! <wsdl:message name="getMapRequest"> ! <wsdl:part name="name" type="soapenc:string"/> </wsdl:message> ! <wsdl:message name="createGeoPointResponse"> ! <wsdl:part name="createGeoPointReturn" type="tns1:MapDTO"/> </wsdl:message> --- 115,153 ---- </wsdl:message> ! <wsdl:message name="createGeoPointResponse"> ! <wsdl:part name="createGeoPointReturn" type="tns1:MapDTO"/> </wsdl:message> ! <wsdl:message name="createNewMapResponse"> ! <wsdl:part name="createNewMapReturn" type="tns1:MapDTO"/> ! ! </wsdl:message> ! ! <wsdl:message name="SessionException"> ! ! <wsdl:part name="fault" type="tns2:SessionException"/> ! ! </wsdl:message> ! ! <wsdl:message name="deleteGeoPointRequest"> ! ! <wsdl:part name="sessionId" type="xsd:long"/> ! ! <wsdl:part name="id" type="xsd:long"/> ! ! </wsdl:message> ! ! <wsdl:message name="getMapNamesResponse"> ! ! <wsdl:part name="getMapNamesReturn" type="impl:ArrayOf_tns1_StringReplacementDTO"/> ! ! </wsdl:message> ! ! <wsdl:message name="getMapRequest"> ! ! <wsdl:part name="name" type="soapenc:string"/> </wsdl:message> *************** *** 113,125 **** </wsdl:message> ! <wsdl:message name="createNewMapResponse"> ! <wsdl:part name="createNewMapReturn" type="tns1:MapDTO"/> </wsdl:message> ! <wsdl:message name="SessionException"> ! <wsdl:part name="fault" type="tns2:SessionException"/> </wsdl:message> --- 157,169 ---- </wsdl:message> ! <wsdl:message name="getGeoPointsForMapResponse"> ! <wsdl:part name="getGeoPointsForMapReturn" type="impl:ArrayOf_tns3_GeoPointDTO"/> </wsdl:message> ! <wsdl:message name="MapException"> ! <wsdl:part name="fault" type="tns2:MapException"/> </wsdl:message> *************** *** 127,130 **** --- 171,176 ---- <wsdl:message name="createGeoPointRequest"> + <wsdl:part name="sessionId" type="xsd:long"/> + <wsdl:part name="mapName" type="soapenc:string"/> *************** *** 141,150 **** </wsdl:message> - <wsdl:message name="MapException"> - - <wsdl:part name="fault" type="tns2:MapException"/> - - </wsdl:message> - <wsdl:message name="getMapResponse"> --- 187,190 ---- *************** *** 185,189 **** </wsdl:operation> ! <wsdl:operation name="createGeoPoint" parameterOrder="mapName xPos yPos longitude latitude altitude"> <wsdl:input message="impl:createGeoPointRequest" name="createGeoPointRequest"/> --- 225,241 ---- </wsdl:operation> ! <wsdl:operation name="getGeoPointsForMap" parameterOrder="sessionId mapName"> ! ! <wsdl:input message="impl:getGeoPointsForMapRequest" name="getGeoPointsForMapRequest"/> ! ! <wsdl:output message="impl:getGeoPointsForMapResponse" name="getGeoPointsForMapResponse"/> ! ! <wsdl:fault message="impl:MapException" name="MapException"/> ! ! <wsdl:fault message="impl:SessionException" name="SessionException"/> ! ! </wsdl:operation> ! ! <wsdl:operation name="createGeoPoint" parameterOrder="sessionId mapName xPos yPos longitude latitude altitude"> <wsdl:input message="impl:createGeoPointRequest" name="createGeoPointRequest"/> *************** *** 191,197 **** <wsdl:output message="impl:createGeoPointResponse" name="createGeoPointResponse"/> </wsdl:operation> ! <wsdl:operation name="deleteGeoPoint" parameterOrder="mapName xPos yPos"> <wsdl:input message="impl:deleteGeoPointRequest" name="deleteGeoPointRequest"/> --- 243,253 ---- <wsdl:output message="impl:createGeoPointResponse" name="createGeoPointResponse"/> + <wsdl:fault message="impl:MapException" name="MapException"/> + + <wsdl:fault message="impl:SessionException" name="SessionException"/> + </wsdl:operation> ! <wsdl:operation name="deleteGeoPoint" parameterOrder="sessionId id"> <wsdl:input message="impl:deleteGeoPointRequest" name="deleteGeoPointRequest"/> *************** *** 199,202 **** --- 255,262 ---- <wsdl:output message="impl:deleteGeoPointResponse" name="deleteGeoPointResponse"/> + <wsdl:fault message="impl:MapException" name="MapException"/> + + <wsdl:fault message="impl:SessionException" name="SessionException"/> + </wsdl:operation> *************** *** 279,282 **** --- 339,372 ---- </wsdl:operation> + <wsdl:operation name="getGeoPointsForMap"> + + <wsdlsoap:operation soapAction=""/> + + <wsdl:input name="getGeoPointsForMapRequest"> + + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://facade.server.magicmap.sf.net" use="encoded"/> + + </wsdl:input> + + <wsdl:output name="getGeoPointsForMapResponse"> + + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/magicmap/services/MapFacade" use="encoded"/> + + </wsdl:output> + + <wsdl:fault name="MapException"> + + <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="MapException" namespace="http://localhost:8080/magicmap/services/MapFacade" use="encoded"/> + + </wsdl:fault> + + <wsdl:fault name="SessionException"> + + <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="SessionException" namespace="http://localhost:8080/magicmap/services/MapFacade" use="encoded"/> + + </wsdl:fault> + + </wsdl:operation> + <wsdl:operation name="createGeoPoint"> *************** *** 295,298 **** --- 385,400 ---- </wsdl:output> + <wsdl:fault name="MapException"> + + <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="MapException" namespace="http://localhost:8080/magicmap/services/MapFacade" use="encoded"/> + + </wsdl:fault> + + <wsdl:fault name="SessionException"> + + <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="SessionException" namespace="http://localhost:8080/magicmap/services/MapFacade" use="encoded"/> + + </wsdl:fault> + </wsdl:operation> *************** *** 313,316 **** --- 415,430 ---- </wsdl:output> + <wsdl:fault name="MapException"> + + <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="MapException" namespace="http://localhost:8080/magicmap/services/MapFacade" use="encoded"/> + + </wsdl:fault> + + <wsdl:fault name="SessionException"> + + <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="SessionException" namespace="http://localhost:8080/magicmap/services/MapFacade" use="encoded"/> + + </wsdl:fault> + </wsdl:operation> |
From: Andreas W. <an...@us...> - 2006-02-20 11:08:17
|
Update of /cvsroot/magicmap//magicmapserver/dblayer/src/net/sf/magicmap/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10908/dblayer/src/net/sf/magicmap/db Modified Files: GeoPosition.java Log Message: patch Index: GeoPosition.java =================================================================== RCS file: /cvsroot/magicmap//magicmapserver/dblayer/src/net/sf/magicmap/db/GeoPosition.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GeoPosition.java 19 Feb 2006 18:18:46 -0000 1.4 --- GeoPosition.java 20 Feb 2006 11:07:42 -0000 1.5 *************** *** 1,10 **** package net.sf.magicmap.db; - import java.util.Collection; - import java.util.HashSet; /** * @author lederer & weiß * @jdo.persistence-capable * identity-type="application" --- 1,9 ---- package net.sf.magicmap.db; /** * @author lederer & weiß + * * @jdo.persistence-capable * identity-type="application" *************** *** 19,26 **** * vendor-name="jpox" key="poid-class-generator" * value="org.jpox.poid.SequenceTablePoidGenerator" ! */ ! /** ! * @author Florian ! */ public class GeoPosition { --- 18,22 ---- * vendor-name="jpox" key="poid-class-generator" * value="org.jpox.poid.SequenceTablePoidGenerator" ! */ public class GeoPosition { *************** *** 59,63 **** * null-value="exception" */ ! int posX; /** --- 55,59 ---- * null-value="exception" */ ! Integer posX; /** *************** *** 68,72 **** * null-value="exception" */ ! int posY; --- 64,68 ---- * null-value="exception" */ ! Integer posY; *************** *** 78,82 **** * null-value="exception" */ ! int latitude; /** --- 74,78 ---- * null-value="exception" */ ! Integer latitude; /** *************** *** 87,91 **** * null-value="exception" */ ! int longitude; /** --- 83,87 ---- * null-value="exception" */ ! Integer longitude; /** *************** *** 96,108 **** * null-value="exception" */ ! int altitude; /** ! * ! * @param map ! * @param posX ! * @param posY ! */ ! public GeoPosition(Map map, int posX, int posY, int latitude, int longitude, int altitude) { super(); --- 92,107 ---- * null-value="exception" */ ! Integer altitude; ! /** ! * @param map ! * @param posX ! * @param posY ! * @param latitude ! * @param longitude ! * @param altitude ! */ ! public GeoPosition(Map map, Integer posX, Integer posY, Integer latitude, Integer longitude, Integer altitude) { super(); *************** *** 132,136 **** * @return Returns the posX. */ ! public int getPosX(){ return this.posX; } --- 131,135 ---- * @return Returns the posX. */ ! public Integer getPosX(){ return this.posX; } *************** *** 139,143 **** * @return Returns the posY. */ ! public int getPosY(){ return this.posY; } --- 138,142 ---- * @return Returns the posY. */ ! public Integer getPosY(){ return this.posY; } *************** *** 146,150 **** * @return Returns the latitude. */ ! public int getLatitude() { return latitude; } --- 145,149 ---- * @return Returns the latitude. */ ! public Integer getLatitude() { return latitude; } *************** *** 153,157 **** * @return Returns the longitude. */ ! public int getLongitude() { return longitude; } --- 152,156 ---- * @return Returns the longitude. */ ! public Integer getLongitude() { return longitude; } *************** *** 160,164 **** * @return Returns the altitude. */ ! public int getAltitude() { return altitude; } --- 159,163 ---- * @return Returns the altitude. */ ! public Integer getAltitude() { return altitude; } *************** *** 167,171 **** * @param altitude The altitude to set. */ ! public void setAltitude(int altitude) { this.altitude = altitude; } --- 166,170 ---- * @param altitude The altitude to set. */ ! public void setAltitude(Integer altitude) { this.altitude = altitude; } *************** *** 174,178 **** * @param latitude The latitude to set. */ ! public void setLatitude(int latitude) { this.latitude = latitude; } --- 173,177 ---- * @param latitude The latitude to set. */ ! public void setLatitude(Integer latitude) { this.latitude = latitude; } *************** *** 181,185 **** * @param longitude The longitude to set. */ ! public void setLongitude(int longitude) { this.longitude = longitude; } --- 180,184 ---- * @param longitude The longitude to set. */ ! public void setLongitude(Integer longitude) { this.longitude = longitude; } *************** *** 195,199 **** * @param posX The posX to set. */ ! public void setPosX(int posX) { this.posX = posX; } --- 194,198 ---- * @param posX The posX to set. */ ! public void setPosX(Integer posX) { this.posX = posX; } *************** *** 202,206 **** * @param posY The posY to set. */ ! public void setPosY(int posY) { this.posY = posY; } --- 201,205 ---- * @param posY The posY to set. */ ! public void setPosY(Integer posY) { this.posY = posY; } |
From: Johannes Z. <jza...@us...> - 2006-02-20 08:50:24
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/model/node In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14055/src/net/sf/magicmap/client/model/node Modified Files: NodeModel.java Log Message: Changes to show maps in the outline view tree Refactorings Index: NodeModel.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/model/node/NodeModel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NodeModel.java 8 Jul 2005 20:12:11 -0000 1.2 --- NodeModel.java 20 Feb 2006 08:50:20 -0000 1.3 *************** *** 32,35 **** --- 32,37 ---- public static final int NODETYPE_CLIENT = 2; public static final int NODETYPE_LOCATION = 3; + // TODO: this does not really fulfil the concept, has to extended later + public static final int NODETYPE_MAP = 4; private HashMap nodes; |
From: Johannes Z. <jza...@us...> - 2006-02-20 08:50:14
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/model/node In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13911/src/net/sf/magicmap/client/model/node Added Files: MapNode.java Log Message: Changes to show maps in the outline view tree Refactorings --- NEW FILE: MapNode.java --- package net.sf.magicmap.client.model.node; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import javax.swing.SwingUtilities; import net.sf.magicmap.client.interfaces.MapCallback; import net.sf.magicmap.client.meta.MapInfo; import net.sf.magicmap.server.dto.MapDTO; /** * Node type for maps * (currently only used for the outline view) * @author Johannes Zapotoczky (joh...@za...) */ public class MapNode extends Node implements MapCallback { private MapInfo mapInfo; /** * Constructor * @param model - the corresponding node model (!= null) */ public MapNode(NodeModel model) { super(model); } /* (non-Javadoc) * @see net.sf.magicmap.client.model.node.Node#getNeighbors() */ public ArrayList getNeighbors() { return new ArrayList(); } /* (non-Javadoc) * @see net.sf.magicmap.client.model.node.Node#getType() */ public int getType() { return NodeModel.NODETYPE_MAP; } /* (non-Javadoc) * @see net.sf.magicmap.client.interfaces.MapCallback#mapReceived(net.sf.magicmap.server.dto.MapDTO) */ public void mapReceived(final MapDTO mapDTO) { try{ // Mit SWING synchronisieren.... SwingUtilities.invokeAndWait(new Runnable() { public void run(){ mapInfo = new MapInfo(); mapInfo.height = mapDTO.getImageHeight().intValue(); mapInfo.width = mapDTO.getImageWidth().intValue(); mapInfo.name = mapDTO.getName(); mapInfo.imageURL = mapDTO.getImageURL().toString(); } }); } catch (InterruptedException e){ // TODO Auto-generated catch block e.printStackTrace(); } catch (InvocationTargetException e){ // TODO Auto-generated catch block e.printStackTrace(); } } /* (non-Javadoc) * @see net.sf.magicmap.client.interfaces.MapCallback#getMapError(java.lang.Exception) */ public void getMapError(Exception e) { e.printStackTrace(); mapInfo = null; } public MapInfo getMapInfo() { return mapInfo; } } |
From: Johannes Z. <jza...@us...> - 2006-02-20 08:50:08
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/views In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13570/src/net/sf/magicmap/client/views Modified Files: MapView.java OutlineView.java Log Message: Changes to show maps in the outline view tree Refactorings Index: OutlineView.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/views/OutlineView.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** OutlineView.java 12 Oct 2005 21:44:17 -0000 1.5 --- OutlineView.java 20 Feb 2006 08:49:59 -0000 1.6 *************** *** 1,4 **** /* ! * Created on 26.11.2004 */ --- 1,4 ---- /* ! * Created on 26.11.2004 */ *************** *** 29,32 **** --- 29,33 ---- import net.sf.magicmap.client.gui.utils.RelativePanelBuilder; import net.sf.magicmap.client.interfaces.NodeModelListener; + import net.sf.magicmap.client.model.node.MapNode; import net.sf.magicmap.client.model.node.Node; import net.sf.magicmap.client.model.node.NodeModel; *************** *** 35,310 **** /** ! * @author thuebner */ ! public class OutlineView extends View implements NodeModelListener, TreeSelectionListener{ ! ! private NodeModel model; ! private JTree tree; ! private DefaultTreeModel treemodel; ! private DefaultMutableTreeNode treeroot; ! private OutlineNode nodeAccessPoints; ! private OutlineNode nodeClients; ! private OutlineNode nodeLocations; ! ! public OutlineView() { ! super(); ! this.setFrameIcon(GUIBuilder.getToolIcon(GUIConstants.ICON_OUTLINE)); ! } ! ! /* (non-Javadoc) ! * @see java.awt.Component#getName() ! */ ! public String getName(){ ! return GUIUtils.i18n("outline", false); ! } ! /* (non-Javadoc) ! * @see net.sf.magicmap.client.views.View#buildViewComponent() ! */ ! protected JComponent buildViewComponent(){ ! RelativeLayout layout = new RelativeLayout(); ! RelativePanelBuilder builder = new RelativePanelBuilder(layout); ! treeroot = new OutlineNode("ROOT"); ! treemodel = new DefaultTreeModel(treeroot); ! nodeAccessPoints = new OutlineNode(GUIUtils.i18n("accesspoints")); ! nodeClients = new OutlineNode(GUIUtils.i18n("clients")); ! nodeLocations = new OutlineNode(GUIUtils.i18n("locations")); ! ! treeroot.add(nodeAccessPoints); ! treeroot.add(nodeClients); ! treeroot.add(nodeLocations); ! tree = new JTree(treemodel); ! tree.setRootVisible(false); ! tree.setCellRenderer(new OutlineRenderer()); ! tree.setBorder(new EmptyBorder(new Insets(3, 3, 3, 3))); ! tree.addTreeSelectionListener(this); ! JComponent pane = new JScrollPane(tree,JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); ! pane.setBorder(new EmptyBorder(new Insets(0, 0, 0, 0))); ! builder.add(pane, "tree"); ! builder.setTopTopDistance("tree", null, 0); ! builder.setBottomBottomDistance("tree", null, 0); ! builder.setLeftLeftDistance("tree", null, 0); ! builder.setRightRightDistance("tree", null, 0); ! JPanel panel = builder.getPanel(); ! panel.setMinimumSize(new Dimension(200, -1)); ! panel.setMaximumSize(new Dimension(-1,-1)); ! return panel; ! } ! public NodeModel getModel(){ ! return model; ! } - public void setModel(NodeModel model){ - this.model = model; - } ! /** ! * Erweiterter Knoten für einen Baum. Es wird Knoten aus dem NodeModel ! * von PACW aufgenommen. ! * @author thuebner ! */ ! private class OutlineNode extends DefaultMutableTreeNode { ! private Node node; ! /** ! * Konstruktor für Überschriften ! * @param title ! */ ! public OutlineNode(String title) { ! super(title); ! node = null; ! } - /** - * Konstruktur für Knoten aus dem NodeModel - * @param node - */ - public OutlineNode(Node node) { - this.node = node; - } ! public Node getNode(){ ! return this.node; ! } ! } ! private class OutlineRenderer extends DefaultTreeCellRenderer { ! /* (non-Javadoc) ! * @see javax.swing.tree.TreeCellRenderer#getTreeCellRendererComponent(javax.swing.JTree, java.lang.Object, boolean, boolean, boolean, int, boolean) ! */ ! public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, ! boolean leaf, int row, boolean hasFocus){ ! Node node = ((OutlineNode) value).getNode(); ! JLabel c; ! if (node == null){ ! c = (JLabel) super.getTreeCellRendererComponent(tree, value, selected, expanded, false, row, hasFocus); ! // Dafür sorgen, dass Folder-Icons angezeigt werden, auch wenn keine Unterelemente ! if (!expanded){ ! c.setIcon(this.getDefaultClosedIcon()); ! } else{ ! c.setIcon(this.getDefaultOpenIcon()); ! } ! } else{ ! c = (JLabel) super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); ! c.setText(node.getDisplayName()); ! Icon icon = Controller.getInstance().getMapView().getIconForNode(node); ! if (icon == null) icon = this.getDefaultLeafIcon(); ! c.setIcon(icon); ! } ! c.setPreferredSize(new Dimension(300, -1)); ! return c; ! } ! } ! ! private TreePath getOutlineNodePath(OutlineNode root, Node node){ ! int size = root.getChildCount(); ! for (int i = 0; i < size; i++){ ! OutlineNode on = (OutlineNode) root.getChildAt(i); ! if (on.getNode() == node){ ! return new TreePath((Object[])on.getPath()); ! } ! } ! return null; ! } ! private TreePath getOutlineNodePath(Node node){ ! switch (node.getType()) { ! case NodeModel.NODETYPE_ACCESSPOINT : ! return getOutlineNodePath(nodeAccessPoints, node); ! case NodeModel.NODETYPE_CLIENT : ! return getOutlineNodePath(nodeClients, node); ! case NodeModel.NODETYPE_LOCATION : ! return getOutlineNodePath(nodeLocations, node); ! default : ! return null; ! } ! } ! private OutlineNode findOutlineNode(OutlineNode root, Node node){ ! int size = root.getChildCount(); ! for (int i = 0; i < size; i++){ ! OutlineNode on = (OutlineNode) root.getChildAt(i); ! if (on.getNode() == node){ ! return on; ! } ! } ! return null; ! } ! ! private OutlineNode findOutlineNode(Node node){ ! switch (node.getType()) { ! case NodeModel.NODETYPE_ACCESSPOINT : ! return findOutlineNode(nodeAccessPoints, node); ! case NodeModel.NODETYPE_CLIENT : ! return findOutlineNode(nodeClients, node); ! case NodeModel.NODETYPE_LOCATION : ! return findOutlineNode(nodeLocations, node); ! default : ! return null; ! } ! } ! /* (non-Javadoc) ! * @see net.sf.magicmap.client.interfaces.NodeModelListener#nodeAddedEvent(net.sf.magicmap.client.model.Node) ! */ ! public void nodeAddedEvent(Node node){ ! OutlineNode on = new OutlineNode(node); ! on.setAllowsChildren(false); ! int index = 0; ! switch (node.getType()) { ! case NodeModel.NODETYPE_ACCESSPOINT : ! index = getAlphabeticalIndex(nodeAccessPoints,on); ! treemodel.insertNodeInto(on,nodeAccessPoints,index); ! break; ! case NodeModel.NODETYPE_CLIENT : ! index = getAlphabeticalIndex(nodeClients,on); ! treemodel.insertNodeInto(on,nodeClients,index); ! break; ! case NodeModel.NODETYPE_LOCATION : ! index = getAlphabeticalIndex(nodeLocations,on); ! treemodel.insertNodeInto(on,nodeLocations,index); ! break; ! } ! for (int i=0; i<tree.getRowCount();i++) ! if(tree.isShowing()&& tree.isCollapsed(i)) ! tree.expandRow(i); ! } ! /* (non-Javadoc) ! * @see net.sf.magicmap.client.interfaces.NodeModelListener#nodeUpdatedEvent(net.sf.magicmap.client.model.Node, int, java.lang.Object) ! */ ! public void nodeUpdatedEvent(Node node, int type, Object data){ ! if (type == NodeModel.UPDATE_LABELCHANGED || type == NodeModel.UPDATE_FIXSTATE){ ! OutlineNode on = findOutlineNode(node); ! if (on != null){ ! treemodel.reload(on); ! } else{ ! System.out.println("Node not found in tree view: " + node); ! } ! } else if (type == NodeModel.UPDATE_CLEAR){ ! this.nodeAccessPoints.removeAllChildren(); ! this.nodeClients.removeAllChildren(); ! this.nodeLocations.removeAllChildren(); ! treemodel.reload(); ! } ! } ! /* (non-Javadoc) ! * @see net.sf.magicmap.client.interfaces.NodeModelListener#nodeRemovedEvent(net.sf.magicmap.client.model.Node) ! */ ! public void nodeRemovedEvent(Node node){ ! OutlineNode on = findOutlineNode(node); ! if (on != null){ ! treemodel.removeNodeFromParent(on); ! } ! } ! ! private int getAlphabeticalIndex(OutlineNode parent,OutlineNode node){ ! int index=0; ! while((parent.getChildCount() > index) && (node.getNode().getDisplayName().compareToIgnoreCase(((OutlineNode)(parent.getChildAt(index))).getNode().getDisplayName()) > 0)){ ! ++index; ! } ! return index; ! } ! public void setSelected(Node node){ ! setSelected(getOutlineNodePath(node)); ! } ! ! private void setSelected(TreePath outlineNodePath) { ! tree.setSelectionPath(outlineNodePath); ! } ! public void clearSelection(){ ! tree.clearSelection(); ! } ! public void valueChanged(TreeSelectionEvent e) { ! if(!((OutlineNode)e.getPath().getLastPathComponent()).getAllowsChildren()){ ! Node node = ((OutlineNode)e.getPath().getLastPathComponent()).getNode(); ! Controller.getInstance().getMapView().getPACWGraphDraw().setSelected(Controller.getInstance().getMapView().findVertex(node)); ! } else { ! Controller.getInstance().getMapView().getPACWGraphDraw().setSelected(null); } } - - - } \ No newline at end of file --- 36,444 ---- /** ! * View for the outline (left side list view of the application) ! * ! * @author thuebner */ ! public class OutlineView extends View implements NodeModelListener, TreeSelectionListener { + /** + * serial version id + */ + private static final long serialVersionUID = 5695610129194636842L; + + private NodeModel model; + private JTree tree; + private DefaultTreeModel treemodel; + private DefaultMutableTreeNode treeroot; + + /** + * The outline nodes + */ + private OutlineNode nodeMaps; + private OutlineNode nodeAccessPoints; + private OutlineNode nodeClients; + private OutlineNode nodeLocations; + + + /** + * Constructor + */ + public OutlineView() { + super(); + this.setFrameIcon(GUIBuilder.getToolIcon(GUIConstants.ICON_OUTLINE)); + } ! ! /* (non-Javadoc) ! * @see net.sf.magicmap.client.views.View#buildViewComponent() ! */ ! protected JComponent buildViewComponent(){ ! RelativeLayout layout = new RelativeLayout(); ! RelativePanelBuilder builder = new RelativePanelBuilder(layout); ! treeroot = new OutlineNode("ROOT"); ! treemodel = new DefaultTreeModel(treeroot); ! nodeMaps = new OutlineNode(GUIUtils.i18n("outline_maps")); ! nodeAccessPoints = new OutlineNode(GUIUtils.i18n("accesspoints")); ! nodeClients = new OutlineNode(GUIUtils.i18n("clients")); ! nodeLocations = new OutlineNode(GUIUtils.i18n("locations")); ! ! treeroot.add(nodeMaps); ! treeroot.add(nodeAccessPoints); ! treeroot.add(nodeClients); ! treeroot.add(nodeLocations); ! tree = new JTree(treemodel); ! tree.setRootVisible(false); ! tree.setCellRenderer(new OutlineRenderer()); ! tree.setBorder(new EmptyBorder(new Insets(3, 3, 3, 3))); ! tree.addTreeSelectionListener(this); ! JComponent pane = new JScrollPane(tree,JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); ! pane.setBorder(new EmptyBorder(new Insets(0, 0, 0, 0))); ! builder.add(pane, "tree"); ! builder.setTopTopDistance("tree", null, 0); ! builder.setBottomBottomDistance("tree", null, 0); ! builder.setLeftLeftDistance("tree", null, 0); ! builder.setRightRightDistance("tree", null, 0); ! JPanel panel = builder.getPanel(); ! panel.setMinimumSize(new Dimension(200, -1)); ! panel.setMaximumSize(new Dimension(-1,-1)); ! return panel; ! } ! ! /** ! * Clear the selection of the JTree ! */ ! public void clearSelection(){ ! tree.clearSelection(); ! } ! ! ! /** ! * Getter for node model ! * @return the node model ! */ ! public NodeModel getModel(){ ! return model; ! } ! /* (non-Javadoc) ! * @see java.awt.Component#getName() ! */ ! public String getName(){ ! return GUIUtils.i18n("outline", false); ! } ! ! ! /* (non-Javadoc) ! * @see net.sf.magicmap.client.interfaces.NodeModelListener#nodeAddedEvent(net.sf.magicmap.client.model.Node) ! */ ! public void nodeAddedEvent(Node node){ ! ! OutlineNode on = new OutlineNode(node); ! on.setAllowsChildren(false); ! int index = 0; ! ! switch (node.getType()) { ! case NodeModel.NODETYPE_MAP: ! index = getAlphabeticalIndex(nodeMaps, on); ! treemodel.insertNodeInto(on, nodeMaps, index); ! break; ! case NodeModel.NODETYPE_ACCESSPOINT : ! index = getAlphabeticalIndex(nodeAccessPoints,on); ! treemodel.insertNodeInto(on,nodeAccessPoints,index); ! break; ! case NodeModel.NODETYPE_CLIENT : ! index = getAlphabeticalIndex(nodeClients,on); ! treemodel.insertNodeInto(on,nodeClients,index); ! break; ! case NodeModel.NODETYPE_LOCATION : ! index = getAlphabeticalIndex(nodeLocations,on); ! treemodel.insertNodeInto(on,nodeLocations,index); ! break; ! } ! ! for (int i=0; i<tree.getRowCount(); i++) { ! if(tree.isShowing()&& tree.isCollapsed(i)) { ! tree.expandRow(i); ! } ! } ! } ! ! /* (non-Javadoc) ! * @see net.sf.magicmap.client.interfaces.NodeModelListener#nodeRemovedEvent(net.sf.magicmap.client.model.Node) ! */ ! public void nodeRemovedEvent(Node node) { ! ! OutlineNode on = findOutlineNode(node); ! ! if (on != null) { ! treemodel.removeNodeFromParent(on); ! } ! } ! ! /* (non-Javadoc) ! * @see net.sf.magicmap.client.interfaces.NodeModelListener#nodeUpdatedEvent(net.sf.magicmap.client.model.Node, int, java.lang.Object) ! */ ! public void nodeUpdatedEvent(Node node, int type, Object data) { ! ! if (type == NodeModel.UPDATE_LABELCHANGED || type == NodeModel.UPDATE_FIXSTATE) { ! OutlineNode on = findOutlineNode(node); ! ! if (on != null){ ! treemodel.reload(on); ! } else{ ! System.out.println("Node not found in tree view: " + node); ! } ! } else if (type == NodeModel.UPDATE_CLEAR) { ! // this.nodeMaps.removeAllChildren(); ! this.nodeAccessPoints.removeAllChildren(); ! this.nodeClients.removeAllChildren(); ! this.nodeLocations.removeAllChildren(); ! treemodel.reload(); ! } ! } ! /** ! * Setter for node model ! * @param model - the node model ! */ ! public void setModel(NodeModel model){ ! this.model = model; ! } ! ! public void setSelected(Node node) { ! setSelected(getOutlineNodePath(node)); ! } ! ! /* (non-Javadoc) ! * @see javax.swing.event.TreeSelectionListener#valueChanged(javax.swing.event.TreeSelectionEvent) ! */ ! public void valueChanged(TreeSelectionEvent e) { ! if(!((OutlineNode)e.getPath().getLastPathComponent()).getAllowsChildren()) { ! Node node = ((OutlineNode)e.getPath().getLastPathComponent()).getNode(); ! if (node instanceof MapNode) { ! if (((MapNode)node).getMapInfo() != null) { ! Controller.getInstance().setCurrentMap(((MapNode)node).getMapInfo()); ! } ! } else { ! Controller.getInstance().getMapView().getPACWGraphDraw().setSelected(Controller.getInstance().getMapView().findVertex(node)); ! } ! } else { ! Controller.getInstance().getMapView().getPACWGraphDraw().setSelected(null); ! } ! } ! ! ! /* ! * # private methods ############################################ ! */ ! /** ! * Find OutlineNode for given Node and root OutlineNode ! * @param root - the root OutlineNode ! * @param node - the Node to find ! * @return the OutlineNode if exists, else null ! */ ! private OutlineNode findOutlineNode(OutlineNode root, Node node) { ! int size = root.getChildCount(); ! for (int i = 0; i < size; i++) { ! OutlineNode on = (OutlineNode) root.getChildAt(i); ! if (on.getNode() == node){ ! return on; ! } ! } ! return null; ! } ! ! ! /** ! * Find OutlineNode for given Node ! * @param node - the Node to find ! * @return the OutlineNode if exists, else null ! */ ! private OutlineNode findOutlineNode(Node node){ ! switch (node.getType()) { ! case NodeModel.NODETYPE_MAP: ! return findOutlineNode(nodeMaps, node); ! case NodeModel.NODETYPE_ACCESSPOINT : ! return findOutlineNode(nodeAccessPoints, node); ! case NodeModel.NODETYPE_CLIENT : ! return findOutlineNode(nodeClients, node); ! case NodeModel.NODETYPE_LOCATION : ! return findOutlineNode(nodeLocations, node); ! default : ! return null; ! } ! } ! ! ! /** ! * Get the alphabetical index for given OutlineNode in its parent ! * @param parent - the parent OutlineNode ! * @param node - the OutlineNode to find out the index ! * @return the index of node in parent ! */ ! private int getAlphabeticalIndex(OutlineNode parent, OutlineNode node) { ! int index=0; ! while((parent.getChildCount() > index) && (node.getNode().getDisplayName().compareToIgnoreCase(((OutlineNode)(parent.getChildAt(index))).getNode().getDisplayName()) > 0)) { ! ++index; ! } ! return index; ! } ! ! ! /** ! * Get the TreePath of a Node for a given root OutlineNode ! * @param root - the root OutlineNode ! * @param node - the Node to get the TreePath of ! * @return the path of node in root if exists, else null ! */ ! private TreePath getOutlineNodePath(OutlineNode root, Node node) { ! int size = root.getChildCount(); ! for (int i = 0; i < size; i++){ ! OutlineNode on = (OutlineNode) root.getChildAt(i); ! if (on.getNode() == node){ ! return new TreePath((Object[])on.getPath()); ! } ! } ! return null; ! } ! ! /** ! * Get the TreePath of a Node ! * @param node - the Node to get the TreePath of ! * @return the path of the node if exists, else null ! */ ! private TreePath getOutlineNodePath(Node node) { ! switch (node.getType()) { ! case NodeModel.NODETYPE_MAP : ! return getOutlineNodePath(nodeMaps, node); ! case NodeModel.NODETYPE_ACCESSPOINT : ! return getOutlineNodePath(nodeAccessPoints, node); ! case NodeModel.NODETYPE_CLIENT : ! return getOutlineNodePath(nodeClients, node); ! case NodeModel.NODETYPE_LOCATION : ! return getOutlineNodePath(nodeLocations, node); ! default : ! return null; ! } ! } ! ! /** ! * Sets the selection on a given TreePath ! * @param outlineNodePath - the TreePath to set the selection on ! */ ! private void setSelected(TreePath outlineNodePath) { ! tree.setSelectionPath(outlineNodePath); ! } ! ! ! /* ! * # private inner classes ####################################### ! */ ! /** ! * Erweiterter Knoten für einen Baum. Es wird Knoten aus dem NodeModel ! * von PACW aufgenommen. ! * @author thuebner ! */ ! private class OutlineNode extends DefaultMutableTreeNode { ! /** ! * serial version id ! */ ! private static final long serialVersionUID = 8604452363363204008L; ! ! /** ! * the outline node ! */ ! private Node node; ! /** ! * Konstruktor für Überschriften ! * @param title ! */ ! public OutlineNode(String title) { ! super(title); ! node = null; ! } ! /** ! * Konstruktur für Knoten aus dem NodeModel ! * @param node ! */ ! public OutlineNode(Node node) { ! this.node = node; ! } ! /** ! * Getter for the node ! * @return ! */ ! public Node getNode(){ ! return this.node; ! } ! } ! ! /** ! * Private class for the outline rendering ! * ! * @author (vermutlich) thuebner ! * @author Johannes Zapotoczky (joh...@za...) ! */ ! private class OutlineRenderer extends DefaultTreeCellRenderer { + /** + * serial version id + */ + private static final long serialVersionUID = 1516105045685167210L; ! /* (non-Javadoc) ! * @see javax.swing.tree.TreeCellRenderer#getTreeCellRendererComponent(javax.swing.JTree, java.lang.Object, boolean, boolean, boolean, int, boolean) ! */ ! public Component getTreeCellRendererComponent(JTree tree, ! Object value, boolean selected, boolean expanded, ! boolean leaf, int row, boolean hasFocus) { ! ! Node node = ((OutlineNode) value).getNode(); ! JLabel c; ! if (node == null) { ! c = (JLabel) super.getTreeCellRendererComponent(tree, value, selected, expanded, false, row, hasFocus); ! // Dafür sorgen, dass Folder-Icons angezeigt werden, auch wenn keine Unterelemente ! if (!expanded) { ! c.setIcon(this.getDefaultClosedIcon()); ! } else{ ! c.setIcon(this.getDefaultOpenIcon()); ! } ! } else{ ! c = (JLabel) super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); ! c.setText(node.getDisplayName()); ! Icon icon = Controller.getInstance().getMapView().getIconForNode(node); ! if (icon == null) icon = this.getDefaultLeafIcon(); ! c.setIcon(icon); ! } ! c.setPreferredSize(new Dimension(300, -1)); ! return c; ! } } } Index: MapView.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/views/MapView.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** MapView.java 12 Oct 2005 21:44:17 -0000 1.14 --- MapView.java 20 Feb 2006 08:49:58 -0000 1.15 *************** *** 69,73 **** public class MapView extends View implements VertexListener, NodeModelListener { ! private static final String NODE_KEY = "NODE"; private Icon clientIcon; --- 69,78 ---- public class MapView extends View implements VertexListener, NodeModelListener { ! /** ! * serial version id ! */ ! private static final long serialVersionUID = 6813465565034050923L; ! ! private static final String NODE_KEY = "NODE"; private Icon clientIcon; |
From: Johannes Z. <jza...@us...> - 2006-02-20 08:49:51
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/interfaces In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13513/src/net/sf/magicmap/client/interfaces Modified Files: MapNamesCallback.java Log Message: Changes to show maps in the outline view tree Refactorings Index: MapNamesCallback.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/interfaces/MapNamesCallback.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MapNamesCallback.java 16 Jan 2005 16:01:25 -0000 1.1 --- MapNamesCallback.java 20 Feb 2006 08:49:48 -0000 1.2 *************** *** 6,16 **** /** * @author thuebner */ public interface MapNamesCallback { ! public void mapNamesReceived(String[] names); ! ! public void getMapNamesError(Exception e); } \ No newline at end of file --- 6,31 ---- /** + * * @author thuebner */ public interface MapNamesCallback { ! /** ! * Open the map dialog ! * @param names - the names of the maps ! */ ! public void openMapDialog(String[] names); ! ! /** ! * Refresh the maps in the outline view ! * @param names - the names of the maps ! */ ! public void addMapNamesToOutline(String[] names); + /** + * Get the error msg of the failed map names retrievement + * @param e - the occurred exception + */ + public void getMapNamesError(Exception e); + } \ No newline at end of file |
From: Johannes Z. <jza...@us...> - 2006-02-20 08:49:43
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/gui/dialogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13480/src/net/sf/magicmap/client/gui/dialogs Modified Files: ConnectServerDialog.java Log Message: Changes to show maps in the outline view tree Refactorings Index: ConnectServerDialog.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/ConnectServerDialog.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ConnectServerDialog.java 2 Feb 2006 21:23:14 -0000 1.4 --- ConnectServerDialog.java 20 Feb 2006 08:49:37 -0000 1.5 *************** *** 32,35 **** --- 32,40 ---- public class ConnectServerDialog extends JDialog implements ActionListener { + /** + * serial version id + */ + private static final long serialVersionUID = 221520511929814197L; + private JPanel mainPanel; private ServerConnectionInfo serverConnectionInfo; |
From: Johannes Z. <jza...@us...> - 2006-02-20 08:49:31
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13449/src/net/sf/magicmap/client/gui Modified Files: MainGUI.java Log Message: Changes to show maps in the outline view tree Refactorings Index: MainGUI.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** MainGUI.java 10 Feb 2006 15:14:02 -0000 1.12 --- MainGUI.java 20 Feb 2006 08:49:27 -0000 1.13 *************** *** 1,4 **** --- 1,5 ---- /* * Created on 21.11.2004 + * Refactored on 15.02.2006 */ *************** *** 43,46 **** --- 44,49 ---- import net.sf.magicmap.client.meta.MapInfo; [...1257 lines suppressed...] ! /** ! * Wechselt zwischen Sichtbar und Unsichtbar ! * ! */ ! protected void toogleInvisible() { ! Controller.getInstance().setInvisible(!Controller.getInstance().isInvisible()); ! statusBar.setInvisible(Controller.getInstance().isInvisible()); ! } ! ! /** ! * Connect to server ! */ ! protected void connect() { ! statusBar.setMessage(GUIUtils.i18n(GUIConstants.STATE_CONNECTING)); ! statusBar.setInvisible(Controller.getInstance().isInvisible()); ! Controller.getInstance().connect(MainGUI.this); ! } ! } |
From: Johannes Z. <jza...@us...> - 2006-02-20 08:49:22
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13367/src/net/sf/magicmap/client/controller Modified Files: VirtualServerManager.java Controller.java ServerManager.java SOAPServerManager.java Log Message: Changes to show maps in the outline view tree Refactorings Index: VirtualServerManager.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller/VirtualServerManager.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** VirtualServerManager.java 8 Nov 2005 11:24:19 -0000 1.4 --- VirtualServerManager.java 20 Feb 2006 08:49:14 -0000 1.5 *************** *** 147,151 **** * @see net.sf.magicmap.client.controller.ServerManager#retrieveMapNames(net.sf.magicmap.client.interfaces.MapNamesCallback) */ ! public void retrieveMapNames(final MapNamesCallback callback){ if (!isConnected()) return; Thread thread = new Thread() { --- 147,151 ---- * @see net.sf.magicmap.client.controller.ServerManager#retrieveMapNames(net.sf.magicmap.client.interfaces.MapNamesCallback) */ ! public void retrieveMapNames(final MapNamesCallback callback, final boolean openDialog){ if (!isConnected()) return; Thread thread = new Thread() { *************** *** 163,168 **** } String[] names = (String[]) result.toArray(new String[0]); ! ! callback.mapNamesReceived(names); } catch (Exception e){ e.printStackTrace(); --- 163,172 ---- } String[] names = (String[]) result.toArray(new String[0]); ! ! if (openDialog) { ! callback.openMapDialog(names); ! } else { ! callback.addMapNamesToOutline(names); ! } } catch (Exception e){ e.printStackTrace(); Index: Controller.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Controller.java 8 Nov 2005 11:24:19 -0000 1.7 --- Controller.java 20 Feb 2006 08:49:14 -0000 1.8 *************** *** 11,15 **** import java.util.ArrayList; - import net.sf.magicmap.client.gui.utils.CallbackHandler; import net.sf.magicmap.client.interfaces.CreateNewMapCallback; import net.sf.magicmap.client.interfaces.CreatePositionCallback; --- 11,14 ---- *************** *** 48,398 **** public class Controller { ! private static Controller controller = null; ! private NodeModel nodeModel; // Model für Graphen ! private MeasurementModel measurementModel; // Model für Messungen ! private MeasurementModel measurementModelOther; // Messungen anderen Clients / Orte ! private Handler handler; // Für Scannen ! private AbstractScanner scanner; // Scanner ! private ClientNode client; // Ausgezeichneter Knoten ! private ServerPoller poller; // Server ständig nach Änderungen fragen ! private PollHandler pollhandler; // Klasse zur Verarbeitung der Pollergebnisse ! private ServerManager serverManager; // Manager für die Verbindung zum Server ! private CallbackHandler callbackHandler; // Sämtliche callbacks werden dort behandelt ! private String clientMac; ! private MapInfo currentMap; ! private OutlineView outlineView; ! private ConsoleView consoleView; ! private MapView mapView; ! private MeasurementView measurementView; ! private boolean invisble; // Insible-Modus (keine Daten an Server) ! private Controller() { ! this.nodeModel = new NodeModel(); ! this.measurementModel = new MeasurementModel(); ! this.measurementModelOther = new MeasurementModel(); ! this.client = new ClientNode(nodeModel); ! try{ ! client.setName(InetAddress.getLocalHost().getHostName()); ! } catch (UnknownHostException e){ ! client.setName("invalidhostname"); ! } ! this.nodeModel.addNode(client); ! this.handler = new Handler(measurementModel, nodeModel, client); ! this.scanner = null; ! this.currentMap = null; ! this.serverManager = null; ! this.pollhandler = new PollHandler(this); ! this.callbackHandler = new CallbackHandler(); ! try{ ! this.clientMac = NetworkInfo.getMacAddress(); ! } catch (IOException e1){ ! this.clientMac = "00:00:00:00:00:00"; ! } ! clientMac = clientMac.replace(':', '-'); ! clientMac.toUpperCase().trim(); ! client.setMacAddress(clientMac); ! Settings.setClientName(client.getDisplayName()); ! Settings.setClientMAC(clientMac); ! buildViews(); ! initializeScanner(); ! } ! public ClientNode getClient(){ ! return this.client; ! } ! /** ! * Erzeugt die Hauptviews der Anwendung ! * ! */ ! private void buildViews(){ ! this.outlineView = new OutlineView(); ! this.consoleView = new ConsoleView(); ! this.mapView = new MapView(); ! this.measurementView = new MeasurementView(); ! //registerMeasurementModelListener(measurementView); ! setMeasurementViewLocal(true); ! registerNodeModelListener(mapView); ! registerNodeModelListener(outlineView); ! } ! private void initializeScanner(){ ! if (scanner == null){ ! this.scanner = new UDPScanner(2446); ! this.scanner.addScannerListener(handler); ! } ! } ! public MapView getMapView(){ ! return this.mapView; ! } ! public OutlineView getOutlineView(){ ! return this.outlineView; ! } ! public ConsoleView getConsoleView(){ ! return this.consoleView; ! } ! public MeasurementView getMeasurementView(){ ! return this.measurementView; ! } ! public static Controller getInstance(){ ! if (controller == null){ ! controller = new Controller(); ! } ! return controller; ! } ! public NodeModel getNodeModel(){ ! return nodeModel; ! } ! public void registerNodeModelListener(NodeModelListener listener){ ! nodeModel.addNodeModelListener(listener); ! } ! public void unregisterNodeModelListener(NodeModelListener listener){ ! nodeModel.removeNodeModelListener(listener); ! } ! public void registerMeasurementModelListener(MeasurementModelListener listener){ ! measurementModel.addMeasurementModelListener(listener); ! } ! public void unregisterMeasurementModelListener(MeasurementModelListener listener){ ! measurementModel.removeMeasurementModelListener(listener); ! } - /** - * Baut das MeasurementModelOther neu auf. - * @param ap - */ - public void buildOtherMeasurement(AccessPointSeerNode ap){ - System.out.println("Building measurement model..."); - this.measurementModelOther.clear(); - ArrayList aes = ap.getApEdges(); - for (int i = 0; i < aes.size(); i++){ - AccessPointEdge ae = (AccessPointEdge) aes.get(i); - SeenAccessPoint sp = new SeenAccessPoint(ae.getAccessPoint().getMacAddress(), ae.getSignalLevel()); - this.measurementModelOther.addAccessPoint(sp); - } - } ! /** ! * Änndert die Anzeige des Measurement-Views ! * @param local true, wenn lokale Stärken angezeigt werden sollen ! */ ! public void setMeasurementViewLocal(boolean local){ ! if (local){ ! measurementModelOther.removeMeasurementModelListener(measurementView); ! measurementModel.addMeasurementModelListener(measurementView); ! measurementModel.clear(); ! } else{ ! measurementModel.removeMeasurementModelListener(measurementView); ! measurementModelOther.addMeasurementModelListener(measurementView); ! measurementModelOther.clear(); ! } ! } - public MeasurementModel getMeasurementModel(){ - return measurementModel; - } ! /** ! * Gibt an ob verbunden oder nicht verbunden ! * @return true wenn ja, false sonst ! */ ! public boolean isConnected(){ ! return (serverManager != null && serverManager.isConnected()); ! } ! /** ! * Liefert Kartenbeschreibung der aktuell geladenen Karte ! * @return Kartenbeschreibung (MapInfo) oder null, wenn keine Karte aktiv ! */ ! public MapInfo getCurrentMap(){ ! return this.currentMap; ! } ! /** ! * Setzt aktuelle Karte und startet dabei das ServerPolling ! * @param map ! */ ! public void setCurrentMap(MapInfo map){ ! if (isMapLoaded()){ ! closeMap(); ! } ! this.currentMap = map; ! try{ ! serverManager.reloadMap(); ! this.mapView.loadMap(map); ! } catch (MalformedURLException e){ ! System.out.println("Map loading failed." + e.getMessage()); ! closeMap(); ! } ! if (isMapLoaded() && isConnected()){ ! registerNodeModelListener(mapView); ! serverManager.resetTimestamp(); ! setMeasurementViewLocal(true); ! poller.start(); ! initializeScanner(); // Scanner neu initialisieren ! scanner.start(); ! } ! } ! public void restartServerPoller(){ if (isMapLoaded() && isConnected()){ ! poller.stop(); ! poller.start(); } ! } ! public boolean isMapLoaded(){ ! return currentMap != null; ! } ! /** ! * Schließt Karte und beendet Polling vom Server ! * ! */ ! public void closeMap(){ ! scanner.terminate(); ! scanner = null; ! try{ ! Thread.sleep(1000); ! } catch (InterruptedException e1){ ! // TODO Auto-generated catch block ! e1.printStackTrace(); ! } ! this.currentMap = null; ! this.mapView.unloadMap(); ! serverManager.closeMap(); ! poller.stop(); ! nodeModel.clear(); ! unregisterNodeModelListener(mapView); ! nodeModel.addNode(client); ! } ! /** ! * Liefert eigene Mac-Adresse vom Client. ! * @return ! */ ! public String getClientMac(){ ! return clientMac; ! } ! /** ! * Liefert X-Position des Clients auf der Karte ! * @return ! */ ! public int getClientPosX(){ ! return mapView.getX(client); ! } ! /** ! * Liefert Y-Position des Clients auf der Karte ! * @return ! */ ! public int getClientPosY(){ ! return mapView.getY(client); ! } ! public boolean isInvisible(){ ! return this.invisble; ! } ! public void setInvisible(boolean value){ ! this.invisble = value; ! } ! /********************************************************************** ! * ! * API für die GUI ! * ! **********************************************************************/ ! public void connect(ServerConnectCallback callback){ ! if (Settings.isUseNoServer()){ ! serverManager = new VirtualServerManager(this); ! } else{ ! serverManager = new SOAPServerManager(this); ! } ! // Poller erzeugen (benötigt ServerManager) ! this.poller = new ServerPoller(serverManager, pollhandler); ! serverManager.connect(callback); ! } ! public void disconnect(ServerDisconnectCallback callback){ ! serverManager.disconnect(callback); ! } ! /** ! * Erzeugt einen Referenzpunkt auf der aktuellen Karte mit den aktuellen ! * Messwerten des Clients mit den angegebenen Koordinaten. ! * ! */ ! public void createLocation(int x, int y, String name, boolean fixed, CreatePositionCallback callback){ ! if (!isConnected() || !isMapLoaded()){ ! callback.positionCreationError(new Exception("Nicht verbunden oder keine Karte geladen.")); ! } else{ ! serverManager.createLocation(x, y, fixed, name, callback); ! ! } ! } ! /** ! * Entfernt einen ! * @param node ! */ ! public void deletePosition(String name, String mapname, DeletePositionCallback callback){ ! Node node = nodeModel.findNode(name); ! if (node != null){ ! if (node.getId() != -1){ ! serverManager.deletePosition(node.getId(), Controller.getInstance().getCurrentMap().name, callback); ! } else{ ! System.out.println("Node has no positionId, so its position cannot be deleted."); ! } ! } ! } ! public void setClientPosition(final int x, final int y, final boolean fixed, final String clientMac, ! final PositionCallback callback){ ! serverManager.setClientPosition(x, y, fixed, clientMac, callback); ! } ! public void setAccessPointPosition(final int x, final int y, boolean fixed, final String accessPointMac, ! final PositionCallback callback){ ! serverManager.setAccessPointPosition(x, y, fixed, accessPointMac, callback); ! } ! public void movePosition(final long positionId, final String mapname, final int x, final int y, boolean fixed, ! final MovePositionCallback callback){ ! serverManager.movePosition(positionId, mapname,x, y, fixed, callback); ! } ! /** ! * Holt Karte vom Server. Ergebnis via Callback ! * @param name ! * @param callback ! */ ! public void retrieveMap(String name, MapCallback callback){ ! serverManager.retrieveMap(name, callback); ! } ! public void retrieveMapNames(MapNamesCallback callback){ ! serverManager.retrieveMapNames(callback); ! } ! public void createNewMap(final String name, final String URL, final int width, final int height, ! final CreateNewMapCallback callback){ ! serverManager.createNewMap(name, URL, width, height, callback); ! } ! } \ No newline at end of file --- 47,508 ---- public class Controller { ! private static Controller controller = null; ! private NodeModel nodeModel; // Model für Graphen ! private MeasurementModel measurementModel; // Model für Messungen ! private MeasurementModel measurementModelOther; // Messungen anderen Clients / Orte ! private Handler handler; // Für Scannen ! private AbstractScanner scanner; // Scanner ! private ClientNode client; // Ausgezeichneter Knoten ! private ServerPoller poller; // Server ständig nach Änderungen fragen ! private PollHandler pollhandler; // Klasse zur Verarbeitung der Pollergebnisse ! private ServerManager serverManager; // Manager für die Verbindung zum Server ! // private CallbackHandler callbackHandler; // Sämtliche callbacks werden dort behandelt ! ! private String clientMac; ! private MapInfo currentMap; ! ! private OutlineView outlineView; ! private ConsoleView consoleView; ! private MapView mapView; ! private MeasurementView measurementView; ! private boolean invisble; // Insible-Modus (keine Daten an Server) ! /** ! * Private constructor for singleton instance ! */ ! private Controller() { ! this.nodeModel = new NodeModel(); ! this.measurementModel = new MeasurementModel(); ! this.measurementModelOther = new MeasurementModel(); ! this.client = new ClientNode(nodeModel); ! try{ ! client.setName(InetAddress.getLocalHost().getHostName()); ! } catch (UnknownHostException e){ ! client.setName("invalidhostname"); ! } ! this.nodeModel.addNode(client); ! this.handler = new Handler(measurementModel, nodeModel, client); ! this.scanner = null; ! this.currentMap = null; ! this.serverManager = null; ! this.pollhandler = new PollHandler(this); ! // this.callbackHandler = new CallbackHandler(); ! try { ! this.clientMac = NetworkInfo.getMacAddress(); ! } catch (IOException e1){ ! this.clientMac = "00:00:00:00:00:00"; ! } ! clientMac = clientMac.replace(':', '-'); ! clientMac.toUpperCase().trim(); ! client.setMacAddress(clientMac); ! Settings.setClientName(client.getDisplayName()); ! Settings.setClientMAC(clientMac); ! buildViews(); ! initializeScanner(); ! } ! ! /** ! * Getter for client node ! * @return the client node ! */ ! public ClientNode getClient(){ ! return this.client; ! } ! ! /** ! * Erzeugt die Hauptviews der Anwendung ! */ ! private void buildViews(){ ! this.outlineView = new OutlineView(); ! this.consoleView = new ConsoleView(); ! this.mapView = new MapView(); ! this.measurementView = new MeasurementView(); ! //registerMeasurementModelListener(measurementView); ! setMeasurementViewLocal(true); ! registerNodeModelListener(mapView); ! registerNodeModelListener(outlineView); ! } ! ! /** ! * Initialize the scanner ! */ ! private void initializeScanner(){ ! if (scanner == null) { ! this.scanner = new UDPScanner(2446); ! this.scanner.addScannerListener(handler); ! } ! } ! ! /** ! * Getter for the map view ! * @return the map view ! */ ! public MapView getMapView(){ ! return this.mapView; ! } ! ! /** ! * Getter for the outline view ! * @return the outline view ! */ ! public OutlineView getOutlineView(){ ! return this.outlineView; ! } ! ! /** ! * Getter for the console view ! * @return the console view ! */ ! public ConsoleView getConsoleView(){ ! return this.consoleView; ! } ! ! /** ! * Getter for the measurement view ! * @return the measurement view ! */ ! public MeasurementView getMeasurementView(){ ! return this.measurementView; ! } ! ! /** ! * Provides the singleton controller instance (creates a new one if null) ! * @return the singleton controller instance ! */ ! public static Controller getInstance(){ ! if (controller == null){ ! controller = new Controller(); ! } ! return controller; ! } ! ! /** ! * Getter for the node model ! * @return the node model ! */ ! public NodeModel getNodeModel(){ ! return nodeModel; ! } ! ! /** ! * Register the node model listener ! * @param listener - the node model listener ! */ ! public void registerNodeModelListener(NodeModelListener listener){ ! nodeModel.addNodeModelListener(listener); ! } ! ! /** ! * Unregister the node model listener ! * @param listener - the node model listener ! */ ! public void unregisterNodeModelListener(NodeModelListener listener){ ! nodeModel.removeNodeModelListener(listener); ! } ! ! /** ! * Register the measurement model listener ! * @param listener the measurement model listener ! */ ! public void registerMeasurementModelListener(MeasurementModelListener listener){ ! measurementModel.addMeasurementModelListener(listener); ! } ! ! /** ! * Unregister the measurement model listener ! * @param listener - the measurement model listener ! */ ! public void unregisterMeasurementModelListener(MeasurementModelListener listener){ ! measurementModel.removeMeasurementModelListener(listener); ! } ! ! /** ! * Baut das MeasurementModelOther neu auf. ! * @param ap - the access point seer node ! */ ! public void buildOtherMeasurement(AccessPointSeerNode ap) { ! System.out.println("Building measurement model..."); ! this.measurementModelOther.clear(); ! ArrayList aes = ap.getApEdges(); ! for (int i = 0; i < aes.size(); i++){ ! AccessPointEdge ae = (AccessPointEdge) aes.get(i); ! SeenAccessPoint sp = new SeenAccessPoint(ae.getAccessPoint().getMacAddress(), ae.getSignalLevel()); ! this.measurementModelOther.addAccessPoint(sp); ! } ! } ! ! /** ! * Änndert die Anzeige des Measurement-Views ! * @param local true, wenn lokale Stärken angezeigt werden sollen ! */ ! public void setMeasurementViewLocal(boolean local) { ! if (local) { ! measurementModelOther.removeMeasurementModelListener(measurementView); ! measurementModel.addMeasurementModelListener(measurementView); ! measurementModel.clear(); ! } else{ ! measurementModel.removeMeasurementModelListener(measurementView); ! measurementModelOther.addMeasurementModelListener(measurementView); ! measurementModelOther.clear(); ! } ! } ! /** ! * Getter for measurement model ! * @return the measurement model ! */ ! public MeasurementModel getMeasurementModel(){ ! return measurementModel; ! } ! /** ! * Gibt an ob verbunden oder nicht verbunden ! * @return true wenn ja, false sonst ! */ ! public boolean isConnected() { ! return (serverManager != null && serverManager.isConnected()); ! } ! ! /** ! * Liefert Kartenbeschreibung der aktuell geladenen Karte ! * @return Kartenbeschreibung (MapInfo) oder null, wenn keine Karte aktiv ! */ ! public MapInfo getCurrentMap() { ! return this.currentMap; ! } ! ! /** ! * Setzt aktuelle Karte und startet dabei das ServerPolling ! * @param map ! */ ! public void setCurrentMap(MapInfo map) { ! if (isMapLoaded()) { ! closeMap(); ! } ! this.currentMap = map; ! try { ! serverManager.reloadMap(); ! this.mapView.loadMap(map); ! } catch (MalformedURLException e){ ! System.out.println("Map loading failed." + e.getMessage()); ! closeMap(); ! } ! if (isMapLoaded() && isConnected()) { ! registerNodeModelListener(mapView); ! serverManager.resetTimestamp(); ! setMeasurementViewLocal(true); ! poller.start(); ! initializeScanner(); // Scanner neu initialisieren ! scanner.start(); ! } ! } ! ! /** ! * Restart server poller ! */ ! public void restartServerPoller(){ if (isMapLoaded() && isConnected()){ ! poller.stop(); ! poller.start(); } ! } ! ! /** ! * Check whether map is loaded ! * @return <code>true</code> if map loaded, <code>false</code> else ! */ ! public boolean isMapLoaded(){ ! return currentMap != null; ! } ! ! /** ! * Schließt Karte und beendet Polling vom Server ! * ! */ ! public void closeMap() { ! scanner.terminate(); ! scanner = null; ! try { ! Thread.sleep(1000); ! } catch (InterruptedException e1){ ! // TODO Auto-generated catch block ! e1.printStackTrace(); ! } ! this.currentMap = null; ! this.mapView.unloadMap(); ! serverManager.closeMap(); ! poller.stop(); ! nodeModel.clear(); ! unregisterNodeModelListener(mapView); ! nodeModel.addNode(client); ! } ! ! /** ! * Liefert eigene Mac-Adresse vom Client. ! * @return client mac address ! */ ! public String getClientMac(){ ! return clientMac; ! } ! ! /** ! * Liefert X-Position des Clients auf der Karte ! * @return client x position ! */ ! public int getClientPosX(){ ! return mapView.getX(client); ! } ! ! /** ! * Liefert Y-Position des Clients auf der Karte ! * @return ! */ ! public int getClientPosY(){ ! return mapView.getY(client); ! } ! ! /** ! * Check for invisibility ! * @return <code>true</code> if invisible, <code>false</code> else ! */ ! public boolean isInvisible(){ ! return this.invisble; ! } ! ! /** ! * Setter for invisibility ! * @param value - boolean value for invisibility ! */ ! public void setInvisible(boolean value){ ! this.invisble = value; ! } ! ! ! /********************************************************************** ! * ! * API für die GUI ! * ! **********************************************************************/ ! ! public void connect(ServerConnectCallback callback){ ! if (Settings.isUseNoServer()){ ! serverManager = new VirtualServerManager(this); ! } else{ ! serverManager = new SOAPServerManager(this); ! } ! // Poller erzeugen (benötigt ServerManager) ! this.poller = new ServerPoller(serverManager, pollhandler); ! serverManager.connect(callback); ! } ! ! ! public void disconnect(ServerDisconnectCallback callback){ ! serverManager.disconnect(callback); ! } ! ! /** ! * Erzeugt einen Referenzpunkt auf der aktuellen Karte mit den aktuellen ! * Messwerten des Clients mit den angegebenen Koordinaten. ! */ ! public void createLocation(int x, int y, String name, boolean fixed, CreatePositionCallback callback){ ! if (!isConnected() || !isMapLoaded()) { ! callback.positionCreationError(new Exception("Nicht verbunden oder keine Karte geladen.")); ! } else{ ! serverManager.createLocation(x, y, fixed, name, callback); ! } ! } ! ! /** ! * Entfernt einen ! * @param node ! */ ! public void deletePosition(String name, String mapname, DeletePositionCallback callback){ ! Node node = nodeModel.findNode(name); ! if (node != null) { ! if (node.getId() != -1){ ! serverManager.deletePosition(node.getId(), Controller.getInstance().getCurrentMap().name, callback); ! } else{ ! System.out.println("Node has no positionId, so its position cannot be deleted."); ! } ! } ! } ! ! ! public void setClientPosition(final int x, final int y, final boolean fixed, final String clientMac, ! final PositionCallback callback) { ! ! serverManager.setClientPosition(x, y, fixed, clientMac, callback); ! } ! ! public void setAccessPointPosition(final int x, final int y, boolean fixed, final String accessPointMac, ! final PositionCallback callback) { ! ! serverManager.setAccessPointPosition(x, y, fixed, accessPointMac, callback); ! } ! ! public void movePosition(final long positionId, final String mapname, final int x, final int y, boolean fixed, ! final MovePositionCallback callback) { ! ! serverManager.movePosition(positionId, mapname,x, y, fixed, callback); ! } ! ! /** ! * Holt Karte vom Server. Ergebnis via Callback ! * @param name ! * @param callback ! */ ! public void retrieveMap(String name, MapCallback callback) { ! serverManager.retrieveMap(name, callback); ! } ! ! public void retrieveMapNames(MapNamesCallback callback, boolean openMapDialog){ ! serverManager.retrieveMapNames(callback, openMapDialog); ! } ! ! public void createNewMap(final String name, final String URL, final int width, final int height, ! final CreateNewMapCallback callback) { ! ! serverManager.createNewMap(name, URL, width, height, callback); ! } ! } Index: ServerManager.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller/ServerManager.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ServerManager.java 8 Nov 2005 11:24:19 -0000 1.8 --- ServerManager.java 20 Feb 2006 08:49:14 -0000 1.9 *************** *** 124,128 **** * um die Kartennamen bzw. die */ ! public abstract void retrieveMapNames(final MapNamesCallback callback); /** --- 124,128 ---- * um die Kartennamen bzw. die */ ! public abstract void retrieveMapNames(final MapNamesCallback callback, boolean openDialog); /** Index: SOAPServerManager.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller/SOAPServerManager.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SOAPServerManager.java 8 Nov 2005 11:24:19 -0000 1.4 --- SOAPServerManager.java 20 Feb 2006 08:49:14 -0000 1.5 *************** *** 149,153 **** * um die Kartennamen bzw. die */ ! public void retrieveMapNames(final MapNamesCallback callback){ if (isConnected()){ Thread getMapNamesThread = new Thread() { --- 149,153 ---- * um die Kartennamen bzw. die */ ! public void retrieveMapNames(final MapNamesCallback callback, final boolean openDialog){ if (isConnected()){ Thread getMapNamesThread = new Thread() { *************** *** 157,161 **** try{ String[] names = SOAPServerManager.this.mapDelegate.getMapNames(); ! callback.mapNamesReceived(names); } catch (Exception e){ e.printStackTrace(); --- 157,165 ---- try{ String[] names = SOAPServerManager.this.mapDelegate.getMapNames(); ! if (openDialog) { ! callback.openMapDialog(names); ! } else { ! callback.addMapNamesToOutline(names); ! } } catch (Exception e){ e.printStackTrace(); |
From: Florian L. <fle...@us...> - 2006-02-19 18:18:57
|
Update of /cvsroot/magicmap/magicmapserver/dblayer/src/net/sf/magicmap/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1622/dblayer/src/net/sf/magicmap/db Modified Files: GeoPosition.java Log Message: Index: GeoPosition.java =================================================================== RCS file: /cvsroot/magicmap/magicmapserver/dblayer/src/net/sf/magicmap/db/GeoPosition.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GeoPosition.java 19 Feb 2006 16:33:26 -0000 1.3 --- GeoPosition.java 19 Feb 2006 18:18:46 -0000 1.4 *************** *** 12,16 **** * vendor-name="jpox" * key="table-name" ! * value="position" * @jdo.class-vendor-extension * vendor-name="jpox" key="use-poid-generator" --- 12,16 ---- * vendor-name="jpox" * key="table-name" ! * value="geoposition" * @jdo.class-vendor-extension * vendor-name="jpox" key="use-poid-generator" |
From: Florian L. <fle...@us...> - 2006-02-19 17:44:07
|
Update of /cvsroot/magicmap/magicmapserver/dblayer/src/net/sf/magicmap/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16660/dblayer/src/net/sf/magicmap/db Modified Files: Map.java Log Message: Index: Map.java =================================================================== RCS file: /cvsroot/magicmap/magicmapserver/dblayer/src/net/sf/magicmap/db/Map.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Map.java 23 Jan 2005 18:10:52 -0000 1.2 --- Map.java 19 Feb 2006 17:43:58 -0000 1.3 *************** *** 123,126 **** --- 123,138 ---- /** + * Positionen für diese Karte + * + * @jdo.field + * persistence-modifier="persistent" + * collection-type="collection" + * element-type="GeoPosition" + * dependent="true" + * mapped-by="map" + **/ + Collection GeoPositions = new HashSet(); + + /** * @param name * @param imageURL *************** *** 243,245 **** --- 255,273 ---- this.imageWidth = imageWidth; } + + /** + * @return Returns the geoPositions. + */ + + public Collection getGeoPositions() { + return GeoPositions; + } + + public void addGeoPosition(GeoPosition p){ + this.positions.add(p); + } + + public void removeGeoPosition(GeoPosition p){ + this.positions.remove(p); + } } \ No newline at end of file |
From: Florian L. <fle...@us...> - 2006-02-19 16:33:32
|
Update of /cvsroot/magicmap/magicmapserver/dblayer/src/net/sf/magicmap/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17428/dblayer/src/net/sf/magicmap/db Modified Files: GeoPosition.java Log Message: update icon on fixstate change of a node Index: GeoPosition.java =================================================================== RCS file: /cvsroot/magicmap/magicmapserver/dblayer/src/net/sf/magicmap/db/GeoPosition.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GeoPosition.java 17 Feb 2006 16:15:28 -0000 1.2 --- GeoPosition.java 19 Feb 2006 16:33:26 -0000 1.3 *************** *** 20,23 **** --- 20,26 ---- * value="org.jpox.poid.SequenceTablePoidGenerator" */ + /** + * @author Florian + */ public class GeoPosition { *************** *** 67,72 **** --- 70,99 ---- int posY; + + /** + * Latitude der GeoPosition + * + * @jdo.field + * persistence-modifier="persistent" + * null-value="exception" + */ int latitude; + + /** + * Longgitude der GeoPosition + * + * @jdo.field + * persistence-modifier="persistent" + * null-value="exception" + */ int longitude; + + /** + * Altitude der GeoPosition + * + * @jdo.field + * persistence-modifier="persistent" + * null-value="exception" + */ int altitude; *************** *** 77,81 **** * @param posY */ ! public GeoPosition(Map map, int posX, int posY) { super(); --- 104,108 ---- * @param posY */ ! public GeoPosition(Map map, int posX, int posY, int latitude, int longitude, int altitude) { super(); *************** *** 83,87 **** this.posX = posX; this.posY = posY; ! } --- 110,116 ---- this.posX = posX; this.posY = posY; ! this.latitude = latitude; ! this.longitude = longitude; ! this.altitude = altitude; } *************** *** 113,129 **** return this.posY; } ! /** ! * @param posX The posX to set. */ ! public void setPosX(int posX){ ! this.posX = posX; } /** ! * @param posY The posY to set. */ ! public void setPosY(int posY){ ! this.posY = posY; } } --- 142,208 ---- return this.posY; } ! /** ! * @return Returns the latitude. */ ! public int getLatitude() { ! return latitude; ! } ! ! /** ! * @return Returns the longitude. ! */ ! public int getLongitude() { ! return longitude; } /** ! * @return Returns the altitude. */ ! public int getAltitude() { ! return altitude; } + + /** + * @param altitude The altitude to set. + */ + public void setAltitude(int altitude) { + this.altitude = altitude; + } + + /** + * @param latitude The latitude to set. + */ + public void setLatitude(int latitude) { + this.latitude = latitude; + } + + /** + * @param longitude The longitude to set. + */ + public void setLongitude(int longitude) { + this.longitude = longitude; + } + + /** + * @param map The map to set. + */ + public void setMap(Map map) { + this.map = map; + } + + /** + * @param posX The posX to set. + */ + public void setPosX(int posX) { + this.posX = posX; + } + + /** + * @param posY The posY to set. + */ + public void setPosY(int posY) { + this.posY = posY; + } + } |
From: Andreas W. <an...@us...> - 2006-02-17 16:15:33
|
Update of /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/facade In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30130/src/net/sf/magicmap/server/facade Modified Files: MapFacade.java Log Message: Index: MapFacade.java =================================================================== RCS file: /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/facade/MapFacade.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** MapFacade.java 15 Feb 2006 12:23:35 -0000 1.8 --- MapFacade.java 17 Feb 2006 16:15:28 -0000 1.9 *************** *** 14,17 **** --- 14,18 ---- import net.sf.magicmap.db.Map; import net.sf.magicmap.db.Session; + import net.sf.magicmap.server.dto.GeoPointDTO; import net.sf.magicmap.server.dto.StringReplacementDTO; import net.sf.magicmap.server.dto.MapDTO; *************** *** 178,181 **** --- 179,187 ---- return result; } + + public GeoPointDTO [] getGeoPointsForMap(String mapName){ + //TODO: implement method + return null; + } /** |
From: Andreas W. <an...@us...> - 2006-02-17 16:15:33
|
Update of /cvsroot/magicmap/magicmapserver/dblayer/src/net/sf/magicmap/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30130/dblayer/src/net/sf/magicmap/db Modified Files: GeoPosition.java Log Message: Index: GeoPosition.java =================================================================== RCS file: /cvsroot/magicmap/magicmapserver/dblayer/src/net/sf/magicmap/db/GeoPosition.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GeoPosition.java 14 Feb 2006 16:02:19 -0000 1.1 --- GeoPosition.java 17 Feb 2006 16:15:28 -0000 1.2 *************** *** 72,83 **** /** - * AccessPoints, die diese Hardware haben - * - * @jdo.field - * persistence-modifier="persistent" - */ - AccessPoint accessPoint; - - /** * * @param map --- 72,75 ---- |
From: Andreas W. <an...@us...> - 2006-02-17 16:12:58
|
Update of /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/dto In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28837/src/net/sf/magicmap/server/dto Modified Files: MapDTO.java Added Files: GeoPointDTO.java Log Message: --- NEW FILE: GeoPointDTO.java --- package net.sf.magicmap.server.dto; /** * @author Andreas Weiss und Florian Lederer * */ public class GeoPointDTO { private Long id; // Geokoordinaten in Millisekunden private Integer geoPointX; private Integer geoPointY; private Integer geoPointLat; private Integer geoPointLong; private Integer geoPointAlt; /** * @return */ public Integer getGeoPointAlt() { return geoPointAlt; } /** * @param geoPointAlt */ public void setGeoPointAlt(Integer geoPointAlt) { this.geoPointAlt = geoPointAlt; } /** * @return */ public Integer getGeoPointLat() { return geoPointLat; } /** * @param geoPointLat */ public void setGeoPointLat(Integer geoPointLat) { this.geoPointLat = geoPointLat; } /** * @return */ public Integer getGeoPointLong() { return geoPointLong; } /** * @param geoPointLong */ public void setGeoPointLong(Integer geoPointLong) { this.geoPointLong = geoPointLong; } /** * @return */ public Integer getGeoPointX() { return geoPointX; } public void setGeoPointX(Integer geoPointX) { this.geoPointX = geoPointX; } public Integer getGeoPointY() { return geoPointY; } public void setGeoPointY(Integer geoPointY) { this.geoPointY = geoPointY; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } } Index: MapDTO.java =================================================================== RCS file: /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/dto/MapDTO.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MapDTO.java 10 Feb 2006 15:01:14 -0000 1.5 --- MapDTO.java 17 Feb 2006 16:12:34 -0000 1.6 *************** *** 80,120 **** } public Integer getGeoPoint2X(){ ! return this.geoPoint1X; } public Integer getGeoPoint2Y(){ ! return this.geoPoint1Y; } public Integer getGeoPoint2Lat(){ ! return this.geoPoint1Lat; } public Integer getGeoPoint2Long(){ ! return this.geoPoint1Long; } public Integer getGeoPoint2Alt(){ ! return this.geoPoint1Alt; } public Integer getGeoPoint3X(){ ! return this.geoPoint1X; } public Integer getGeoPoint3Y(){ ! return this.geoPoint1Y; } public Integer getGeoPoint3Lat(){ ! return this.geoPoint1Lat; } public Integer getGeoPoint3Long(){ ! return this.geoPoint1Long; } public Integer getGeoPoint3Alt(){ ! return this.geoPoint1Alt; } --- 80,120 ---- } public Integer getGeoPoint2X(){ ! return this.geoPoint2X; } public Integer getGeoPoint2Y(){ ! return this.geoPoint2Y; } public Integer getGeoPoint2Lat(){ ! return this.geoPoint2Lat; } public Integer getGeoPoint2Long(){ ! return this.geoPoint2Long; } public Integer getGeoPoint2Alt(){ ! return this.geoPoint2Alt; } public Integer getGeoPoint3X(){ ! return this.geoPoint3X; } public Integer getGeoPoint3Y(){ ! return this.geoPoint3Y; } public Integer getGeoPoint3Lat(){ ! return this.geoPoint3Lat; } public Integer getGeoPoint3Long(){ ! return this.geoPoint3Long; } public Integer getGeoPoint3Alt(){ ! return this.geoPoint3Alt; } |