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: <fle...@us...> - 2008-02-11 12:59:49
|
Revision: 733 http://magicmap.svn.sourceforge.net/magicmap/?rev=733&view=rev Author: flederohr Date: 2008-02-11 04:22:53 -0800 (Mon, 11 Feb 2008) Log Message: ----------- reverted last changes Modified Paths: -------------- trunk/magicmapclient/build.xml Modified: trunk/magicmapclient/build.xml =================================================================== --- trunk/magicmapclient/build.xml 2008-02-07 21:27:03 UTC (rev 732) +++ trunk/magicmapclient/build.xml 2008-02-11 12:22:53 UTC (rev 733) @@ -89,9 +89,9 @@ </target> <target name="axis" depends="prepare"> - <axis-wsdl2java output="${src.gen}" testcase="false" verbose="false" noimports="true" debug="false" url="file:/${basedir}/inf/PositionFacade.wsdl" /> - <axis-wsdl2java output="${src.gen}" testcase="false" verbose="false" noimports="true" debug="false" url="file:/${basedir}/inf/SessionFacade.wsdl" /> - <axis-wsdl2java output="${src.gen}" testcase="false" verbose="false" noimports="true" debug="false" url="file:/${basedir}/inf/MapFacade.wsdl" /> + <axis-wsdl2java output="${src.gen}" testcase="false" verbose="false" noimports="true" debug="false" url="inf/PositionFacade.wsdl" /> + <axis-wsdl2java output="${src.gen}" testcase="false" verbose="false" noimports="true" debug="false" url="inf/SessionFacade.wsdl" /> + <axis-wsdl2java output="${src.gen}" testcase="false" verbose="false" noimports="true" debug="false" url="inf/MapFacade.wsdl" /> </target> <target name="compile" depends="axis"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jan...@us...> - 2008-02-07 22:02:14
|
Revision: 732 http://magicmap.svn.sourceforge.net/magicmap/?rev=732&view=rev Author: jan_fride Date: 2008-02-07 13:27:03 -0800 (Thu, 07 Feb 2008) Log Message: ----------- changed uris to strings Modified Paths: -------------- trunk/magicmapclient/src/net/sf/magicmap/core/model/node/IMagicNode.java trunk/magicmapclient/src/net/sf/magicmap/core/model/node/IMagicNodeModel.java trunk/magicmapclient/src/net/sf/magicmap/core/model/node/NodeKeyFunction.java trunk/magicmapclient/src/net/sf/magicmap/core/model/node/impl/MagicNode.java trunk/magicmapclient/src/net/sf/magicmap/core/model/node/impl/MagicNodeModel.java Removed Paths: ------------- trunk/magicmapclient/src/net/sf/magicmap/core/model/URI.java trunk/magicmapclient/src/net/sf/magicmap/core/model/UnsupportedUriException.java trunk/magicmapclient/src/net/sf/magicmap/core/model/impl/URIImpl.java Deleted: trunk/magicmapclient/src/net/sf/magicmap/core/model/URI.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/core/model/URI.java 2008-02-04 15:51:35 UTC (rev 731) +++ trunk/magicmapclient/src/net/sf/magicmap/core/model/URI.java 2008-02-07 21:27:03 UTC (rev 732) @@ -1,42 +0,0 @@ -package net.sf.magicmap.core.model; - -import java.net.URL; - -/** - * <p> - * Class URI ZUSAMMENFASSUNG - * </p> - * <p> - * DETAILS - * </p> - * - * @author Jan Friderici - * Date: 21.01.2008 - * Time: 21:52:54 - */ -public interface URI { - /** - * Get the protocol. - * @return - */ - String getProtocol(); - - /** - * Return the uri as string.... - * @return - */ - String toString(); - - /** - * - * @return - */ - java.net.URI toJavaURI(); - - /** - * - * @return - * @throws UnsupportedUriException - */ - URL toJavaURL() throws UnsupportedUriException; -} Deleted: trunk/magicmapclient/src/net/sf/magicmap/core/model/UnsupportedUriException.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/core/model/UnsupportedUriException.java 2008-02-04 15:51:35 UTC (rev 731) +++ trunk/magicmapclient/src/net/sf/magicmap/core/model/UnsupportedUriException.java 2008-02-07 21:27:03 UTC (rev 732) @@ -1,28 +0,0 @@ -package net.sf.magicmap.core.model; - -/** - * <p> - * Class UnsupportedUriException ZUSAMMENFASSUNG - * </p> - * <p> - * DETAILS - * </p> - * - * @author Jan Friderici - * Date: 21.01.2008 - * Time: 21:53:51 - */ -public class UnsupportedUriException extends RuntimeException { - - public UnsupportedUriException(String s) { - super(s); - } - - public UnsupportedUriException(String s, Throwable throwable) { - super(s, throwable); - } - - public UnsupportedUriException(Throwable throwable) { - super(throwable); - } -} Deleted: trunk/magicmapclient/src/net/sf/magicmap/core/model/impl/URIImpl.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/core/model/impl/URIImpl.java 2008-02-04 15:51:35 UTC (rev 731) +++ trunk/magicmapclient/src/net/sf/magicmap/core/model/impl/URIImpl.java 2008-02-07 21:27:03 UTC (rev 732) @@ -1,67 +0,0 @@ -package net.sf.magicmap.core.model.impl; - -import net.sf.magicmap.core.model.URI; -import net.sf.magicmap.core.model.UnsupportedUriException; - -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; - -/** - * <p> - * Class URIImpl ZUSAMMENFASSUNG - * </p> - * <p> - * DETAILS - * </p> - * - * @author Jan Friderici - * Date: 13.01.2008 - * Time: 11:35:41 - */ -public class URIImpl implements URI { - private final String uri; - - - public URIImpl(String uri) { - this.uri = uri; - } - - /** - * - * @return - */ - public String getProtocol() { - return uri.substring(0, uri.indexOf(":")); - } - - public String toString() { - return uri; - } - - /** - * - * @return - */ - public java.net.URI toJavaURI() { - try { - return new java.net.URI(uri); - } catch (URISyntaxException e) { - throw new UnsupportedUriException(e); - } - } - - /** - * - * @return - * @throws UnsupportedUriException - */ - public URL toJavaURL() throws UnsupportedUriException { - try { - return new java.net.URL(uri); - } catch (MalformedURLException e) { - throw new UnsupportedUriException(e); - } - } - -} Modified: trunk/magicmapclient/src/net/sf/magicmap/core/model/node/IMagicNode.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/core/model/node/IMagicNode.java 2008-02-04 15:51:35 UTC (rev 731) +++ trunk/magicmapclient/src/net/sf/magicmap/core/model/node/IMagicNode.java 2008-02-07 21:27:03 UTC (rev 732) @@ -2,7 +2,6 @@ import net.sf.magicmap.client.model.node.INode; import net.sf.magicmap.client.model.node.Node; -import net.sf.magicmap.core.model.URI; /** * <p> @@ -20,15 +19,15 @@ /** * <p>Get the server the nodes is stored.</p> - * @return the server id the node is stored with. + * @return the server id the perception is stored with. */ - URI getServerID(); + String getServerID(); /** * <p>The nodes id. This ID will vary depending....</p> - * @return a unique id for this node. + * @return a unique id for this perception. */ - URI getNodeID(); + String getNodeID(); /** * <p>For objects that need the old class.</p> Modified: trunk/magicmapclient/src/net/sf/magicmap/core/model/node/IMagicNodeModel.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/core/model/node/IMagicNodeModel.java 2008-02-04 15:51:35 UTC (rev 731) +++ trunk/magicmapclient/src/net/sf/magicmap/core/model/node/IMagicNodeModel.java 2008-02-07 21:27:03 UTC (rev 732) @@ -2,7 +2,6 @@ import net.sf.magicmap.client.model.node.INode; import net.sf.magicmap.client.model.node.INodeModel; -import net.sf.magicmap.core.model.URI; import java.util.List; @@ -21,10 +20,10 @@ public interface IMagicNodeModel extends INodeModel { /** - * <p>return the server this node model is connected with - if any.</p> + * <p>return the server this perception model is connected with - if any.</p> * @return the uri for the connected server. */ - URI getServerID(); + String getServerID(); /** * @@ -34,8 +33,8 @@ /** - * get an magic node. - * @param node the magic node to get. + * get an magic perception. + * @param node the magic perception to get. * @return */ IMagicNode getMagicNode(INode node); Modified: trunk/magicmapclient/src/net/sf/magicmap/core/model/node/NodeKeyFunction.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/core/model/node/NodeKeyFunction.java 2008-02-04 15:51:35 UTC (rev 731) +++ trunk/magicmapclient/src/net/sf/magicmap/core/model/node/NodeKeyFunction.java 2008-02-07 21:27:03 UTC (rev 732) @@ -21,8 +21,8 @@ Class<N> getNodeClass(); /** - * Calculate a key for the given node. - * @param node the node to create a key for. + * Calculate a key for the given perception. + * @param node the perception to create a key for. * @return */ K key(N node); Modified: trunk/magicmapclient/src/net/sf/magicmap/core/model/node/impl/MagicNode.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/core/model/node/impl/MagicNode.java 2008-02-04 15:51:35 UTC (rev 731) +++ trunk/magicmapclient/src/net/sf/magicmap/core/model/node/impl/MagicNode.java 2008-02-07 21:27:03 UTC (rev 732) @@ -2,8 +2,6 @@ import net.sf.magicmap.client.model.node.Node; import net.sf.magicmap.client.model.node.NodeContainer; -import net.sf.magicmap.core.model.URI; -import net.sf.magicmap.core.model.impl.URIImpl; import net.sf.magicmap.core.model.node.IMagicNode; import net.sf.magicmap.core.model.node.IMagicNodeModel; @@ -25,15 +23,15 @@ public class MagicNode implements IMagicNode { private final Node delegate; private final IMagicNodeModel magicNodeModel; - private final URI nodeURI; + private final String nodeURI; public MagicNode(Node delegate, IMagicNodeModel magicNodeModel) { this.delegate = delegate; this.magicNodeModel = magicNodeModel; - nodeURI = new URIImpl( - magicNodeModel.getServerID().toString() + nodeURI = + magicNodeModel.getServerID() + "/" + delegate.getType() - + " /" + delegate.getId()); + + " /" + delegate.getId(); } @@ -141,11 +139,11 @@ return delegate.getNodeContainer(); } - public URI getServerID() { + public String getServerID() { return getModel().getServerID(); } - public URI getNodeID() { + public String getNodeID() { return nodeURI; } Modified: trunk/magicmapclient/src/net/sf/magicmap/core/model/node/impl/MagicNodeModel.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/core/model/node/impl/MagicNodeModel.java 2008-02-04 15:51:35 UTC (rev 731) +++ trunk/magicmapclient/src/net/sf/magicmap/core/model/node/impl/MagicNodeModel.java 2008-02-07 21:27:03 UTC (rev 732) @@ -4,8 +4,6 @@ import net.sf.magicmap.client.meta.MapInfo; import net.sf.magicmap.client.model.location.INodePlacer; import net.sf.magicmap.client.model.node.*; -import net.sf.magicmap.core.model.URI; -import net.sf.magicmap.core.model.impl.URIImpl; import net.sf.magicmap.core.model.node.IMagicNode; import net.sf.magicmap.core.model.node.IMagicNodeModel; import net.sf.magicmap.core.model.node.INodeIndex; @@ -27,7 +25,7 @@ */ public class MagicNodeModel implements IMagicNodeModel { private final INodeModel delegate; - private URI serverID; + private String serverID; private final WeakHashMap<Node, IMagicNode> nodeMap = new WeakHashMap<Node, IMagicNode>(); @@ -42,10 +40,6 @@ } - public void setServerID(String serverURL) { - serverID = new URIImpl(serverURL); - } - /** * <p>Create an index to find nodes with a quicknesssssss..</\x9F> * @param function the function to use. @@ -105,7 +99,7 @@ * * @return get the id of the server.... */ - public URI getServerID() { + public String getServerID() { return serverID; } @@ -113,7 +107,7 @@ * * @param serverID */ - public void setServerID(URI serverID) { + public void setServerID(String serverID) { this.serverID = serverID; } @@ -217,7 +211,7 @@ } /** - * Returns the rotigionals node placer. + * Returns the rotigionals perception placer. * @return */ public INodePlacer getNodePlacer() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-02-04 17:00:03
|
Revision: 731 http://magicmap.svn.sourceforge.net/magicmap/?rev=731&view=rev Author: anweiss Date: 2008-02-04 07:51:35 -0800 (Mon, 04 Feb 2008) Log Message: ----------- renamed pollintevall to pollinterval and selected the correct pollinterval in the options menu at startup Modified Paths: -------------- trunk/magicmapclient/src/net/sf/magicmap/client/controller/ServerPoller.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainFrame.java trunk/magicmapclient/src/net/sf/magicmap/client/utils/Settings.java Modified: trunk/magicmapclient/src/net/sf/magicmap/client/controller/ServerPoller.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/controller/ServerPoller.java 2008-02-04 15:43:54 UTC (rev 730) +++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/ServerPoller.java 2008-02-04 15:51:35 UTC (rev 731) @@ -40,7 +40,7 @@ } public void start(){ - this.timer.scheduleAtFixedRate(pollPositionsTimerTask(), Settings.POLL_DELAY, Settings.getPollIntevall()); + this.timer.scheduleAtFixedRate(pollPositionsTimerTask(), Settings.POLL_DELAY, Settings.getPollInterval()); this.timer.scheduleAtFixedRate(pollGeoPointsTimerTask(), Settings.POLL_DELAY + 1000, 120000); } Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainFrame.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainFrame.java 2008-02-04 15:43:54 UTC (rev 730) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainFrame.java 2008-02-04 15:51:35 UTC (rev 731) @@ -253,7 +253,7 @@ menu.add(dataInvocationRate); for (int i = 0; i < MainFrame.numberOfdataInvocationRateAction; i++) dataInvocationRate.add(GUIBuilder.createCheckBoxMenuItem(this.dataInvocationRateAction[i], false)); - this.dataInvocationRateAction[4].setSelected(true); + this.dataInvocationRateAction[(Settings.getPollInterval()/1000)-1].setSelected(true); return menu; } @@ -590,7 +590,7 @@ } } }; - + this.homepageAction = new MagicAction("homepage") { /** @@ -806,7 +806,7 @@ for (int j = 0; j < MainFrame.numberOfdataInvocationRateAction; j++) MainFrame.this.dataInvocationRateAction[j].setSelected(false); MainFrame.this.dataInvocationRateAction[thisAction].setSelected(true); - Settings.setPollIntevall((thisAction + 1) * 1000); + Settings.setPollInterval((thisAction + 1) * 1000); Controller.getInstance().restartServerPoller(); } }; Modified: trunk/magicmapclient/src/net/sf/magicmap/client/utils/Settings.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/utils/Settings.java 2008-02-04 15:43:54 UTC (rev 730) +++ trunk/magicmapclient/src/net/sf/magicmap/client/utils/Settings.java 2008-02-04 15:51:35 UTC (rev 731) @@ -36,7 +36,7 @@ private static final String settingsFileName = "settings.ini"; private static final String SERVERNAMES_KEY = "servernames"; private static final String LASTSELECTEDSERVER_KEY = "lastselectedserver"; - private static final String POLLINTERVALL_KEY = "pollintevall"; + private static final String POLLINTERVAL_KEY = "pollinterval"; private static final String CLIENTNAME_KEY = "clientname"; private static final String STANDALONE_KEY = "standalone"; // private static final String VIEWOPTION_KEY = "viewoption"; @@ -55,7 +55,7 @@ private static ArrayList<String> default_server_list = new ArrayList<String>(); private static int lastSelectedServer = 0; public static final int TIMEOUT = 15000; - private static int pollIntevall = 5000; + private static int pollInterval = 5000; public static final long POLL_DELAY = 500; public static String WEBSERVICE_PATH = "/magicmap/services/"; @@ -80,12 +80,12 @@ Settings.clientMAC = clientMAC; } - public static int getPollIntevall(){ - return Settings.pollIntevall; + public static int getPollInterval(){ + return Settings.pollInterval; } - public static void setPollIntevall(int pollIntevall){ - Settings.pollIntevall = pollIntevall; + public static void setPollInterval(int pollInterval){ + Settings.pollInterval = pollInterval; } public static String getClientName(){ @@ -207,11 +207,11 @@ else // default value Settings.lastSelectedServer = 0; - if ((property = Settings.settingsProperties.getProperty(Settings.POLLINTERVALL_KEY)) != null) - Settings.pollIntevall = Integer.parseInt(property.trim()); + if ((property = Settings.settingsProperties.getProperty(Settings.POLLINTERVAL_KEY)) != null) + Settings.pollInterval = Integer.parseInt(property.trim()); else // default value - Settings.pollIntevall = 5000; + Settings.pollInterval = 5000; if ((property = Settings.settingsProperties.getProperty(Settings.CLIENTNAME_KEY)) != null) Settings.clientName = property.trim(); else @@ -282,7 +282,7 @@ Settings.settingsProperties.put(Settings.SERVERNAMES_KEY, property.substring(0, property.lastIndexOf(','))); Settings.settingsProperties.put(Settings.LASTSELECTEDSERVER_KEY, String .valueOf(Settings.lastSelectedServer)); - Settings.settingsProperties.put(Settings.POLLINTERVALL_KEY, String.valueOf(Settings.pollIntevall)); + Settings.settingsProperties.put(Settings.POLLINTERVAL_KEY, String.valueOf(Settings.pollInterval)); Settings.settingsProperties.put(Settings.CLIENTNAME_KEY, Settings.clientName); if (Settings.standAlone) property = "YES"; @@ -297,7 +297,7 @@ + "# This file stores the configuration for MagicMap. #" + newline + "# #" + newline + "####################################################################" + newline - + newline + "# Comma seperated list of default MagicMap-Servers" + newline + + newline + "# Comma separated list of default MagicMap-Servers" + newline + "# servernames= server-url1:port1, server-url2:port2 , ..." + newline + newline + "# lastselectedserver=index" + newline + newline + "# pollintevall=time in ms" + newline + newline + "# clientname=" + newline + newline + "# standalone=(YES|NO)"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fle...@us...> - 2008-02-04 16:59:42
|
Revision: 729 http://magicmap.svn.sourceforge.net/magicmap/?rev=729&view=rev Author: flederohr Date: 2008-02-04 07:22:07 -0800 (Mon, 04 Feb 2008) Log Message: ----------- Introduced new icon-concept Modified Paths: -------------- trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineTree.java Added Paths: ----------- trunk/magicmapclient/src/net/sf/magicmap/client/gui/icons/ trunk/magicmapclient/src/net/sf/magicmap/client/gui/icons/AccessPointNodeIcon.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/icons/ClientNodeIcon.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/icons/GeoPosNodeIcon.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/icons/LocationNodeIcon.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/icons/MapNodeIcon.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/icon/ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/icon/AbstractNodeIcon.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/icon/INodeIcon.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/icon/NodeIconAndPredicate.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/icon/NodeIconContainer.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/icon/NodeIconNotPredicate.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/icon/NodeIconOrPredicate.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/icon/NodeIconPredicate.java Removed Paths: ------------- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/AccessPointNodeIcon.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/ClientNodeIcon.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/GeoPosNodeIcon.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/INodeIcon.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/LocationNodeIcon.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/MapNodeIcon.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/NodeIcons.java Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java 2008-02-01 13:41:00 UTC (rev 728) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java 2008-02-04 15:22:07 UTC (rev 729) @@ -1,6 +1,5 @@ /* - * Created on 21.11.2004 - * Refactored on 15.02.2006 + * Created on 21.11.2004 Refactored on 15.02.2006 */ package net.sf.magicmap.client.gui; @@ -11,17 +10,19 @@ import javax.swing.JComponent; -import net.sf.magicmap.client.gui.utils.AccessPointNodeIcon; -import net.sf.magicmap.client.gui.utils.ClientNodeIcon; -import net.sf.magicmap.client.gui.utils.GeoPosNodeIcon; -import net.sf.magicmap.client.gui.utils.LocationNodeIcon; -import net.sf.magicmap.client.gui.utils.MapNodeIcon; -import net.sf.magicmap.client.gui.utils.NodeIcons; +import net.sf.magicmap.client.gui.icons.AccessPointNodeIcon; +import net.sf.magicmap.client.gui.icons.ClientNodeIcon; +import net.sf.magicmap.client.gui.icons.GeoPosNodeIcon; +import net.sf.magicmap.client.gui.icons.LocationNodeIcon; +import net.sf.magicmap.client.gui.icons.MapNodeIcon; +import net.sf.magicmap.client.gui.utils.icon.NodeIconContainer; import net.sf.magicmap.client.model.node.INodeSelectionModel; +import net.sf.magicmap.client.model.node.NodeModelConstants; import net.sf.magicmap.client.model.node.NodeSelectionModel; /** * The main GUI window + * * @author thuebner * @author Florian Lederer */ @@ -34,6 +35,7 @@ /** * Getter for the singleton instance of the main GUI + * * @return the main GUI (creates a new one if none exists) */ public static MainGUI getInstance(){ @@ -41,31 +43,30 @@ return MainGUI.mainGUI; } - private Map<String, JComponent> jComponentMap = new HashMap<String, JComponent>(); + private Map<String, JComponent> jComponentMap = new HashMap<String, JComponent>(); private INodeSelectionModel nodeSelectionModel; - private NodeIcons nodeIcons; + private NodeIconContainer nodeIconContainer; private MainFrame mainFrame; + public static final String VIEW_KEY_MAP_VIEW = "mapView"; + public static final String VIEW_KEY_MAP_PANEL = "mapPanel"; - public static final String VIEW_KEY_MAP_VIEW = "mapView"; - public static final String VIEW_KEY_MAP_PANEL = "mapPanel"; - /** - * Erzeugt Hauptfenster der Anwendung. - * Private constructor, only used by getInstance() to fulfill singleton pattern + * Erzeugt Hauptfenster der Anwendung. Private constructor, only used by + * getInstance() to fulfill singleton pattern */ private MainGUI() { // NodeSelectionModel nodeSelectionModel = new NodeSelectionModel(); - // NodeIcons - nodeIcons = NodeIcons.getInstance(); - nodeIcons.registerNodeIcon(new ClientNodeIcon()); - nodeIcons.registerNodeIcon(new AccessPointNodeIcon()); - nodeIcons.registerNodeIcon(new LocationNodeIcon()); - nodeIcons.registerNodeIcon(new GeoPosNodeIcon()); - nodeIcons.registerNodeIcon(new MapNodeIcon()); + // NodeIconContainer + nodeIconContainer = NodeIconContainer.getInstance(); + nodeIconContainer.registerNodeIcon(NodeModelConstants.NODETYPE_CLIENT, new ClientNodeIcon()); + nodeIconContainer.registerNodeIcon(NodeModelConstants.NODETYPE_ACCESSPOINT, new AccessPointNodeIcon()); + nodeIconContainer.registerNodeIcon(NodeModelConstants.NODETYPE_LOCATION, new LocationNodeIcon()); + nodeIconContainer.registerNodeIcon(NodeModelConstants.NODETYPE_GEOPOS, new GeoPosNodeIcon()); + nodeIconContainer.registerNodeIcon(NodeModelConstants.NODETYPE_MAP, new MapNodeIcon()); } /** @@ -95,7 +96,7 @@ return nodeSelectionModel; } - public NodeIcons getNodeIcons(){ - return nodeIcons; + public NodeIconContainer getNodeIconContainer(){ + return nodeIconContainer; } } Copied: trunk/magicmapclient/src/net/sf/magicmap/client/gui/icons/AccessPointNodeIcon.java (from rev 726, trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/AccessPointNodeIcon.java) =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/icons/AccessPointNodeIcon.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/icons/AccessPointNodeIcon.java 2008-02-04 15:22:07 UTC (rev 729) @@ -0,0 +1,108 @@ + +package net.sf.magicmap.client.gui.icons; + +import java.awt.Color; + +import net.sf.magicmap.client.gui.utils.GUIBuilder; +import net.sf.magicmap.client.gui.utils.icon.AbstractNodeIcon; +import net.sf.magicmap.client.gui.utils.icon.NodeIconAndPredicate; +import net.sf.magicmap.client.gui.utils.icon.NodeIconPredicate; +import net.sf.magicmap.client.model.node.AccessPointNode; +import net.sf.magicmap.client.model.node.Node; + +/** + * @author Florian Lederer + */ +public class AccessPointNodeIcon extends AbstractNodeIcon { + + private final NodeIconPredicate apIsHiddenPredicate = new NodeIconPredicate() { + + public boolean showIcon(Node node){ + return ((AccessPointNode) node).isHidden(); + }; + }; + + private final NodeIconPredicate apIsFixPredicate = new NodeIconPredicate() { + + public boolean showIcon(Node node){ + return ((AccessPointNode) node).isFix(); + }; + }; + + private final NodeIconPredicate apIsHiddenAndFixPredicate = new NodeIconAndPredicate(apIsHiddenPredicate, + apIsFixPredicate); + + public AccessPointNodeIcon() { + super(); + + try { + + addBackgroundIcon(GUIBuilder.getToolIcon("accesspoint.png", "NodeIcons"), NodeIconPredicate.TRUE); + addBackgroundIcon(GUIBuilder.getToolIcon("accesspoint_hidden.png", "NodeIcons"), apIsHiddenPredicate); + + addOverlayIcon(GUIBuilder.getToolIcon("anchor_white.png", "NodeIcons"), apIsFixPredicate); + addOverlayIcon(GUIBuilder.getToolIcon("anchor_black.png", "NodeIcons"), apIsHiddenAndFixPredicate); + + } catch (SecurityException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + // + // ImageIcon accessPoint; + // ImageIcon accessPointFixed; + // ImageIcon accessPointHidden; + // ImageIcon accessPointHiddenFixed; + // + // private ImageIcon getAccessPoint(){ + // if (accessPoint == null) accessPoint = GUIBuilder.getToolIcon("accesspoint.png", "NodeIconContainer"); + // return accessPoint; + // } + // + // private ImageIcon getAccessPointFixed(){ + // if (accessPointFixed == null) { + // final ImageIcon anchor = GUIBuilder.getToolIcon("anchor_white.png", "NodeIconContainer"); + // accessPointFixed = new ImageIcon(getAccessPoint().getImage()) { + // + // @Override + // public synchronized void paintIcon(Component c, Graphics g, int x, int y){ + // super.paintIcon(c, g, x, y); + // g.drawImage(anchor.getImage(), x, y, x + getIconWidth(), y + getIconHeight(), 0, 0, anchor + // .getIconWidth(), anchor.getIconHeight(), null); + // } + // }; + // } + // return accessPointFixed; + // } + // + // private ImageIcon getAccessPointHidden(){ + // if (accessPointHidden == null) + // accessPointHidden = GUIBuilder.getToolIcon("accesspoint_hidden.png", "NodeIconContainer"); + // return accessPointHidden; + // } + // + // private ImageIcon getAccessPointHiddenFixed(){ + // if (accessPointHiddenFixed == null) { + // final ImageIcon anchor = GUIBuilder.getToolIcon("anchor_black.png", "NodeIconContainer"); + // accessPointHiddenFixed = new ImageIcon(getAccessPointHidden().getImage()) { + // + // @Override + // public synchronized void paintIcon(Component c, Graphics g, int x, int y){ + // super.paintIcon(c, g, x, y); + // g.drawImage(anchor.getImage(), x, y, x + getIconWidth(), y + getIconHeight(), 0, 0, anchor + // .getIconWidth(), anchor.getIconHeight(), null); + // } + // }; + // } + // return accessPointHiddenFixed; + // } + + public Color getBgColor(Node node){ + return Color.RED; + } + + public Color getFgColor(Node node){ + return Color.BLACK; + } +} Copied: trunk/magicmapclient/src/net/sf/magicmap/client/gui/icons/ClientNodeIcon.java (from rev 726, trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/ClientNodeIcon.java) =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/icons/ClientNodeIcon.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/icons/ClientNodeIcon.java 2008-02-04 15:22:07 UTC (rev 729) @@ -0,0 +1,42 @@ + +package net.sf.magicmap.client.gui.icons; + +import java.awt.Color; + +import net.sf.magicmap.client.gui.utils.GUIBuilder; +import net.sf.magicmap.client.gui.utils.icon.AbstractNodeIcon; +import net.sf.magicmap.client.gui.utils.icon.NodeIconPredicate; +import net.sf.magicmap.client.model.node.Node; + +/** + * @author Florian Lederer + */ +public class ClientNodeIcon extends AbstractNodeIcon { + + private final NodeIconPredicate clientIsFixPredicate = new NodeIconPredicate() { + + public boolean showIcon(Node node){ + return node.isFix(); + } + }; + + public ClientNodeIcon() { + super(); + try { + addBackgroundIcon(GUIBuilder.getToolIcon("client.png", "NodeIcons"), NodeIconPredicate.TRUE); + addOverlayIcon(GUIBuilder.getToolIcon("anchor_black.png", "NodeIcons"), clientIsFixPredicate); + } catch (SecurityException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + public Color getBgColor(Node node){ + return Color.GREEN; + } + + public Color getFgColor(Node node){ + return Color.BLACK; + } + +} Copied: trunk/magicmapclient/src/net/sf/magicmap/client/gui/icons/GeoPosNodeIcon.java (from rev 726, trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/GeoPosNodeIcon.java) =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/icons/GeoPosNodeIcon.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/icons/GeoPosNodeIcon.java 2008-02-04 15:22:07 UTC (rev 729) @@ -0,0 +1,31 @@ + +package net.sf.magicmap.client.gui.icons; + +import java.awt.Color; + +import net.sf.magicmap.client.gui.utils.GUIBuilder; +import net.sf.magicmap.client.gui.utils.icon.AbstractNodeIcon; +import net.sf.magicmap.client.gui.utils.icon.NodeIconPredicate; +import net.sf.magicmap.client.model.node.Node; + +/** + * @author Florian Lederer + */ +public class GeoPosNodeIcon extends AbstractNodeIcon { + + // if (geoPos == null) geoPos = GUIBuilder.getToolIcon("geopos.png", "NodeIconContainer"); + // if (geoPosBig == null) geoPosBig = GUIBuilder.getToolIcon("geopos_big.png", "NodeIconContainer"); + + public GeoPosNodeIcon() { + super(); + addBackgroundIcon(GUIBuilder.getToolIcon("geopos.png", "NodeIcons"), NodeIconPredicate.TRUE); + } + + public Color getBgColor(Node node){ + return Color.YELLOW; + } + + public Color getFgColor(Node node){ + return Color.BLACK; + } +} Copied: trunk/magicmapclient/src/net/sf/magicmap/client/gui/icons/LocationNodeIcon.java (from rev 726, trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/LocationNodeIcon.java) =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/icons/LocationNodeIcon.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/icons/LocationNodeIcon.java 2008-02-04 15:22:07 UTC (rev 729) @@ -0,0 +1,44 @@ + +package net.sf.magicmap.client.gui.icons; + +import java.awt.Color; + +import net.sf.magicmap.client.gui.utils.GUIBuilder; +import net.sf.magicmap.client.gui.utils.icon.AbstractNodeIcon; +import net.sf.magicmap.client.gui.utils.icon.NodeIconPredicate; +import net.sf.magicmap.client.model.node.LocationNode; +import net.sf.magicmap.client.model.node.Node; + +/** + * @author Florian Lederer + */ +public class LocationNodeIcon extends AbstractNodeIcon { + + private NodeIconPredicate locationUpdateIconPredicate = new NodeIconPredicate() { + + public boolean showIcon(Node node){ + return ((LocationNode) node).isUpdate(); + } + }; + + public LocationNodeIcon() { + super(); + try { + addBackgroundIcon(GUIBuilder.getToolIcon("location.png", "NodeIcons"), NodeIconPredicate.TRUE); + addBackgroundIcon(GUIBuilder.getToolIcon("location_rescan.png", "NodeIcons"), locationUpdateIconPredicate); + } catch (SecurityException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + @Override + public Color getBgColor(Node node){ + return Color.BLUE; + } + + @Override + public Color getFgColor(Node node){ + return Color.BLACK; + } +} Copied: trunk/magicmapclient/src/net/sf/magicmap/client/gui/icons/MapNodeIcon.java (from rev 726, trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/MapNodeIcon.java) =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/icons/MapNodeIcon.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/icons/MapNodeIcon.java 2008-02-04 15:22:07 UTC (rev 729) @@ -0,0 +1,30 @@ + +package net.sf.magicmap.client.gui.icons; + +import java.awt.Color; + +import net.sf.magicmap.client.gui.utils.GUIBuilder; +import net.sf.magicmap.client.gui.utils.icon.AbstractNodeIcon; +import net.sf.magicmap.client.gui.utils.icon.NodeIconPredicate; +import net.sf.magicmap.client.model.node.Node; + +/** + * @author Florian Lederer + */ +public class MapNodeIcon extends AbstractNodeIcon { + + public MapNodeIcon() { + super(); + addBackgroundIcon(GUIBuilder.getToolIcon("map.png", "NodeIcons"), NodeIconPredicate.TRUE); + } + + @Override + public Color getBgColor(Node node){ + return Color.GRAY; + } + + @Override + public Color getFgColor(Node node){ + return Color.BLACK; + } +} Deleted: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/AccessPointNodeIcon.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/AccessPointNodeIcon.java 2008-02-01 13:41:00 UTC (rev 728) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/AccessPointNodeIcon.java 2008-02-04 15:22:07 UTC (rev 729) @@ -1,98 +0,0 @@ - -package net.sf.magicmap.client.gui.utils; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Graphics; - -import javax.swing.Icon; -import javax.swing.ImageIcon; - -import net.sf.magicmap.client.model.node.AccessPointNode; -import net.sf.magicmap.client.model.node.INodeModel; -import net.sf.magicmap.client.model.node.Node; - -/** - * @author Florian Lederer - */ -public class AccessPointNodeIcon implements INodeIcon { - - ImageIcon accessPoint; - ImageIcon accessPointFixed; - ImageIcon accessPointHidden; - ImageIcon accessPointHiddenFixed; - - private ImageIcon getAccessPoint(){ - if (accessPoint == null) accessPoint = GUIBuilder.getToolIcon("accesspoint.png", "NodeIcons"); - return accessPoint; - } - - private ImageIcon getAccessPointFixed(){ - if (accessPointFixed == null) { - final ImageIcon anchor = GUIBuilder.getToolIcon("anchor_white.png", "NodeIcons"); - accessPointFixed = new ImageIcon(getAccessPoint().getImage()) { - - @Override - public synchronized void paintIcon(Component c, Graphics g, int x, int y){ - super.paintIcon(c, g, x, y); - g.drawImage(anchor.getImage(), x, y, x + getIconWidth(), y + getIconHeight(), 0, 0, anchor - .getIconWidth(), anchor.getIconHeight(), null); - } - }; - } - return accessPointFixed; - } - - private ImageIcon getAccessPointHidden(){ - if (accessPointHidden == null) - accessPointHidden = GUIBuilder.getToolIcon("accesspoint_hidden.png", "NodeIcons"); - return accessPointHidden; - } - - private ImageIcon getAccessPointHiddenFixed(){ - if (accessPointHiddenFixed == null) { - final ImageIcon anchor = GUIBuilder.getToolIcon("anchor_black.png", "NodeIcons"); - accessPointHiddenFixed = new ImageIcon(getAccessPointHidden().getImage()) { - - @Override - public synchronized void paintIcon(Component c, Graphics g, int x, int y){ - super.paintIcon(c, g, x, y); - g.drawImage(anchor.getImage(), x, y, x + getIconWidth(), y + getIconHeight(), 0, 0, anchor - .getIconWidth(), anchor.getIconHeight(), null); - } - }; - } - return accessPointHiddenFixed; - } - - public Color getBgColor(Node node){ - return Color.BLACK; - } - - public Color getFgColor(Node node){ - return Color.BLACK; - } - - public Icon getIcon(Node node){ - AccessPointNode ap = (AccessPointNode) node; - if (ap.isHidden()) { - if (ap.isFix()) - return getAccessPointHiddenFixed(); - else - return getAccessPointHidden(); - } else { - if (ap.isFix()) - return getAccessPointFixed(); - else - return getAccessPoint(); - } - } - - public Class getNodeClass(){ - return AccessPointNode.class; - } - - public int getNodeType(){ - return INodeModel.NODETYPE_ACCESSPOINT; - } -} Deleted: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/ClientNodeIcon.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/ClientNodeIcon.java 2008-02-01 13:41:00 UTC (rev 728) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/ClientNodeIcon.java 2008-02-04 15:22:07 UTC (rev 729) @@ -1,66 +0,0 @@ - -package net.sf.magicmap.client.gui.utils; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Graphics; - -import javax.swing.Icon; -import javax.swing.ImageIcon; - -import net.sf.magicmap.client.model.node.ClientNode; -import net.sf.magicmap.client.model.node.INodeModel; -import net.sf.magicmap.client.model.node.Node; - -/** - * @author Florian Lederer - */ -public class ClientNodeIcon implements INodeIcon { - - private ImageIcon client; - private ImageIcon clientFixed; - - private ImageIcon getClient(){ - if (client == null) client = GUIBuilder.getToolIcon("client.png", "NodeIcons"); - return client; - } - - private ImageIcon getClientFixed(){ - if (clientFixed == null) { - final ImageIcon anchor = GUIBuilder.getToolIcon("anchor_black.png", "NodeIcons"); - clientFixed = new ImageIcon(getClient().getImage()) { - - @Override - public synchronized void paintIcon(Component c, Graphics g, int x, int y){ - super.paintIcon(c, g, x, y); - g.drawImage(anchor.getImage(), x, y, x + getIconWidth(), y + getIconHeight(), 0, 0, anchor - .getIconWidth(), anchor.getIconHeight(), null); - } - }; - } - return clientFixed; - } - - public Color getBgColor(Node node){ - return Color.BLACK; - } - - public Color getFgColor(Node node){ - return Color.BLACK; - } - - public Icon getIcon(Node node){ - if (node.isFix()) return getClientFixed(); - return getClient(); - - } - - public Class getNodeClass(){ - return ClientNode.class; - } - - public int getNodeType(){ - return INodeModel.NODETYPE_CLIENT; - } - -} Deleted: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/GeoPosNodeIcon.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/GeoPosNodeIcon.java 2008-02-01 13:41:00 UTC (rev 728) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/GeoPosNodeIcon.java 2008-02-04 15:22:07 UTC (rev 729) @@ -1,51 +0,0 @@ -package net.sf.magicmap.client.gui.utils; - -import java.awt.Color; - -import javax.swing.Icon; -import javax.swing.ImageIcon; - -import net.sf.magicmap.client.model.node.GeoPosNode; -import net.sf.magicmap.client.model.node.INodeModel; -import net.sf.magicmap.client.model.node.Node; - -/** - * @author Florian Lederer - */ -public class GeoPosNodeIcon implements INodeIcon { - - private ImageIcon geoPos; - private ImageIcon geoPosBig; - - private ImageIcon getGeoPos(){ - if (geoPos == null) geoPos = GUIBuilder.getToolIcon("geopos.png", "NodeIcons"); - return geoPos; - } - - private ImageIcon getGeoPosBig(){ - if (geoPosBig == null) geoPosBig = GUIBuilder.getToolIcon("geopos_big.png", "NodeIcons"); - return geoPosBig; - } - - public Color getBgColor(Node node){ - return Color.BLACK; - } - - public Color getFgColor(Node node){ - return Color.BLACK; - } - - public Icon getIcon(Node node){ - return getGeoPos(); - - } - - public Class getNodeClass(){ - return GeoPosNode.class; - } - - public int getNodeType(){ - return INodeModel.NODETYPE_GEOPOS; - } - -} Deleted: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/INodeIcon.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/INodeIcon.java 2008-02-01 13:41:00 UTC (rev 728) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/INodeIcon.java 2008-02-04 15:22:07 UTC (rev 729) @@ -1,23 +0,0 @@ -package net.sf.magicmap.client.gui.utils; - -import java.awt.Color; - -import javax.swing.Icon; - -import net.sf.magicmap.client.model.node.Node; - - -/** - * - * @author Jan Friderici - * @author Florian Lederer - * - * @param <T> the nodetype this is icon is for. - */ -public interface INodeIcon { - public int getNodeType(); - public Class getNodeClass(); - public Icon getIcon(Node node); - public Color getFgColor(Node node); - public Color getBgColor(Node node); -} Deleted: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/LocationNodeIcon.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/LocationNodeIcon.java 2008-02-01 13:41:00 UTC (rev 728) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/LocationNodeIcon.java 2008-02-04 15:22:07 UTC (rev 729) @@ -1,57 +0,0 @@ - -package net.sf.magicmap.client.gui.utils; - -import java.awt.Color; -import java.awt.Component; -import java.awt.Graphics; - -import javax.swing.Icon; -import javax.swing.ImageIcon; - -import net.sf.magicmap.client.model.node.INodeModel; -import net.sf.magicmap.client.model.node.LocationNode; -import net.sf.magicmap.client.model.node.Node; - -/** - * @author Florian Lederer - */ -public class LocationNodeIcon implements INodeIcon { - - ImageIcon location; - ImageIcon locationFixed; - ImageIcon locationRescan; - - private ImageIcon getLocation(){ - if (location == null) location = GUIBuilder.getToolIcon("location.png", "NodeIcons"); - return location; - } - - private ImageIcon getLocationRescan(){ - if (locationRescan == null) locationRescan = GUIBuilder.getToolIcon("location_rescan.png", "NodeIcons"); - return locationRescan; - } - - public Color getBgColor(Node node){ - return Color.BLACK; - } - - public Color getFgColor(Node node){ - return Color.BLACK; - } - - public Icon getIcon(Node node){ - if (node.isUpdate()) { - return getLocationRescan(); - } else { - return getLocation(); - } - } - - public Class getNodeClass(){ - return LocationNode.class; - } - - public int getNodeType(){ - return INodeModel.NODETYPE_LOCATION; - } -} Deleted: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/MapNodeIcon.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/MapNodeIcon.java 2008-02-01 13:41:00 UTC (rev 728) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/MapNodeIcon.java 2008-02-04 15:22:07 UTC (rev 729) @@ -1,45 +0,0 @@ - -package net.sf.magicmap.client.gui.utils; - -import java.awt.Color; - -import javax.swing.Icon; -import javax.swing.ImageIcon; - -import net.sf.magicmap.client.model.node.INodeModel; -import net.sf.magicmap.client.model.node.MapNode; -import net.sf.magicmap.client.model.node.Node; - -/** - * @author Florian Lederer - */ -public class MapNodeIcon implements INodeIcon { - - private ImageIcon map; - - private ImageIcon getMap(){ - if (map == null) map = GUIBuilder.getToolIcon("map.png", "NodeIcons"); - return map; - } - - public Color getBgColor(Node node){ - return Color.BLACK; - } - - public Color getFgColor(Node node){ - return Color.BLACK; - } - - public Icon getIcon(Node node){ - return getMap(); - - } - - public Class getNodeClass(){ - return MapNode.class; - } - - public int getNodeType(){ - return INodeModel.NODETYPE_MAP; - } -} Deleted: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/NodeIcons.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/NodeIcons.java 2008-02-01 13:41:00 UTC (rev 728) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/NodeIcons.java 2008-02-04 15:22:07 UTC (rev 729) @@ -1,68 +0,0 @@ - -package net.sf.magicmap.client.gui.utils; - -import java.awt.Color; -import java.util.HashMap; -import java.util.Map; - -import javax.swing.Icon; - -import net.sf.magicmap.client.model.node.Node; - -import org.apache.log4j.Logger; - -/** - * @author Florian Lederer - */ -public class NodeIcons { - - private static NodeIcons ni = null; - - private static Logger log = Logger.getLogger(NodeIcons.class); - - private static final INodeIcon DEFAULT_ICON = new INodeIcon() { - - Icon defaultIcon = GUIBuilder.getToolIcon("default.png", - "NodeIcons"); - - public Color getBgColor(Node node){ - return Color.BLACK; - } - - public Color getFgColor(Node node){ - return Color.BLACK; - } - - public Icon getIcon(Node node){ - return defaultIcon; - } - - public Class getNodeClass(){ - return null; - } - - public int getNodeType(){ - return -1; - } - }; - - private final Map<Class, INodeIcon> iconMap = new HashMap<Class, INodeIcon>(); - - private NodeIcons() {} - - public static NodeIcons getInstance(){ - if (NodeIcons.ni == null) NodeIcons.ni = new NodeIcons(); - return NodeIcons.ni; - } - - public INodeIcon getNodeIcon(Node node){ - if (node == null) return null; - if (iconMap.containsKey(node.getClass())) return iconMap.get(node.getClass()); - return DEFAULT_ICON; - } - - public void registerNodeIcon(INodeIcon icon){ - iconMap.put(icon.getNodeClass(), icon); - } - -} \ No newline at end of file Added: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/icon/AbstractNodeIcon.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/icon/AbstractNodeIcon.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/icon/AbstractNodeIcon.java 2008-02-04 15:22:07 UTC (rev 729) @@ -0,0 +1,105 @@ + +package net.sf.magicmap.client.gui.utils.icon; + +import java.awt.Color; +import java.awt.Component; +import java.awt.Graphics; +import java.util.ArrayList; + +import javax.swing.Icon; +import javax.swing.ImageIcon; + +import net.sf.magicmap.client.model.node.Node; + +/** + * @author Florian Lederer + */ + +abstract public class AbstractNodeIcon implements INodeIcon { + + private class IconStore { + + public NodeIconPredicate condition; + public ImageIcon icon; + + public IconStore(NodeIconPredicate condition, ImageIcon icon) { + this.condition = condition; + this.icon = icon; + } + } + + private ArrayList<IconStore> overlayIcons = new ArrayList<IconStore>(); + + private ArrayList<IconStore> backgroundIcons = new ArrayList<IconStore>(); + + abstract public Color getBgColor(Node node); + + abstract public Color getFgColor(Node node); + + public Icon getIcon(Node node){ + + final ImageIcon overlayIcon = getOverlayIcon(node); + final ImageIcon backgroundIcon = getBackgroundIcon(node); + + if (overlayIcon == null) + return backgroundIcon; + else if (backgroundIcon == null) + return overlayIcon; + else + return new ImageIcon(getBackgroundIcon(node).getImage()) { + + /** + * + */ + private static final long serialVersionUID = 1L; + + @Override + public synchronized void paintIcon(Component c, Graphics g, int x, int y){ + super.paintIcon(c, g, x, y); + g.drawImage(overlayIcon.getImage(), x, y, x + getIconWidth(), y + getIconHeight(), 0, 0, + overlayIcon.getIconWidth(), overlayIcon.getIconHeight(), null); + } + }; + } + + public void addBackgroundIcon(ImageIcon icon, NodeIconPredicate condition){ + backgroundIcons.add(0, new IconStore(condition, icon)); + } + + public void addOverlayIcon(ImageIcon icon, NodeIconPredicate condition){ + overlayIcons.add(0, new IconStore(condition, icon)); + } + + protected ImageIcon getBackgroundIcon(final Node node){ + ImageIcon icon = null; + for (IconStore store : backgroundIcons) { + try { + if (store.condition.showIcon(node)) { + icon = store.icon; + break; + } + } catch (IllegalArgumentException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + return icon; + } + + protected ImageIcon getOverlayIcon(final Node node){ + ImageIcon icon = null; + for (IconStore store : overlayIcons) { + try { + if ((Boolean) store.condition.showIcon(node)) { + icon = store.icon; + break; + } + } catch (IllegalArgumentException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + return icon; + } + +} Copied: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/icon/INodeIcon.java (from rev 726, trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/INodeIcon.java) =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/icon/INodeIcon.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/icon/INodeIcon.java 2008-02-04 15:22:07 UTC (rev 729) @@ -0,0 +1,23 @@ + +package net.sf.magicmap.client.gui.utils.icon; + +import java.awt.Color; + +import javax.swing.Icon; + +import net.sf.magicmap.client.model.node.Node; + +/** + * + * @author Jan Friderici + * @author Florian Lederer + * + */ +public interface INodeIcon { + + public Icon getIcon(Node node); + + public Color getFgColor(Node node); + + public Color getBgColor(Node node); +} Added: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/icon/NodeIconAndPredicate.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/icon/NodeIconAndPredicate.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/icon/NodeIconAndPredicate.java 2008-02-04 15:22:07 UTC (rev 729) @@ -0,0 +1,24 @@ + +package net.sf.magicmap.client.gui.utils.icon; + +import net.sf.magicmap.client.model.node.Node; + +/** + * @author Florian Lederer + */ + +public class NodeIconAndPredicate implements NodeIconPredicate { + + private final NodeIconPredicate first; + private final NodeIconPredicate second; + + public NodeIconAndPredicate(NodeIconPredicate first, NodeIconPredicate second) { + + this.first = first; + this.second = second; + } + + public boolean showIcon(Node node){ + return first.showIcon(node) && second.showIcon(node); + } +} \ No newline at end of file Added: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/icon/NodeIconContainer.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/icon/NodeIconContainer.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/icon/NodeIconContainer.java 2008-02-04 15:22:07 UTC (rev 729) @@ -0,0 +1,62 @@ + +package net.sf.magicmap.client.gui.utils.icon; + +import java.awt.Color; +import java.util.HashMap; +import java.util.Map; + +import javax.swing.Icon; + +import net.sf.magicmap.client.gui.utils.GUIBuilder; +import net.sf.magicmap.client.model.node.Node; + +import org.apache.log4j.Logger; + +/** + * @author Florian Lederer + */ +public class NodeIconContainer { + + private static NodeIconContainer ni = null; + + private static Logger log = Logger.getLogger(NodeIconContainer.class); + + public static final INodeIcon DEFAULT_ICON = new INodeIcon() { + + Icon defaultIcon = GUIBuilder.getToolIcon("default.png", + "NodeIcons"); + + public Color getBgColor(Node node){ + return Color.BLACK; + } + + public Color getFgColor(Node node){ + return Color.BLACK; + } + + public Icon getIcon(Node node){ + return defaultIcon; + } + }; + + private final Map<Integer, INodeIcon> iconMap = new HashMap<Integer, INodeIcon>(); + + private NodeIconContainer() {} + + public static NodeIconContainer getInstance(){ + if (NodeIconContainer.ni == null) NodeIconContainer.ni = new NodeIconContainer(); + return NodeIconContainer.ni; + } + + public INodeIcon getNodeIcon(Node node){ + if (node == null) return null; + // TODO: replace getType() with getCategory() when implemented + if (iconMap.containsKey(node.getType())) return iconMap.get(node.getType()); + return DEFAULT_ICON; + } + + public void registerNodeIcon(int category, INodeIcon icon){ + iconMap.put(category, icon); + } + +} \ No newline at end of file Added: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/icon/NodeIconNotPredicate.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/icon/NodeIconNotPredicate.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/icon/NodeIconNotPredicate.java 2008-02-04 15:22:07 UTC (rev 729) @@ -0,0 +1,22 @@ + +package net.sf.magicmap.client.gui.utils.icon; + +import net.sf.magicmap.client.model.node.Node; + +/** + * @author Florian Lederer + */ + +public class NodeIconNotPredicate implements NodeIconPredicate { + + private final NodeIconPredicate other; + + public NodeIconNotPredicate(NodeIconPredicate other) { + this.other = other; + } + + public boolean showIcon(Node node){ + return !other.showIcon(node); + } + +} Added: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/icon/NodeIconOrPredicate.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/icon/NodeIconOrPredicate.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/icon/NodeIconOrPredicate.java 2008-02-04 15:22:07 UTC (rev 729) @@ -0,0 +1,24 @@ + +package net.sf.magicmap.client.gui.utils.icon; + +import net.sf.magicmap.client.model.node.Node; + +/** + * @author Florian Lederer + */ + +public class NodeIconOrPredicate implements NodeIconPredicate { + + private final NodeIconPredicate first; + private final NodeIconPredicate second; + + public NodeIconOrPredicate(NodeIconPredicate first, NodeIconPredicate second) { + + this.first = first; + this.second = second; + } + + public boolean showIcon(Node node){ + return first.showIcon(node) || second.showIcon(node); + } +} \ No newline at end of file Added: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/icon/NodeIconPredicate.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/icon/NodeIconPredicate.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/icon/NodeIconPredicate.java 2008-02-04 15:22:07 UTC (rev 729) @@ -0,0 +1,25 @@ +package net.sf.magicmap.client.gui.utils.icon; + +import net.sf.magicmap.client.model.node.Node; + +/** + * @author Florian Lederer + */ + + +public interface NodeIconPredicate { + + public boolean showIcon(Node node); + + public static final NodeIconPredicate TRUE = new NodeIconPredicate() { + public boolean showIcon(Node node) { + return true; + }; + }; + + public static final NodeIconPredicate FALSE = new NodeIconPredicate() { + public boolean showIcon(Node node) { + return false; + }; + }; +} Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java 2008-02-01 13:41:00 UTC (rev 728) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java 2008-02-04 15:22:07 UTC (rev 729) @@ -26,7 +26,7 @@ import net.sf.magicmap.client.gui.utils.GUIBuilder; import net.sf.magicmap.client.gui.utils.GUIConstants; import net.sf.magicmap.client.gui.utils.GUIUtils; -import net.sf.magicmap.client.gui.utils.NodeIcons; +import net.sf.magicmap.client.gui.utils.icon.NodeIconContainer; import net.sf.magicmap.client.meta.MapInfo; import net.sf.magicmap.client.model.location.INodePlacer; import net.sf.magicmap.client.model.location.jung.JungNodePlacer; @@ -102,7 +102,7 @@ private boolean calculateHeight = false; - private static Logger log = Logger.getLogger(NodeIcons.class); + private static Logger log = Logger.getLogger(NodeIconContainer.class); // @TODO TEST LAYOUT! JungNodePlacer layoutModel; @@ -210,7 +210,7 @@ if (!showLocations) return null; break; } - return MainGUI.getInstance().getNodeIcons().getNodeIcon(node).getFgColor(node); + return MainGUI.getInstance().getNodeIconContainer().getNodeIcon(node).getFgColor(node); } public Color getBackColor(Vertex v){ @@ -226,7 +226,7 @@ if (!showLocations) return null; break; } - return MainGUI.getInstance().getNodeIcons().getNodeIcon(node).getBgColor(node); + return MainGUI.getInstance().getNodeIconContainer().getNodeIcon(node).getBgColor(node); } public Icon getIcon(Vertex v){ @@ -242,7 +242,7 @@ if (!showLocations) return null; break; } - return MainGUI.getInstance().getNodeIcons().getNodeIcon(node).getIcon(node); + return MainGUI.getInstance().getNodeIconContainer().getNodeIcon(node).getIcon(node); } }); Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineTree.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineTree.java 2008-02-01 13:41:00 UTC (rev 728) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineTree.java 2008-02-04 15:22:07 UTC (rev 729) @@ -88,7 +88,7 @@ } else { c = (JLabel) super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); c.setText(node.getDisplayName()); - Icon icon = MainGUI.getInstance().getNodeIcons().getNodeIcon(node).getIcon(node); + Icon icon = MainGUI.getInstance().getNodeIconContainer().getNodeIcon(node).getIcon(node); if (icon == null) icon = this.getDefaultLeafIcon(); c.setIcon(icon); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fle...@us...> - 2008-02-04 15:44:17
|
Revision: 730 http://magicmap.svn.sourceforge.net/magicmap/?rev=730&view=rev Author: flederohr Date: 2008-02-04 07:43:54 -0800 (Mon, 04 Feb 2008) Log Message: ----------- added right-click-menu for accesspoint-hiding Modified Paths: -------------- trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineView.java Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineView.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineView.java 2008-02-04 15:22:07 UTC (rev 729) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineView.java 2008-02-04 15:43:54 UTC (rev 730) @@ -333,9 +333,12 @@ case MouseEvent.BUTTON3 : // TODO: right-click-menu Node node; - // check if MapNode is selected if ((node = ((OutlineTreeNode) ((OutlineTree) e.getSource()).getSelectionPath().getLastPathComponent()) - .getNode()) instanceof Node) this.getMenuContainer().buildMenu(node, new JPopupMenu()).show(this, e.getX(), e.getY()); + .getNode()) instanceof Node){ + JPopupMenu menu; + if((menu = this.getMenuContainer().buildMenu(node, new JPopupMenu())).getComponentCount() > 0) + menu.show(this, e.getX(), e.getY()); + } break; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-02-01 13:41:10
|
Revision: 728 http://magicmap.svn.sourceforge.net/magicmap/?rev=728&view=rev Author: anweiss Date: 2008-02-01 05:41:00 -0800 (Fri, 01 Feb 2008) Log Message: ----------- added interface functions to edit the attributes hashmap for every node Modified Paths: -------------- trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java trunk/magicmapclient/src/net/sf/magicmap/client/controller/IController.java trunk/magicmapclient/src/net/sf/magicmap/core/model/node/impl/MagicNode.java Modified: trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java 2008-02-01 13:35:17 UTC (rev 727) +++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java 2008-02-01 13:41:00 UTC (rev 728) @@ -4,7 +4,6 @@ package net.sf.magicmap.client.controller; - import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; @@ -14,7 +13,15 @@ import net.sf.magicmap.client.gui.MainGUI; import net.sf.magicmap.client.gui.utils.GUIUtils; import net.sf.magicmap.client.gui.views.MapView; -import net.sf.magicmap.client.interfaces.*; +import net.sf.magicmap.client.interfaces.CreateNewMapCallback; +import net.sf.magicmap.client.interfaces.CreatePositionCallback; +import net.sf.magicmap.client.interfaces.DeletePositionCallback; +import net.sf.magicmap.client.interfaces.MapCallback; +import net.sf.magicmap.client.interfaces.MapNamesCallback; +import net.sf.magicmap.client.interfaces.MovePositionCallback; +import net.sf.magicmap.client.interfaces.PositionCallback; +import net.sf.magicmap.client.interfaces.ServerConnectCallback; +import net.sf.magicmap.client.interfaces.ServerDisconnectCallback; import net.sf.magicmap.client.measurement.ScannerAllocator; import net.sf.magicmap.client.measurement.interfaces.AbstractScanResult; import net.sf.magicmap.client.measurement.interfaces.AbstractScanner; @@ -63,23 +70,23 @@ * Das Knotenmodel. */ - private IMagicNodeModel nodeModel; // Model f\xFCr Graphen + private IMagicNodeModel nodeModel; // Model f\xFCr Graphen - private ClientNode client; // Ausgezeichneter Knoten + private ClientNode client; // Ausgezeichneter Knoten - private HashMap<String, String> ClientAttributes = new HashMap<String,String>(); // zus\xE4tzliche Attribute f\xFCr den Clienten + private HashMap<String, String> ClientAttributes = new HashMap<String, String>(); // zus\xE4tzliche Attribute f\xFCr den Clienten - private ServerPoller poller; // Server st\xE4ndig nach \xC4nderungen fragen + private ServerPoller poller; // Server st\xE4ndig nach \xC4nderungen fragen - private PollHandler pollhandler; // Klasse zur Verarbeitung der Pollergebnisse + private PollHandler pollhandler; // Klasse zur Verarbeitung der Pollergebnisse - private ServerManager serverManager; // Manager f\xFCr die Verbindung zum Server + private ServerManager serverManager; // Manager f\xFCr die Verbindung zum Server // private CallbackHandler callbackHandler; // S\xE4mtliche callbacks werden dort behandelt private MapInfo currentMap; - private boolean invisble; // Invisible-Modus (keine Daten an Server) + private boolean invisble; // Invisible-Modus (keine Daten an Server) private ScannerAllocator scannerAllocator; private PluginManager pluginManager; @@ -541,20 +548,44 @@ } catch (MalformedURLException e) {} catch (IOException e) {} } + /* + * (non-Javadoc) + * @see net.sf.magicmap.client.controller.IController#getClientAttributes() + */ public HashMap<String, String> getClientAttributes(){ return ClientAttributes; } - public void setClientAttributes(HashMap<String, String> clientAttributes){ + /* + * (non-Javadoc) + * @see net.sf.magicmap.client.controller.IController#setClientInterfaceAttributes(java.util.HashMap) + */ + public void setClientInterfaceAttributes(HashMap<String, String> clientAttributes){ ClientAttributes = clientAttributes; } - public void addInterface(HashMap<String, String> intorface){ -// int count = Integer.parseInt(this.getClientAttributes().get(DriverInformations.NUMBEROFINTERFACES)); + /* + * (non-Javadoc) + * @see net.sf.magicmap.client.controller.IController#addClientInterface(java.util.HashMap) + */ + public void addClientInterface(HashMap<String, String> intorface){ + // int count = Integer.parseInt(this.getClientAttributes().get(DriverInformations.NUMBEROFINTERFACES)); if (!(this.getClientAttributes().containsValue(intorface.get(DriverInformations.DEVICENAME)))) { -// count++; -// this.ClientAttributes.put(DriverInformations.NUMBEROFINTERFACES, String.valueOf(count)); + // count++; + // this.ClientAttributes.put(DriverInformations.NUMBEROFINTERFACES, String.valueOf(count)); this.ClientAttributes.putAll(intorface); } } + + /* + * (non-Javadoc) + * @see net.sf.magicmap.client.controller.IController#addAttributeForSelected(java.lang.String, java.lang.String) + */ + public void addAttributeForSelected(String key, String value){ + MainGUI.getInstance().getNodeSelectionModel().getSelectedNode().addAttribute(key, value); + } + + public void removeAttributeForSelected(String key){ + MainGUI.getInstance().getNodeSelectionModel().getSelectedNode().removeAttribute(key); + } } \ No newline at end of file Modified: trunk/magicmapclient/src/net/sf/magicmap/client/controller/IController.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/controller/IController.java 2008-02-01 13:35:17 UTC (rev 727) +++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/IController.java 2008-02-01 13:41:00 UTC (rev 728) @@ -2,7 +2,15 @@ package net.sf.magicmap.client.controller; import java.util.HashMap; -import net.sf.magicmap.client.interfaces.*; + +import net.sf.magicmap.client.interfaces.CreateNewMapCallback; +import net.sf.magicmap.client.interfaces.CreatePositionCallback; +import net.sf.magicmap.client.interfaces.DeletePositionCallback; +import net.sf.magicmap.client.interfaces.MapCallback; +import net.sf.magicmap.client.interfaces.MapNamesCallback; +import net.sf.magicmap.client.interfaces.MovePositionCallback; +import net.sf.magicmap.client.interfaces.PositionCallback; +import net.sf.magicmap.client.interfaces.ServerConnectCallback; import net.sf.magicmap.client.measurement.interfaces.AbstractScanResult; import net.sf.magicmap.client.measurement.interfaces.AbstractScanner; import net.sf.magicmap.client.measurement.interfaces.AbstractScannerHandler; @@ -190,4 +198,18 @@ * */ void initializePlugins(); + + HashMap<String, String> getClientAttributes(); + + /* + * Fills a hashmap with informations about the clients interface. + * + */ + void setClientInterfaceAttributes(HashMap<String, String> clientAttributes); + + void addClientInterface(HashMap<String, String> intorface); + + void addAttributeForSelected(String key, String value); + + void removeAttributeForSelected(String key); } Modified: trunk/magicmapclient/src/net/sf/magicmap/core/model/node/impl/MagicNode.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/core/model/node/impl/MagicNode.java 2008-02-01 13:35:17 UTC (rev 727) +++ trunk/magicmapclient/src/net/sf/magicmap/core/model/node/impl/MagicNode.java 2008-02-01 13:41:00 UTC (rev 728) @@ -8,6 +8,7 @@ import net.sf.magicmap.core.model.node.IMagicNodeModel; import java.util.ArrayList; +import java.util.HashMap; /** * <p> @@ -151,4 +152,28 @@ public Node asNode() { return delegate; } + + + public void addAttribute(String key, String value){ + this.delegate.addAttribute(key, value); + + } + + + public HashMap<String, String> getAttributes(){ + return this.delegate.getAttributes(); + } + + + public void removeAttribute(String key){ + this.delegate.removeAttribute(key); + + } + + + public void setAttributes(HashMap<String, String> newAttributes){ + this.delegate.setAttributes(newAttributes); + + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-02-01 13:35:25
|
Revision: 727 http://magicmap.svn.sourceforge.net/magicmap/?rev=727&view=rev Author: anweiss Date: 2008-02-01 05:35:17 -0800 (Fri, 01 Feb 2008) Log Message: ----------- added interface functions to edit the attributes hashmap for every node Modified Paths: -------------- trunk/magicmapclient/src/net/sf/magicmap/client/model/node/INode.java trunk/magicmapclient/src/net/sf/magicmap/client/model/node/Node.java Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/node/INode.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/node/INode.java 2008-02-01 12:12:41 UTC (rev 726) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/node/INode.java 2008-02-01 13:35:17 UTC (rev 727) @@ -1,5 +1,6 @@ package net.sf.magicmap.client.model.node; +import java.util.HashMap; import java.util.List; /** @@ -66,4 +67,12 @@ void setPhysical(boolean physical); public NodeContainer getNodeContainer(); + + public void setAttributes(HashMap<String, String> newAttributes); + + public HashMap<String, String> getAttributes(); + + public void addAttribute(String key, String value); + + public void removeAttribute(String key); } Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/node/Node.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/node/Node.java 2008-02-01 12:12:41 UTC (rev 726) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/node/Node.java 2008-02-01 13:35:17 UTC (rev 727) @@ -255,7 +255,6 @@ this.parentNode = parentNode; } - /** * Ask if this node is a physical or information node. * @return @@ -283,4 +282,11 @@ return this.attributes; } + public void addAttribute(String key, String value){ + this.attributes.put(key, value); + } + + public void removeAttribute(String key){ + this.attributes.remove(key); + } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fle...@us...> - 2008-02-01 12:12:43
|
Revision: 726 http://magicmap.svn.sourceforge.net/magicmap/?rev=726&view=rev Author: flederohr Date: 2008-02-01 04:12:41 -0800 (Fri, 01 Feb 2008) Log Message: ----------- added menu for accesspoint-hiding to the OutlineView Modified Paths: -------------- trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineView.java trunk/magicmapclient/src/net/sf/magicmap/client/model/node/INodeSelectionModel.java trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeSelectionModel.java Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineView.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineView.java 2008-02-01 11:53:28 UTC (rev 725) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineView.java 2008-02-01 12:12:41 UTC (rev 726) @@ -6,11 +6,14 @@ import java.awt.Dimension; import java.awt.Insets; +import java.awt.event.ActionEvent; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; +import javax.swing.AbstractAction; import javax.swing.JComponent; import javax.swing.JPanel; +import javax.swing.JPopupMenu; import javax.swing.JScrollPane; import javax.swing.JTree; import javax.swing.border.EmptyBorder; @@ -20,12 +23,22 @@ import net.sf.magicmap.client.controller.Controller; import net.sf.magicmap.client.gui.MainGUI; +import net.sf.magicmap.client.gui.MapPanel; import net.sf.magicmap.client.gui.utils.GUIBuilder; import net.sf.magicmap.client.gui.utils.GUIConstants; import net.sf.magicmap.client.gui.utils.GUIUtils; +import net.sf.magicmap.client.gui.utils.MagicAction; import net.sf.magicmap.client.gui.utils.RelativePanelBuilder; +import net.sf.magicmap.client.gui.utils.menu.NodeMenuAndPredicate; +import net.sf.magicmap.client.gui.utils.menu.NodeMenuContainer; +import net.sf.magicmap.client.gui.utils.menu.NodeMenuPredicate; +import net.sf.magicmap.client.gui.utils.menu.NodeMenuTypePredicate; +import net.sf.magicmap.client.model.node.AccessPointNode; +import net.sf.magicmap.client.model.node.ClientNode; +import net.sf.magicmap.client.model.node.INode; import net.sf.magicmap.client.model.node.INodeModel; import net.sf.magicmap.client.model.node.INodeModelSelectionListener; +import net.sf.magicmap.client.model.node.LocationNode; import net.sf.magicmap.client.model.node.MapNode; import net.sf.magicmap.client.model.node.Node; import net.sf.magicmap.client.model.node.NodeModelConstants; @@ -63,10 +76,57 @@ this.outlineModel = new OutlineModel(nodeModel); rootNode = (OutlineTreeNode) outlineModel.getRoot(); setContent(buildViewComponent()); + buildNodeMenu(); MainGUI.getInstance().getNodeSelectionModel().addNodeModelSelectionListener(this); MainGUI.getInstance().registerJComponent(this, name); } + private void buildNodeMenu(){ + NodeMenuContainer nc = this.getMenuContainer(); + + nc.addNodeMenuItem(this, GUIBuilder.createMenuItem(new MagicAction("map.panel.context.hide.ap"){ + /** + * + */ + private static final long serialVersionUID = 0L; + + @Override + public void actionPerformed(ActionEvent e){ + AccessPointNode ap = (AccessPointNode) MainGUI.getInstance().getNodeSelectionModel().getSelectedNode(); + ap.setHiddenStatus(true); + ap.setName(ap.getName() + "(" + GUIUtils.i18n("node.accesspoint.is.hide") + ")"); + Controller.getInstance().setAccessPointHiddenStatus(ap.getMacAddress(), true, ((MapPanel)MainGUI.getInstance().getJComponent("mapPanel"))); + } + }),new NodeMenuAndPredicate(new NodeMenuTypePredicate(NodeModelConstants.NODETYPE_ACCESSPOINT),new NodeMenuPredicate(){ + + public boolean show(Object context){ + return !((AccessPointNode)context).isHidden(); + } + + })); + + nc.addNodeMenuItem(this, GUIBuilder.createMenuItem(new MagicAction("map.panel.context.hide.ap.off"){ + /** + * + */ + private static final long serialVersionUID = 0L; + + @Override + public void actionPerformed(ActionEvent e){ + AccessPointNode ap = (AccessPointNode) MainGUI.getInstance().getNodeSelectionModel().getSelectedNode(); + ap.setHiddenStatus(false); + ap.setName(ap.getName().substring(0, ap.getName().length() - 5)); + Controller.getInstance().setAccessPointHiddenStatus(ap.getMacAddress(), false, ((MapPanel)MainGUI.getInstance().getJComponent("mapPanel"))); + } + }),new NodeMenuAndPredicate(new NodeMenuTypePredicate(NodeModelConstants.NODETYPE_ACCESSPOINT),new NodeMenuPredicate(){ + + public boolean show(Object context){ + return ((AccessPointNode)context).isHidden(); + } + + })); + } + /* (non-Javadoc) * @see net.sf.magicmap.client.views.View#buildViewComponent() */ @@ -141,7 +201,7 @@ */ public synchronized void valueChanged(TreeSelectionEvent tse){ OutlineTreeNode outlineTreeNode = ((OutlineTreeNode) tse.getPath().getLastPathComponent()); - if (null != outlineTreeNode.getNode()) { + if (null != outlineTreeNode) { final Node node = outlineTreeNode.getNode(); if (null != node) { MainGUI.getInstance().getNodeSelectionModel().removeNodeModelSelectionListener(this); @@ -272,6 +332,10 @@ break; case MouseEvent.BUTTON3 : // TODO: right-click-menu + Node node; + // check if MapNode is selected + if ((node = ((OutlineTreeNode) ((OutlineTree) e.getSource()).getSelectionPath().getLastPathComponent()) + .getNode()) instanceof Node) this.getMenuContainer().buildMenu(node, new JPopupMenu()).show(this, e.getX(), e.getY()); break; } Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/node/INodeSelectionModel.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/node/INodeSelectionModel.java 2008-02-01 11:53:28 UTC (rev 725) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/node/INodeSelectionModel.java 2008-02-01 12:12:41 UTC (rev 726) @@ -18,4 +18,6 @@ * @return the selected node. */ Node selectNode(Node selectedNode); + + Node getSelectedNode(); } Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeSelectionModel.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeSelectionModel.java 2008-02-01 11:53:28 UTC (rev 725) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeSelectionModel.java 2008-02-01 12:12:41 UTC (rev 726) @@ -41,4 +41,8 @@ } return selectedNode; } + + public Node getSelectedNode(){ + return selectedNode; + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-02-01 11:53:39
|
Revision: 725 http://magicmap.svn.sourceforge.net/magicmap/?rev=725&view=rev Author: anweiss Date: 2008-02-01 03:53:28 -0800 (Fri, 01 Feb 2008) Log Message: ----------- fixed client name empty bug (bug no. 1884334) Modified Paths: -------------- trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/ConnectServerDialog.java Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/ConnectServerDialog.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/ConnectServerDialog.java 2008-02-01 11:36:23 UTC (rev 724) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/ConnectServerDialog.java 2008-02-01 11:53:28 UTC (rev 725) @@ -222,7 +222,7 @@ serverConnectionInfo.name = this.clientname.getText(); serverConnectionInfo.useNoServer = this.useNoServer.isSelected(); if (useNoServer.isSelected()) { - if (serverConnectionInfo.name == "") serverConnectionInfo.name = System.getProperty("user.name"); + if (serverConnectionInfo.name.trim().equalsIgnoreCase("")) serverConnectionInfo.name = System.getProperty("user.name"); serverConnectionInfo.password = System.getProperty("user.name"); } try { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fle...@us...> - 2008-02-01 11:36:26
|
Revision: 724 http://magicmap.svn.sourceforge.net/magicmap/?rev=724&view=rev Author: flederohr Date: 2008-02-01 03:36:23 -0800 (Fri, 01 Feb 2008) Log Message: ----------- efficient handling of hiddenstate changes Modified Paths: -------------- trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/handler/AccessPointHiddenStateHandler.java Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/handler/AccessPointHiddenStateHandler.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/handler/AccessPointHiddenStateHandler.java 2008-02-01 10:44:15 UTC (rev 723) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/handler/AccessPointHiddenStateHandler.java 2008-02-01 11:36:23 UTC (rev 724) @@ -6,6 +6,7 @@ import net.sf.magicmap.client.model.location.INodePlacer; import net.sf.magicmap.client.model.location.NodeUpdateHandler; import net.sf.magicmap.client.model.node.AccessPointNode; +import net.sf.magicmap.client.model.node.AccessPointSeerNode; import net.sf.magicmap.client.model.node.ClientNode; import net.sf.magicmap.client.model.node.LocationNode; import net.sf.magicmap.client.model.node.Node; @@ -28,18 +29,14 @@ // TODO: change to ap.getNeighbors() when it is implemented ArrayList<Node> nl = new ArrayList<Node>(ap.getModel().getNodes()); for (Node n : nl) - if (n instanceof LocationNode && ((LocationNode) n).getSeenAccessPoints().contains(ap)) + if (n instanceof AccessPointSeerNode && ((AccessPointSeerNode) n).getSeenAccessPoints().contains(ap)) nodePlacer.removeEdge(n, ap); - else if (n instanceof ClientNode && ((ClientNode) n).getSeenAccessPoints().contains(ap)) - nodePlacer.removeEdge(n, ap); } else { // TODO: change to ap.getNeighbors() when it is implemented ArrayList<Node> nl = new ArrayList<Node>(ap.getModel().getNodes()); for (Node n : nl) - if (n instanceof LocationNode && ((LocationNode) n).getSeenAccessPoints().contains(ap)) + if (n instanceof AccessPointSeerNode && ((AccessPointSeerNode) n).getSeenAccessPoints().contains(ap)) nodePlacer.addEdge(n, ap); - else if (n instanceof ClientNode && ((ClientNode) n).getSeenAccessPoints().contains(ap)) - nodePlacer.addEdge(n, ap); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fle...@us...> - 2008-02-01 10:44:31
|
Revision: 723 http://magicmap.svn.sourceforge.net/magicmap/?rev=723&view=rev Author: flederohr Date: 2008-02-01 02:44:15 -0800 (Fri, 01 Feb 2008) Log Message: ----------- avoid nullpointer-exception on accesspoint-hiding Modified Paths: -------------- trunk/magicmapclient/src/net/sf/magicmap/client/model/node/AccessPointSeerNode.java Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/node/AccessPointSeerNode.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/node/AccessPointSeerNode.java 2008-02-01 10:07:57 UTC (rev 722) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/node/AccessPointSeerNode.java 2008-02-01 10:44:15 UTC (rev 723) @@ -123,7 +123,7 @@ if (apEdges.containsKey(ap.getMacAddress())) { apEdges.remove(ap.getMacAddress()); getModel().updateNode(this, NodeModelConstants.UPDATE_NOTSEESACCESSPOINT, ap); - if (!ap.isFix()) { + if (!ap.isFix() && !ap.isHidden()) { boolean deleteAP = true; for (AccessPointSeerNode asn : this.getModel().getAccessPointSeerNodes()) { if (asn.getSignalLevelForAccessPoint(ap) != -Constants.MIN_SIGNALLEVEL) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fle...@us...> - 2008-02-01 10:08:00
|
Revision: 722 http://magicmap.svn.sourceforge.net/magicmap/?rev=722&view=rev Author: flederohr Date: 2008-02-01 02:07:57 -0800 (Fri, 01 Feb 2008) Log Message: ----------- fixed classpath Modified Paths: -------------- trunk/magicmapserver/.classpath Modified: trunk/magicmapserver/.classpath =================================================================== --- trunk/magicmapserver/.classpath 2008-01-31 13:30:03 UTC (rev 721) +++ trunk/magicmapserver/.classpath 2008-02-01 10:07:57 UTC (rev 722) @@ -9,10 +9,5 @@ <classpathentry kind="lib" path="lib.dev/jasper-runtime.jar"/> <classpathentry kind="lib" path="lib.dev/jsp-api.jar"/> <classpathentry kind="lib" path="lib.dev/servlet-api.jar"/> - <classpathentry kind="var" path="TOMCAT_HOME/lib/servlet-api.jar"/> - <classpathentry kind="var" path="TOMCAT_HOME/lib/jasper.jar"/> - <classpathentry kind="var" path="TOMCAT_HOME/lib/jsp-api.jar"/> - <classpathentry kind="var" path="TOMCAT_HOME/lib/el-api.jar"/> - <classpathentry kind="var" path="TOMCAT_HOME/lib/annotations-api.jar"/> <classpathentry kind="output" path="web/WEB-INF/classes"/> </classpath> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fle...@us...> - 2008-01-31 14:00:08
|
Revision: 721 http://magicmap.svn.sourceforge.net/magicmap/?rev=721&view=rev Author: flederohr Date: 2008-01-31 05:30:03 -0800 (Thu, 31 Jan 2008) Log Message: ----------- path-safety for the wsdl2java plug-in Modified Paths: -------------- trunk/magicmapclient/build.xml Modified: trunk/magicmapclient/build.xml =================================================================== --- trunk/magicmapclient/build.xml 2008-01-28 13:55:25 UTC (rev 720) +++ trunk/magicmapclient/build.xml 2008-01-31 13:30:03 UTC (rev 721) @@ -89,9 +89,9 @@ </target> <target name="axis" depends="prepare"> - <axis-wsdl2java output="${src.gen}" testcase="false" verbose="false" noimports="true" debug="false" url="inf/PositionFacade.wsdl" /> - <axis-wsdl2java output="${src.gen}" testcase="false" verbose="false" noimports="true" debug="false" url="inf/SessionFacade.wsdl" /> - <axis-wsdl2java output="${src.gen}" testcase="false" verbose="false" noimports="true" debug="false" url="inf/MapFacade.wsdl" /> + <axis-wsdl2java output="${src.gen}" testcase="false" verbose="false" noimports="true" debug="false" url="file:/${basedir}/inf/PositionFacade.wsdl" /> + <axis-wsdl2java output="${src.gen}" testcase="false" verbose="false" noimports="true" debug="false" url="file:/${basedir}/inf/SessionFacade.wsdl" /> + <axis-wsdl2java output="${src.gen}" testcase="false" verbose="false" noimports="true" debug="false" url="file:/${basedir}/inf/MapFacade.wsdl" /> </target> <target name="compile" depends="axis"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-01-28 14:01:48
|
Revision: 719 http://magicmap.svn.sourceforge.net/magicmap/?rev=719&view=rev Author: anweiss Date: 2008-01-28 05:22:14 -0800 (Mon, 28 Jan 2008) Log Message: ----------- added hashmap with attributes for every node that can be stored on the server Added Paths: ----------- trunk/magicmapclient/src/net/sf/magicmap/client/net/VistaNetworkInfo.java trunk/magicmapclient/src/net/sf/magicmap/client/utils/NodeTypes.java Added: trunk/magicmapclient/src/net/sf/magicmap/client/net/VistaNetworkInfo.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/net/VistaNetworkInfo.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/client/net/VistaNetworkInfo.java 2008-01-28 13:22:14 UTC (rev 719) @@ -0,0 +1,102 @@ +/* + * Created on 21.01.2008 + */ + +package net.sf.magicmap.client.net; + +import java.io.IOException; +import java.text.ParseException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class VistaNetworkInfo extends NetworkInfo { + + public static final String IPCONFIG_COMMAND = "netsh wlan show interfaces"; + + @Override + public String parseMacAddress() throws ParseException{ + // run command + String ipConfigResponse = null; + try { + ipConfigResponse = runConsoleCommand(VistaNetworkInfo.IPCONFIG_COMMAND); + } catch (IOException e) { + e.printStackTrace(); + throw new ParseException(e.getMessage(), 0); + } + + java.util.StringTokenizer tokenizer = new java.util.StringTokenizer(ipConfigResponse, "\n"); + String lastMacAddress = null; + while (tokenizer.hasMoreTokens()) { + String line = tokenizer.nextToken().trim(); + + if (line.trim().startsWith("Status")) { + String[] splitString = line.split(":"); + return lastMacAddress; + } + // see if line might contain a MAC address + int macAddressPosition = line.indexOf(":"); + if (macAddressPosition <= 0) continue; + + // trim the line and see if it matches the pattern + String macAddressCandidate = line.substring(macAddressPosition + 1).trim(); + if (VistaNetworkInfo.isMacAddress(macAddressCandidate)) { + lastMacAddress = macAddressCandidate; + continue; + } + } + + ParseException ex = new ParseException("No active connection found or cannot read MAC address from [" + + ipConfigResponse + "]", 0); + ex.printStackTrace(); + throw ex; + } + + @Override + public void collectMacAddresses() throws ParseException{ + NetworkInfo.macAddresses.clear(); + // run command + String ipConfigResponse = null; + try { + ipConfigResponse = runConsoleCommand(VistaNetworkInfo.IPCONFIG_COMMAND); + } catch (IOException e) { + e.printStackTrace(); + throw new ParseException(e.getMessage(), 0); + } + + java.util.StringTokenizer tokenizer = new java.util.StringTokenizer(ipConfigResponse, "\n"); + String macAddressCandidate; + String lastMAC = null; + String[] splitLine = null; + boolean foundActive = false; + while (tokenizer.hasMoreTokens()) { + // split the line and take everything right from the ":" + splitLine = tokenizer.nextToken().trim().split(":"); + macAddressCandidate = splitLine[1]; + // see if line might contain a MAC address + if (VistaNetworkInfo.isMacAddress(macAddressCandidate)) { + // Ok we got something, but we better check if it's active + macAddressCandidate.replace(':', '-'); + lastMAC = macAddressCandidate; + } else if ((lastMAC != null) && (splitLine[0].trim().equals("Status"))) { + // only german to test things + if (!splitLine[1].equals("getrennt")) { + NetworkInfo.macAddresses.add(lastMAC); + foundActive = true; + break; + } + } + } + // we found some wireless devices but none was active + if ((lastMAC != null) && !foundActive){ + NetworkInfo.macAddresses.add(lastMAC); + System.out.println("Inaktives Netz"); + } + } + + private static boolean isMacAddress(String macAddressCandidate){ + Pattern macPattern = Pattern.compile("([0-9A-F]{2})(([-:][0-9A-F]{2}){5})(([-:][0-9A-F]{2}){2})?"); + // .compile("[0-9a-fA-F]{2}([-:]{1}[0-9a-fA-F]{2}[-:]{1}[0-9a-fA-F]{2}[-:]{1}[0-9a-fA-F]{2}[-:]{1}[0-9a-fA-F]{2}[-:]{1}[0-9a-fA-F]{2})"); + Matcher m = macPattern.matcher(macAddressCandidate.toUpperCase()); + return m.matches(); + } +} \ No newline at end of file Added: trunk/magicmapclient/src/net/sf/magicmap/client/utils/NodeTypes.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/utils/NodeTypes.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/client/utils/NodeTypes.java 2008-01-28 13:22:14 UTC (rev 719) @@ -0,0 +1,9 @@ +package net.sf.magicmap.client.utils; + + +public final class NodeTypes { + public static final String ACCESSPOINT = "ACCESSPOINT"; + public final static String LOCATION = "POSITION"; + public static final String CLIENT = "CLIENT"; + public static final String SNIFFER = "SNIFFER"; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-01-28 14:01:48
|
Revision: 718 http://magicmap.svn.sourceforge.net/magicmap/?rev=718&view=rev Author: anweiss Date: 2008-01-28 05:18:41 -0800 (Mon, 28 Jan 2008) Log Message: ----------- added hashmap with attributes for every node that can be stored on the server Modified Paths: -------------- trunk/magicmapclient/.project trunk/magicmapclient/.settings/org.eclipse.jdt.core.prefs trunk/magicmapclient/.settings/org.eclipse.jdt.ui.prefs trunk/magicmapclient/inf/PositionFacade.wsdl trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java trunk/magicmapclient/src/net/sf/magicmap/client/controller/IController.java trunk/magicmapclient/src/net/sf/magicmap/client/controller/PollHandler.java trunk/magicmapclient/src/net/sf/magicmap/client/controller/SOAPServerManager.java trunk/magicmapclient/src/net/sf/magicmap/client/controller/ServerManager.java trunk/magicmapclient/src/net/sf/magicmap/client/controller/VirtualServerManager.java trunk/magicmapclient/src/net/sf/magicmap/client/delegate/PositionDelegate.java trunk/magicmapclient/src/net/sf/magicmap/client/delegate/interfaces/PositionFacadeInterface.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/MapPanel.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/LoadMapDialog.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/GUIUtils.java trunk/magicmapclient/src/net/sf/magicmap/client/model/measurement/IMeasurementModel.java trunk/magicmapclient/src/net/sf/magicmap/client/model/node/AccessPointSeerNode.java trunk/magicmapclient/src/net/sf/magicmap/client/model/node/Node.java trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeModel.java trunk/magicmapclient/src/net/sf/magicmap/client/net/NetworkInfo.java trunk/magicmapclient/src/net/sf/magicmap/client/utils/DriverInformations.java Modified: trunk/magicmapclient/.project =================================================================== --- trunk/magicmapclient/.project 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/.project 2008-01-28 13:18:41 UTC (rev 718) @@ -11,10 +11,16 @@ <arguments> </arguments> </buildCommand> + <buildCommand> + <name>net.sf.eclipsensis.installoptions.InstallOptionsBuilder</name> + <arguments> + </arguments> + </buildCommand> </buildSpec> <natures> <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> <nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.jem.beaninfo.BeanInfoNature</nature> + <nature>net.sf.eclipsensis.installoptions.InstallOptionsNature</nature> </natures> </projectDescription> Modified: trunk/magicmapclient/.settings/org.eclipse.jdt.core.prefs =================================================================== --- trunk/magicmapclient/.settings/org.eclipse.jdt.core.prefs 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/.settings/org.eclipse.jdt.core.prefs 2008-01-28 13:18:41 UTC (rev 718) @@ -1,4 +1,4 @@ -#Mon Sep 04 16:13:41 CEST 2006 +#Fri Nov 09 15:22:53 CET 2007 eclipse.preferences.version=1 org.eclipse.jdt.core.formatter.align_type_members_on_columns=true org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 Modified: trunk/magicmapclient/.settings/org.eclipse.jdt.ui.prefs =================================================================== --- trunk/magicmapclient/.settings/org.eclipse.jdt.ui.prefs 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/.settings/org.eclipse.jdt.ui.prefs 2008-01-28 13:18:41 UTC (rev 718) @@ -1,4 +1,5 @@ -#Thu Aug 31 15:41:15 CEST 2006 +#Fri Nov 09 15:22:53 CET 2007 eclipse.preferences.version=1 formatter_profile=_MagicMap Coding Conventions formatter_settings_version=10 +internal.default.compliance=default Modified: trunk/magicmapclient/inf/PositionFacade.wsdl =================================================================== (Binary files differ) Modified: trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java 2008-01-28 13:18:41 UTC (rev 718) @@ -4,6 +4,13 @@ package net.sf.magicmap.client.controller; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.HashMap; + import net.sf.magicmap.client.gui.MainGUI; import net.sf.magicmap.client.gui.utils.GUIUtils; import net.sf.magicmap.client.gui.views.MapView; @@ -13,20 +20,22 @@ import net.sf.magicmap.client.measurement.interfaces.AbstractScanner; import net.sf.magicmap.client.measurement.interfaces.AbstractScannerHandler; import net.sf.magicmap.client.meta.MapInfo; -import net.sf.magicmap.client.model.node.*; +import net.sf.magicmap.client.model.node.ClientNode; +import net.sf.magicmap.client.model.node.GeoPos; +import net.sf.magicmap.client.model.node.INodeModel; +import net.sf.magicmap.client.model.node.MapNode; +import net.sf.magicmap.client.model.node.Node; +import net.sf.magicmap.client.model.node.NodeModel; import net.sf.magicmap.client.plugin.PluginManager; +import net.sf.magicmap.client.utils.DriverInformations; import net.sf.magicmap.client.utils.Settings; import net.sf.magicmap.core.model.node.IMagicNodeModel; import net.sf.magicmap.core.model.node.impl.MagicNodeModel; import net.sf.magicmap.server.dto.MapDTO; import net.sf.magicmap.server.exception.SessionException; + import org.apache.log4j.xml.DOMConfigurator; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; - /** * Kann \xC4nderungen an View und am Modell vornehmen und zieht alle F\xE4den * der Anwendung. @@ -42,35 +51,38 @@ MapNamesCallback, MapCallback { - private static int numCalled = 0; - private static int disconnectAttempts = 0; + private static int numCalled = 0; + private static int disconnectAttempts = 0; /** * Die Instanz. */ - private static Controller controller = null; + private static Controller controller = null; /** * Das Knotenmodel. */ + private IMagicNodeModel nodeModel; // Model f\xFCr Graphen private ClientNode client; // Ausgezeichneter Knoten - private ServerPoller poller; // Server st\xE4ndig nach \xC4nderungen fragen + private HashMap<String, String> ClientAttributes = new HashMap<String,String>(); // zus\xE4tzliche Attribute f\xFCr den Clienten - private PollHandler pollhandler; // Klasse zur Verarbeitung der Pollergebnisse + private ServerPoller poller; // Server st\xE4ndig nach \xC4nderungen fragen - private ServerManager serverManager; // Manager f\xFCr die Verbindung zum Server + private PollHandler pollhandler; // Klasse zur Verarbeitung der Pollergebnisse + private ServerManager serverManager; // Manager f\xFCr die Verbindung zum Server + // private CallbackHandler callbackHandler; // S\xE4mtliche callbacks werden dort behandelt - private MapInfo currentMap; + private MapInfo currentMap; - private boolean invisble; // Invisible-Modus (keine Daten an Server) + private boolean invisble; // Invisible-Modus (keine Daten an Server) - private ScannerAllocator scannerAllocator; - private PluginManager pluginManager; + private ScannerAllocator scannerAllocator; + private PluginManager pluginManager; /** * Private constructor for singleton instance @@ -169,13 +181,13 @@ this.scannerAllocator.startAllScanner(); this.pluginManager.loadMap(); -// if (this.currentMap.realheight > 0 && this.currentMap.realwidth > 0) + // if (this.currentMap.realheight > 0 && this.currentMap.realwidth > 0) // TODO: Interface f\xFCr GUI mit methode setMapTitle() -// ((MapView) MainGUI.getInstance().getJComponent("mapView")).setTitle(GUIUtils.i18n("map", false) + " - " -// + this.currentMap.name + " Gr\xF6\xDFe: " + this.currentMap.realwidth + " X " -// + this.currentMap.realheight + " cm"); + // ((MapView) MainGUI.getInstance().getJComponent("mapView")).setTitle(GUIUtils.i18n("map", false) + " - " + // + this.currentMap.name + " Gr\xF6\xDFe: " + this.currentMap.realwidth + " X " + // + this.currentMap.realheight + " cm"); } } @@ -306,11 +318,12 @@ * Erzeugt einen Referenzpunkt auf der aktuellen Karte mit den aktuellen * Messwerten des Clients mit den angegebenen Koordinaten. */ - public void createLocation(int x, int y, int z, String name, boolean fixed, CreatePositionCallback callback){ + public void createLocation(int x, int y, int z, String name, boolean fixed, HashMap<String, String> attributes, + CreatePositionCallback callback){ if (!isConnected() || !isMapLoaded()) callback.positionCreationError(new Exception("Nicht verbunden oder keine Karte geladen.")); else - this.serverManager.createLocation(x, y, z, fixed, name, callback); + this.serverManager.createLocation(x, y, z, fixed, name, attributes, callback); } /** @@ -389,15 +402,15 @@ } public void setClientPosition(final int x, final int y, final int z, final boolean fixed, final String clientMac, - final PositionCallback callback){ + final HashMap<String, String> attributes, final PositionCallback callback){ - this.serverManager.setClientPosition(x, y, z, fixed, clientMac, callback); + this.serverManager.setClientPosition(x, y, z, fixed, clientMac, attributes, callback); } public void setAccessPointPosition(final int x, final int y, final int z, boolean fixed, - final String accessPointMac, final PositionCallback callback){ + final String accessPointMac, final HashMap<String, String> attributes, final PositionCallback callback){ - this.serverManager.setAccessPointPosition(x, y, z, fixed, accessPointMac, callback); + this.serverManager.setAccessPointPosition(x, y, z, fixed, accessPointMac, attributes, callback); } public void setAccessPointHiddenStatus(String accessPointMac, boolean hidden, PositionCallback callback){ @@ -527,4 +540,21 @@ nodeModel.addNode(node); } catch (MalformedURLException e) {} catch (IOException e) {} } -} + + public HashMap<String, String> getClientAttributes(){ + return ClientAttributes; + } + + public void setClientAttributes(HashMap<String, String> clientAttributes){ + ClientAttributes = clientAttributes; + } + + public void addInterface(HashMap<String, String> intorface){ +// int count = Integer.parseInt(this.getClientAttributes().get(DriverInformations.NUMBEROFINTERFACES)); + if (!(this.getClientAttributes().containsValue(intorface.get(DriverInformations.DEVICENAME)))) { +// count++; +// this.ClientAttributes.put(DriverInformations.NUMBEROFINTERFACES, String.valueOf(count)); + this.ClientAttributes.putAll(intorface); + } + } +} \ No newline at end of file Modified: trunk/magicmapclient/src/net/sf/magicmap/client/controller/IController.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/controller/IController.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/IController.java 2008-01-28 13:18:41 UTC (rev 718) @@ -1,6 +1,7 @@ package net.sf.magicmap.client.controller; +import java.util.HashMap; import net.sf.magicmap.client.interfaces.*; import net.sf.magicmap.client.measurement.interfaces.AbstractScanResult; import net.sf.magicmap.client.measurement.interfaces.AbstractScanner; @@ -118,7 +119,7 @@ * Erzeugt einen Referenzpunkt auf der aktuellen Karte mit den aktuellen * Messwerten des Clients mit den angegebenen Koordinaten. */ - void createLocation(int x, int y, int z, String name, boolean fixed, CreatePositionCallback callback); + void createLocation(int x, int y, int z, String name, boolean fixed, final HashMap <String, String> attributes, CreatePositionCallback callback); /** * Erzeugt eine Geokoordinate auf der aktuellen Karte mit den angegebenen @@ -157,9 +158,9 @@ */ void deleteGeoPoint(String name, String string, DeletePositionCallback callback); - void setClientPosition(int x, int y, int z, boolean fixed, String clientMac, PositionCallback callback); + void setClientPosition(int x, int y, int z, boolean fixed, String clientMac, HashMap <String, String> attributes, PositionCallback callback); - void setAccessPointPosition(int x, int y, int z, boolean fixed, String accessPointMac, PositionCallback callback); + void setAccessPointPosition(int x, int y, int z, boolean fixed, String accessPointMac, HashMap <String, String> attributes, PositionCallback callback); void setAccessPointHiddenStatus(String accessPointMac, boolean hidden, PositionCallback callback); Modified: trunk/magicmapclient/src/net/sf/magicmap/client/controller/PollHandler.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/controller/PollHandler.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/PollHandler.java 2008-01-28 13:18:41 UTC (rev 718) @@ -313,10 +313,14 @@ // Position \xE4ndern if (!client.isCalculated()) client.setPosition(position.getPosX(), position.getPosY(), position.getPosZ()); // FixierungsStatus setzen - client.setFix(position.isFixed()); + if (position.isFixed()) { + client.setPosition(position.getPosX(), position.getPosY(), position.getPosZ()); + client.setFix(position.isFixed()); + } else + client.setFix(position.isFixed()); - // TODO: ist die id hier wirklich notwendig? - client.setId(position.getId()); + // TODO: ist die id hier wirklich notwendig? + client.setId(position.getId()); // Signalst\xE4rken usw. verwaltet der scannende // Client selbst Modified: trunk/magicmapclient/src/net/sf/magicmap/client/controller/SOAPServerManager.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/controller/SOAPServerManager.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/SOAPServerManager.java 2008-01-28 13:18:41 UTC (rev 718) @@ -7,6 +7,7 @@ import java.io.IOException; import java.rmi.RemoteException; import java.util.Collection; +import java.util.HashMap; import edu.uci.ics.jung.graph.Vertex; import edu.uci.ics.jung.visualization.SpringLayout; @@ -264,7 +265,7 @@ */ @Override public void createLocation(final int x, final int y, final int z, final boolean fixed, final String name, - final CreatePositionCallback callback){ + final HashMap<String, String> attributes, final CreatePositionCallback callback){ if (isConnected()) { final SignalCharacterDTO signalCharacter = currentSignalCharacter(); System.out.println("signalCharacter.getSimpleScanResults() " + signalCharacter.getSimpleScanResults()); @@ -279,7 +280,7 @@ SOAPServerManager.this.positionDelgate.createOrUpdatePosition( SOAPServerManager.this.sessionId, SOAPServerManager.this.controller.getCurrentMap().name, x, y, z, signalCharacter, - name, fixed); + name, fixed, attributes); // TODO: Zus\xE4tzliche Parameter zur Position callback.positionCreated(); } catch (Exception e) { @@ -453,7 +454,7 @@ */ @Override public void setClientPosition(final int x, final int y, final int z, final boolean fixed, final String clientMac, - final PositionCallback callback){ + final HashMap<String, String> attributes, final PositionCallback callback){ if (isConnected()) { Thread positionThread = new Thread() { @@ -465,7 +466,7 @@ SOAPServerManager.this.positionDelgate.createOrUpdateClientPosition( SOAPServerManager.this.sessionId, SOAPServerManager.this.controller.getCurrentMap().name, x, y, z, - currentSignalCharacter(), clientMac, fixed); + currentSignalCharacter(), clientMac, fixed, attributes); // TODO: Zus\xE4tzliche Parameter zur Position callback.positionUpdated(clientMac); } catch (Exception e) { @@ -494,7 +495,7 @@ */ @Override public void setAccessPointPosition(final int x, final int y, final int z, final boolean fixed, - final String accessPointMac, final PositionCallback callback){ + final String accessPointMac, final HashMap<String, String> attributes, final PositionCallback callback){ if (isConnected()) { Thread positionThread = new Thread() { @@ -506,7 +507,7 @@ SOAPServerManager.this.positionDelgate.createOrUpdateAccessPosition( SOAPServerManager.this.sessionId, SOAPServerManager.this.controller.getCurrentMap().name, x, y, z, accessPointMac, - fixed); + fixed, attributes); // TODO: Zus\xE4tzliche Parameter zur Position callback.positionUpdated(accessPointMac); } catch (Exception e) { @@ -619,10 +620,12 @@ synchronized (SOAPServerManager.mutex) { if (!isConnected()) return; try { - // TODO: abfrage ist im moment nicht aus dem Nodemodel m\xF6glich, daher behelfsl\xF6sung direkt aus dem Layout + // TODO: abfrage ist im moment nicht aus dem Nodemodel m\xF6glich, daher behelfsl\xF6sung direkt aus dem Layout ClientNode client = Controller.getInstance().getClient(); - Vertex clientVertex = ((JungNodePlacer) Controller.getInstance().getNodeModel().getNodePlacer()).findVertex(client); - SpringLayout layout = ((JungNodePlacer) Controller.getInstance().getNodeModel().getNodePlacer()).getLayout(); + Vertex clientVertex = ((JungNodePlacer) Controller.getInstance().getNodeModel() + .getNodePlacer()).findVertex(client); + SpringLayout layout = ((JungNodePlacer) Controller.getInstance().getNodeModel() + .getNodePlacer()).getLayout(); int x = (int) layout.getX(clientVertex); int y = (int) layout.getY(clientVertex); int z = SOAPServerManager.this.controller.getClientPosZ(); @@ -642,7 +645,8 @@ SOAPServerManager.this.sessionId, SOAPServerManager.this.controller.getCurrentMap().name, x, y, z, signalCharacter, SOAPServerManager.this.controller.getClient().getMacAddress(), - SOAPServerManager.this.controller.getClient().isFix()); + SOAPServerManager.this.controller.getClient().isFix(), + SOAPServerManager.this.controller.getClientAttributes()); // TODO: Zus\xE4tzliche Parameter zur Position System.out.println("Client info submitted."); } catch (Exception e) { Modified: trunk/magicmapclient/src/net/sf/magicmap/client/controller/ServerManager.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/controller/ServerManager.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/ServerManager.java 2008-01-28 13:18:41 UTC (rev 718) @@ -12,6 +12,7 @@ import java.util.Calendar; import java.util.Collection; import java.util.GregorianCalendar; +import java.util.HashMap; import java.util.Iterator; import net.sf.magicmap.client.interfaces.CreateNewMapCallback; @@ -145,7 +146,7 @@ * @param node * @param callback */ - public abstract void createLocation(final int x, final int y, final int z, final boolean fixed, final String name, + public abstract void createLocation(final int x, final int y, final int z, final boolean fixed, final String name, final HashMap<String, String> attributes, final CreatePositionCallback callback); /** @@ -181,7 +182,7 @@ public void movePosition(long sessionId, long positionId, int newPositionX, int newPositionY) throws RemoteException, public void deletePosition(long sessionId, long positionId) throws RemoteException, MapException, SessionException{ */public abstract void setClientPosition(final int x, final int y, final int z, final boolean fixed, - final String clientMac, final PositionCallback callback); + final String clientMac, final HashMap<String, String> attributes, final PositionCallback callback); /** * Eine Position von (-1,-1) bedeutet, dass der Client nicht fixiert ist sondern @@ -192,7 +193,7 @@ * @param callback Callback */ public abstract void setAccessPointPosition(final int x, final int y, final int z, final boolean fixed, - final String accessPointMac, final PositionCallback callback); + final String accessPointMac, final HashMap<String, String> attributes, final PositionCallback callback); /** * Setzt den Berechnungsstatus des Accesspoint Modified: trunk/magicmapclient/src/net/sf/magicmap/client/controller/VirtualServerManager.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/controller/VirtualServerManager.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/VirtualServerManager.java 2008-01-28 13:18:41 UTC (rev 718) @@ -5,6 +5,7 @@ package net.sf.magicmap.client.controller; import java.util.ArrayList; +import java.util.HashMap; import net.sf.magicmap.client.interfaces.CreateNewMapCallback; import net.sf.magicmap.client.interfaces.CreatePositionCallback; @@ -20,6 +21,7 @@ import net.sf.magicmap.client.interfaces.ServerDisconnectCallback; import net.sf.magicmap.client.meta.MapInfo; import net.sf.magicmap.client.model.node.GeoPos; +import net.sf.magicmap.client.utils.NodeTypes; import net.sf.magicmap.client.utils.Settings; import net.sf.magicmap.client.utils.Version; import net.sf.magicmap.server.Init; @@ -39,7 +41,7 @@ */ public class VirtualServerManager extends ServerManager { - private static String mutex = "net.sf.magicmap.client.controller.Controller"; + private static String mutex = "net.sf.magicmap.client.controller.Controller"; /** * @param controller @@ -230,7 +232,7 @@ * net.sf.magicmap.client.interfaces.CreatePositionCallback) */ public void createLocation(final int x, final int y, final int z, final boolean fixed, final String name, - final CreatePositionCallback callback){ + final HashMap<String, String> attributes, final CreatePositionCallback callback){ if (!isConnected()) return; final SignalCharacterDTO signalCharacter = currentSignalCharacter(); System.out.println("signalCharacter.getSimpleScanResults() " + signalCharacter.getSimpleScanResults()); @@ -240,8 +242,8 @@ synchronized (mutex) { if (!isConnected()) return; try { - positionFacade.createOrUpdatePosition(sessionId, controller.getCurrentMap().name, x, y, z, - signalCharacter, name, fixed); + positionFacade.createOrUpdatePosition(sessionId, NodeTypes.LOCATION, controller.getCurrentMap().name, x, + y, z, signalCharacter, name, fixed, attributes); // TODO: Zus\xE4tzliche Parameter zur Position callback.positionCreated(); } catch (Exception e) { @@ -351,7 +353,7 @@ * net.sf.magicmap.client.interfaces.PositionCallback) */ public void setClientPosition(final int x, final int y, final int z, final boolean fixed, final String clientMac, - final PositionCallback callback){ + final HashMap<String, String> attributes, final PositionCallback callback){ if (!isConnected()) return; Thread thread = new Thread() { @@ -360,8 +362,8 @@ if (!isConnected()) return; try { - positionFacade.createOrUpdateClientPosition(sessionId, controller.getCurrentMap().name, x, y, - z, currentSignalCharacter(), clientMac, fixed); + positionFacade.createOrUpdatePosition(sessionId, NodeTypes.CLIENT, controller.getCurrentMap().name, x, y, + z, currentSignalCharacter(), clientMac, fixed, attributes); // TODO: Zus\xE4tzliche Parameter zur Position callback.positionUpdated(clientMac); } catch (Exception e) { @@ -382,7 +384,7 @@ * net.sf.magicmap.client.interfaces.PositionCallback) */ public void setAccessPointPosition(final int x, final int y, final int z, final boolean fixed, - final String accessPointMac, final PositionCallback callback){ + final String accessPointMac, final HashMap<String, String> attributes, final PositionCallback callback){ if (!isConnected()) return; Thread thread = new Thread() { @@ -390,8 +392,9 @@ synchronized (mutex) { if (!isConnected()) return; try { - positionFacade.createOrUpdateAccessPosition(sessionId, controller.getCurrentMap().name, x, y, - z, accessPointMac, fixed); + //TODO: SignalCharacter for APs? + positionFacade.createOrUpdatePosition(sessionId, NodeTypes.ACCESSPOINT, controller.getCurrentMap().name, + x, y, z, null, accessPointMac, fixed, attributes); // TODO: Zus\xE4tzliche Parameter zur Position callback.positionUpdated(accessPointMac); } catch (Exception e) { @@ -447,13 +450,14 @@ synchronized (mutex) { if (!isConnected()) return; try { + // TODO: use the arraylist and not null! or make null the null the default value to get all types PositionDTO[] positions; if (VirtualServerManager.this.timestamp == -1) positions = positionFacade.getPositionsForMapSince(VirtualServerManager.this.sessionId, - controller.getCurrentMap().name, new Long(3600000), true); + null, controller.getCurrentMap().name, new Long(3600000), true); else positions = positionFacade.getPositionsForMapSince(VirtualServerManager.this.sessionId, - controller.getCurrentMap().name, VirtualServerManager.this.timestamp, false); + null, controller.getCurrentMap().name, VirtualServerManager.this.timestamp, false); for (int i = 0; i < positions.length; i++) { if (positions[i].getLastModified().longValue() > timestamp) { timestamp = positions[i].getLastModified().longValue(); @@ -499,6 +503,7 @@ int y = controller.getClientPosY(); // int z = 0; int z = controller.getClientPosZ(); + HashMap<String, String> attributes = controller.getClientAttributes(); if (x < 0) x = 0; else if (x >= controller.getCurrentMap().width) x = controller.getCurrentMap().width - 1; @@ -509,9 +514,9 @@ if (z < 0) z = 0; // else if (z >= ) z = ;; - positionFacade.createOrUpdateClientPosition(sessionId, controller.getCurrentMap().name, x, y, + positionFacade.createOrUpdatePosition(sessionId, NodeTypes.CLIENT, controller.getCurrentMap().name, x, y, z, signalCharacter, controller.getClient().getMacAddress(), controller.getClient() - .isFix()); + .isFix(), attributes); // TODO: Zus\xE4tzliche Parameter zur Position System.out.println("Client info submitted."); } catch (Exception e) { Modified: trunk/magicmapclient/src/net/sf/magicmap/client/delegate/PositionDelegate.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/delegate/PositionDelegate.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/delegate/PositionDelegate.java 2008-01-28 13:18:41 UTC (rev 718) @@ -4,6 +4,7 @@ import java.net.MalformedURLException; import java.net.URL; import java.rmi.RemoteException; +import java.util.HashMap; import localhost.magicmap.services.PositionFacade.PositionFacade; import localhost.magicmap.services.PositionFacade.PositionFacadeServiceLocator; @@ -54,13 +55,13 @@ * java.lang.String, int, int, * com.saugstation.pacw.generated.SignalCharacter, java.lang.String) */ - public void createOrUpdatePosition(long sessionId, String mapName, int positionX, int positionY, int positionZ, - SignalCharacterDTO character, String positionName, boolean fixed) throws RemoteException, MapException, - SessionException{ + public void createOrUpdatePosition(long sessionId,String mapName, int positionX, int positionY, int positionZ, + SignalCharacterDTO character, String positionName, boolean fixed, HashMap<String, String> attributes) + throws RemoteException, MapException, SessionException{ try { long timeA = System.currentTimeMillis(); - this.binding.createOrUpdatePosition(sessionId, mapName, positionX, positionY, positionZ, character, - positionName, fixed); + this.binding.createOrUpdatePosition(sessionId, "POSITION", mapName, positionX, positionY, positionZ, + character, positionName, fixed, attributes); long timeB = System.currentTimeMillis(); System.out.println("createOrUpdatePosition brauchte: " + (timeB - timeA) + "ms"); } catch (Exception e) { @@ -76,12 +77,12 @@ * com.saugstation.pacw.generated.SignalCharacter, java.lang.String) */ public void createOrUpdateClientPosition(long sessionId, String mapName, int positionX, int positionY, - int positionZ, SignalCharacterDTO character, String clientMac, boolean fixed) throws RemoteException, - MapException, SessionException{ + int positionZ, SignalCharacterDTO character, String clientMac, boolean fixed, + HashMap<String, String> attributes) throws RemoteException, MapException, SessionException{ try { long timeA = System.currentTimeMillis(); - this.binding.createOrUpdateClientPosition(sessionId, mapName, positionX, positionY, positionZ, character, - clientMac, fixed); + this.binding.createOrUpdatePosition(sessionId, "CLIENT", mapName, positionX, positionY, positionZ, + character, clientMac, fixed, attributes); long timeB = System.currentTimeMillis(); System.out.println("createOrUpdateClientPosition brauchte: " + (timeB - timeA) + "ms"); } catch (Exception e) { @@ -97,11 +98,12 @@ * com.saugstation.pacw.generated.SignalCharacter, java.lang.String) */ public void createOrUpdateAccessPosition(long sessionId, String mapName, int positionX, int positionY, - int positionZ, String accessPointMac, boolean fixed) throws RemoteException, MapException, SessionException{ + int positionZ, String accessPointMac, boolean fixed, HashMap<String, String> attributes) + throws RemoteException, MapException, SessionException{ try { long timeA = System.currentTimeMillis(); - this.binding.createOrUpdateAccessPosition(sessionId, mapName, positionX, positionY, positionZ, - accessPointMac, fixed); + this.binding.createOrUpdatePosition(sessionId, "ACCESSPOINT", mapName, positionX, positionY, positionZ, + null, accessPointMac, fixed, attributes); long timeB = System.currentTimeMillis(); System.out.println("createOrUpdateAccessPosition brauchte: " + (timeB - timeA) + "ms"); } catch (Exception e) { @@ -153,7 +155,7 @@ */ public PositionDTO[] getPositionsForMapSince(long sessionId, String mapName, long timeStamp, boolean timeflag) throws RemoteException, MapException, SessionException{ - return this.binding.getPositionsForMapSince(sessionId, mapName, timeStamp, timeflag); + return this.binding.getPositionsForMapSince(sessionId, null, mapName, timeStamp, timeflag); } /* Modified: trunk/magicmapclient/src/net/sf/magicmap/client/delegate/interfaces/PositionFacadeInterface.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/delegate/interfaces/PositionFacadeInterface.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/delegate/interfaces/PositionFacadeInterface.java 2008-01-28 13:18:41 UTC (rev 718) @@ -1,11 +1,11 @@ /* * Created on 15.11.2004 - * */ package net.sf.magicmap.client.delegate.interfaces; import java.rmi.RemoteException; +import java.util.HashMap; import net.sf.magicmap.server.dto.PositionDTO; import net.sf.magicmap.server.dto.SignalCharacterDTO; @@ -32,8 +32,8 @@ * @throws MapException Fehlende Karte, inkosistente Positionsangaben */ public abstract void createOrUpdatePosition(long sessionId, String mapName, int positionX, int positionY, - int positionZ, SignalCharacterDTO character, String positionName, boolean fixed) throws SessionException, - MapException, RemoteException; + int positionZ, SignalCharacterDTO character, String identifier, boolean fixed, + HashMap<String, String> attributes) throws SessionException, MapException, RemoteException; /** * Legt eine Position f�r einen Client fest oder korrigiert diese @@ -48,8 +48,8 @@ * @throws MapException Fehlende Karte, inkosistente Positionsangaben */ public abstract void createOrUpdateClientPosition(long sessionId, String mapName, int positionX, int positionY, - int positionZ, SignalCharacterDTO character, String clientMac, boolean fixed) throws SessionException, - MapException, RemoteException; + int positionZ, SignalCharacterDTO character, String clientMac, boolean fixed, + HashMap<String, String> attribute) throws SessionException, MapException, RemoteException; /** * Legt eine Position f�r einen AccessPoint fest oder korrigiert diese @@ -64,7 +64,8 @@ * @throws MapException Fehlende Karte, inkosistente Positionsangaben */ public abstract void createOrUpdateAccessPosition(long sessionId, String mapName, int positionX, int positionY, - int positionZ, String accessPointMac, boolean fixed) throws SessionException, MapException, RemoteException; + int positionZ, String accessPointMac, boolean fixed, HashMap<String, String> attribute) + throws SessionException, MapException, RemoteException; /** * Verschiebt eine beliebige Position auf der Karte Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/MapPanel.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/MapPanel.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/MapPanel.java 2008-01-28 13:18:41 UTC (rev 718) @@ -397,7 +397,7 @@ * nehmen! */ Controller.getInstance().createLocation(getLastX(), getLastY(), Settings.DEFAULT_HEIGHT, - (r + " (" + Controller.getInstance().getClient().getName() + ") <" + timeAsString + ">"), true, + (r + " (" + Controller.getInstance().getClient().getName() + ") <" + timeAsString + ">"), true, Controller.getInstance().getClientAttributes(), this); } } @@ -425,7 +425,7 @@ this.selectedNode.setUpdate(true); // aktuelles Icon wird auf das // UpdateIcon gesetzt Controller.getInstance() - .createLocation(getLastX(), getLastY(), this.selectedNode.getZ(), r, true, this); // der + .createLocation(getLastX(), getLastY(), this.selectedNode.getZ(), r, true, Controller.getInstance().getClientAttributes(), this); // der // Referenzpunkt neu eingemessen } @@ -481,7 +481,7 @@ Controller.getInstance() .setAccessPointPosition(this.selectedNode.getX(), this.selectedNode.getY(), this.selectedNode.getZ(), true, - ((AccessPointNode) this.selectedNode).getMacAddress(), this); + ((AccessPointNode) this.selectedNode).getMacAddress(), this.selectedNode.getAttributes(), this); else Controller.getInstance().movePosition(this.selectedNode.getId(), Controller.getInstance().getCurrentMap().name, this.selectedNode.getX(), @@ -489,7 +489,7 @@ } else if (this.selectedNode.getType() == NodeModelConstants.NODETYPE_CLIENT) { if (this.selectedNode.getId() == -1) Controller.getInstance().setClientPosition(this.selectedNode.getX(), this.selectedNode.getY(), - this.selectedNode.getZ(), true, ((ClientNode) this.selectedNode).getMacAddress(), this); + this.selectedNode.getZ(), true, ((ClientNode) this.selectedNode).getMacAddress(), this.selectedNode.getAttributes(), this); else Controller.getInstance().movePosition(this.selectedNode.getId(), Controller.getInstance().getCurrentMap().name, this.selectedNode.getX(), @@ -497,7 +497,7 @@ } else if (this.selectedNode.getType() == NodeModelConstants.NODETYPE_LOCATION) if (this.selectedNode.getId() == -1) Controller.getInstance().createLocation(this.selectedNode.getX(), this.selectedNode.getY(), - this.selectedNode.getZ(), this.selectedNode.getName(), true, this); + this.selectedNode.getZ(), this.selectedNode.getName(), true, this.selectedNode.getAttributes(), this); else Controller.getInstance().movePosition(this.selectedNode.getId(), Controller.getInstance().getCurrentMap().name, this.selectedNode.getX(), Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/LoadMapDialog.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/LoadMapDialog.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/LoadMapDialog.java 2008-01-28 13:18:41 UTC (rev 718) @@ -116,6 +116,11 @@ this.list = new JList(mapModel); list.setCellRenderer(new DefaultListCellRenderer() { + /** + * Default serial version UID + */ + private static final long serialVersionUID = 1L; + @Override public Component getListCellRendererComponent(JList list, Object value, int arg2, boolean arg3, boolean arg4){ Component cellRenderer = super.getListCellRendererComponent(list, value, arg2, arg3, arg4); Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/GUIUtils.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/GUIUtils.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/GUIUtils.java 2008-01-28 13:18:41 UTC (rev 718) @@ -5,20 +5,29 @@ package net.sf.magicmap.client.gui.utils; +import java.awt.Dimension; +import java.awt.Window; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.SwingConstants; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.border.EmptyBorder; +import javax.swing.plaf.metal.MetalLookAndFeel; + +import net.sf.magicmap.client.gui.MainGUI; + import com.jgoodies.looks.Options; import com.jgoodies.looks.plastic.Plastic3DLookAndFeel; -import com.jgoodies.looks.plastic.PlasticLookAndFeel; import com.jgoodies.looks.plastic.theme.ExperienceBlue; -import net.sf.magicmap.client.gui.MainGUI; -import javax.swing.*; -import javax.swing.border.EmptyBorder; -import javax.swing.plaf.metal.MetalLookAndFeel; -import java.awt.*; -import java.util.*; -import apple.laf.AquaLookAndFeel; - /** * @author msc * Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/measurement/IMeasurementModel.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/measurement/IMeasurementModel.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/measurement/IMeasurementModel.java 2008-01-28 13:18:41 UTC (rev 718) @@ -2,6 +2,7 @@ package net.sf.magicmap.client.model.measurement; import java.util.Collection; +import java.util.HashMap; import net.sf.magicmap.client.interfaces.MeasurementModelListener; @@ -17,13 +18,24 @@ */ public Collection<SeenAccessPoint> get(); +// /** +// * Add a scanresult. +// * @param apMac the accesspoints mac +// * @param signalLevel the signal level. +// */ +// void updateScanResult(String apMac, double signalLevel); + /** * Add a scanresult. * @param apMac the accesspoints mac * @param signalLevel the signal level. + * @param infos additional informations like type, hardware, drivers etc... + * The keys for "infos" can be found in net.sf.magicmap.client.utils.DriverInformations.java */ void updateScanResult(String apMac, double signalLevel); + + /** * Add a scanresult without using average calculation. * @param apMac the accesspoints mac @@ -44,6 +56,13 @@ * @param signalLevel */ void directUpdateScanResult(String[] apMac, double[] signalLevel); + + /** + * Batch update to avoid event overflow ;-) + * @param apMac + * @param signalLevel + */ + void updateScanResult(String[] apMac, double[] signalLevel, HashMap<String, String>[] infos); /** * Gets the SeenAccessPoint for a given seer. Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/node/AccessPointSeerNode.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/node/AccessPointSeerNode.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/node/AccessPointSeerNode.java 2008-01-28 13:18:41 UTC (rev 718) @@ -17,10 +17,9 @@ import net.sf.magicmap.client.model.measurement.IMeasurementModel; import net.sf.magicmap.client.model.measurement.SeenAccessPoint; - /** * Ein Objekt das Access Points in einer Umgebung mit Signalst\xE4rken sehen kann. - * + * * @author thuebner */ public abstract class AccessPointSeerNode extends Node { @@ -28,7 +27,7 @@ /* * Alle Kanten zu AccessPoints (AccessPointEdge) mit entsprechenden * Informationen \xFCber die Signalst\xE4rke - * + * */ private final Map<String, AccessPointEdge> apEdges = new HashMap<String, AccessPointEdge>(); private IMeasurementModel measurementModel; @@ -56,7 +55,7 @@ * AccessPointer-Seher gemessen wurde oder * net.sf.magicmap.client.measurement.Constants.MIN_SIGNALLEVEL wenn * AccessPoint nicht gesehen wird. - * + * * @param ap * @return */ @@ -67,15 +66,15 @@ /** * Setzt / Aktualisiert die Signalst\xE4rke zu einem Access Point - * + * * @param ap the access point - * @param level the signal strength of the ap + * @param the signal strength of the ap */ public void setSignalLevelForAcessPoint(AccessPointNode ap, double level){ if (!apEdges.containsKey(ap.getMacAddress())) { seesAccessPoint(ap, level); } else { - if(ap.isHidden()){ + if (ap.isHidden()) { notSeesAccessPoint(ap); return; } @@ -86,6 +85,18 @@ } + /** + * Normalisiert die Signalst\xE4rke zu einem Access Point + * + * @param ap the access point + * @param level the signal strength of the ap + */ + public void setSignalLevelForAcessPoint(AccessPointNode ap, double level,HashMap<String, Object> infos){ + // TODO : Normalisierung, Faktor einmal vom Server holen und dann das level umrechnen. + // TODO : Streuung und dergleichen berechnen + setSignalLevelForAcessPoint(ap, level); + } + public void seesAccessPoint(AccessPointNode ap, double signalStrength){ if (!getSeenAccessPoints().contains(ap) && !ap.isHidden()) { AccessPointEdge ae = new AccessPointEdge(); @@ -145,7 +156,7 @@ /** * New Model for measurements. contains all measurement made. - * + * */ public class MeasurementModel implements IMeasurementModel { @@ -157,9 +168,8 @@ } /** - * Adds an access point to the list of seen ap for a - * given client. - * + * Adds an access point to the list of seen ap for a given client. + * * @param client the client seeing the ap * @param ap the seen access point. */ @@ -168,10 +178,11 @@ apMap.put(ap.getMac(), ap); fireAccessPointAdded(ap); } - //client.getModel().updateNode(client, NodeModelConstants.UPDATE_SEESACCESSPOINT, null); + // client.getModel().updateNode(client, + // NodeModelConstants.UPDATE_SEESACCESSPOINT, null); } + public void updateScanResult(String apMac, double signalLevel){ - public void updateScanResult(String apMac, double signalLevel){ SeenAccessPoint accessPoint = getAccessPoint(apMac); final INodeModel nodeModel = AccessPointSeerNode.this.getModel(); @@ -203,7 +214,7 @@ } } } - + public void directUpdateScanResult(String apMac, double signalLevel){ SeenAccessPoint accessPoint = getAccessPoint(apMac); final INodeModel nodeModel = AccessPointSeerNode.this.getModel(); @@ -237,7 +248,6 @@ } } - public void updateScanResult(String[] apMac, double[] signalLevel){ HashSet<String> seenAps = new HashSet<String>(); for (SeenAccessPoint sap : this.get()) { @@ -251,7 +261,7 @@ updateScanResult(mac, Double.NEGATIVE_INFINITY); } } - + public void directUpdateScanResult(String[] apMac, double[] signalLevel){ HashSet<String> seenAps = new HashSet<String>(); for (SeenAccessPoint sap : this.get()) { @@ -265,9 +275,15 @@ directUpdateScanResult(mac, Double.NEGATIVE_INFINITY); } } + + public void updateScanResult(String[] apMac, double[] signalLevel, HashMap<String, String>[] infos){ + // TODO Auto-generated method stub + + } /** * Returns a list of seen access points for a given client. + * * @param forNode * @return */ @@ -325,6 +341,5 @@ mml.clearAccessPoints(); } } - } } \ No newline at end of file Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/node/Node.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/node/Node.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/node/Node.java 2008-01-28 13:18:41 UTC (rev 718) @@ -5,6 +5,7 @@ package net.sf.magicmap.client.model.node; import java.util.ArrayList; +import java.util.HashMap; /** * Einfacher Knoten in unserem Graphen aus Clients, AccessPoints, und @@ -12,78 +13,81 @@ * * @author thuebner */ -public abstract class Node implements INode{ - // Es gibt zwar die sch\xF6ne Methode Collections.emptyList() aber - // Da diese keine ArrayList ist m\xFCessen wir das selber machen :-/ - private static final ArrayList emptyList = new ArrayList(){ - public boolean add(Object o) { - return false; - } +public abstract class Node implements INode { - public void add(int index, Object element) { - } - }; - /** + // Es gibt zwar die sch\xF6ne Methode Collections.emptyList() aber + // Da diese keine ArrayList ist m\xFCessen wir das selber machen :-/ + private static final ArrayList emptyList = new ArrayList() { + + public boolean add(Object o){ + return false; + } + + public void add(int index, Object element){} + }; + /** * Ein leerer Knoten. */ - public static final Node EMPTY_NODE = new Node(null) { + public static final Node EMPTY_NODE = new Node(null) { - @Override - public ArrayList getNeighbors(){ - return emptyList; - } + @Override + public ArrayList getNeighbors(){ + return emptyList; + } - @Override - public int getType(){ - return -1; - } + @Override + public int getType(){ + return -1; + } - }; + }; /** * */ - private static int counter = 0; + private static int counter = 0; /** * */ - private String name; // Beschreibung + private String name; // Beschreibung /** * */ - private String displayName; + private String displayName; /** * */ - private String internal; + private String internal; - protected boolean fix; // Fest oder beweglich + protected boolean fix; // Fest oder beweglich /** * */ - protected boolean update = false; // wenn Referenzpunktupdate = true + protected boolean update = false; // wenn Referenzpunktupdate = true - private int x; // Position (nur wenn fix = true) + private int x; // Position (nur wenn fix = true) - private int y; + private int y; - private int z; + private int z; - private long id; + private long id; - private transient INodeModel model; + private transient INodeModel model; - private Node parentNode; + private Node parentNode; + private HashMap<String, String> attributes = new HashMap<String, String>(); + /** * true wenn der Knoten ein Objekt mit einer r\xE4umlichen * Ausbreitung darstellt. (Infoobjekte haben unter Umst\xE4nden keinen Ort). */ - private boolean physical; + private boolean physical; /** * Erzeugt leeren Knoten. Ein Knoten mu\xDF \xFCber sein NodeModel bescheid @@ -127,7 +131,6 @@ } /** - * TODO what does this mean? * @return */ public boolean isUpdate(){ @@ -135,7 +138,6 @@ } /** - * TODO !? * @param newupdate */ public void setUpdate(boolean newupdate){ @@ -273,4 +275,12 @@ return null; } + public void setAttributes(HashMap<String, String> newAttributes){ + this.attributes = newAttributes; + } + + public HashMap<String, String> getAttributes(){ + return this.attributes; + } + } \ No newline at end of file Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeModel.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeModel.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeModel.java 2008-01-28 13:18:41 UTC (rev 718) @@ -6,6 +6,7 @@ import net.sf.magicmap.client.meta.MapInfo; import net.sf.magicmap.client.model.location.INodePlacer; import net.sf.magicmap.client.model.location.jung.JungNodePlacer; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; Modified: trunk/magicmapclient/src/net/sf/magicmap/client/net/NetworkInfo.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/net/NetworkInfo.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/net/NetworkInfo.java 2008-01-28 13:18:41 UTC (rev 718) @@ -138,7 +138,9 @@ /** Sort of like a factory... */ public static NetworkInfo getNetworkInfo() throws IOException{ String os = System.getProperty("os.name"); - + if(os.contains("Vista")) + return new VistaNetworkInfo(); + else if (os.startsWith("Windows")) return new WindowsNetworkInfo(); else if (os.startsWith("Linux")) Modified: trunk/magicmapclient/src/net/sf/magicmap/client/utils/DriverInformations.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/utils/DriverInformations.java 2008-01-21 23:17:30 UTC (rev 717) +++ trunk/magicmapclient/src/net/sf/magicmap/client/utils/DriverInformations.java 2008-01-28 13:18:41 UTC (rev 718) @@ -1,13 +1,13 @@ + package net.sf.magicmap.client.utils; +public final class DriverInformations { -public final class DriverInformations { - public final static String DRIVER = "DRIVER"; - public final static String VENDOR = "VENDOR"; - public final static String PROVIDER= "PROVIDER"; - public final static String DATE = "DATE"; - public final static String VERSION = "VERSION"; - public final static String INFFILE = "INFFILE"; - public final static String TYPE = "TYPE"; - public final static String SUPPORTEDTYPES = "SUPPORTEDTYPES"; + public final static String OSNAME = "OSNAME"; //name of the operating system + public final static String RADIOTYPE = "RADIOTYPE"; //wlan, bluetooth, gsm, etc... + public final static String DEVICENAME = "DEVICENAME"; //name of the device + public final static String VENDOR = "VENDOR"; //name of the vendor + public final static String VERSION = "VERSION"; //driver version + public final static String TYPE = "TYPE"; + public final static String SUPPORTEDTYPES = "SUPPORTEDTYPES"; //e.g.: 802.11a 802.11b 802.11g } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-01-28 13:55:55
|
Revision: 720 http://magicmap.svn.sourceforge.net/magicmap/?rev=720&view=rev Author: anweiss Date: 2008-01-28 05:55:25 -0800 (Mon, 28 Jan 2008) Log Message: ----------- added hashmaps for (client) nodes Modified Paths: -------------- trunk/magicmapserver/.classpath trunk/magicmapserver/dblayer/src/net/sf/magicmap/db/Position.java trunk/magicmapserver/dblayer/src/net/sf/magicmap/db/ScanResult.java trunk/magicmapserver/src/net/sf/magicmap/server/cache/PositionCache.java trunk/magicmapserver/src/net/sf/magicmap/server/dto/PositionDTO.java trunk/magicmapserver/src/net/sf/magicmap/server/dto/SimpleScanResultDTO.java trunk/magicmapserver/src/net/sf/magicmap/server/facade/PositionFacade.java trunk/magicmapserver/src/net/sf/magicmap/server/interfaces/PositionFacadeInterface.java trunk/magicmapserver/src/net/sf/magicmap/server/utils/Version.java Modified: trunk/magicmapserver/.classpath =================================================================== --- trunk/magicmapserver/.classpath 2008-01-28 13:22:14 UTC (rev 719) +++ trunk/magicmapserver/.classpath 2008-01-28 13:55:25 UTC (rev 720) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="src"/> - <classpathentry output="dblayer/bin" kind="src" path="dblayer/src"/> + <classpathentry kind="src" output="dblayer/bin" path="dblayer/src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="lib" path="web/WEB-INF/lib/log4j-1.2.8.jar"/> <classpathentry kind="lib" path="web/WEB-INF/lib/jpox-20041204.032009.jar"/> @@ -9,5 +9,10 @@ <classpathentry kind="lib" path="lib.dev/jasper-runtime.jar"/> <classpathentry kind="lib" path="lib.dev/jsp-api.jar"/> <classpathentry kind="lib" path="lib.dev/servlet-api.jar"/> + <classpathentry kind="var" path="TOMCAT_HOME/lib/servlet-api.jar"/> + <classpathentry kind="var" path="TOMCAT_HOME/lib/jasper.jar"/> + <classpathentry kind="var" path="TOMCAT_HOME/lib/jsp-api.jar"/> + <classpathentry kind="var" path="TOMCAT_HOME/lib/el-api.jar"/> + <classpathentry kind="var" path="TOMCAT_HOME/lib/annotations-api.jar"/> <classpathentry kind="output" path="web/WEB-INF/classes"/> </classpath> Modified: trunk/magicmapserver/dblayer/src/net/sf/magicmap/db/Position.java =================================================================== --- trunk/magicmapserver/dblayer/src/net/sf/magicmap/db/Position.java 2008-01-28 13:22:14 UTC (rev 719) +++ trunk/magicmapserver/dblayer/src/net/sf/magicmap/db/Position.java 2008-01-28 13:55:25 UTC (rev 720) @@ -5,6 +5,7 @@ package net.sf.magicmap.db; import java.util.Collection; +import java.util.HashMap; import java.util.HashSet; /** @@ -38,7 +39,7 @@ * persistence-modifier="persistent" * primary-key="true" */ - long id; + long id; /** * @@ -47,7 +48,7 @@ * persistence-modifier="persistent" * null-value="exception" */ - String name; + String name; /** * zugeh\xF6rige Karte @@ -56,7 +57,7 @@ * persistence-modifier="persistent" * null-value="exception" */ - Map map; + Map map; /** * x Position im Bild @@ -65,7 +66,7 @@ * persistence-modifier="persistent" * null-value="exception" */ - int posX; + int posX; /** * y Position im Bild @@ -74,7 +75,7 @@ * persistence-modifier="persistent" * null-value="exception" */ - int posY; + int posY; /** * z Position im Bild @@ -83,7 +84,7 @@ * persistence-modifier="persistent" * null-value="exception" */ - int posZ; + int posZ; /** * Zeit der loggens der Position @@ -92,7 +93,7 @@ * persistence-modifier="persistent" * null-value="exception" */ - long lastModified; + long lastModified; /** * schon gel\xF6scht? @@ -100,7 +101,7 @@ * @jdo.field * persistence-modifier="persistent" */ - int deleted; + int deleted; /** * fixiert @@ -108,7 +109,7 @@ * @jdo.field * persistence-modifier="persistent" */ - int fixed; + int fixed; /** * GridFields f\xFCr diesen Ort @@ -119,7 +120,7 @@ * element-type="ScanResult" * mapped-by="position" */ - Collection scanResults = new HashSet(); + Collection scanResults = new HashSet(); /** * Client, die diese Hardware haben @@ -127,7 +128,7 @@ * @jdo.field * persistence-modifier="persistent" */ - Client client; + Client client; /** * AccessPoints, die diese Hardware haben @@ -135,15 +136,26 @@ * @jdo.field * persistence-modifier="persistent" */ - AccessPoint accessPoint; + AccessPoint accessPoint; /** + * @jdo.field + * persistence-modifier="persistent" + * collection-type="map" + * key-type="java.lang.String" + * value-type="java.lang.String" + * dependent="true" + * @jdo.join + */ + java.util.Map attributes = new HashMap(); + + /** * * @param map * @param posX * @param posY */ - public Position(Map map, int posX, int posY, int posZ, String name) { + public Position(Map map, int posX, int posY, int posZ, String name, HashMap attributes) { super(); this.map = map; @@ -151,6 +163,7 @@ this.posY = posY; this.posZ = posZ; this.name = name; + this.attributes = attributes; this.deleted = 0; this.lastModified = System.currentTimeMillis(); @@ -310,4 +323,13 @@ this.posZ = posZ; this.lastModified = System.currentTimeMillis(); } + + public void setAttributes(HashMap<String,String> attributes){ + this.attributes = attributes; + this.lastModified = System.currentTimeMillis(); + } + + public java.util.Map<String,String> getAttributes(){ + return this.attributes; + } } \ No newline at end of file Modified: trunk/magicmapserver/dblayer/src/net/sf/magicmap/db/ScanResult.java =================================================================== --- trunk/magicmapserver/dblayer/src/net/sf/magicmap/db/ScanResult.java 2008-01-28 13:22:14 UTC (rev 719) +++ trunk/magicmapserver/dblayer/src/net/sf/magicmap/db/ScanResult.java 2008-01-28 13:55:25 UTC (rev 720) @@ -5,6 +5,7 @@ package net.sf.magicmap.db; import java.sql.Timestamp; +import java.util.HashMap; /** * @author msc @@ -118,6 +119,18 @@ * persistence-modifier="persistent" */ int round = -1; + + /** + * @jdo.field + * persistence-modifier="persistent" + * collection-type="map" + * key-type="java.lang.String" + * value-type="java.lang.String" + * dependent="true" + * @jdo.join + */ + java.util.Map informations = new java.util.HashMap(); + /** * @param client @@ -126,7 +139,7 @@ * @param noiseLevel * @param logtime */ - public ScanResult(Client client, AccessPoint accessPoint, Double signalLevel, Double noiseLevel, Timestamp logtime) { + public ScanResult(Client client, AccessPoint accessPoint, Double signalLevel, Double noiseLevel, Timestamp logtime, HashMap<String,String> informations) { super(); this.client = client; @@ -134,6 +147,7 @@ this.signalLevel = signalLevel; this.noiseLevel = noiseLevel; this.logtime = logtime; + this.informations = informations; } public AccessPoint getAccessPoint(){ @@ -227,4 +241,12 @@ public void setPosition(Position position){ this.position = position; } + + public void setInformations(HashMap<String,String> informations){ + this.informations = informations; + } + + public HashMap<String,String> getInformations(){ + return (new HashMap<String,String>(this.informations)); + } } \ No newline at end of file Modified: trunk/magicmapserver/src/net/sf/magicmap/server/cache/PositionCache.java =================================================================== --- trunk/magicmapserver/src/net/sf/magicmap/server/cache/PositionCache.java 2008-01-28 13:22:14 UTC (rev 719) +++ trunk/magicmapserver/src/net/sf/magicmap/server/cache/PositionCache.java 2008-01-28 13:55:25 UTC (rev 720) @@ -5,6 +5,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; +import java.util.HashMap; import java.util.Hashtable; import java.util.Iterator; import java.util.TreeMap; @@ -37,7 +38,7 @@ * serial version id */ private static final long serialVersionUID = 1L; - // Sigleton Hashtable + // Singleton Hashtable private static final PositionCache single_positionCache = new PositionCache(); public static PositionCache getPositionCache(){ @@ -130,9 +131,9 @@ if (dtos != null) { for (int i = 0; i < dtos.length; i++) { AccessPoint ap = findOrCreateAccessPoint(dtos[i].getMacAP(), pm); - //@TODO think about? ap.setSsid(dtos[i].getSsid()); + // @TODO think about? ap.setSsid(dtos[i].getSsid()); ScanResult sr = new ScanResult(client, ap, dtos[i].getSignalLevel(), dtos[i].getNoise(), new Timestamp( - dto.getLastModified())); + dto.getLastModified()), dtos[i].getInfos()); pm.makePersistent(sr); sr.setPosition(pos); } @@ -150,15 +151,17 @@ Map map = checkMap(mapName, pm); Position pos = checkPosition(position.getName(), map, pm); if (pos == null) { - pos = new Position(map, position.getPosX(), position.getPosY(), position.getPosZ(), position.getName()); + pos = new Position(map, position.getPosX(), position.getPosY(), position.getPosZ(), position.getName(), + position.getAttributes()); logger.info("Position in db z: " + pos.getPosZ()); pm.makePersistent(pos); + } else { + pos.setPosX(position.getPosX()); + pos.setPosY(position.getPosY()); + pos.setPosZ(position.getPosZ()); + pos.setAttributes(position.getAttributes()); } pos.setDeleted(position.isDeleted()); - pos.setPosX(position.getPosX()); - pos.setPosY(position.getPosY()); - pos.setPosZ(position.getPosZ()); - pos.setFixed(position.isFixed()); if (position.getClient() != null) { @@ -261,10 +264,11 @@ while (scanIt.hasNext()) { ScanResult sr = (ScanResult) scanIt.next(); - // Date lastSeen = null; - // if (sr.getScantime() != null){ - // lastSeen = new Date(sr.getScantime().getTime()); - // } + // Date lastSeen = null; + // if (sr.getScantime() != null){ + // lastSeen = new + // Date(sr.getScantime().getTime()); + // } SimpleScanResultDTO ssr = new SimpleScanResultDTO(); @@ -274,6 +278,7 @@ ssr.setNoise(sr.getNoiseLevel()); ssr.setSignalLevel(sr.getSignalLevel()); ssr.setSsid(sr.getAccessPoint().getSsid()); + ssr.setInfos(sr.getInformations()); ArrayList<SimpleScanResultDTO> list; if (dto.getCharacter().getSimpleScanResults() == null) { @@ -288,6 +293,7 @@ (SimpleScanResultDTO[]) list.toArray(new SimpleScanResultDTO[0])); } } + HashMap attributes = new HashMap(pos.getAttributes()); getMapHashtable(map).addPositionFromDB(dto); } } @@ -523,7 +529,7 @@ logger.info("leaving getPositionsSince()"); return positions.toArray(new PositionDTO[0]); } else { - Collection<String> newPositions = timeMap.tailMap(time+1).values(); + Collection<String> newPositions = timeMap.tailMap(time + 1).values(); logger.info("Daten in timeMap: " + timeMap.toString()); logger.info("Daten in tailMap: " + newPositions.toString()); PositionDTO[] positions = new PositionDTO[newPositions.size()]; Modified: trunk/magicmapserver/src/net/sf/magicmap/server/dto/PositionDTO.java =================================================================== --- trunk/magicmapserver/src/net/sf/magicmap/server/dto/PositionDTO.java 2008-01-28 13:22:14 UTC (rev 719) +++ trunk/magicmapserver/src/net/sf/magicmap/server/dto/PositionDTO.java 2008-01-28 13:55:25 UTC (rev 720) @@ -1,31 +1,33 @@ package net.sf.magicmap.server.dto; +import java.util.HashMap; + /** - * author schweige - * date 03.12.2004 - * copyright (C) 2004 Martin Schweigert, Tobias H\xFCbner + * author schweige date 03.12.2004 copyright (C) 2004 Martin Schweigert, Tobias + * H\xFCbner * * - * 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. + * 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 PositionDTO { - private Long id; - private boolean deleted; - private Long lastModified; - private Integer posX; - private Integer posY; - private Integer posZ; - private String name; - private SignalCharacterDTO character; - private boolean fixed; + private Long id; + private boolean deleted; + private Long lastModified; + private Integer posX; + private Integer posY; + private Integer posZ; + private String name; + private SignalCharacterDTO character; + private boolean fixed; + private HashMap<String, String> attributes; - private AccessPointDTO accessPoint; - private ClientDTO client; + private AccessPointDTO accessPoint; + private ClientDTO client; public PositionDTO() { // @@ -87,7 +89,8 @@ this.posY = posY; } - /* (non-Javadoc) + /* + * (non-Javadoc) * @see net.sf.magicmap.server.facade.dto.DTO#getCSEP() */ protected String getCSEP(){ @@ -186,4 +189,21 @@ public void setPosZ(Integer posZ){ this.posZ = posZ; } + + /** + * @return Returns the infos + */ + public HashMap<String, String> getAttributes(){ + return this.attributes; + } + + /** + * Sets the infos for this position. + * + * @param newInfos The new informations for this position. + */ + public void setAttributes(HashMap<String, String> attributes){ + this.attributes = attributes; + } + } \ No newline at end of file Modified: trunk/magicmapserver/src/net/sf/magicmap/server/dto/SimpleScanResultDTO.java =================================================================== --- trunk/magicmapserver/src/net/sf/magicmap/server/dto/SimpleScanResultDTO.java 2008-01-28 13:22:14 UTC (rev 719) +++ trunk/magicmapserver/src/net/sf/magicmap/server/dto/SimpleScanResultDTO.java 2008-01-28 13:55:25 UTC (rev 720) @@ -1,6 +1,8 @@ package net.sf.magicmap.server.dto; +import java.util.HashMap; + /** * author schweige * date 03.12.2004 @@ -14,11 +16,12 @@ */ public class SimpleScanResultDTO { - protected String ssid; // WLAN-Name (optional) - protected String macAP; // MAC-Adresse AccessPoint - protected Double signalLevel; // Signallevel in dB (negativer Wert) - protected Double noise; // Signal-Rausch-Abstand (optional) - protected Long lastSeen; // (optional) + protected String ssid; // WLAN-Name (optional) + protected String macAP; // MAC-Adresse AccessPoint + protected Double signalLevel; // Signallevel in dB (negativer Wert) + protected Double noise; // Signal-Rausch-Abstand (optional) + protected Long lastSeen; // (optional) + protected HashMap<String, String> infos; //additional informations for this scanresult public SimpleScanResultDTO() { @@ -93,4 +96,16 @@ public void setSignalLevel(Double signalLevel){ this.signalLevel = signalLevel; } + + /** + * @return infos The additional informations. + */ + public HashMap<String, String> getInfos(){ + return this.infos; + } + + public void setInfos(HashMap<String, String> newInfos){ + this.infos = newInfos; + } + } \ No newline at end of file Modified: trunk/magicmapserver/src/net/sf/magicmap/server/facade/PositionFacade.java =================================================================== --- trunk/magicmapserver/src/net/sf/magicmap/server/facade/PositionFacade.java 2008-01-28 13:22:14 UTC (rev 719) +++ trunk/magicmapserver/src/net/sf/magicmap/server/facade/PositionFacade.java 2008-01-28 13:55:25 UTC (rev 720) @@ -6,7 +6,9 @@ import java.io.PrintWriter; import java.rmi.RemoteException; import java.util.Collection; +import java.util.HashMap; +import javax.jdo.CreateLifecycleListener; import javax.jdo.Extent; import javax.jdo.PersistenceManager; import javax.jdo.Query; @@ -32,78 +34,7 @@ protected transient Category logger = Category.getInstance(this.getClass()); - /* (non-Javadoc) - * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#createPosition(long, java.lang.String, int, int, net.sf.magicmap.server.facade.dto.SignalCharacter, java.lang.String) - */ - public void createOrUpdatePosition(long sessionId, String mapName, int positionX, int positionY, int positionZ, - SignalCharacterDTO character, String positionName, boolean fixed) throws SessionException, MapException{ - this.logger.info("createOrUpdatePosition()"); - PersistenceManager pm = null; - Transaction tx = null; - try { - pm = JDOUtil.pmfactory.getPersistenceManager(); - tx = pm.currentTransaction(); - tx.begin(); - createOrUpdatePositionInternal(sessionId, mapName, positionX, positionY, positionZ, character, - positionName, fixed, pm); - if (tx.isActive()) { - tx.commit(); - } - } catch (Exception e) { - if (tx.isActive()) tx.rollback(); - e.printStackTrace(); - if (e instanceof MapException) { - throw (MapException) e; - } - if (e instanceof SessionException) { - throw (SessionException) e; - } - } finally { - JDOUtil.closePM(pm); - } - this.logger.info("createOrUpdatePosition() - done"); - - } - /** - * @param sessionId - * @param mapName - * @param positionX - * @param positionY - * @param character - * @param positionName - * @param pm - * @throws SessionException - * @throws MapException - */ - private void createOrUpdatePositionInternal(long sessionId, String mapName, int positionX, int positionY, - int positionZ, SignalCharacterDTO character, String positionName, boolean fixed, PersistenceManager pm) - throws SessionException, MapException{ - Session session = checkSession(sessionId, pm); - Client client = session.getClient(); - if (client == null) { - throw new SessionException("Ung\xFCltige Session"); - } - if (character == null || character.getSimpleScanResults() == null - || character.getSimpleScanResults().length == 0) { - throw new MapException("Signalcharacter enth\xE4lt keine Daten"); - } - if (positionName == null || "".equals(positionName)) { - throw new MapException("Name der Position darf nicht leer sein"); - } - Map map = checkMap(mapName, positionX, positionY, pm); - - PositionDTO pos = new PositionDTO(); - pos.setCharacter(character); - pos.setFixed(fixed); - pos.setName(positionName); - pos.setPosX(positionX); - pos.setPosY(positionY); - pos.setPosZ(positionZ); - PositionCache.getPositionCache().createOrUpdatePosition(map, pos, client.getMac()); - } - - /** * @param macAP * @param pm * @return @@ -144,7 +75,7 @@ Map result = checkMap(mapName, pm); if (positionX < 0 || positionY < 0 || positionX > (result.getImageWidth().intValue() - 1) || positionY > (result.getImageHeight().intValue() - 1)) { - // pm.currentTransaction().rollback(); + // pm.currentTransaction().rollback(); throw new MapException("Position ist nicht auf der Karte"); } return result; @@ -201,7 +132,7 @@ */ private Client checkClient(String mac, PersistenceManager pm) throws MapException{ if (mac == null || "".equals(mac)) { - // pm.currentTransaction().rollback(); + // pm.currentTransaction().rollback(); throw new MapException("Client mac darf nicht leer sein"); } Client result = null; @@ -219,25 +150,26 @@ } - /* (non-Javadoc) - * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#createOrUpdateClientPosition(long, java.lang.String, int, int, net.sf.magicmap.server.facade.dto.SignalCharacter, java.lang.String) - */ - public void createOrUpdateClientPosition(long sessionId, String mapName, int positionX, int positionY, - int positionZ, SignalCharacterDTO character, String clientMac, boolean fixed) throws SessionException, - MapException{ - this.logger.info("createOrUpdateClientPosition()"); - + // TODO: use the extra attributes! + public void createOrUpdatePosition(long sessionId, String type, String mapName, int positionX, int positionY, int positionZ, + SignalCharacterDTO character, String identifier, boolean fixed, HashMap<String, String> attributes) throws SessionException, MapException{ PersistenceManager pm = null; Transaction tx = null; - try { + System.out.println("CreateOrUpdate " + type ); + try{ pm = JDOUtil.pmfactory.getPersistenceManager(); tx = pm.currentTransaction(); tx.begin(); - createOrUpdateClientPositionInternal(sessionId, mapName, positionX, positionY, positionZ, character, - clientMac, fixed, pm); - if (tx.isActive()) { - tx.commit(); - } + if (type.equals("POSITION")) + createOrUpdatePositionInternal(sessionId, mapName, positionX, positionY, positionZ, character, identifier, fixed, attributes, pm); + else if (type.equals("CLIENT")) + createOrUpdateClientPositionInternal(sessionId, mapName, positionX, positionY, positionZ, character, identifier, fixed, attributes, pm); + else if (type.equals("ACCESSPOINT")) + createOrUpdateAccessPositionInternal(sessionId, mapName, positionX, positionY, positionZ, identifier, fixed, attributes, pm); + + if(tx.isActive()) { + tx.commit(); + } } catch (Exception e) { if (tx.isActive()) tx.rollback(); e.printStackTrace(); @@ -250,23 +182,138 @@ } finally { JDOUtil.closePM(pm); } + this.logger.info("createOrUpdatePositionGeneric() - done"); - this.logger.info("createOrUpdateClientPosition() - done"); } +// /* +// * (non-Javadoc) +// * +// * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#createPosition(long, +// * java.lang.String, int, int, +// * net.sf.magicmap.server.facade.dto.SignalCharacter, java.lang.String) +// */ +// public void createOrUpdatePosition(long sessionId, String mapName, int positionX, int positionY, int positionZ, +// SignalCharacterDTO character, String positionName, boolean fixed, HashMap<String, Object> attributes) throws SessionException, MapException{ +// this.logger.info("createOrUpdatePosition()"); +// PersistenceManager pm = null; +// Transaction tx = null; +// try { +// pm = JDOUtil.pmfactory.getPersistenceManager(); +// tx = pm.currentTransaction(); +// tx.begin(); +// createOrUpdatePositionInternal(sessionId, mapName, positionX, positionY, positionZ, character, +// positionName, fixed, attributes, pm); +// if (tx.isActive()) { +// tx.commit(); +// } +// } catch (Exception e) { +// if (tx.isActive()) tx.rollback(); +// e.printStackTrace(); +// if (e instanceof MapException) { +// throw (MapException) e; +// } +// if (e instanceof SessionException) { +// throw (SessionException) e; +// } +// } finally { +// JDOUtil.closePM(pm); +// } +// this.logger.info("createOrUpdatePosition() - done"); +// +// } + /** * @param sessionId * @param mapName * @param positionX * @param positionY * @param character + * @param positionName + * @param pm + * @throws SessionException + * @throws MapException + */ + private void createOrUpdatePositionInternal(long sessionId, String mapName, int positionX, int positionY, + int positionZ, SignalCharacterDTO character, String positionName, boolean fixed, HashMap<String, String> attributes, PersistenceManager pm) + throws SessionException, MapException{ + Session session = checkSession(sessionId, pm); + Client client = session.getClient(); + if (client == null) { + throw new SessionException("Ung\xFCltige Session"); + } + if (character == null || character.getSimpleScanResults() == null + || character.getSimpleScanResults().length == 0) { + throw new MapException("Signalcharacter enth\xE4lt keine Daten"); + } + if (positionName == null || "".equals(positionName)) { + throw new MapException("Name der Position darf nicht leer sein"); + } + Map map = checkMap(mapName, positionX, positionY, pm); + + PositionDTO pos = new PositionDTO(); + pos.setCharacter(character); + pos.setFixed(fixed); + pos.setName(positionName); + pos.setPosX(positionX); + pos.setPosY(positionY); + pos.setPosZ(positionZ); + pos.setAttributes(attributes); + PositionCache.getPositionCache().createOrUpdatePosition(map, pos, client.getMac()); + } + +// /* +// * (non-Javadoc) +// * +// * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#createOrUpdateClientPosition(long, +// * java.lang.String, int, int, +// * net.sf.magicmap.server.facade.dto.SignalCharacter, java.lang.String) +// */ +// public void createOrUpdateClientPosition(long sessionId, String mapName, int positionX, int positionY, +// int positionZ, SignalCharacterDTO character, String clientMac, boolean fixed, HashMap<String, Object> attributes) throws SessionException, +// MapException{ +// this.logger.info("createOrUpdateClientPosition()"); +// +// PersistenceManager pm = null; +// Transaction tx = null; +// try { +// pm = JDOUtil.pmfactory.getPersistenceManager(); +// tx = pm.currentTransaction(); +// tx.begin(); +// createOrUpdateClientPositionInternal(sessionId, mapName, positionX, positionY, positionZ, character, +// clientMac, fixed, attributes, pm); +// if (tx.isActive()) { +// tx.commit(); +// } +// } catch (Exception e) { +// if (tx.isActive()) tx.rollback(); +// e.printStackTrace(); +// if (e instanceof MapException) { +// throw (MapException) e; +// } +// if (e instanceof SessionException) { +// throw (SessionException) e; +// } +// } finally { +// JDOUtil.closePM(pm); +// } +// +// this.logger.info("createOrUpdateClientPosition() - done"); +// } + + /** + * @param sessionId + * @param mapName + * @param positionX + * @param positionY + * @param character * @param clientMac * @param pm * @throws SessionException * @throws MapException */ private void createOrUpdateClientPositionInternal(long sessionId, String mapName, int positionX, int positionY, - int positionZ, SignalCharacterDTO character, String clientMac, boolean fixed, PersistenceManager pm) + int positionZ, SignalCharacterDTO character, String clientMac, boolean fixed, HashMap<String, String> attributes, PersistenceManager pm) throws SessionException, MapException{ checkSession(sessionId, pm); Map map = checkMap(mapName, positionX, positionY, pm); @@ -285,61 +332,80 @@ pos.setPosX(positionX); pos.setPosY(positionY); pos.setPosZ(positionZ); + pos.setAttributes(attributes); logger.info("inside createOrUpdateClientPositionInternal Z-Koordinate: " + positionZ); PositionCache.getPositionCache().createOrUpdatePosition(map, pos); } - /* (non-Javadoc) - * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#createOrUpdateAccessPosition(long, java.lang.String, int, int, net.sf.magicmap.server.facade.dto.SignalCharacter, java.lang.String) - */ - public void createOrUpdateAccessPosition(long sessionId, String mapName, int positionX, int positionY, - int positionZ, String accessPointMac, boolean fixed) throws SessionException, MapException{ - this.logger.info("createOrUpdateAccessPosition()"); - PersistenceManager pm = null; - Transaction tx = null; - try { - pm = JDOUtil.pmfactory.getPersistenceManager(); - tx = pm.currentTransaction(); - tx.begin(); - checkSession(sessionId, pm); - Map map = checkMap(mapName, positionX, positionY, pm); - AccessPoint ap = findOrCreateAccessPoint(accessPointMac, pm); +// /* +// * (non-Javadoc) +// * +// * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#createOrUpdateAccessPosition(long, +// * java.lang.String, int, int, +// * net.sf.magicmap.server.facade.dto.SignalCharacter, java.lang.String) +// */ +// public void createOrUpdateAccessPosition(long sessionId, String mapName, int positionX, int positionY, +// int positionZ, String accessPointMac, boolean fixed, HashMap<String, Object> attributes) throws SessionException, MapException{ +// this.logger.info("createOrUpdateAccessPosition()"); +// PersistenceManager pm = null; +// Transaction tx = null; +// try { +// pm = JDOUtil.pmfactory.getPersistenceManager(); +// tx = pm.currentTransaction(); +// tx.begin(); +// +// createOrUpdateAccessPositionInternal(sessionId, mapName, positionX, positionY, positionZ, accessPointMac, +// fixed, attributes, pm); +// +// if (tx.isActive()) { +// tx.commit(); +// } +// } catch (Exception e) { +// if (tx.isActive()) tx.rollback(); +// e.printStackTrace(); +// if (e instanceof MapException) { +// throw (MapException) e; +// } +// if (e instanceof SessionException) { +// throw (SessionException) e; +// } +// } finally { +// JDOUtil.closePM(pm); +// } +// this.logger.info("createOrUpdateAccessPosition() - done"); +// +// } - PositionDTO pos = new PositionDTO(); - if (ap != null) { - AccessPointDTO apDTO = new AccessPointDTO(); - apDTO.setMac(ap.getMac()); - apDTO.setSsid(ap.getSsid()); // zur zeit noch nicht verwendet TODO ssid setzen - apDTO.setHidden(ap.getHidden()); - pos.setAccessPoint(apDTO); - } - pos.setFixed(fixed); - pos.setName(accessPointMac); - pos.setPosX(positionX); - pos.setPosY(positionY); - pos.setPosZ(positionZ); - PositionCache.getPositionCache().createOrUpdatePosition(map, pos); - if (tx.isActive()) { - tx.commit(); - } - } catch (Exception e) { - if (tx.isActive()) tx.rollback(); - e.printStackTrace(); - if (e instanceof MapException) { - throw (MapException) e; - } - if (e instanceof SessionException) { - throw (SessionException) e; - } - } finally { - JDOUtil.closePM(pm); + private void createOrUpdateAccessPositionInternal(long sessionId, String mapName, int positionX, int positionY, + int positionZ, String accessPointMac, boolean fixed, HashMap<String, String> attributes, PersistenceManager pm) throws SessionException, + MapException{ + checkSession(sessionId, pm); + Map map = checkMap(mapName, positionX, positionY, pm); + AccessPoint ap = findOrCreateAccessPoint(accessPointMac, pm); + + PositionDTO pos = new PositionDTO(); + if (ap != null) { + AccessPointDTO apDTO = new AccessPointDTO(); + apDTO.setMac(ap.getMac()); + apDTO.setSsid(ap.getSsid()); // zur zeit noch nicht verwendet + // TODO: ssid setzen + apDTO.setHidden(ap.getHidden()); + pos.setAccessPoint(apDTO); } - this.logger.info("createOrUpdateAccessPosition() - done"); - + pos.setFixed(fixed); + pos.setName(accessPointMac); + pos.setPosX(positionX); + pos.setPosY(positionY); + pos.setPosZ(positionZ); + pos.setAttributes(attributes); + PositionCache.getPositionCache().createOrUpdatePosition(map, pos); } - /* (non-Javadoc) - * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#movePosition(long, long, int, int) + /* + * (non-Javadoc) + * + * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#movePosition(long, + * long, int, int) */ public void movePosition(long sessionId, String mapname, long positionId, int newPositionX, int newPositionY, int newPositionZ, boolean fixed) throws SessionException, MapException{ @@ -354,7 +420,7 @@ Map map = checkMap(mapname, newPositionX, newPositionY, pm); PositionCache.getPositionCache().movePosition(map, positionId, newPositionX, newPositionY, newPositionZ, fixed); - //logger.info("Z-Koord.: " + newPositionZ); + // logger.info("Z-Koord.: " + newPositionZ); if (tx.isActive()) { tx.commit(); } @@ -374,8 +440,11 @@ } - /* (non-Javadoc) - * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#deletePosition(long, long) + /* + * (non-Javadoc) + * + * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#deletePosition(long, + * long) */ public void deletePosition(long sessionId, String mapname, long positionId) throws SessionException, MapException{ this.logger.info("deletePosition()"); @@ -408,11 +477,14 @@ } - /* (non-Javadoc) - * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#getPositionsForMapSince(long, java.lang.String, long) + /* + * (non-Javadoc) + * + * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#getPositionsForMapSince(long, + * java.lang.String, long, boolean) */ - public PositionDTO[] getPositionsForMapSince(long sessionId, String mapName, long timeStamp, boolean timeflag) - throws MapException, SessionException{ + public PositionDTO[] getPositionsForMapSince(long sessionId, String[] types, String mapName, long timeStamp, + boolean timeflag) throws MapException, SessionException{ this.logger.info("getPositionsForMapSince() " + timeStamp); PositionDTO[] result = null; PersistenceManager pm = null; @@ -446,8 +518,11 @@ return result; } - /* (non-Javadoc) - * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#getPositionsForClientOnMap(long, java.lang.String, java.lang.String) + /* + * (non-Javadoc) + * + * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#getPositionsForClientOnMap(long, + * java.lang.String, java.lang.String) */ public String getPositionForClientOnMap(long sessionId, String mapName, String clientMac) throws MapException, SessionException, RemoteException{ @@ -508,7 +583,8 @@ if (ap != null) { AccessPointDTO apDTO = new AccessPointDTO(); apDTO.setMac(ap.getMac()); - apDTO.setSsid(ap.getSsid()); // zur zeit noch nicht verwendet TODO ssid setzen + apDTO.setSsid(ap.getSsid()); // zur zeit noch nicht verwendet + // TODO ssid setzen apDTO.setHidden(hidden); pos.setAccessPoint(apDTO); } Modified: trunk/magicmapserver/src/net/sf/magicmap/server/interfaces/PositionFacadeInterface.java =================================================================== --- trunk/magicmapserver/src/net/sf/magicmap/server/interfaces/PositionFacadeInterface.java 2008-01-28 13:22:14 UTC (rev 719) +++ trunk/magicmapserver/src/net/sf/magicmap/server/interfaces/PositionFacadeInterface.java 2008-01-28 13:55:25 UTC (rev 720) @@ -2,6 +2,7 @@ package net.sf.magicmap.server.interfaces; import java.rmi.RemoteException; +import java.util.HashMap; import net.sf.magicmap.server.dto.PositionDTO; import net.sf.magicmap.server.dto.SignalCharacterDTO; @@ -21,53 +22,57 @@ */ public interface PositionFacadeInterface { - /** - * legt eine neue Position an - * - * @param sessionId g\xFCltige sessionId - * @param mapName Name der Karte - * @param positionX x-Position im Image - * @param positionY y-Position im Image - * @param character Signalcharacteristik an dieser Position - * @param Name der Position (Ort an dieser Position) - * @throws SessionException ung\xFCltige session - * @throws MapException Fehlende Karte, inkosistente Positionsangaben - */ - public abstract void createOrUpdatePosition(long sessionId, String mapName, int positionX, int positionY, - int positionZ, SignalCharacterDTO character, String positionName, boolean fixed) throws SessionException, - MapException, RemoteException; + public abstract void createOrUpdatePosition(long sessionId, String type, String mapName, int positionX, + int positionY, int positionZ, SignalCharacterDTO character, String positionName, boolean fixed, + HashMap<String, String> attributes) throws SessionException, MapException, RemoteException; - /** - * Legt eine Position f\xFCr einen Client fest oder korrigiert diese - * - * @param sessionId g\xFCltige sessionId - * @param mapName Name der Karte - * @param positionX x-Position im Image - * @param positionY y-Position im Image - * @param character Signalcharacteristik an dieser Position - * @param clientMac Macc Adresse, des zu positionierenden Clients - * @throws SessionException ung\xFCltige session - * @throws MapException Fehlende Karte, inkosistente Positionsangaben - */ - public abstract void createOrUpdateClientPosition(long sessionId, String mapName, int positionX, int positionY, - int positionZ, SignalCharacterDTO character, String clientMac, boolean fixed) throws SessionException, - MapException, RemoteException; + // /** + // * legt eine neue Position an + // * + // * @param sessionId g\xFCltige sessionId + // * @param mapName Name der Karte + // * @param positionX x-Position im Image + // * @param positionY y-Position im Image + // * @param character Signalcharacteristik an dieser Position + // * @param Name der Position (Ort an dieser Position) + // * @throws SessionException ung\xFCltige session + // * @throws MapException Fehlende Karte, inkosistente Positionsangaben + // */ + // public abstract void createOrUpdatePosition(long sessionId, String mapName, int positionX, int positionY, + // int positionZ, SignalCharacterDTO character, String positionName, boolean fixed) throws SessionException, + // MapException, RemoteException; + // + // /** + // * Legt eine Position f\xFCr einen Client fest oder korrigiert diese + // * + // * @param sessionId g\xFCltige sessionId + // * @param mapName Name der Karte + // * @param positionX x-Position im Image + // * @param positionY y-Position im Image + // * @param character Signalcharacteristik an dieser Position + // * @param clientMac Macc Adresse, des zu positionierenden Clients + // * @throws SessionException ung\xFCltige session + // * @throws MapException Fehlende Karte, inkosistente Positionsangaben + // */ + // public abstract void createOrUpdateClientPosition(long sessionId, String mapName, int positionX, int positionY, + // int positionZ, SignalCharacterDTO character, String clientMac, boolean fixed) throws SessionException, + // MapException, RemoteException; + // + // /** + // * Legt eine Position f\xFCr einen AccessPoint fest oder korrigiert diese + // * + // * @param sessionId g\xFCltige sessionId + // * @param mapName Name der Karte + // * @param positionX x-Position im Image + // * @param positionY y-Position im Image + // * @param accessPointMac Macc Adresse, des zu positionierenden Clients + // * @throws SessionException ung\xFCltige session + // * @throws MapException Fehlende Karte, inkosistente Positionsangaben + // */ + // public abstract void createOrUpdateAccessPosition(long sessionId, String mapName, int positionX, int positionY, + // int positionZ, String accessPointMac, boolean fixed) throws SessionException, MapException, RemoteException; /** - * Legt eine Position f\xFCr einen AccessPoint fest oder korrigiert diese - * - * @param sessionId g\xFCltige sessionId - * @param mapName Name der Karte - * @param positionX x-Position im Image - * @param positionY y-Position im Image - * @param accessPointMac Macc Adresse, des zu positionierenden Clients - * @throws SessionException ung\xFCltige session - * @throws MapException Fehlende Karte, inkosistente Positionsangaben - */ - public abstract void createOrUpdateAccessPosition(long sessionId, String mapName, int positionX, int positionY, - int positionZ, String accessPointMac, boolean fixed) throws SessionException, MapException, RemoteException; - - /** * Verschiebt eine beliebige Position auf der Karte * * @param sessionId g\xFCltige session id @@ -103,8 +108,8 @@ * @return Liste aller Positionen der Karte * @throws MapException Fehlende Karte */ - public abstract PositionDTO[] getPositionsForMapSince(long sessionId, String mapName, long timeStamp, - boolean timeflag) throws MapException, SessionException, RemoteException; + public abstract PositionDTO[] getPositionsForMapSince(long sessionId, String[] types, String mapName, + long timeStamp, boolean timeflag) throws MapException, SessionException, RemoteException; /** * Liefert aktuelle Position des Clients mit der angegebenen MacAdresse Modified: trunk/magicmapserver/src/net/sf/magicmap/server/utils/Version.java =================================================================== --- trunk/magicmapserver/src/net/sf/magicmap/server/utils/Version.java 2008-01-28 13:22:14 UTC (rev 719) +++ trunk/magicmapserver/src/net/sf/magicmap/server/utils/Version.java 2008-01-28 13:55:25 UTC (rev 720) @@ -14,5 +14,5 @@ */ public interface Version { - public static final String PROTOCOL_VERSION = "0.8"; + public static final String PROTOCOL_VERSION = "0.9"; } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jan...@us...> - 2008-01-21 23:17:59
|
Revision: 717 http://magicmap.svn.sourceforge.net/magicmap/?rev=717&view=rev Author: jan_fride Date: 2008-01-21 15:17:30 -0800 (Mon, 21 Jan 2008) Log Message: ----------- * Added Genric Collection lib (hopefully to eclipse?) * Fixed Bug in NodeKeyFunction. (Some funtionality is still missing) Modified Paths: -------------- trunk/magicmapclient/.classpath trunk/magicmapclient/src/net/sf/magicmap/core/model/node/NodeKeyFunction.java Added Paths: ----------- trunk/magicmapclient/lib/collections-generic-4.01.jar Modified: trunk/magicmapclient/.classpath =================================================================== --- trunk/magicmapclient/.classpath 2008-01-21 22:18:23 UTC (rev 716) +++ trunk/magicmapclient/.classpath 2008-01-21 23:17:30 UTC (rev 717) @@ -36,5 +36,6 @@ <classpathentry kind="lib" path="lib/nekohtml.jar"/> <classpathentry kind="lib" path="lib-dev/junit.jar"/> <classpathentry kind="lib" path="lib/looks-2.1.4.jar"/> - <classpathentry kind="output" path="bin"/> + <classpathentry kind="lib" path="lib/collections-generic-4.01.jar"/> + <classpathentry kind="output" path="bin"/> </classpath> Added: trunk/magicmapclient/lib/collections-generic-4.01.jar =================================================================== (Binary files differ) Property changes on: trunk/magicmapclient/lib/collections-generic-4.01.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/magicmapclient/src/net/sf/magicmap/core/model/node/NodeKeyFunction.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/core/model/node/NodeKeyFunction.java 2008-01-21 22:18:23 UTC (rev 716) +++ trunk/magicmapclient/src/net/sf/magicmap/core/model/node/NodeKeyFunction.java 2008-01-21 23:17:30 UTC (rev 717) @@ -25,5 +25,5 @@ * @param node the node to create a key for. * @return */ - K key(INode node); + K key(N node); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jan...@us...> - 2008-01-21 23:00:33
|
Revision: 715 http://magicmap.svn.sourceforge.net/magicmap/?rev=715&view=rev Author: jan_fride Date: 2008-01-21 14:01:28 -0800 (Mon, 21 Jan 2008) Log Message: ----------- Added IMagicNode and IMagicNodeModel. The Controller will return an instance of MagicNodeModel. Worked with first tests. Index not tested yet ;-) Modified Paths: -------------- trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java trunk/magicmapclient/src/net/sf/magicmap/client/controller/IController.java trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeModel.java Added Paths: ----------- trunk/magicmapclient/src/net/sf/magicmap/core/ trunk/magicmapclient/src/net/sf/magicmap/core/model/ trunk/magicmapclient/src/net/sf/magicmap/core/model/URI.java trunk/magicmapclient/src/net/sf/magicmap/core/model/UnsupportedUriException.java trunk/magicmapclient/src/net/sf/magicmap/core/model/impl/ trunk/magicmapclient/src/net/sf/magicmap/core/model/impl/URIImpl.java trunk/magicmapclient/src/net/sf/magicmap/core/model/node/ trunk/magicmapclient/src/net/sf/magicmap/core/model/node/IMagicNode.java trunk/magicmapclient/src/net/sf/magicmap/core/model/node/IMagicNodeModel.java trunk/magicmapclient/src/net/sf/magicmap/core/model/node/INodeIndex.java trunk/magicmapclient/src/net/sf/magicmap/core/model/node/NodeKeyFunction.java trunk/magicmapclient/src/net/sf/magicmap/core/model/node/impl/ trunk/magicmapclient/src/net/sf/magicmap/core/model/node/impl/MagicNode.java trunk/magicmapclient/src/net/sf/magicmap/core/model/node/impl/MagicNodeModel.java trunk/magicmapclient/src/net/sf/magicmap/core/model/node/impl/NodeIndex.java Modified: trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java 2008-01-13 23:10:04 UTC (rev 714) +++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java 2008-01-21 22:01:28 UTC (rev 715) @@ -4,41 +4,29 @@ package net.sf.magicmap.client.controller; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; - import net.sf.magicmap.client.gui.MainGUI; import net.sf.magicmap.client.gui.utils.GUIUtils; import net.sf.magicmap.client.gui.views.MapView; -import net.sf.magicmap.client.interfaces.CreateNewMapCallback; -import net.sf.magicmap.client.interfaces.CreatePositionCallback; -import net.sf.magicmap.client.interfaces.DeletePositionCallback; -import net.sf.magicmap.client.interfaces.MapCallback; -import net.sf.magicmap.client.interfaces.MapNamesCallback; -import net.sf.magicmap.client.interfaces.MovePositionCallback; -import net.sf.magicmap.client.interfaces.PositionCallback; -import net.sf.magicmap.client.interfaces.ServerConnectCallback; -import net.sf.magicmap.client.interfaces.ServerDisconnectCallback; +import net.sf.magicmap.client.interfaces.*; import net.sf.magicmap.client.measurement.ScannerAllocator; import net.sf.magicmap.client.measurement.interfaces.AbstractScanResult; import net.sf.magicmap.client.measurement.interfaces.AbstractScanner; import net.sf.magicmap.client.measurement.interfaces.AbstractScannerHandler; import net.sf.magicmap.client.meta.MapInfo; -import net.sf.magicmap.client.model.node.ClientNode; -import net.sf.magicmap.client.model.node.GeoPos; -import net.sf.magicmap.client.model.node.INodeModel; -import net.sf.magicmap.client.model.node.MapNode; -import net.sf.magicmap.client.model.node.Node; -import net.sf.magicmap.client.model.node.NodeModel; +import net.sf.magicmap.client.model.node.*; import net.sf.magicmap.client.plugin.PluginManager; import net.sf.magicmap.client.utils.Settings; +import net.sf.magicmap.core.model.node.IMagicNodeModel; +import net.sf.magicmap.core.model.node.impl.MagicNodeModel; import net.sf.magicmap.server.dto.MapDTO; import net.sf.magicmap.server.exception.SessionException; - import org.apache.log4j.xml.DOMConfigurator; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; + /** * Kann \xC4nderungen an View und am Modell vornehmen und zieht alle F\xE4den * der Anwendung. @@ -65,7 +53,7 @@ /** * Das Knotenmodel. */ - private INodeModel nodeModel; // Model f\xFCr Graphen + private IMagicNodeModel nodeModel; // Model f\xFCr Graphen private ClientNode client; // Ausgezeichneter Knoten @@ -93,7 +81,7 @@ // // Das Model der Knoten. // - this.nodeModel = new NodeModel(); + this.nodeModel = new MagicNodeModel(new NodeModel()); this.scannerAllocator = new ScannerAllocator(); this.currentMap = null; this.serverManager = null; @@ -129,7 +117,7 @@ * * @return the node model */ - public INodeModel getNodeModel(){ + public IMagicNodeModel getNodeModel(){ return this.nodeModel; } @@ -306,6 +294,7 @@ this.poller = new ServerPoller(this.serverManager, this.pollhandler); this.serverManager.connect(callback); + this.getNodeModel().setServerID(Settings.getServerURL()); this.pluginManager.connect(); } Modified: trunk/magicmapclient/src/net/sf/magicmap/client/controller/IController.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/controller/IController.java 2008-01-13 23:10:04 UTC (rev 714) +++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/IController.java 2008-01-21 22:01:28 UTC (rev 715) @@ -1,22 +1,14 @@ package net.sf.magicmap.client.controller; -import net.sf.magicmap.client.interfaces.CreateNewMapCallback; -import net.sf.magicmap.client.interfaces.CreatePositionCallback; -import net.sf.magicmap.client.interfaces.DeletePositionCallback; -import net.sf.magicmap.client.interfaces.MapCallback; -import net.sf.magicmap.client.interfaces.MapNamesCallback; -import net.sf.magicmap.client.interfaces.MovePositionCallback; -import net.sf.magicmap.client.interfaces.PositionCallback; -import net.sf.magicmap.client.interfaces.ServerConnectCallback; -import net.sf.magicmap.client.interfaces.ServerDisconnectCallback; +import net.sf.magicmap.client.interfaces.*; import net.sf.magicmap.client.measurement.interfaces.AbstractScanResult; import net.sf.magicmap.client.measurement.interfaces.AbstractScanner; import net.sf.magicmap.client.measurement.interfaces.AbstractScannerHandler; import net.sf.magicmap.client.meta.MapInfo; import net.sf.magicmap.client.model.node.ClientNode; import net.sf.magicmap.client.model.node.GeoPos; -import net.sf.magicmap.client.model.node.INodeModel; +import net.sf.magicmap.core.model.node.IMagicNodeModel; /** * @author Jan Friderici (ja...@fr...) @@ -35,7 +27,7 @@ * * @return the node model */ - INodeModel getNodeModel(); + IMagicNodeModel getNodeModel(); /** * Gibt an ob verbunden oder nicht verbunden @@ -150,14 +142,18 @@ /** * Entfernt einen * - * @param node + * @param name + * @param mapname + * @param mapname + * @param mapname + * @param callback */ void deletePosition(String name, String mapname, DeletePositionCallback callback); /** * @param name * @param string - * @param panel + * @param callback */ void deleteGeoPoint(String name, String string, DeletePositionCallback callback); Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeModel.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeModel.java 2008-01-13 23:10:04 UTC (rev 714) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeModel.java 2008-01-21 22:01:28 UTC (rev 715) @@ -1,24 +1,16 @@ package net.sf.magicmap.client.model.node; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - import net.sf.magicmap.client.gui.MainGUI; import net.sf.magicmap.client.interfaces.NodeModelListener; import net.sf.magicmap.client.meta.MapInfo; import net.sf.magicmap.client.model.location.INodePlacer; import net.sf.magicmap.client.model.location.jung.JungNodePlacer; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import java.util.*; + /** * Model zur Beschreibung des aktuellen Zustands in der * Welt der Clients und AccessPoints. Es k\xF6nnen Anfragen @@ -90,8 +82,7 @@ log.info("Map has Children: " + currentMap.getChildren().size()); } for (NodeModelListener listener : this.listeners) { - NodeModelListener l = (NodeModelListener) listener; - l.nodeAddedEvent(node); + listener.nodeAddedEvent(node); } } Added: trunk/magicmapclient/src/net/sf/magicmap/core/model/URI.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/core/model/URI.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/core/model/URI.java 2008-01-21 22:01:28 UTC (rev 715) @@ -0,0 +1,42 @@ +package net.sf.magicmap.core.model; + +import java.net.URL; + +/** + * <p> + * Class URI ZUSAMMENFASSUNG + * </p> + * <p> + * DETAILS + * </p> + * + * @author Jan Friderici + * Date: 21.01.2008 + * Time: 21:52:54 + */ +public interface URI { + /** + * Get the protocol. + * @return + */ + String getProtocol(); + + /** + * Return the uri as string.... + * @return + */ + String toString(); + + /** + * + * @return + */ + java.net.URI toJavaURI(); + + /** + * + * @return + * @throws UnsupportedUriException + */ + URL toJavaURL() throws UnsupportedUriException; +} Added: trunk/magicmapclient/src/net/sf/magicmap/core/model/UnsupportedUriException.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/core/model/UnsupportedUriException.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/core/model/UnsupportedUriException.java 2008-01-21 22:01:28 UTC (rev 715) @@ -0,0 +1,28 @@ +package net.sf.magicmap.core.model; + +/** + * <p> + * Class UnsupportedUriException ZUSAMMENFASSUNG + * </p> + * <p> + * DETAILS + * </p> + * + * @author Jan Friderici + * Date: 21.01.2008 + * Time: 21:53:51 + */ +public class UnsupportedUriException extends RuntimeException { + + public UnsupportedUriException(String s) { + super(s); + } + + public UnsupportedUriException(String s, Throwable throwable) { + super(s, throwable); + } + + public UnsupportedUriException(Throwable throwable) { + super(throwable); + } +} Added: trunk/magicmapclient/src/net/sf/magicmap/core/model/impl/URIImpl.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/core/model/impl/URIImpl.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/core/model/impl/URIImpl.java 2008-01-21 22:01:28 UTC (rev 715) @@ -0,0 +1,67 @@ +package net.sf.magicmap.core.model.impl; + +import net.sf.magicmap.core.model.URI; +import net.sf.magicmap.core.model.UnsupportedUriException; + +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; + +/** + * <p> + * Class URIImpl ZUSAMMENFASSUNG + * </p> + * <p> + * DETAILS + * </p> + * + * @author Jan Friderici + * Date: 13.01.2008 + * Time: 11:35:41 + */ +public class URIImpl implements URI { + private final String uri; + + + public URIImpl(String uri) { + this.uri = uri; + } + + /** + * + * @return + */ + public String getProtocol() { + return uri.substring(0, uri.indexOf(":")); + } + + public String toString() { + return uri; + } + + /** + * + * @return + */ + public java.net.URI toJavaURI() { + try { + return new java.net.URI(uri); + } catch (URISyntaxException e) { + throw new UnsupportedUriException(e); + } + } + + /** + * + * @return + * @throws UnsupportedUriException + */ + public URL toJavaURL() throws UnsupportedUriException { + try { + return new java.net.URL(uri); + } catch (MalformedURLException e) { + throw new UnsupportedUriException(e); + } + } + +} Added: trunk/magicmapclient/src/net/sf/magicmap/core/model/node/IMagicNode.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/core/model/node/IMagicNode.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/core/model/node/IMagicNode.java 2008-01-21 22:01:28 UTC (rev 715) @@ -0,0 +1,38 @@ +package net.sf.magicmap.core.model.node; + +import net.sf.magicmap.client.model.node.INode; +import net.sf.magicmap.client.model.node.Node; +import net.sf.magicmap.core.model.URI; + +/** + * <p> + * Class IMagicNode ZUSAMMENFASSUNG + * </p> + * <p> + * DETAILS + * </p> + * + * @author Jan Friderici + * Date: 21.01.2008 + * Time: 21:51:20 + */ +public interface IMagicNode extends INode { + + /** + * <p>Get the server the nodes is stored.</p> + * @return the server id the node is stored with. + */ + URI getServerID(); + + /** + * <p>The nodes id. This ID will vary depending....</p> + * @return a unique id for this node. + */ + URI getNodeID(); + + /** + * <p>For objects that need the old class.</p> + * @return + */ + Node asNode(); +} Added: trunk/magicmapclient/src/net/sf/magicmap/core/model/node/IMagicNodeModel.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/core/model/node/IMagicNodeModel.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/core/model/node/IMagicNodeModel.java 2008-01-21 22:01:28 UTC (rev 715) @@ -0,0 +1,68 @@ +package net.sf.magicmap.core.model.node; + +import net.sf.magicmap.client.model.node.INode; +import net.sf.magicmap.client.model.node.INodeModel; +import net.sf.magicmap.core.model.URI; + +import java.util.List; + +/** + * <p> + * This interface adds several methods to the old INodeModel. + * </p> + * <p> + * DETAILS + * </p> + * + * @author Jan Friderici + * Date: 15.01.2008 + * Time: 22:39:45 + */ +public interface IMagicNodeModel extends INodeModel { + + /** + * <p>return the server this node model is connected with - if any.</p> + * @return the uri for the connected server. + */ + URI getServerID(); + + /** + * + * @return the target. + */ + INodeModel getNodeModel(); + + + /** + * get an magic node. + * @param node the magic node to get. + * @return + */ + IMagicNode getMagicNode(INode node); + + /** + * <p>Create an index with the given key generating function.</p> + * @param function the function to generate the keys. + * @return the index + */ + <K, N extends INode>INodeIndex<K,N> createIndex(NodeKeyFunction<K,N> function); + + /** + * Remove the index. + * @param index + * @return + */ + boolean removeIndex(INodeIndex index); + + /** + * + * @return + */ + List<? extends INodeIndex> getNodeIndexList(); + + /** + * + * @param serverURL + */ + void setServerID(String serverURL); +} Added: trunk/magicmapclient/src/net/sf/magicmap/core/model/node/INodeIndex.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/core/model/node/INodeIndex.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/core/model/node/INodeIndex.java 2008-01-21 22:01:28 UTC (rev 715) @@ -0,0 +1,43 @@ +package net.sf.magicmap.core.model.node; + +import net.sf.magicmap.client.model.node.INode; + +import java.util.Collection; + +/** + * <p> + * Class INodeIndex ZUSAMMENFASSUNG + * </p> + * <p> + * DETAILS + * </p> + * + * @author Jan Friderici + * Date: 21.01.2008 + * Time: 21:55:44 + */ +public interface INodeIndex <K, N extends INode> { + + + /** + * + * @param key + * @return + */ + N getUnique(K key); + + /** + * + * @param key + * @return + */ + Collection<N> get(K key); + + /** + * + * @param n + * @return + */ + K getKey(N n); + +} Added: trunk/magicmapclient/src/net/sf/magicmap/core/model/node/NodeKeyFunction.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/core/model/node/NodeKeyFunction.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/core/model/node/NodeKeyFunction.java 2008-01-21 22:01:28 UTC (rev 715) @@ -0,0 +1,29 @@ +package net.sf.magicmap.core.model.node; + +import net.sf.magicmap.client.model.node.INode; + +/** + * <p> + * Class NodeKeyFunction ZUSAMMENFASSUNG + * </p> + * <p> + * DETAILS + * </p> + * + * @author Jan Friderici + * Date: 21.01.2008 + * Time: 22:11:43 + */ +public interface NodeKeyFunction<K, N extends INode> { + + Class<K> getKeyClass(); + + Class<N> getNodeClass(); + + /** + * Calculate a key for the given node. + * @param node the node to create a key for. + * @return + */ + K key(INode node); +} Added: trunk/magicmapclient/src/net/sf/magicmap/core/model/node/impl/MagicNode.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/core/model/node/impl/MagicNode.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/core/model/node/impl/MagicNode.java 2008-01-21 22:01:28 UTC (rev 715) @@ -0,0 +1,154 @@ +package net.sf.magicmap.core.model.node.impl; + +import net.sf.magicmap.client.model.node.Node; +import net.sf.magicmap.client.model.node.NodeContainer; +import net.sf.magicmap.core.model.URI; +import net.sf.magicmap.core.model.impl.URIImpl; +import net.sf.magicmap.core.model.node.IMagicNode; +import net.sf.magicmap.core.model.node.IMagicNodeModel; + +import java.util.ArrayList; + +/** + * <p> + * Decorates the old nodes. + * </p> + * <p> + * DETAILS + * </p> + * + * @author Jan Friderici + * Date: 19.01.2008 + * Time: 14:12:54 + */ +public class MagicNode implements IMagicNode { + private final Node delegate; + private final IMagicNodeModel magicNodeModel; + private final URI nodeURI; + + public MagicNode(Node delegate, IMagicNodeModel magicNodeModel) { + this.delegate = delegate; + this.magicNodeModel = magicNodeModel; + nodeURI = new URIImpl( + magicNodeModel.getServerID().toString() + + "/" + delegate.getType() + + " /" + delegate.getId()); + } + + + public String getDisplayName() { + return delegate.getDisplayName(); + } + + public void setDisplayName(String s) { + delegate.setDisplayName(s); + } + + public boolean isUpdate() { + return delegate.isUpdate(); + } + + public void setUpdate(boolean b) { + delegate.setUpdate(b); + } + + public boolean isFix() { + return delegate.isFix(); + } + + public void setFix(boolean b) { + delegate.setFix(b); + } + + public String getName() { + return delegate.getName(); + } + + public void setName(String s) { + delegate.setName(s); + } + + public int getX() { + return delegate.getX(); + } + + public int getY() { + return delegate.getY(); + } + + public void setPositionSilent(int i, int i1, int i2) { + delegate.setPositionSilent(i, i1, i2); + } + + public void setPosition(int i, int i1, int i2) { + delegate.setPosition(i, i1, i2); + } + + public ArrayList<? extends Node> getNeighbors() { + return delegate.getNeighbors(); + } + + public IMagicNodeModel getModel() { + return magicNodeModel; + } + + public int getType() { + return delegate.getType(); + } + + public int hashCode() { + return delegate.hashCode(); + } + + public String toString() { + return delegate.toString(); + } + + public long getId() { + return delegate.getId(); + } + + public void setId(long l) { + delegate.setId(l); + } + + public int getZ() { + return delegate.getZ(); + } + + public void setZ(int i) { + delegate.setZ(i); + } + + public Node getParentNode() { + return delegate.getParentNode(); + } + + public void setParentNode(Node node) { + delegate.setParentNode(node); + } + + public boolean isPhysical() { + return delegate.isPhysical(); + } + + public void setPhysical(boolean b) { + delegate.setPhysical(b); + } + + public NodeContainer getNodeContainer() { + return delegate.getNodeContainer(); + } + + public URI getServerID() { + return getModel().getServerID(); + } + + public URI getNodeID() { + return nodeURI; + } + + public Node asNode() { + return delegate; + } +} Added: trunk/magicmapclient/src/net/sf/magicmap/core/model/node/impl/MagicNodeModel.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/core/model/node/impl/MagicNodeModel.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/core/model/node/impl/MagicNodeModel.java 2008-01-21 22:01:28 UTC (rev 715) @@ -0,0 +1,236 @@ +package net.sf.magicmap.core.model.node.impl; + +import net.sf.magicmap.client.interfaces.NodeModelListener; +import net.sf.magicmap.client.meta.MapInfo; +import net.sf.magicmap.client.model.location.INodePlacer; +import net.sf.magicmap.client.model.node.*; +import net.sf.magicmap.core.model.URI; +import net.sf.magicmap.core.model.impl.URIImpl; +import net.sf.magicmap.core.model.node.IMagicNode; +import net.sf.magicmap.core.model.node.IMagicNodeModel; +import net.sf.magicmap.core.model.node.INodeIndex; +import net.sf.magicmap.core.model.node.NodeKeyFunction; + +import java.util.*; + +/** + * <p> + * Uses a decorator pattern to enhance to old information model. + * </p> + * <p> + * DETAILS + * </p> + * + * @author Jan Friderici + * Date: 18.01.2008 + * Time: 18:51:39 + */ +public class MagicNodeModel implements IMagicNodeModel { + private final INodeModel delegate; + private URI serverID; + + private final WeakHashMap<Node, IMagicNode> nodeMap = new WeakHashMap<Node, IMagicNode>(); + + private final List<NodeIndex> nodeInedexList = new LinkedList<NodeIndex>(); + + /** + * <p>...</p> + * @param delegate the old model to use. + */ + public MagicNodeModel(INodeModel delegate) { + this.delegate = delegate; + } + + + public void setServerID(String serverURL) { + serverID = new URIImpl(serverURL); + } + + /** + * <p>Create an index to find nodes with a quicknesssssss..</\x9F> + * @param function the function to use. + * @return + */ + public <K, N extends INode> INodeIndex<K, N> createIndex(NodeKeyFunction<K, N> function) { + NodeIndex<K,N> index = new NodeIndex<K,N>(this, function, function.getNodeClass()); + nodeInedexList.add(index); + return index; + } + + /** + * + * @param index + * @return + */ + public boolean removeIndex(INodeIndex index) { + return nodeInedexList.remove(index); + } + + + public IMagicNode getMagicNode(INode node) { + return nodeMap.get(node); + } + + /** + * + * @return + */ + public List<? extends INodeIndex> getNodeIndexList() { + return nodeInedexList; + } + + /** + * + * @param node + */ + public void addNode(Node node) { + delegate.addNode(node); + if (!(node instanceof IMagicNode)) { + nodeMap.put(node, new MagicNode(node, this)); + } + } + + /** + * + * @param node + */ + public void removeNode(Node node) { + delegate.removeNode(node); + if (!(node instanceof IMagicNode)) { + nodeMap.remove(node); + } + } + + /** + * + * @return get the id of the server.... + */ + public URI getServerID() { + return serverID; + } + + /** + * + * @param serverID + */ + public void setServerID(URI serverID) { + this.serverID = serverID; + } + + /** + * + * @return + */ + public INodeModel getNodeModel() { + return delegate; + } + + + public IMagicNode getMagicNode(Node node) { + return nodeMap.get(node); + } + + + + + + public void updateNode(Node node, int i, Object o) { + delegate.updateNode(node, i, o); + } + + public void rehashNode(Node node, String s) { + delegate.rehashNode(node, s); + } + + public ArrayList<? extends Node> findNeighbors(Node node) { + return delegate.findNeighbors(node); + } + + public ArrayList<? extends Node> findNonNeighbors(Node node) { + return delegate.findNonNeighbors(node); + } + + public void addNodeModelListener(NodeModelListener nodeModelListener) { + delegate.addNodeModelListener(nodeModelListener); + } + + public void removeNodeModelListener(NodeModelListener nodeModelListener) { + delegate.removeNodeModelListener(nodeModelListener); + } + + public NodeModelListener[] nodeModelListeners() { + return delegate.nodeModelListeners(); + } + + public Set<AccessPointSeerNode> getAccessPointSeerNodes() { + return delegate.getAccessPointSeerNodes(); + } + + public ArrayList<LocationNode> getLocationsWithAtLeastOneAccessPoint(ArrayList<AccessPointNode> accessPointNodes) { + return delegate.getLocationsWithAtLeastOneAccessPoint(accessPointNodes); + } + + public ArrayList<LocationNode> getLocationsWithAtLeastOneAccessPoint(ArrayList<AccessPointNode> accessPointNodes, Node node) { + return delegate.getLocationsWithAtLeastOneAccessPoint(accessPointNodes, node); + } + + public Node findNode(String s) { + return delegate.findNode(s); + } + + public boolean nodeExists(String s) { + return delegate.nodeExists(s); + } + + public AccessPointNode findAccessPoint(String s) { + return delegate.findAccessPoint(s); + } + + public boolean accessPointExists(String s) { + return delegate.accessPointExists(s); + } + + public ClientNode findClient(String s) { + return delegate.findClient(s); + } + + public boolean clientExists(String s) { + return delegate.clientExists(s); + } + + public Collection<Node> getNodes() { + return delegate.getNodes(); + } + + public void clear() { + delegate.clear(); + nodeMap.clear(); + + } + + /** + * + * @param iNodePlacer + */ + public void setNodePlacer(INodePlacer iNodePlacer) { + delegate.setNodePlacer(iNodePlacer); + } + + /** + * Returns the rotigionals node placer. + * @return + */ + public INodePlacer getNodePlacer() { + return delegate.getNodePlacer(); + } + + public void setCurrentMap(MapInfo mapInfo) { + delegate.setCurrentMap(mapInfo); + } + + public MapNode getCurrentMap() { + return delegate.getCurrentMap(); + } + + +} Added: trunk/magicmapclient/src/net/sf/magicmap/core/model/node/impl/NodeIndex.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/core/model/node/impl/NodeIndex.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/core/model/node/impl/NodeIndex.java 2008-01-21 22:01:28 UTC (rev 715) @@ -0,0 +1,121 @@ +package net.sf.magicmap.core.model.node.impl; + +import net.sf.magicmap.client.interfaces.NodeModelListener; +import net.sf.magicmap.client.model.node.INode; +import net.sf.magicmap.client.model.node.Node; +import net.sf.magicmap.core.model.node.IMagicNodeModel; +import net.sf.magicmap.core.model.node.INodeIndex; +import net.sf.magicmap.core.model.node.NodeKeyFunction; +import org.apache.commons.collections15.MultiMap; +import org.apache.commons.collections15.multimap.MultiHashMap; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +/** + * <p> + * Class NodeIndex ZUSAMMENFASSUNG + * </p> + * <p> + * DETAILS + * </p> + * + * @author Jan Friderici + * Date: 21.01.2008 + * Time: 22:16:28 + */ +public class NodeIndex<K, N extends INode> implements INodeIndex<K,N> { + private final MultiMap<K,N> nodes = new MultiHashMap<K,N>(); + private final Map<N,K> keyMap = new HashMap<N,K>(); + private final NodeKeyFunction<K,N> keyFunction; + private final Class<N> nodeClass; + + /** + * + */ + private NodeModelListener nodeModelListener = new NodeModelListener() { + public void nodeAddedEvent(Node node) { + if (nodeClass.isAssignableFrom(node.getClass())) { + indexNode((N)node); + } + } + + public void nodeUpdatedEvent(Node node, int type, Object data) { + //To change body of implemented methods use File | Settings | File Templates. + } + + public void nodeRemovedEvent(Node node) { + removeNode(node); + } + }; + + + /** + * + * @param node + */ + private void removeNode(Node node) { + final K key = keyMap.remove(node); + if (key != null) { + nodes.get(key).remove((N)node); + } + } + + + /** + * + * @param node + */ + private void indexNode(N node) { + final K key = keyFunction.key(node); + nodes.put(key, node); + keyMap.put(node, key); + } + + /** + * + * @param keyFunction + */ + public NodeIndex(IMagicNodeModel nodeModel, NodeKeyFunction<K, N> keyFunction, Class<N> nodeClass) { + + this.keyFunction = keyFunction; + this.nodeClass = nodeClass; + nodeModel.addNodeModelListener(nodeModelListener); + } + + + /** + * + * @param key + * @return + */ + public N getUnique(K key) { + final Collection<N> nodes = get(key); + return nodes == null || nodes.size() == 0 ? null : nodes.iterator().next(); + } + + /** + * + * @param key + * @return + */ + public Collection<N> get(K key) { + return nodes.get(key); + } + + /** + * + * @param n + * @return + */ + public K getKey(N n) { + return keyMap.get(n); + } + + public void clear() { + this.nodes.clear(); + this.keyMap.clear(); + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jan...@us...> - 2008-01-21 22:19:06
|
Revision: 716 http://magicmap.svn.sourceforge.net/magicmap/?rev=716&view=rev Author: jan_fride Date: 2008-01-21 14:18:23 -0800 (Mon, 21 Jan 2008) Log Message: ----------- Added NodeGraphListener and INodePlacer#getLength(IMagicEdge....) Modified Paths: -------------- trunk/magicmapclient/src/net/sf/magicmap/client/model/location/INodePlacer.java trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java Added Paths: ----------- trunk/magicmapclient/src/net/sf/magicmap/client/model/location/MagicGraphEvent.java trunk/magicmapclient/src/net/sf/magicmap/client/model/location/NodeGraphListener.java Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/location/INodePlacer.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/location/INodePlacer.java 2008-01-21 22:01:28 UTC (rev 715) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/location/INodePlacer.java 2008-01-21 22:18:23 UTC (rev 716) @@ -1,12 +1,12 @@ package net.sf.magicmap.client.model.location; -import java.util.HashMap; - import net.sf.magicmap.client.algorithms.NodeMetricManager; import net.sf.magicmap.client.model.node.IMagicEdge; import net.sf.magicmap.client.model.node.Node; +import java.util.HashMap; + /** * Berechnet die Orte von Knoten. Um einem Model ein INodePlacer hinzuzfügen * muss man nur @@ -33,7 +33,15 @@ */ void deleteNode(Node node); + /** + * get the edges length. + * @param egde the edge + * @return the edges Length or Double.NaN. + */ + double getLength(IMagicEdge egde); + + /** * Legt eine gerichtete Kante zwischen den beiden Knoten an. * * @param n1 die Quelle der Kante @@ -113,7 +121,27 @@ /** * + * @param l */ + void addNodeGraphListener(NodeGraphListener l); + + /** + * + * @param l + */ + void removeNodeGraphListener(NodeGraphListener l); + + /** + * + * @return + */ + NodeGraphListener[] getNodeGraphListeners(); + + + + /** + * + */ static final class NodeHandlerFactory { public final HashMap<Integer, NodeUpdateHandler> handlerMap; Added: trunk/magicmapclient/src/net/sf/magicmap/client/model/location/MagicGraphEvent.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/location/MagicGraphEvent.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/location/MagicGraphEvent.java 2008-01-21 22:18:23 UTC (rev 716) @@ -0,0 +1,34 @@ +package net.sf.magicmap.client.model.location; + +import net.sf.magicmap.client.model.node.IMagicEdge; + +import java.util.EventObject; + +/** + * <p> + * Class MagicGraphEvent ZUSAMMENFASSUNG + * </p> + * <p> + * DETAILS + * </p> + * + * @author Jan Friderici + * Date: 21.01.2008 + * Time: 09:07:01 + */ +public class MagicGraphEvent extends EventObject { + private final IMagicEdge edge; + + public MagicGraphEvent(INodePlacer placer, IMagicEdge edge) { + super(placer); + this.edge = edge; + } + + public INodePlacer getSource() { + return (INodePlacer)super.getSource(); + } + + public IMagicEdge getEdge() { + return edge; + } +} Added: trunk/magicmapclient/src/net/sf/magicmap/client/model/location/NodeGraphListener.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/location/NodeGraphListener.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/location/NodeGraphListener.java 2008-01-21 22:18:23 UTC (rev 716) @@ -0,0 +1,31 @@ +package net.sf.magicmap.client.model.location; + + +import java.util.EventListener; + +/** + * <p> + * Class NodeGraphListener ZUSAMMENFASSUNG + * </p> + * <p> + * DETAILS + * </p> + * + * @author Jan Friderici + * Date: 21.01.2008 + * Time: 09:06:43 + */ +public interface NodeGraphListener extends EventListener{ + + /** + * + * @param edge + */ + void edgeAdded(MagicGraphEvent edge); + + /** + * + * @param edge + */ + void edgeRemoved(MagicGraphEvent edge); +} Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java 2008-01-21 22:01:28 UTC (rev 715) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java 2008-01-21 22:18:23 UTC (rev 716) @@ -4,6 +4,9 @@ import edu.uci.ics.jung.graph.Edge; import edu.uci.ics.jung.graph.Vertex; import edu.uci.ics.jung.graph.decorators.StringLabeller; +import edu.uci.ics.jung.graph.event.GraphEvent; +import edu.uci.ics.jung.graph.event.GraphEventListener; +import edu.uci.ics.jung.graph.event.GraphEventType; import edu.uci.ics.jung.graph.impl.DirectedSparseGraph; import edu.uci.ics.jung.graph.impl.DirectedSparseVertex; import edu.uci.ics.jung.utils.UserData; @@ -12,12 +15,15 @@ import net.sf.magicmap.client.algorithms.NodeMetricManager; import net.sf.magicmap.client.algorithms.NodeModelMetric; import net.sf.magicmap.client.model.location.INodePlacer; +import net.sf.magicmap.client.model.location.MagicGraphEvent; +import net.sf.magicmap.client.model.location.NodeGraphListener; import net.sf.magicmap.client.model.location.NodeUpdateHandler; import net.sf.magicmap.client.model.location.jung.handler.*; import net.sf.magicmap.client.model.node.*; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import javax.swing.event.EventListenerList; import java.awt.*; import java.util.*; @@ -82,6 +88,33 @@ private final Map<Edge, IMagicEdge> magicEdges = new HashMap<Edge, IMagicEdge>(); + + private final EventListenerList listeners = new EventListenerList(); + + /** + * Listener thet lstens on the original graph. + */ + private GraphEventListener edgeAddListener = new GraphEventListener() { + public void vertexAdded(GraphEvent event) { + // NOP + } + + public void vertexRemoved(GraphEvent event) { + // NOP + } + + public void edgeAdded(GraphEvent event) { + JungEdge edge = (JungEdge) event.getGraphElement(); + fireEdgeAdded(edge); + } + + public void edgeRemoved(GraphEvent event) { + JungEdge edge = (JungEdge) event.getGraphElement(); + fireEdgeRemoved(edge); + } + }; + + public JungNodePlacer() { this(new MagicMetric()); } @@ -111,6 +144,7 @@ this.labeller = StringLabeller.getLabeller(this); initNodeHandler(); + super.addListener(edgeAddListener, GraphEventType.ALL_SINGLE_EVENTS); } /** @@ -421,4 +455,59 @@ return edgeCopy.iterator(); } } + + + /** + * + * @param l + */ + public void addNodeGraphListener(NodeGraphListener l) { + listeners.add(NodeGraphListener.class, l); + } + + /** + * + * @param l + */ + public void removeNodeGraphListener(NodeGraphListener l) { + listeners.remove(NodeGraphListener.class, l); + } + + /** + * + * @return + */ + public NodeGraphListener[] getNodeGraphListeners() { + return listeners.getListeners(NodeGraphListener.class); + } + + /** + * Forward to the springlayout.... + * @param egde + * @return + */ + public double getLength(IMagicEdge egde) { + return this.layout.getLength((JungEdge)egde); + } + + /** + * + * @param edge + */ + private void fireEdgeAdded(JungEdge edge) { + final MagicGraphEvent e = new MagicGraphEvent(this,edge); + for (NodeGraphListener l: getNodeGraphListeners()) { + l.edgeAdded(e); + } + } + /** + * + * @param edge + */ + private void fireEdgeRemoved(JungEdge edge) { + final MagicGraphEvent e = new MagicGraphEvent(this,edge); + for (NodeGraphListener l: getNodeGraphListeners()) { + l.edgeRemoved(e); + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jan...@us...> - 2008-01-14 00:01:25
|
Revision: 714 http://magicmap.svn.sourceforge.net/magicmap/?rev=714&view=rev Author: jan_fride Date: 2008-01-13 15:10:04 -0800 (Sun, 13 Jan 2008) Log Message: ----------- Added Map Functions to edges (set and get data). Modified Paths: -------------- branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungEdge.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/client/model/node/IMagicEdge.java trunk/magicmapserver/magicmapserver.iml trunk/magicmapserver/web/WEB-INF/lib/ant-project.properties Modified: branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungEdge.java =================================================================== --- branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungEdge.java 2008-01-02 22:07:28 UTC (rev 713) +++ branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungEdge.java 2008-01-13 23:10:04 UTC (rev 714) @@ -1,9 +1,10 @@ package net.sf.magicmap.client.model.location.jung; +import edu.uci.ics.jung.graph.Vertex; +import edu.uci.ics.jung.graph.impl.DirectedSparseEdge; +import edu.uci.ics.jung.utils.UserData; import net.sf.magicmap.client.model.node.IMagicEdge; import net.sf.magicmap.client.model.node.Node; -import edu.uci.ics.jung.graph.Vertex; -import edu.uci.ics.jung.graph.impl.DirectedSparseEdge; public class JungEdge extends DirectedSparseEdge implements IMagicEdge{ @@ -19,4 +20,22 @@ public Node getTargetNode(){ return (Node) getDest().getUserDatum(LayoutSettings.NODE_KEY); } + + /** + * + * @param key + * @return + */ + public Object getData(String key) { + return getUserDatum(key); + } + + /** + * + * @param key + * @param value + */ + public void setData(String key, Object value) { + setUserDatum(key,value, UserData.REMOVE); + } } Modified: branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/client/model/node/IMagicEdge.java =================================================================== --- branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/client/model/node/IMagicEdge.java 2008-01-02 22:07:28 UTC (rev 713) +++ branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/client/model/node/IMagicEdge.java 2008-01-13 23:10:04 UTC (rev 714) @@ -24,7 +24,20 @@ /** * + * @param key + * @return */ + Object getData(String key); + + /** + * + * @param key + */ + void setData(String key, Object value); + + /** + * + */ public enum EdgeType{ NONE, PARENT_EDGE, DISTANCE_EDGE; } Modified: trunk/magicmapserver/magicmapserver.iml =================================================================== --- trunk/magicmapserver/magicmapserver.iml 2008-01-02 22:07:28 UTC (rev 713) +++ trunk/magicmapserver/magicmapserver.iml 2008-01-13 23:10:04 UTC (rev 714) @@ -9,6 +9,10 @@ <webroots> <root url="file://$MODULE_DIR$/web" relative="/" /> </webroots> + <sourceRoots> + <root url="file://$MODULE_DIR$/dblayer/src" /> + <root url="file://$MODULE_DIR$/src" /> + </sourceRoots> <building> <setting name="EXPLODED_URL" value="file://" /> <setting name="EXPLODED_ENABLED" value="false" /> Modified: trunk/magicmapserver/web/WEB-INF/lib/ant-project.properties =================================================================== --- trunk/magicmapserver/web/WEB-INF/lib/ant-project.properties 2008-01-02 22:07:28 UTC (rev 713) +++ trunk/magicmapserver/web/WEB-INF/lib/ant-project.properties 2008-01-13 23:10:04 UTC (rev 714) @@ -16,7 +16,7 @@ # generated java sources (think of stubs etc...) src.gen.dir=src-gen -# descriptors and meta information files +# descriptors and meta infoObject files inf.gen.dir=inf-gen # compiled java classes classes.dir=classes This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jza...@us...> - 2008-01-02 22:07:34
|
Revision: 713 http://magicmap.svn.sourceforge.net/magicmap/?rev=713&view=rev Author: jzapotoc Date: 2008-01-02 14:07:28 -0800 (Wed, 02 Jan 2008) Log Message: ----------- added required jar Modified Paths: -------------- trunk/magicmapclient/.classpath Modified: trunk/magicmapclient/.classpath =================================================================== --- trunk/magicmapclient/.classpath 2008-01-02 18:57:34 UTC (rev 712) +++ trunk/magicmapclient/.classpath 2008-01-02 22:07:28 UTC (rev 713) @@ -4,7 +4,7 @@ <classpathentry kind="src" path="test"/> <classpathentry kind="src" path="src-gen"/> <classpathentry kind="src" path="res"/> - <classpathentry sourcepath="/magicmapserver/src" kind="lib" path="/magicmapserver/dist/magicmap-server.jar"/> + <classpathentry kind="lib" path="/magicmapserver/dist/magicmap-server.jar" sourcepath="/magicmapserver/src"/> <classpathentry kind="lib" path="lib/commons-httpclient-3.0-rc3.jar"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="lib" path="lib/colt.jar"/> @@ -35,5 +35,6 @@ <classpathentry kind="lib" path="lib/foxtrot.jar"/> <classpathentry kind="lib" path="lib/nekohtml.jar"/> <classpathentry kind="lib" path="lib-dev/junit.jar"/> + <classpathentry kind="lib" path="lib/looks-2.1.4.jar"/> <classpathentry kind="output" path="bin"/> </classpath> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jan...@us...> - 2008-01-02 18:57:36
|
Revision: 712 http://magicmap.svn.sourceforge.net/magicmap/?rev=712&view=rev Author: jan_fride Date: 2008-01-02 10:57:34 -0800 (Wed, 02 Jan 2008) Log Message: ----------- Path Modified Paths: -------------- branches/info/magicmapclient/magicmapclient/.classpath Modified: branches/info/magicmapclient/magicmapclient/.classpath =================================================================== --- branches/info/magicmapclient/magicmapclient/.classpath 2008-01-02 18:25:53 UTC (rev 711) +++ branches/info/magicmapclient/magicmapclient/.classpath 2008-01-02 18:57:34 UTC (rev 712) @@ -15,7 +15,7 @@ <classpathentry kind="lib" path="lib/xmlParserAPIs.jar"/> <classpathentry kind="lib" path="lib/RelativeLayout.jar"/> <classpathentry kind="lib" path="lib/forms-1.0.5.jar"/> - <classpathentry kind="lib" path="lib/looks-1.2.2.jar"/> + <classpathentry kind="lib" path="lib/looks-2.1.4.jar"/> <classpathentry kind="lib" path="lib/activation.jar"/> <classpathentry kind="lib" path="lib/mail.jar"/> <classpathentry kind="lib" path="lib/commons-discovery.jar"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jan...@us...> - 2008-01-02 18:25:55
|
Revision: 711 http://magicmap.svn.sourceforge.net/magicmap/?rev=711&view=rev Author: jan_fride Date: 2008-01-02 10:25:53 -0800 (Wed, 02 Jan 2008) Log Message: ----------- Added Paths: ----------- branches/info/magicmapclient/magicmapclient/ branches/info/magicmapclient/magicmapclient/build.xml branches/info/magicmapclient/magicmapclient/lib/looks-2.1.4.jar branches/info/magicmapclient/magicmapclient/magicmapclient.iml branches/info/magicmapclient/magicmapclient/src/com/jgoodies/uif_lite/panel/SimpleInternalFrame.java branches/info/magicmapclient/magicmapclient/src/edu/uci/ics/jung/visualization/VisualizationViewer.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/client/core/MagicMapApplication.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/client/gui/utils/GUIUtils.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/client/model/location/INodePlacer.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/client/model/node/IMagicEdge.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/client/model/node/INode.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/client/model/node/INodeModel.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/client/model/node/Node.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/core/ branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/core/model/ branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/core/model/graph/ branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/core/model/graph/IGraphEdge.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/core/model/graph/IGraphElement.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/core/model/graph/IGraphNode.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/core/model/graph/INodeGraph.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/core/model/graph/impl/ branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/core/model/graph/impl/BaseGraphElement.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/core/model/graph/impl/BaseGraphNode.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/core/model/graph/impl/BaseNodeGraph.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/core/model/graph/jung/ branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/core/model/location/ branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/core/model/location/ForwardingNodePlacer.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/core/model/node/ branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/core/model/node/InterceptableNodeModel.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/core/model/node/KeyGenerator.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/core/model/node/NodeFilter.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/core/model/node/NodeIndex.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/core/model/node/NodeModelInterceptor.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/core/model/node/SearchableNodeIndex.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/core/model/node/SearchableNodeModel.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/core/model/node/impl/ branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/core/model/node/impl/BaseNodeIndex.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/core/model/node/impl/MacNodeKeyGenerator.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/core/model/node/impl/NodeIndexFactory.java Removed Paths: ------------- branches/info/magicmapclient/magicmapclient/build.xml branches/info/magicmapclient/magicmapclient/magicmapclient.iml branches/info/magicmapclient/magicmapclient/src/com/jgoodies/uif_lite/panel/SimpleInternalFrame.java branches/info/magicmapclient/magicmapclient/src/edu/uci/ics/jung/visualization/VisualizationViewer.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/client/core/MagicMapApplication.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/client/gui/utils/GUIUtils.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/client/model/location/INodePlacer.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/client/model/node/IMagicEdge.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/client/model/node/INode.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/client/model/node/INodeModel.java branches/info/magicmapclient/magicmapclient/src/net/sf/magicmap/client/model/node/Node.java Copied: branches/info/magicmapclient/magicmapclient (from rev 704, trunk/magicmapclient) Deleted: branches/info/magicmapclient/magicmapclient/build.xml =================================================================== --- trunk/magicmapclient/build.xml 2007-12-21 12:06:47 UTC (rev 704) +++ branches/info/magicmapclient/magicmapclient/build.xml 2008-01-02 18:25:53 UTC (rev 711) @@ -1,168 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> -<project name="magicmapclient" default="jar" basedir="."> - <property name="application" value="magicmap" /> - <!-- Version Information --> - <property name="version.number" value="0.9.2" /> - <property name="version.appendix" value="beta 1" /> - <property name="jar.name" value="${application}.jar" /> - <property name="main.class" value="net.sf.magicmap.client.core.MagicMapApplication" /> - - <!-- Setting for maven path--> - <property name="maven.home" value="D:\_development\_Tools\maven-2.0.5"/> - - - - <property name="server" value="../magicmapserver" /> - <property name="build" value="build" /> - <property name="build-test" value="build-test" /> - <property name="dist" value="dist" /> - <property name="test" value="test" /> - <property name="src" value="src" /> - <property name="src.gen" value="src-gen" /> - <property name="res" value="res" /> - - <path id="build.classpath"> - <fileset dir="."> - <include name="${jar.name}" /> - </fileset> - <fileset dir="lib"> - <include name="**/*.jar" /> - </fileset> - <!-- use server classes --> - <fileset dir="${server}/dist"> - <include name="*.jar" /> - </fileset> - </path> - <path id="test.classpath"> - <fileset dir="."> - <include name="${jar.name}" /> - </fileset> - <fileset dir="lib"> - <include name="**/*.jar" /> - </fileset> - <!-- use server classes --> - <fileset dir="${server}/dist"> - <include name="*.jar" /> - </fileset> - <pathelement location="${build}"></pathelement> - </path> - - <pathconvert property="classpath" pathsep=" " dirsep="/"> - <path> - <fileset dir="."> - <include name="${jar.name}" /> - </fileset> - <fileset dir="lib"> - <include name="**/*.jar" /> - </fileset> - <!-- use server classes --> - <filelist dir="lib" files="magicmap-server.jar" /> - </path> - <map from="${basedir}" to="." /> - </pathconvert> - - <path id="axis.classpath"> - <fileset dir="lib"> - <include name="**/*.jar" /> - </fileset> - <fileset dir="lib-dev"> - <include name="**/*.jar" /> - </fileset> - </path> - - <taskdef resource="axis-tasks.properties" classpathref="axis.classpath" /> - - <target name="prepare" depends="clean"> - <mkdir dir="${build}" /> - <mkdir dir="${build-test}" /> - <mkdir dir="${dist}" /> - <mkdir dir="${test}" /> - <mkdir dir="${src.gen}" /> - </target> - - <target name="clean"> - <delete dir="${build}" /> - <delete dir="${build-test}" /> - <delete dir="${dist}" /> - <delete file="${jar.name}" /> - <delete dir="${src.gen}" /> - </target> - - <target name="axis" depends="prepare"> - <axis-wsdl2java output="${src.gen}" testcase="false" verbose="false" noimports="true" debug="false" url="inf/PositionFacade.wsdl" /> - <axis-wsdl2java output="${src.gen}" testcase="false" verbose="false" noimports="true" debug="false" url="inf/SessionFacade.wsdl" /> - <axis-wsdl2java output="${src.gen}" testcase="false" verbose="false" noimports="true" debug="false" url="inf/MapFacade.wsdl" /> - </target> - - <target name="compile" depends="axis"> - <javac destdir="${build}" target="1.5" debug="true" deprecation="true" debuglevel="lines,vars,source" fork="true" encoding="ISO-8859-1"> - <classpath refid="build.classpath" /> - <src path="${src}" /> - <src path="${src.gen}" /> - </javac> - </target> - - <target name="compile-tests" depends="compile"> - <javac destdir="${build-test}" target="1.5" debug="true" deprecation="true" debuglevel="lines,vars,source" fork="true" encoding="ISO-8859-1"> - <classpath refid="test.classpath" /> - <src path="${test}" /> - </javac> - </target> - - <target name="version" depends="compile"> - <tstamp> - <format property="build.number" pattern="yyyyMMddHHmm" /> - </tstamp> - <propertyfile file="res/version.properties"> - <entry key="version" value="${version.number}" /> - <entry key="appendix" value="${version.appendix}" /> - <entry key="buildnumber" value="${build.number}" /> - </propertyfile> - </target> - - <target name="jar" depends="version"> - <jar jarfile="${application}.jar"> - <fileset dir="${build}" /> - <fileset dir="${res}" /> - <manifest> - <attribute name="Main-Class" value="${main.class}" /> - <attribute name="Class-Path" value="${classpath}" /> - </manifest> - </jar> - </target> - - <target name="dist" depends="jar"> - <zip destfile="dist/${application}-${version.number}-${version.appendix}.zip"> - <fileset dir="." includes="lib/*" /> - <fileset dir="." includes="plugins/*" /> - <fileset dir="." includes="${jar.name}" /> - <zipfileset dir="${server}/dist" includes="magicmap-server.jar" fullpath="lib/magicmap-server.jar" /> - <fileset dir="." includes="start.bat start.sh start_nightly.bat start_nightly.sh" /> - </zip> - </target> - - <target name="run" depends="jar"> - <java classname="${main.class}" fork="true" failonerror="true" maxmemory="128m"> - <classpath refid="build.classpath" /> - <arg value="-h" /> - </java> - </target> - - <target name="copy-resources"> - <copy todir="build"> - <fileset dir="${res}"></fileset> - </copy> - </target> - - <!-- Setting for maven path must be checked.--> - <target name="maven-install"> - <exec executable="${maven.home}/bin/mvn.bat"> - <arg value="install:install-file"/> - <arg value="-Dfile=magicmap.jar"/> - <arg value="-DgroupId=net.sf.magicmap"/> - <arg value="-DartifactId=magicmapclient"/> - <arg value="-Dversion=${version.number}"/> - <arg value="-Dpackaging=jar"/> - </exec> - </target> -</project> Copied: branches/info/magicmapclient/magicmapclient/build.xml (from rev 710, trunk/magicmapclient/build.xml) =================================================================== --- branches/info/magicmapclient/magicmapclient/build.xml (rev 0) +++ branches/info/magicmapclient/magicmapclient/build.xml 2008-01-02 18:25:53 UTC (rev 711) @@ -0,0 +1,168 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<project name="magicmapclient" default="jar" basedir="."> + <property name="application" value="magicmap" /> + <!-- Version Information --> + <property name="version.number" value="0.9.2" /> + <property name="version.appendix" value="beta 1" /> + <property name="jar.name" value="${application}.jar" /> + <property name="main.class" value="net.sf.magicmap.client.core.MagicMapApplication" /> + + <!-- Setting for maven path--> + <property name="maven.home" value="/usr/local/maven"/> + + + + <property name="server" value="../magicmapserver" /> + <property name="build" value="build" /> + <property name="build-test" value="build-test" /> + <property name="dist" value="dist" /> + <property name="test" value="test" /> + <property name="src" value="src" /> + <property name="src.gen" value="src-gen" /> + <property name="res" value="res" /> + + <path id="build.classpath"> + <fileset dir="."> + <include name="${jar.name}" /> + </fileset> + <fileset dir="lib"> + <include name="**/*.jar" /> + </fileset> + <!-- use server classes --> + <fileset dir="${server}/dist"> + <include name="*.jar" /> + </fileset> + </path> + <path id="test.classpath"> + <fileset dir="."> + <include name="${jar.name}" /> + </fileset> + <fileset dir="lib"> + <include name="**/*.jar" /> + </fileset> + <!-- use server classes --> + <fileset dir="${server}/dist"> + <include name="*.jar" /> + </fileset> + <pathelement location="${build}"></pathelement> + </path> + + <pathconvert property="classpath" pathsep=" " dirsep="/"> + <path> + <fileset dir="."> + <include name="${jar.name}" /> + </fileset> + <fileset dir="lib"> + <include name="**/*.jar" /> + </fileset> + <!-- use server classes --> + <filelist dir="lib" files="magicmap-server.jar" /> + </path> + <map from="${basedir}" to="." /> + </pathconvert> + + <path id="axis.classpath"> + <fileset dir="lib"> + <include name="**/*.jar" /> + </fileset> + <fileset dir="lib-dev"> + <include name="**/*.jar" /> + </fileset> + </path> + + <taskdef resource="axis-tasks.properties" classpathref="axis.classpath" /> + + <target name="prepare" depends="clean"> + <mkdir dir="${build}" /> + <mkdir dir="${build-test}" /> + <mkdir dir="${dist}" /> + <mkdir dir="${test}" /> + <mkdir dir="${src.gen}" /> + </target> + + <target name="clean"> + <delete dir="${build}" /> + <delete dir="${build-test}" /> + <delete dir="${dist}" /> + <delete file="${jar.name}" /> + <delete dir="${src.gen}" /> + </target> + + <target name="axis" depends="prepare"> + <axis-wsdl2java output="${src.gen}" testcase="false" verbose="false" noimports="true" debug="false" url="inf/PositionFacade.wsdl" /> + <axis-wsdl2java output="${src.gen}" testcase="false" verbose="false" noimports="true" debug="false" url="inf/SessionFacade.wsdl" /> + <axis-wsdl2java output="${src.gen}" testcase="false" verbose="false" noimports="true" debug="false" url="inf/MapFacade.wsdl" /> + </target> + + <target name="compile" depends="axis"> + <javac destdir="${build}" target="1.5" debug="true" deprecation="true" debuglevel="lines,vars,source" fork="true" encoding="ISO-8859-1"> + <classpath refid="build.classpath" /> + <src path="${src}" /> + <src path="${src.gen}" /> + </javac> + </target> + + <target name="compile-tests" depends="compile"> + <javac destdir="${build-test}" target="1.5" debug="true" deprecation="true" debuglevel="lines,vars,source" fork="true" encoding="ISO-8859-1"> + <classpath refid="test.classpath" /> + <src path="${test}" /> + </javac> + </target> + + <target name="version" depends="compile"> + <tstamp> + <format property="build.number" pattern="yyyyMMddHHmm" /> + </tstamp> + <propertyfile file="res/version.properties"> + <entry key="version" value="${version.number}" /> + <entry key="appendix" value="${version.appendix}" /> + <entry key="buildnumber" value="${build.number}" /> + </propertyfile> + </target> + + <target name="jar" depends="version"> + <jar jarfile="${application}.jar"> + <fileset dir="${build}" /> + <fileset dir="${res}" /> + <manifest> + <attribute name="Main-Class" value="${main.class}" /> + <attribute name="Class-Path" value="${classpath}" /> + </manifest> + </jar> + </target> + + <target name="dist" depends="jar"> + <zip destfile="dist/${application}-${version.number}-${version.appendix}.zip"> + <fileset dir="." includes="lib/*" /> + <fileset dir="." includes="plugins/*" /> + <fileset dir="." includes="${jar.name}" /> + <zipfileset dir="${server}/dist" includes="magicmap-server.jar" fullpath="lib/magicmap-server.jar" /> + <fileset dir="." includes="start.bat start.sh start_nightly.bat start_nightly.sh" /> + </zip> + </target> + + <target name="run" depends="jar"> + <java classname="${main.class}" fork="true" failonerror="true" maxmemory="128m"> + <classpath refid="build.classpath" /> + <arg value="-h" /> + </java> + </target> + + <target name="copy-resources"> + <copy todir="build"> + <fileset dir="${res}"></fileset> + </copy> + </target> + + <!-- Setting for maven path must be checked.--> + <target name="maven-install"> + <exec executable="${maven.home}/bin/mvn"> + <arg value="install:install-file"/> + <arg value="-Dfile=magicmap.jar"/> + <arg value="-DgroupId=net.sf.magicmap"/> + <arg value="-DartifactId=magicmapclient"/> + <arg value="-Dversion=${version.number}"/> + <arg value="-Dpackaging=jar"/> + </exec> + </target> +</project> Copied: branches/info/magicmapclient/magicmapclient/lib/looks-2.1.4.jar (from rev 710, trunk/magicmapclient/lib/looks-2.1.4.jar) =================================================================== (Binary files differ) Deleted: branches/info/magicmapclient/magicmapclient/magicmapclient.iml =================================================================== --- trunk/magicmapclient/magicmapclient.iml 2007-12-21 12:06:47 UTC (rev 704) +++ branches/info/magicmapclient/magicmapclient/magicmapclient.iml 2008-01-02 18:25:53 UTC (rev 711) @@ -1,302 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<module version="4" relativePaths="false" type="JAVA_MODULE"> - <component name="ModuleRootManager" /> - <component name="NewModuleRootManager" inherit-compiler-output="false"> - <output url="file://$MODULE_DIR$/build" /> - <exclude-output /> - <output-test url="file://$MODULE_DIR$/build-test" /> - <content url="file://$MODULE_DIR$"> - <sourceFolder url="file://$MODULE_DIR$/res" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src-gen" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" /> - <excludeFolder url="file://$MODULE_DIR$/build" /> - <excludeFolder url="file://$MODULE_DIR$/build-test" /> - <excludeFolder url="file://$MODULE_DIR$/target" /> - </content> - <orderEntry type="inheritedJdk" /> - <orderEntry type="sourceFolder" forTests="false" /> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://X:/maven/junit/junit/3.8.1/junit-3.8.1.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/dom4j-1.6.1.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/forms-1.0.5.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/commons-collections-3.1.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/foxtrot.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/jaxrpc.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/ostermillerutils_1_05_00.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/commons-codec-1.3.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/concurrent.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/colt.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/nekohtml.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/commons-logging.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/jung-1.5.2.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/saaj.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/xmlParserAPIs.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/derby.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/RelativeLayout.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/xercesImpl.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/xml-apis.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/mail.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/jaxen-1.1-beta-9.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/commons-httpclient-3.0-rc3.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/jpox-20041204.032009.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/looks-1.2.2.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/log4j-1.2.8.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/axis.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/activation.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/wsdl4j.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/commons-discovery.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib-dev/junit.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib-dev/axis-ant.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module" module-name="magicmapserver" /> - <orderEntryProperties /> - </component> -</module> - Copied: branches/info/magicmapclient/magicmapclient/magicmapclient.iml (from rev 710, trunk/magicmapclient/magicmapclient.iml) =================================================================== --- branches/info/magicmapclient/magicmapclient/magicmapclient.iml (rev 0) +++ branches/info/magicmapclient/magicmapclient/magicmapclient.iml 2008-01-02 18:25:53 UTC (rev 711) @@ -0,0 +1,290 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module relativePaths="true" type="JAVA_MODULE" version="4"> + <component name="NewModuleRootManager" inherit-compiler-output="true"> + <output url="file://$MODULE_DIR$/build" /> + <exclude-output /> + <output-test url="file://$MODULE_DIR$/build-test" /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/res" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src-gen" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="false" /> + </content> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/../magicmapserver/dist/magicmap-server.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES> + <root url="file://$MODULE_DIR$/../magicmapserver/src" /> + </SOURCES> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/commons-httpclient-3.0-rc3.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="inheritedJdk" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/colt.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/commons-collections-3.1.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/concurrent.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/xercesImpl.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/xml-apis.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/xmlParserAPIs.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/RelativeLayout.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/forms-1.0.5.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/activation.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/mail.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/commons-discovery.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/commons-logging.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/jaxrpc.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/saaj.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/wsdl4j.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/axis.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/jung-1.5.2.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/derby.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/jpox-20041204.032009.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/log4j-1.2.8.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/ostermillerutils_1_05_00.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/dom4j-1.6.1.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/commons-codec-1.3.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/jaxen-1.1-beta-9.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/foxtrot.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/nekohtml.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib-dev/junit.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/looks-2.1.4.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntryProperties /> + </component> +</module> + Deleted: branches/info/magicmapclient/magicmapclient/src/com/jgoodies/uif_lite/panel/SimpleInternalFrame.java =================================================================== --- trunk/magicmapclient/src/com/jgoodies/uif_lite/panel/SimpleInternalFrame.java 2007-12-21 12:06:47 UTC (rev 704) +++ branches/info/magicmapclient/magicmapclient/src/com/jgoodies/uif_lite/panel/SimpleInternalFrame.java 2008-01-02 18:25:53 UTC (rev 711) @@ -1,409 +0,0 @@ -/* - * Copyright (c) 2003 JGoodies Karsten Lentzsch. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * o Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * o Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * o Neither the name of JGoodies Karsten Lentzsch nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package com.jgoodies.uif_lite.panel; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.GradientPaint; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Insets; -import java.awt.LayoutManager; -import java.awt.Paint; - -import javax.swing.BorderFactory; -import javax.swing.Icon; -import javax.swing.JComponent; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.JToolBar; -import javax.swing.SwingConstants; -import javax.swing.UIManager; -import javax.swing.border.AbstractBorder; - -import net.sf.magicmap.client.gui.utils.ShadowBorder; - -import com.jgoodies.plaf.LookUtils; - -/** - * A <code>JPanel</code> subclass that has a drop shadow border and - * that provides a header with icon, title and tool bar.<p> - * - * This class can be used to replace the <code>JInternalFrame</code>, - * for use outside of a <code>JDesktopPane</code>. - * The <code>SimpleInternalFrame</code> is less flexible but often - * more usable; it avoids overlapping windows and scales well - * up to IDE size. - * Several customers have reported that they and their clients feel - * much better with both the appearance and the UI feel.<p> - * - * The SimpleInternalFrame provides the following bound properties: - * <i>frameIcon, title, toolBar, content, selected.</i><p> - * - * By default the SimpleInternalFrame is in <i>selected</i> state. - * If you don't do anything, multiple simple internal frames will - * be displayed as selected. - * - * @author Karsten Lentzsch - * @version $Revision$ - * - * @see javax.swing.JInternalFrame - * @see javax.swing.JDesktopPane - */ - -public class SimpleInternalFrame extends JPanel { - - private JLabel titleLabel; - private GradientPanel gradientPanel; - private JPanel headerPanel; - private boolean isSelected; - - // Instance Creation **************************************************** - - /** - * Constructs a <code>SimpleInternalFrame</code> with the specified title. - * - * @param title the initial title - */ - public SimpleInternalFrame(String title) { - this(null, title, null, null); - } - - /** - * Constructs a <code>SimpleInternalFrame</code> with the specified - * icon, and title. - * - * @param icon the initial icon - * @param title the initial title - */ - public SimpleInternalFrame(Icon icon, String title) { - this(icon, title, null, null); - } - - /** - * Constructs a <code>SimpleInternalFrame</code> with the specified - * title, tool bar, and content panel. - * - * @param title the initial title - * @param bar the initial tool bar - * @param content the initial content pane - */ - public SimpleInternalFrame(String title, JToolBar bar, JComponent content) { - this(null, title, bar, content); - } - - /** - * Constructs a <code>SimpleInternalFrame</code> with the specified - * icon, title, tool bar, and content panel. - * - * @param icon the initial icon - * @param title the initial title - * @param bar the initial tool bar - * @param content the initial content pane - */ - public SimpleInternalFrame(Icon icon, String title, JToolBar bar, JComponent content) { - super(new BorderLayout()); - this.isSelected = false; - this.titleLabel = new JLabel(title, icon, SwingConstants.LEADING); - JPanel top = buildHeader(titleLabel, bar); - - add(top, BorderLayout.NORTH); - if (content != null){ - setContent(content); - } - setBorder(new ShadowBorder()); - setSelected(true); - updateHeader(); - } - - // Public API *********************************************************** - - /** - * Returns the frame's icon. - * - * @return the frame's icon - */ - public Icon getFrameIcon(){ - return titleLabel.getIcon(); - } - - /** - * Sets a new frame icon. - * - * @param newIcon the icon to be set - */ - public void setFrameIcon(Icon newIcon){ - Icon oldIcon = getFrameIcon(); - titleLabel.setIcon(newIcon); - firePropertyChange("frameIcon", oldIcon, newIcon); - } - - /** - * Returns the frame's title text. - * - * @return String the current title text - */ - public String getTitle(){ - return titleLabel.getText(); - } - - /** - * Sets a new title text. - * - * @param newText the title text tp be set - */ - public void setTitle(String newText){ - String oldText = getTitle(); - titleLabel.setText(newText); - firePropertyChange("title", oldText, newText); - } - - /** - * Returns the current toolbar, null if none has been set before. - * - * @return the current toolbar - if any - */ - public JToolBar getToolBar(){ - return headerPanel.getComponentCount() > 1 ? (JToolBar) headerPanel.getComponent(1) : null; - } - - /** - * Sets a new tool bar in the header. - * - * @param newToolBar the tool bar to be set in the header - */ - public void setToolBar(JToolBar newToolBar){ - JToolBar oldToolBar = getToolBar(); - if (oldToolBar == newToolBar){ - return; - } - if (oldToolBar != null){ - headerPanel.remove(oldToolBar); - } - if (newToolBar != null){ - newToolBar.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - headerPanel.add(newToolBar, BorderLayout.EAST); - } - updateHeader(); - firePropertyChange("toolBar", oldToolBar, newToolBar); - } - - /** - * Returns the content - null, if none has been set. - * - * @return the current content - */ - public Component getContent(){ - return hasContent() ? getComponent(1) : null; - } - - /** - * Sets a new panel content; replaces any existing content, if existing. - * - * @param newContent the panel's new content - */ - public void setContent(Component newContent){ - Component oldContent = getContent(); - if (hasContent()){ - remove(oldContent); - } - add(newContent, BorderLayout.CENTER); - firePropertyChange("content", oldContent, newContent); - } - - /** - * Answers if the panel is currently selected (or in other words active) - * or not. In the selected state, the header background will be - * rendered differently. - * - * @return boolean a boolean, where true means the frame is selected - * (currently active) and false means it is not - */ - public boolean isSelected(){ - return isSelected; - } - - /** - * This panel draws its title bar differently if it is selected, - * which may be used to indicate to the user that this panel - * has the focus, or should get more attention than other - * simple internal frames. - * - * @param newValue a boolean, where true means the frame is selected - * (currently active) and false means it is not - */ - public void setSelected(boolean newValue){ - boolean oldValue = isSelected(); - isSelected = newValue; - updateHeader(); - firePropertyChange("selected", oldValue, newValue); - } - - // Building ************************************************************* - - /** - * Creates and answers the header panel, that consists of: - * an icon, a title label, a tool bar, and a gradient background. - * - * @param label the label to paint the icon and text - * @param bar the panel's tool bar - * @return the panel's built header area - */ - private JPanel buildHeader(JLabel label, JToolBar bar){ - gradientPanel = new GradientPanel(new BorderLayout(), getHeaderBackground()); - label.setOpaque(false); - - gradientPanel.add(label, BorderLayout.WEST); - gradientPanel.setBorder(BorderFactory.createEmptyBorder(3, 4, 3, 1)); - - headerPanel = new JPanel(new BorderLayout()); - headerPanel.add(gradientPanel, BorderLayout.CENTER); - setToolBar(bar); - headerPanel.setBorder(new RaisedHeaderBorder()); - headerPanel.setOpaque(false); - return headerPanel; - } - - /** - * Updates the header. - */ - private void updateHeader(){ - gradientPanel.setBackground(getHeaderBackground()); - gradientPanel.setOpaque(isSelected()); - titleLabel.setForeground(getTextForeground(isSelected())); - headerPanel.repaint(); - } - - /** - * Updates the UI. In addition to the superclass behavior, we need - * to update the header component. - */ - public void updateUI(){ - super.updateUI(); - if (titleLabel != null){ - updateHeader(); - } - } - - // Helper Code ********************************************************** - - /** - * Checks and answers if the panel has a content component set. - * - * @return true if the panel has a content, false if it's empty - */ - private boolean hasContent(){ - return getComponentCount() > 1; - } - - /** - * Determines and answers the header's text foreground color. - * Tries to lookup a special color from the L&F. - * In case it is absent, it uses the standard internal frame forground. - * - * @param selected true to lookup the active color, false for the inactive - * @return the color of the foreground text - */ - protected Color getTextForeground(boolean selected){ - Color c = UIManager.getColor(selected - ? "SimpleInternalFrame.activeTitleForeground" - : "SimpleInternalFrame.inactiveTitleForeground"); - if (c != null){ - return c; - } - return UIManager.getColor(selected ? "InternalFrame.activeTitleForeground" : "Label.foreground"); - - } - - /** - * Determines and answers the header's background color. - * Tries to lookup a special color from the L&F. - * In case it is absent, it uses the standard internal frame background. - * - * @return the color of the header's background - */ - protected Color getHeaderBackground(){ - Color c = UIManager.getColor("SimpleInternalFrame.activeTitleBackground"); - if (c != null) return c; - if (LookUtils.IS_LAF_WINDOWS_XP_ENABLED) c = UIManager.getColor("InternalFrame.activeTitleGradient"); - return c != null ? c : UIManager.getColor("InternalFrame.activeTitleBackground"); - } - - // Helper Classes ******************************************************* - - // A custom border for the raised header pseudo 3D effect. - private static class RaisedHeaderBorder extends AbstractBorder { - - private static final Insets INSETS = new Insets(1, 1, 1, 0); - - public Insets getBorderInsets(Component c){ - return INSETS; - } - - public void paintBorder(Component c, Graphics g, int x, int y, int w, int h){ - - g.translate(x, y); - g.setColor(UIManager.getColor("controlLtHighlight")); - g.fillRect(0, 0, w, 1); - g.fillRect(0, 1, 1, h - 1); - g.setColor(UIManager.getColor("controlShadow")); - g.fillRect(0, h - 1, w, 1); - g.translate(-x, -y); - } - } - - // A panel with a horizontal gradient background. - private static class GradientPanel extends JPanel { - - private GradientPanel(LayoutManager lm, Color background) { - super(lm); - setBackground(background); - } - - public void paintComponent(Graphics g){ - super.paintComponent(g); - if (!isOpaque()){ - return; - } - Color control = UIManager.getColor("control"); - int width = getWidth(); - int height = getHeight(); - - Graphics2D g2 = (Graphics2D) g; - Paint storedPaint = g2.getPaint(); - g2.setPaint(new GradientPaint(0, 0, getBackground(), width, 0, control)); - g2.fillRect(0, 0, width, height); - g2.setPaint(storedPaint); - } - } - -} \ No newline at end of file Copied: branches/info/magicmapclient/magicmapclient/src/com/jgoodies/uif_lite/panel/SimpleInternalFrame.java (from rev 710, trunk/magicmapclient/src/com/jgoodies/uif_lite/panel/SimpleInternalFrame.java) =================================================================== --- branches/info/magicmapclient/magicmapclient/src/com/jgoodies/uif_lite/panel/SimpleInternalFrame.java (rev 0) +++ branches/info/magicmapclient/magicmapclient/src/com/jgoodies/uif_lite/panel/SimpleInternalFrame.java 2008-01-02 18:25:53 UTC (rev 711) @@ -0,0 +1,392 @@ +/* + * Copyright (c) 2003 JGoodies Karsten Lentzsch. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * o Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * o Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * o Neither the name of JGoodies Karsten Lentzsch nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.jgoodies.uif_lite.panel; + +import com.jgoodies.looks.LookUtils; +import net.sf.magicmap.client.gui.utils.ShadowBorder; + +import javax.swing.*; +import javax.swing.border.AbstractBorder; +import java.awt.*; + +/** + * A <code>JPanel</code> subclass that has a drop shadow border and + * that provides a header with icon, title and tool bar.<p> + * + * This class can be used to replace the <code>JInternalFrame</code>, + * for use outside of a <code>JDesktopPane</code>. + * The <code>SimpleInternalFrame</code> is less flexible but often + * more usable; it avoids overlapping windows and scales well + * up to IDE size. + * Several customers have reported that they and their clients feel + * much better with both the appearance and the UI feel.<p> + * + * The SimpleInternalFrame provides the following bound properties: + * <i>frameIcon, title, toolBar, content, selected.</i><p> + * + * By default the SimpleInternalFrame is in <i>selected</i> state. + * If you don't do anything, multiple simple internal frames will + * be displayed as selected. + * + * @author Karsten Lentzsch + * @version $Revision$ + * + * @see javax.swing.JInternalFrame + * @see javax.swing.JDesktopPane + */ + +public class SimpleInternalFrame extends JPanel { + + private JLabel titleLabel; + private GradientPanel gradientPanel; + private JPanel headerPanel; + private boolean isSelected; + + // Instance Creation **************************************************** + + /** + * Constructs a <code>SimpleInternalFrame</code> with the specified title. + * + * @param title the initial title + */ + public SimpleInternalFrame(String title) { + this(null, title, null, null); + } + + /** + * Constructs a <code>SimpleInternalFrame</code> with the specified + * icon, and title. + * + * @param icon the initial icon + * @param title the initial title + */ + public SimpleInternalFrame(Icon icon, String title) { + this(icon, title, null, null); + } + + /** + * Constructs a <code>SimpleInternalFrame</code> with the specified + * title, tool bar, and content panel. + * + * @param title the initial title + * @param bar the initial tool bar + * @param content the initial content pane + */ + public SimpleInternalFrame(String title, JToolBar bar, JComponent content) { + this(null, title, bar, content); + } + + /** + * Constructs a <code>SimpleInternalFrame</code> with the specified + * icon, title, tool bar, and content panel. + * + * @param icon the initial icon + * @param title the initial title + * @param bar the initial tool bar + * @param content the initial content pane + */ + public SimpleInternalFrame(Icon icon, String title, JToolBar bar, JComponent content) { + super(new BorderLayout()); + this.isSelected = false; + this.titleLabel = new JLabel(title, icon, SwingConstants.LEADING); + JPanel top = buildHeader(titleLabel, bar); + + add(top, BorderLayout.NORTH); + if (content != null){ + setContent(content); + } + setBorder(new ShadowBorder()); + setSelected(true); + updateHeader(); + } + + // Public API *********************************************************** + + /** + * Returns the frame's icon. + * + * @return the frame's icon + */ + public Icon getFrameIcon(){ + return titleLabel.getIcon(); + } + + /** + * Sets a new frame icon. + * + * @param newIcon the icon to be set + */ + public void setFrameIcon(Icon newIcon){ + Icon oldIcon = getFrameIcon(); + titleLabel.setIcon(newIcon); + firePropertyChange("frameIcon", oldIcon, newIcon); + } + + /** + * Returns the frame's title text. + * + * @return String the current title text + */ + public String getTitle(){ + return titleLabel.getText(); + } + + /** + * Sets a new title text. + * + * @param newText the title text tp be set + */ + public void setTitle(String newText){ + String oldText = getTitle(); + titleLabel.setText(newText); + firePropertyChange("title", oldText, newText); + } + + /** + * Returns the current toolbar, null if none has been set before. + * + * @return the current toolbar - if any + */ + public JToolBar getToolBar(){ + return headerPanel.getComponentCount() > 1 ? (JToolBar) headerPanel.getComponent(1) : null; + } + + /** + * Sets a new tool bar in the header. + * + * @param newToolBar the tool bar to be set in the header + */ + public void setToolBar(JToolBar newToolBar){ + JToolBar oldToolBar = getToolBar(); + if (oldToolBar == newToolBar){ + return; + } + if (oldToolBar != null){ + headerPanel.remove(oldToolBar); + } + if (newToolBar != null){ + newToolBar.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + headerPanel.add(newToolBar, BorderLayout.EAST); + } + updateHeader(); + firePropertyChange("toolBar", oldToolBar, newToolBar); + } + + /** + * Returns the content - null, if none has been set. + * + * @return the current content + */ + public Component getContent(){ + return hasContent() ? getComponent(1) : null; + } + + /** + * Sets a new panel content; replaces any existing content, if existing. + * + * @param newContent the panel's new content + */ + public void setContent(Component newContent){ + Component oldContent = getContent(); + if (hasContent()){ + remove(oldContent); + } + add(newContent, BorderLayout.CENTER); + firePropertyChange("content", oldContent, newContent); + } + + /** + * Answers if the panel is currently selected (or in other words active) + * or not. In the selected state, the header background will be + * rendered differently. + * + * @return boolean a boolean, where true means the frame is selected + * (currently active) and false means it is not + */ + public boolean isSelected(){ + return isSelected; + } + + /** + * This panel draws its title bar differently if it is selected, + * which may be used to indicate to the user that this panel + * has the focus, or should get more attention than other + * simple internal frames. + * + * @param newValue a boolean, where true means the frame is selected + * (currently active) and false means it is not + */ + public void setSelected(boolean newValue){ + boolean oldValue = isSelected(); + isSelected = newValue; + updateHeader(); + firePropertyChange("selected", oldValue, newValue); + } + + // Building ************************************************************* + + /** + * Creates and answers the header panel, that consists of: + * an icon, a title label, a tool bar, and a gradient background. + * + * @param label the label to paint the icon and text + * @param bar the panel's tool bar + * @return the panel's built header area + */ + private JPanel buildHeader(JLabel label, JToolBar bar){ + gradientPanel = new GradientPanel(new BorderLayout(), getHeaderBackground()); + label.setOpaque(false); + + gradientPanel.add(label, BorderLayout.WEST); + gradientPanel.setBorder(BorderFactory.createEmptyBorder(3, 4, 3, 1)); + + headerPanel = new JPanel(new BorderLayout()); + headerPanel.add(gradientPanel, BorderLayout.CENTER); + setToolBar(bar); + headerPanel.setBorder(new RaisedHeaderBorder()); + headerPanel.setOpaque(false); + return headerPanel; + } + + /** + * Updates the header. + */ + private void updateHeader(){ + gradientPanel.setBackground(getHeaderBackground()); + gradientPanel.setOpaque(isSelected()); + titleLabel.setForeground(getTextForeground(isSelected())); + headerPanel.repaint(); + } + + /** + * Updates the UI. In addition to the superclass behavior, we need + * to update the header component. + */ + public void updateUI(){ + super.updateUI(); + if (titleLabel != null){ + updateHeader(); + } + } + + // Helper Code ********************************************************** + + /** + * Checks and answers if the panel has a content component set. + * + * @return true if the panel has a content, false if it's empty + */ + private boolean hasContent(){ + return getComponentCount() > 1; + } + + /** + * Determines and answers the header's text foreground color. + * Tries to lookup a special color from the L&F. + * In case it is absent, it uses the standard internal frame forground. + * + * @param selected true to lookup the active color, false for the inactive + * @return the color of the foreground text + */ + protected Color getTextForeground(boolean selected){ + Color c = UIManager.getColor(selected + ? "SimpleInternalFrame.activeTitleForeground" + : "SimpleInternalFrame.inactiveTitleForeground"); + if (c != null){ + return c; + } + return UIManager.getColor(selected ? "InternalFrame.activeTitleForeground" : "Label.foreground"); + + } + + /** + * Determines and answers the header's background color. + * Tries to lookup a special color from the L&F. + * In case it is absent, it uses the standard internal frame background. + * + * @return the color of the header's background + */ + protected Color getHeaderBackground(){ + Color c = UIManager.getColor("SimpleInternalFrame.activeTitleBackground"); + if (c != null) return c; + if (LookUtils.IS_LAF_WINDOWS_XP_ENABLED) c = UIManager.getColor("InternalFrame.activeTitleGradient"); + return c != null ? c : UIManager.getColor("InternalFrame.activeTitleBackground"); + } + + // Helper Classes *****... [truncated message content] |
From: <jan...@us...> - 2008-01-02 18:15:00
|
Revision: 710 http://magicmap.svn.sourceforge.net/magicmap/?rev=710&view=rev Author: jan_fride Date: 2008-01-02 10:14:57 -0800 (Wed, 02 Jan 2008) Log Message: ----------- Improved Os X Look. Modified Paths: -------------- trunk/magicmapclient/build.xml trunk/magicmapclient/magicmapclient.iml trunk/magicmapclient/src/com/jgoodies/uif_lite/panel/SimpleInternalFrame.java trunk/magicmapclient/src/edu/uci/ics/jung/visualization/VisualizationViewer.java trunk/magicmapclient/src/net/sf/magicmap/client/core/MagicMapApplication.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/GUIUtils.java trunk/magicmapclient/src/net/sf/magicmap/client/model/node/INode.java trunk/magicmapclient/src/net/sf/magicmap/client/model/node/INodeModel.java trunk/magicmapclient/src/net/sf/magicmap/client/model/node/Node.java trunk/magicmapserver/magicmapserver.iml Added Paths: ----------- trunk/magicmapclient/lib/looks-2.1.4.jar Modified: trunk/magicmapclient/build.xml =================================================================== --- trunk/magicmapclient/build.xml 2008-01-01 23:17:35 UTC (rev 709) +++ trunk/magicmapclient/build.xml 2008-01-02 18:14:57 UTC (rev 710) @@ -8,7 +8,7 @@ <property name="main.class" value="net.sf.magicmap.client.core.MagicMapApplication" /> <!-- Setting for maven path--> - <property name="maven.home" value="D:\_development\_Tools\maven-2.0.5"/> + <property name="maven.home" value="/usr/local/maven"/> @@ -156,7 +156,7 @@ <!-- Setting for maven path must be checked.--> <target name="maven-install"> - <exec executable="${maven.home}/bin/mvn.bat"> + <exec executable="${maven.home}/bin/mvn"> <arg value="install:install-file"/> <arg value="-Dfile=magicmap.jar"/> <arg value="-DgroupId=net.sf.magicmap"/> Added: trunk/magicmapclient/lib/looks-2.1.4.jar =================================================================== (Binary files differ) Property changes on: trunk/magicmapclient/lib/looks-2.1.4.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/magicmapclient/magicmapclient.iml =================================================================== --- trunk/magicmapclient/magicmapclient.iml 2008-01-01 23:17:35 UTC (rev 709) +++ trunk/magicmapclient/magicmapclient.iml 2008-01-02 18:14:57 UTC (rev 710) @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<module version="4" relativePaths="false" type="JAVA_MODULE"> - <component name="ModuleRootManager" /> - <component name="NewModuleRootManager" inherit-compiler-output="false"> +<module relativePaths="true" type="JAVA_MODULE" version="4"> + <component name="NewModuleRootManager" inherit-compiler-output="true"> <output url="file://$MODULE_DIR$/build" /> <exclude-output /> <output-test url="file://$MODULE_DIR$/build-test" /> @@ -9,35 +8,34 @@ <sourceFolder url="file://$MODULE_DIR$/res" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src-gen" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" /> - <excludeFolder url="file://$MODULE_DIR$/build" /> - <excludeFolder url="file://$MODULE_DIR$/build-test" /> - <excludeFolder url="file://$MODULE_DIR$/target" /> + <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="false" /> </content> - <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://X:/maven/junit/junit/3.8.1/junit-3.8.1.jar!/" /> + <root url="jar://$MODULE_DIR$/../magicmapserver/dist/magicmap-server.jar!/" /> </CLASSES> <JAVADOC /> - <SOURCES /> + <SOURCES> + <root url="file://$MODULE_DIR$/../magicmapserver/src" /> + </SOURCES> </library> </orderEntry> <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/dom4j-1.6.1.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/commons-httpclient-3.0-rc3.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> </library> </orderEntry> + <orderEntry type="inheritedJdk" /> <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/forms-1.0.5.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/colt.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -55,7 +53,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/foxtrot.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/concurrent.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -64,7 +62,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/jaxrpc.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/xercesImpl.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -73,7 +71,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/ostermillerutils_1_05_00.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/xml-apis.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -82,7 +80,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/commons-codec-1.3.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/xmlParserAPIs.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -91,7 +89,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/concurrent.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/RelativeLayout.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -100,7 +98,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/colt.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/forms-1.0.5.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -109,7 +107,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/nekohtml.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/activation.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -118,7 +116,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/commons-logging.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/mail.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -127,7 +125,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/jung-1.5.2.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/commons-discovery.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -136,7 +134,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/saaj.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/commons-logging.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -145,7 +143,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/xmlParserAPIs.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/jaxrpc.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -154,7 +152,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/derby.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/saaj.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -163,7 +161,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/RelativeLayout.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/wsdl4j.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -172,7 +170,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/xercesImpl.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/axis.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -181,7 +179,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/xml-apis.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/jung-1.5.2.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -190,7 +188,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/mail.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/derby.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -199,7 +197,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/jaxen-1.1-beta-9.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/jpox-20041204.032009.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -208,7 +206,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/commons-httpclient-3.0-rc3.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/log4j-1.2.8.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -217,7 +215,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/jpox-20041204.032009.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/ostermillerutils_1_05_00.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -226,7 +224,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/looks-1.2.2.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/dom4j-1.6.1.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -235,7 +233,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/log4j-1.2.8.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/commons-codec-1.3.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -244,7 +242,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/axis.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/jaxen-1.1-beta-9.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -253,7 +251,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/activation.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/foxtrot.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -262,7 +260,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/wsdl4j.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/nekohtml.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -271,15 +269,6 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/commons-discovery.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> <root url="jar://$MODULE_DIR$/lib-dev/junit.jar!/" /> </CLASSES> <JAVADOC /> @@ -289,13 +278,12 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib-dev/axis-ant.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/looks-2.1.4.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> </library> </orderEntry> - <orderEntry type="module" module-name="magicmapserver" /> <orderEntryProperties /> </component> </module> Modified: trunk/magicmapclient/src/com/jgoodies/uif_lite/panel/SimpleInternalFrame.java =================================================================== --- trunk/magicmapclient/src/com/jgoodies/uif_lite/panel/SimpleInternalFrame.java 2008-01-01 23:17:35 UTC (rev 709) +++ trunk/magicmapclient/src/com/jgoodies/uif_lite/panel/SimpleInternalFrame.java 2008-01-02 18:14:57 UTC (rev 710) @@ -30,30 +30,13 @@ package com.jgoodies.uif_lite.panel; -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.GradientPaint; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Insets; -import java.awt.LayoutManager; -import java.awt.Paint; +import com.jgoodies.looks.LookUtils; +import net.sf.magicmap.client.gui.utils.ShadowBorder; -import javax.swing.BorderFactory; -import javax.swing.Icon; -import javax.swing.JComponent; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.JToolBar; -import javax.swing.SwingConstants; -import javax.swing.UIManager; +import javax.swing.*; import javax.swing.border.AbstractBorder; +import java.awt.*; -import net.sf.magicmap.client.gui.utils.ShadowBorder; - -import com.jgoodies.plaf.LookUtils; - /** * A <code>JPanel</code> subclass that has a drop shadow border and * that provides a header with icon, title and tool bar.<p> Modified: trunk/magicmapclient/src/edu/uci/ics/jung/visualization/VisualizationViewer.java =================================================================== --- trunk/magicmapclient/src/edu/uci/ics/jung/visualization/VisualizationViewer.java 2008-01-01 23:17:35 UTC (rev 709) +++ trunk/magicmapclient/src/edu/uci/ics/jung/visualization/VisualizationViewer.java 2008-01-02 18:14:57 UTC (rev 710) @@ -24,7 +24,6 @@ import java.awt.geom.AffineTransform; import java.util.ArrayList; import java.util.HashMap; -import java.util.Iterator; import java.util.Map; import javax.swing.JPanel; Modified: trunk/magicmapclient/src/net/sf/magicmap/client/core/MagicMapApplication.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/core/MagicMapApplication.java 2008-01-01 23:17:35 UTC (rev 709) +++ trunk/magicmapclient/src/net/sf/magicmap/client/core/MagicMapApplication.java 2008-01-02 18:14:57 UTC (rev 710) @@ -22,11 +22,16 @@ /** * Main entry point for the whole client - * + * * @param args */ public static void main(String[] args){ Settings.setup(args); + // set this before the first window..... + if (GUIUtils.isOsX()) { + System.setProperty("apple.laf.useScreenMenuBar", "true"); + System.setProperty("com.apple.mrj.application.apple.menu.about.name", "MagicMap"); + } JWindow splashScreen = new JWindow(); Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/GUIUtils.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/GUIUtils.java 2008-01-01 23:17:35 UTC (rev 709) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/GUIUtils.java 2008-01-02 18:14:57 UTC (rev 710) @@ -5,32 +5,23 @@ package net.sf.magicmap.client.gui.utils; -import java.awt.Dimension; -import java.awt.Window; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; -import java.util.MissingResourceException; -import java.util.ResourceBundle; +import com.jgoodies.looks.Options; +import com.jgoodies.looks.plastic.Plastic3DLookAndFeel; +import com.jgoodies.looks.plastic.PlasticLookAndFeel; +import com.jgoodies.looks.plastic.theme.ExperienceBlue; +import net.sf.magicmap.client.gui.MainGUI; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.SwingConstants; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.*; import javax.swing.border.EmptyBorder; import javax.swing.plaf.metal.MetalLookAndFeel; +import java.awt.*; +import java.util.*; -import net.sf.magicmap.client.gui.MainGUI; +import apple.laf.AquaLookAndFeel; -import com.jgoodies.plaf.FontSizeHints; -import com.jgoodies.plaf.Options; -import com.jgoodies.plaf.plastic.Plastic3DLookAndFeel; -import com.jgoodies.plaf.plastic.theme.ExperienceBlue; - /** * @author msc - * + * */ public class GUIUtils { @@ -39,22 +30,44 @@ private static Map<String, ResourceBundle> bundles = null; public static void setPlasticLookAndFeel(){ + try { - UIManager.setLookAndFeel(new Plastic3DLookAndFeel()); + if (!isOsX()) { + UIManager.setLookAndFeel(new Plastic3DLookAndFeel()); + + } else { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } } catch (UnsupportedLookAndFeelException e) { e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. + } catch (InstantiationException e) { + e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. + } catch (ClassNotFoundException e) { + e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } - UIManager.put("Application.useSystemFontSettings", Boolean.TRUE); - UIManager.put(Options.USE_SYSTEM_FONTS_APP_KEY, Boolean.TRUE); - UIManager.put(com.jgoodies.plaf.Options.DEFAULT_ICON_SIZE_KEY, new Dimension(18, 18)); - Options.setGlobalFontSizeHints(FontSizeHints.MIXED); - // PlasticLookAndFeel.setFontSizeHints(FontSizeHints.SYSTEM); - MetalLookAndFeel.setCurrentTheme(new ExperienceBlue()); - Options.setGlobalFontSizeHints(FontSizeHints.MIXED); + if (!isOsX()) { + UIManager.put("Application.useSystemFontSettings", Boolean.TRUE); + UIManager.put(Options.USE_SYSTEM_FONTS_APP_KEY, Boolean.TRUE); + //UIManager.put(com.jgoodies.plaf.Options.DEFAULT_ICON_SIZE_KEY, new Dimension(18, 18)); + // Options.setGlobalFontSizeHints(FontSizeHints.MIXED); + // PlasticLookAndFeel.setFontSizeHints(FontSizeHints.SYSTEM); + MetalLookAndFeel.setCurrentTheme(new ExperienceBlue()); + //Options.setGlobalFontSizeHints(FontSizeHints.MIXED); + } else { + System.setProperty("apple.laf.useScreenMenuBar", "true"); + System.setProperty("com.apple.mrj.application.apple.menu.about.name", "MagicMap"); + } } + public static boolean isOsX() { + String lcOSName = System.getProperty("os.name").toLowerCase(); + return lcOSName.startsWith("mac os x"); + } + public static void locateOnScreen(Window frame){ Dimension paneSize = frame.getSize(); Dimension screenSize = frame.getToolkit().getScreenSize(); @@ -155,14 +168,14 @@ return JOptionPane.showOptionDialog(MainGUI.getInstance().getMainFrame(), GUIUtils.i18n("serverresponse") + "\n" + message, GUIUtils.i18n("authentificationerror"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.ERROR_MESSAGE, null, new String[]{GUIUtils.i18n("retry"), GUIUtils.i18n("no")}, GUIUtils - .i18n("retry")) == JOptionPane.YES_OPTION; + .i18n("retry")) == JOptionPane.YES_OPTION; } public static boolean showConnectionError(){ return JOptionPane.showOptionDialog(MainGUI.getInstance().getMainFrame(), GUIUtils .i18n("connectionsproblemsreconnect"), GUIUtils.i18n("connectionproblems"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.ERROR_MESSAGE, null, new String[]{GUIUtils.i18n("yes"), - GUIUtils.i18n("no")}, GUIUtils.i18n("yes")) == JOptionPane.YES_OPTION; + GUIUtils.i18n("no")}, GUIUtils.i18n("yes")) == JOptionPane.YES_OPTION; } public static void showErrorDialog(String message){ Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/node/INode.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/node/INode.java 2008-01-01 23:17:35 UTC (rev 709) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/node/INode.java 2008-01-02 18:14:57 UTC (rev 710) @@ -3,15 +3,19 @@ import java.util.List; /** - * Created by IntelliJ IDEA. - * User: Jan - * Date: 08.02.2007 - * Time: 09:22:33 - * To change this template use File | Settings | File Templates. + * <p> + * Interface for all nodes. + * </p> + * @author Jan Friderici */ public interface INode { - String getDisplayName(); + /** + * + * @return + */ + String getDisplayName(); + void setDisplayName(String displayName); boolean isUpdate(); Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/node/INodeModel.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/node/INodeModel.java 2008-01-01 23:17:35 UTC (rev 709) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/node/INodeModel.java 2008-01-02 18:14:57 UTC (rev 710) @@ -24,13 +24,13 @@ * * @param node the node to add */ - public abstract void addNode(Node node); + void addNode(Node node); /** * Remove a node * @param node removes a node from the model */ - public abstract void removeNode(Node node); + void removeNode(Node node); /** * Notifies all listeners that the state of a given node @@ -42,7 +42,7 @@ * @param data new data, may be null. * @see NodeModelListener */ - public abstract void updateNode(Node node, int type, Object data); + void updateNode(Node node, int type, Object data); /** * Aktualisiert den Hash-Schl\xFCssel f\xFCr einen Knoten. @@ -51,7 +51,7 @@ * @param node Knoten der aktualisiert werden soll * @param name Alter Hash-Wert */ - public abstract void rehashNode(Node node, String name); + void rehashNode(Node node, String name); /** * returns all neighbours for the given node. @@ -59,7 +59,7 @@ * @param node the node * @return all neighbours of the given node. */ - public abstract ArrayList<? extends Node> findNeighbors(Node node); + ArrayList<? extends Node> findNeighbors(Node node); /** * what for? @@ -67,27 +67,27 @@ * @return */ @Deprecated - public abstract ArrayList<? extends Node> findNonNeighbors(Node node); + ArrayList<? extends Node> findNonNeighbors(Node node); /** * Adds a NodeModelListener * @param nodeModelListener the list\xE9ner to add. */ - public abstract void addNodeModelListener(NodeModelListener nodeModelListener); + void addNodeModelListener(NodeModelListener nodeModelListener); /** * remove a NodeModelListener * @param l the listener to remove */ - public abstract void removeNodeModelListener(NodeModelListener l); + void removeNodeModelListener(NodeModelListener l); /** * returns an array of all NodeModelListener. * @return an array of all NodeModelListener registered to this model. */ - public abstract NodeModelListener[] nodeModelListeners(); + NodeModelListener[] nodeModelListeners(); - public Set<AccessPointSeerNode> getAccessPointSeerNodes(); + Set<AccessPointSeerNode> getAccessPointSeerNodes(); /** * Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/node/Node.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/node/Node.java 2008-01-01 23:17:35 UTC (rev 709) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/node/Node.java 2008-01-02 18:14:57 UTC (rev 710) @@ -104,6 +104,12 @@ this.id = -1; } + /** + * <p>the name to display in the gui.</p> + * <p>The default value is the nodes name.</p> + * + * @return the display name for this node. + */ public String getDisplayName(){ if (this.displayName == null) { return this.name; @@ -112,23 +118,43 @@ } } + /** + * <p>Set the name to display.</p> + * @param displayName the new name. + */ public void setDisplayName(String displayName){ this.displayName = displayName; } + /** + * TODO what does this mean? + * @return + */ public boolean isUpdate(){ return update; } + /** + * TODO !? + * @param newupdate + */ public void setUpdate(boolean newupdate){ this.update = newupdate; this.model.updateNode(this, NodeModel.UPDATE_RESCAN, null); } + /** + * + * @return + */ public boolean isFix(){ return fix; } + /** + * + * @param fix + */ public void setFix(boolean fix){ this.fix = fix; this.model.updateNode(this, NodeModel.UPDATE_FIXSTATE, null); @@ -152,12 +178,24 @@ return y; } + /** + * Move the node without notifying. + * @param x + * @param y + * @param z + */ public void setPositionSilent(int x, int y, int z){ this.x = x; this.y = y; this.z = z; } + /** + * Move this node an notify. + * @param x + * @param y + * @param z + */ public void setPosition(int x, int y, int z){ setPositionSilent(x, y, z); model.updateNode(this, NodeModel.UPDATE_POSITION, null); @@ -165,6 +203,10 @@ public abstract ArrayList<? extends Node> getNeighbors(); + /** + * The model this node belongs to + * @return + */ public INodeModel getModel(){ return model; } @@ -179,6 +221,10 @@ return internal; } + /** + * + * @return + */ public long getId(){ return id; } @@ -199,10 +245,19 @@ return parentNode; } + /** + * Set the parent node. + * @param parentNode + */ public void setParentNode(Node parentNode){ this.parentNode = parentNode; } + + /** + * Ask if this node is a physical or information node. + * @return + */ public boolean isPhysical(){ return physical; } Modified: trunk/magicmapserver/magicmapserver.iml =================================================================== --- trunk/magicmapserver/magicmapserver.iml 2008-01-01 23:17:35 UTC (rev 709) +++ trunk/magicmapserver/magicmapserver.iml 2008-01-02 18:14:57 UTC (rev 710) @@ -1,22 +1,48 @@ <?xml version="1.0" encoding="UTF-8"?> -<module version="4" relativePaths="false" type="JAVA_MODULE"> - <component name="ModuleRootManager" /> - <component name="NewModuleRootManager" inherit-compiler-output="false"> +<module relativePaths="true" type="JAVA_MODULE" version="4"> + <component name="FacetManager"> + <facet type="web" name="Web"> + <configuration> + <descriptors> + <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/web/WEB-INF/web.xml" optional="false" version="2.5" /> + </descriptors> + <webroots> + <root url="file://$MODULE_DIR$/web" relative="/" /> + </webroots> + <building> + <setting name="EXPLODED_URL" value="file://" /> + <setting name="EXPLODED_ENABLED" value="false" /> + <setting name="JAR_URL" value="file://" /> + <setting name="JAR_ENABLED" value="false" /> + <setting name="BUILD_MODULE_ON_FRAME_DEACTIVATION" value="false" /> + <setting name="BUILD_EXTERNAL_DEPENDENCIES" value="false" /> + <setting name="EXCLUDE_EXPLODED_DIRECTORY" value="true" /> + <setting name="RUN_JASPER_VALIDATION" value="true" /> + <setting name="BUILD_ONLY_WEB_RESOURCES" value="false" /> + </building> + <packaging> + <containerElement type="module" name="magicmapserver"> + <attribute name="method" value="1" /> + <attribute name="URI" value="/WEB-INF/classes" /> + </containerElement> + </packaging> + </configuration> + </facet> + </component> + <component name="NewModuleRootManager" inherit-compiler-output="true"> <output url="file://$MODULE_DIR$/target/classes" /> <exclude-output /> <output-test url="file://$MODULE_DIR$/target/test-classes" /> <content url="file://$MODULE_DIR$"> <sourceFolder url="file://$MODULE_DIR$/dblayer/src" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> - <excludeFolder url="file://$MODULE_DIR$/target" /> </content> - <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="inheritedJdk" /> <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://X:/maven/junit/junit/3.8.1/junit-3.8.1.jar!/" /> + <root url="jar://$MODULE_DIR$/web/WEB-INF/lib/log4j-1.2.8.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -25,7 +51,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib.dev/jasper-runtime.jar!/" /> + <root url="jar://$MODULE_DIR$/web/WEB-INF/lib/jpox-20041204.032009.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -34,7 +60,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib.dev/jsp-api.jar!/" /> + <root url="jar://$MODULE_DIR$/web/WEB-INF/lib/magicmap-db-layer.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -43,7 +69,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib.dev/servlet-api.jar!/" /> + <root url="jar://$MODULE_DIR$/lib.dev/jasper-runtime.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -52,7 +78,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/dom4j-1.6.1.jar!/" /> + <root url="jar://$MODULE_DIR$/lib.dev/jsp-api.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -61,7 +87,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/forms-1.0.5.jar!/" /> + <root url="jar://$MODULE_DIR$/lib.dev/servlet-api.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -70,7 +96,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/commons-collections-3.1.jar!/" /> + <root url="jar://$MODULE_DIR$/web/WEB-INF/lib/commons-discovery.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -79,7 +105,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/foxtrot.jar!/" /> + <root url="jar://$MODULE_DIR$/web/WEB-INF/lib/commons-logging.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -88,7 +114,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/jaxrpc.jar!/" /> + <root url="jar://$MODULE_DIR$/web/WEB-INF/lib/saaj.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -97,7 +123,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/ostermillerutils_1_05_00.jar!/" /> + <root url="jar://$MODULE_DIR$/web/WEB-INF/lib/axis.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -106,7 +132,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/commons-codec-1.3.jar!/" /> + <root url="jar://$MODULE_DIR$/web/WEB-INF/lib/wsdl4j.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -115,7 +141,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/concurrent.jar!/" /> + <root url="jar://$MODULE_DIR$/web/WEB-INF/lib/jaxrpc.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -124,7 +150,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/colt.jar!/" /> + <root url="jar://$MODULE_DIR$/web/WEB-INF/lib/axis-ant.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -133,7 +159,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/nekohtml.jar!/" /> + <root url="jar://$MODULE_DIR$/../infoobject/lib/db4o-6.4.14.8131-java5.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -142,165 +168,12 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/commons-logging.jar!/" /> + <root url="jar://$MODULE_DIR$/dist/magicmap-server.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> </library> </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/jung-1.5.2.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/saaj.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/xmlParserAPIs.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/derby.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/RelativeLayout.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/xercesImpl.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/xml-apis.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/mail.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/jaxen-1.1-beta-9.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/commons-httpclient-3.0-rc3.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/jpox-20041204.032009.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/looks-1.2.2.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/log4j-1.2.8.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/axis.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/activation.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/wsdl4j.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/commons-discovery.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> <orderEntryProperties /> </component> </module> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jan...@us...> - 2008-01-01 23:17:37
|
Revision: 709 http://magicmap.svn.sourceforge.net/magicmap/?rev=709&view=rev Author: jan_fride Date: 2008-01-01 15:17:35 -0800 (Tue, 01 Jan 2008) Log Message: ----------- Added Paths: ----------- branches/info/magicmapclient/lib/looks-2.1.4.jar Added: branches/info/magicmapclient/lib/looks-2.1.4.jar =================================================================== (Binary files differ) Property changes on: branches/info/magicmapclient/lib/looks-2.1.4.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |