From: <jan...@us...> - 2006-11-07 18:57:23
|
Revision: 477 http://svn.sourceforge.net/magicmap/?rev=477&view=rev Author: jan_fride Date: 2006-11-07 10:53:59 -0800 (Tue, 07 Nov 2006) Log Message: ----------- Plugin erweitert (hashcode, equals und os) Modified Paths: -------------- trunk/magicmapclient/build.xml trunk/magicmapclient/magicmapclient.iml trunk/magicmapclient/src/net/sf/magicmap/artifact/Artifact.java trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/forms/Attribute.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/forms/Form.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/forms/FormLayoutForm.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/forms/FormLayoutReader.java trunk/magicmapclient/src/net/sf/magicmap/client/model/node/INodeModel.java trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeModel.java trunk/magicmapclient/src/net/sf/magicmap/plugin/AbstractPlugin.java trunk/magicmapclient/src/net/sf/magicmap/plugin/IPluginDescriptor.java trunk/magicmapclient/src/net/sf/magicmap/plugin/PluginException.java trunk/magicmapclient/src/net/sf/magicmap/plugin/PluginLoader.java trunk/magicmapclient/src/net/sf/magicmap/plugin/PluginManager.java trunk/magicmapclient/src/net/sf/magicmap/plugin/SimplePluginDescriptor.java trunk/magicmapclient/src/net/sf/magicmap/plugin/SimpleVendor.java trunk/magicmapclient/src/net/sf/magicmap/plugin/ui/PluginDescriptorView.java trunk/magicmapclient/src/net/sf/magicmap/plugin/ui/PluginTableModel.java trunk/magicmapclient/test/net/sf/magicmap/plugin/DocumentDescriptorReaderTest.java Added Paths: ----------- trunk/magicmapclient/src/net/sf/magicmap/client/gui/forms/AbstractForm.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/forms/TabForm.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/VisualList.java trunk/magicmapclient/src/net/sf/magicmap/plugin/PluginRepository.java trunk/magicmapclient/src/net/sf/magicmap/plugin/forms/ trunk/magicmapclient/src/net/sf/magicmap/plugin/forms/PluginsForm.java trunk/magicmapclient/src/net/sf/magicmap/plugin/util/PluginComparator.java trunk/magicmapclient/src/net/sf/magicmap/plugin/util/PluginDescriptorReader.java Removed Paths: ------------- trunk/magicmapclient/src/net/sf/magicmap/client/gui/forms/SimpleInfoObjectForm.java trunk/magicmapclient/src/net/sf/magicmap/plugin/PluginDescriptorReader.java trunk/magicmapclient/src/net/sf/magicmap/plugin/ui/PluginListView.java trunk/magicmapclient/src/net/sf/magicmap/plugin/ui/PluginTreeModel.java Modified: trunk/magicmapclient/build.xml =================================================================== --- trunk/magicmapclient/build.xml 2006-10-31 15:55:58 UTC (rev 476) +++ trunk/magicmapclient/build.xml 2006-11-07 18:53:59 UTC (rev 477) @@ -10,7 +10,9 @@ <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" /> @@ -27,8 +29,20 @@ <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="."> @@ -56,12 +70,15 @@ <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}" /> @@ -81,6 +98,13 @@ </javac> </target> + <target name="compile-tests" depends="compile"> + <javac destdir="${build-test}" debug="true" deprecation="true" debuglevel="lines,vars,source" fork="true"> + <classpath refid="test.classpath" /> + <src path="${test}" /> + </javac> + </target> + <target name="version" depends="compile"> <tstamp> <format property="build.number" pattern="yyyyMMddHHmm" /> @@ -118,5 +142,10 @@ </java> </target> + <target name="copy-resources"> + <copy todir="build"> + <fileset dir="${res}"></fileset> + </copy> + </target> </project> Modified: trunk/magicmapclient/magicmapclient.iml =================================================================== --- trunk/magicmapclient/magicmapclient.iml 2006-10-31 15:55:58 UTC (rev 476) +++ trunk/magicmapclient/magicmapclient.iml 2006-11-07 18:53:59 UTC (rev 477) @@ -1,283 +1,41 @@ <?xml version="1.0" encoding="UTF-8"?> <module version="4" relativePaths="true" type="JAVA_MODULE"> <component name="ModuleRootManager" /> - <component name="NewModuleRootManager"> + <component name="NewModuleRootManager" inherit-compiler-output="false"> <output url="file://$MODULE_DIR$/build" /> <exclude-output /> <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$/.settings" /> + <excludeFolder url="file://$MODULE_DIR$/dist" /> + <excludeFolder url="file://$MODULE_DIR$/inf" /> </content> - <orderEntry type="jdk" jdkName="1.6" /> + <orderEntry type="jdk" jdkName="1.5" jdkType="JavaSDK" /> <orderEntry type="sourceFolder" forTests="false" /> - <orderEntry type="library" name="Groovy from GroovyJ 0.1.7 (Irida)" level="application" /> - <orderEntry type="library" name="magicmap-server.lib" level="project" /> - <orderEntry type="module-library"> + <orderEntry type="module-library" exported=""> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/wsdl4j.jar!/" /> + <root url="jar://$MODULE_DIR$/magicmap.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> </library> </orderEntry> - <orderEntry type="module-library"> + <orderEntry type="library" exported="" name="client-libs" level="project" /> + <orderEntry type="library" exported="" name="lib-dev" level="project" /> + <orderEntry type="module-library" exported=""> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/commons-discovery.jar!/" /> + <root url="jar://$MODULE_DIR$/../magicmapserver/dist/magicmap-server.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/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/xmlParserAPIs.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/xercesImpl.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/forms-1.0.5.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/xml-apis.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/looks-1.2.2.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/jaxrpc.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/dom4j-1.6.1.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/commons-logging.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/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/jaxen-1.1-beta-9.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/derby.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-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/foxtrot.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> <orderEntryProperties /> - <javadoc-paths> - <root url="file://$MODULE_DIR$/../../../../idea/MagicMap/doc/api" /> - </javadoc-paths> </component> <component name="VcsManagerConfiguration"> <option name="ACTIVE_VCS_NAME" value="svn" /> Modified: trunk/magicmapclient/src/net/sf/magicmap/artifact/Artifact.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/artifact/Artifact.java 2006-10-31 15:55:58 UTC (rev 476) +++ trunk/magicmapclient/src/net/sf/magicmap/artifact/Artifact.java 2006-11-07 18:53:59 UTC (rev 477) @@ -3,32 +3,53 @@ public class Artifact implements IArtifact { - private final String groupid; - private final String artifactid; - private final String version; - private static final ArtifactComparator cmp = new ArtifactComparator(); + private final String groupid; + private final String artifactid; + private final String version; + private static final ArtifactComparator cmp = new ArtifactComparator(); - public Artifact(String groupid, String artifactid, String version) { - this.groupid = groupid; - this.artifactid = artifactid; - this.version = version; + public Artifact(String groupid, String artifactid, String version) { + this.groupid = groupid; + this.artifactid = artifactid; + this.version = version; + } - } + public String getVersion(){ + return this.version; + } - public String getVersion(){ - return this.version; - } + public String getArtifactId(){ + return this.artifactid; + } - public String getArtifactId(){ - return this.artifactid; - } + public String getGroupId(){ + return this.groupid; + } - public String getGroupId(){ - return this.groupid; - } - - public int compareTo(IArtifact o){ - return Artifact.cmp.compare(this, o); - } - + public int compareTo(IArtifact o){ + return Artifact.cmp.compare(this, o); + } + /** + * The same hash as any artifact. + * @return + */ + @Override + public int hashCode() { + int hash = 31; + int hashFactor = 17; + hash += getArtifactId() == null ? 0 : getArtifactId().hashCode() * 17; + hash += getGroupId() == null ? 0 : getGroupId().hashCode() * 17; + hash += getVersion() == null ? 0 : getVersion().hashCode() * 17; + return hash; + } + @Override + public boolean equals(Object obj) { + if (obj instanceof IArtifact) { + IArtifact iArtifact = (IArtifact) obj; + return getArtifactId().equals(iArtifact.getArtifactId()) && + getGroupId().equals(iArtifact.getGroupId()) && + getVersion().equals(iArtifact.getVersion()); + } + return super.equals(obj); + } } Modified: trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java 2006-10-31 15:55:58 UTC (rev 476) +++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java 2006-11-07 18:53:59 UTC (rev 477) @@ -53,533 +53,539 @@ */ public class Controller implements IController { - private static int numCalled = 0; + private static int numCalled = 0; - /** - * Die Instanz. - */ - private static Controller controller = null; + /** + * Die Instanz. + */ + private static Controller controller = null; - /** - * Das Knotenmodel. - */ - private INodeModel nodeModel; // Model f\xFCr Graphen + /** + * Das Knotenmodel. + */ + private INodeModel nodeModel; // Model f\xFCr Graphen - private MeasurementModel measurementModel; // Model f\xFCr Messungen + private MeasurementModel measurementModel; // Model f\xFCr Messungen - private MeasurementModel measurementModelOther; // Messungen anderen Clients / Orte + private MeasurementModel measurementModelOther; // Messungen anderen Clients / Orte - private ClientNode client; // Ausgezeichneter Knoten + private ClientNode client; // Ausgezeichneter Knoten - 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 CallbackHandler callbackHandler; // S\xE4mtliche callbacks werden dort behandelt - private MapInfo currentMap; + private MapInfo currentMap; - private OutlineView outlineView; + private OutlineView outlineView; - private ConsoleView consoleView; + private ConsoleView consoleView; - private MapView mapView; + private MapView mapView; - private MeasurementView measurementView; + private MeasurementView measurementView; - private boolean invisble; // Invisible-Modus (keine Daten an Server) + private boolean invisble; // Invisible-Modus (keine Daten an Server) - // pseudo server items - private Collection<InfoObject> infoObjects; + // pseudo server items + private Collection<InfoObject> infoObjects; - private ScannerAllocator scannerAllocator; - private final InfoObjectProviderRegistry infoServiceRegistry; - private final PluginManager pluginManager; + private ScannerAllocator scannerAllocator; + private final InfoObjectProviderRegistry infoServiceRegistry; + private final PluginManager pluginManager; - /** - * Private constructor for singleton instance - */ - private Controller() { - DOMConfigurator.configureAndWatch("log4j.xml"); + /** + * Private constructor for singleton instance + */ + private Controller() { + DOMConfigurator.configureAndWatch("log4j.xml"); - // - // Das Model der Knoten. - // - this.nodeModel = new NodeModel(); + // + // Das Model der Knoten. + // + this.nodeModel = new NodeModel(); - /** - * Messungen f\xFCr den eigenen clienten - */ - this.measurementModel = new MeasurementModel(); + /** + * Messungen f\xFCr den eigenen clienten + */ + this.measurementModel = new MeasurementModel(); - /** - * Messungen f\xFCr alle anderen? - */ - this.measurementModelOther = new MeasurementModel(); + /** + * Messungen f\xFCr alle anderen? + */ + this.measurementModelOther = new MeasurementModel(); - this.scannerAllocator = new ScannerAllocator(); - this.currentMap = null; - this.serverManager = null; + this.scannerAllocator = new ScannerAllocator(); + this.currentMap = null; + this.serverManager = null; - this.pollhandler = new PollHandler(this); + this.pollhandler = new PollHandler(this); - buildViews(); + buildViews(); - // pseudo server items - this.infoObjects = new ArrayList<InfoObject>(); - // initializeScanner(); - this.infoServiceRegistry = new InfoObjectProviderRegistry(this.nodeModel); - PluginHandler.getInstance(); + // pseudo server items + this.infoObjects = new ArrayList<InfoObject>(); + // initializeScanner(); + this.infoServiceRegistry = new InfoObjectProviderRegistry(this.nodeModel); + PluginHandler.getInstance(); - this.pluginManager = new PluginManager(new Settings(), this); + //TODO + try { + this.pluginManager = new PluginManager(new Settings(), this); + } catch (MalformedURLException e) { + throw new RuntimeException(e.getMessage()); + } + } - } + /** + * Getter for client node + * + * @return the client node + */ + public ClientNode getClient(){ + return this.client; + } - /** - * Getter for client node - * - * @return the client node - */ - public ClientNode getClient(){ - return this.client; - } + /** + * Erzeugt die Hauptviews der Anwendung + */ + private void buildViews(){ + this.outlineView = new OutlineView(this.nodeModel); + this.consoleView = new ConsoleView(); + this.mapView = new MapView(this.nodeModel, null); + this.measurementView = new MeasurementView(getMeasurementModel(), this.nodeModel); + // registerMeasurementModelListener(measurementView); + setMeasurementViewLocal(true); + this.nodeModel.addNodeModelListener(this.mapView); + //registerNodeModelListener(outlineView); + } - /** - * Erzeugt die Hauptviews der Anwendung - */ - private void buildViews(){ - this.outlineView = new OutlineView(this.nodeModel); - this.consoleView = new ConsoleView(); - this.mapView = new MapView(this.nodeModel, null); - this.measurementView = new MeasurementView(getMeasurementModel(), this.nodeModel); - // registerMeasurementModelListener(measurementView); - setMeasurementViewLocal(true); - this.nodeModel.addNodeModelListener(this.mapView); - //registerNodeModelListener(outlineView); - } + /** + * Getter for the map view + * + * @return the map view + */ + public MapView getMapView(){ + return this.mapView; + } - /** - * Getter for the map view - * - * @return the map view - */ - public MapView getMapView(){ - return this.mapView; - } + /** + * Getter for the outline view + * + * @return the outline view + */ + public OutlineView getOutlineView(){ + return this.outlineView; + } - /** - * Getter for the outline view - * - * @return the outline view - */ - public OutlineView getOutlineView(){ - return this.outlineView; - } + /** + * Getter for the console view + * + * @return the console view + */ + public ConsoleView getConsoleView(){ + return this.consoleView; + } - /** - * Getter for the console view - * - * @return the console view - */ - public ConsoleView getConsoleView(){ - return this.consoleView; - } + /** + * Getter for the measurement view + * + * @return the measurement view + */ + public MeasurementView getMeasurementView(){ + return this.measurementView; + } - /** - * Getter for the measurement view - * - * @return the measurement view - */ - public MeasurementView getMeasurementView(){ - return this.measurementView; - } + /** + * Provides the singleton controller instance (creates a new one if null) + * + * @return the singleton controller instance + */ + public static Controller getInstance(){ + if (Controller.controller == null) { + ++Controller.numCalled; + Controller.controller = new Controller(); + } + return Controller.controller; + } - /** - * Provides the singleton controller instance (creates a new one if null) - * - * @return the singleton controller instance - */ - public static Controller getInstance(){ - if (Controller.controller == null) { - ++Controller.numCalled; - Controller.controller = new Controller(); - } - return Controller.controller; - } + /** + * Getter for the node model + * + * @return the node model + */ + public INodeModel getNodeModel(){ + return this.nodeModel; + } - /** - * Getter for the node model - * - * @return the node model - */ - public INodeModel getNodeModel(){ - return this.nodeModel; - } + /** + * Baut das MeasurementModelOther neu auf. + * + * @param ap - + * the access point seer node + */ + public void buildOtherMeasurement(AccessPointSeerNode ap){ + System.out.println("Building measurement model..."); + this.measurementModelOther.clear(); + ArrayList aes = ap.getApEdges(); + for (int i = 0; i < aes.size(); i++) { + AccessPointEdge ae = (AccessPointEdge) aes.get(i); + SeenAccessPoint sp = new SeenAccessPoint(ae.getAccessPoint().getMacAddress(), ae.getSignalLevel()); + this.measurementModelOther.addAccessPoint(sp); + } + } - /** - * Baut das MeasurementModelOther neu auf. - * - * @param ap - - * the access point seer node - */ - public void buildOtherMeasurement(AccessPointSeerNode ap){ - System.out.println("Building measurement model..."); - this.measurementModelOther.clear(); - ArrayList aes = ap.getApEdges(); - for (int i = 0; i < aes.size(); i++) { - AccessPointEdge ae = (AccessPointEdge) aes.get(i); - SeenAccessPoint sp = new SeenAccessPoint(ae.getAccessPoint().getMacAddress(), ae.getSignalLevel()); - this.measurementModelOther.addAccessPoint(sp); - } - } + /** + * \xC4nndert die Anzeige des Measurement-Views + * + * @param local + * true, wenn lokale St\xE4rken angezeigt werden sollen + */ + public void setMeasurementViewLocal(boolean local){ + if (local) { + // measurementModelOther.removeMeasurementModelListener(measurementView); + // measurementModel.addMeasurementModelListener(measurementView); + //measurementModel.clear(); + } else { + // measurementModel.removeMeasurementModelListener(measurementView); + // measurementModelOther.addMeasurementModelListener(measurementView); + //measurementModelOther.clear(); + } + } - /** - * \xC4nndert die Anzeige des Measurement-Views - * - * @param local - * true, wenn lokale St\xE4rken angezeigt werden sollen - */ - public void setMeasurementViewLocal(boolean local){ - if (local) { - // measurementModelOther.removeMeasurementModelListener(measurementView); - // measurementModel.addMeasurementModelListener(measurementView); - //measurementModel.clear(); - } else { - // measurementModel.removeMeasurementModelListener(measurementView); - // measurementModelOther.addMeasurementModelListener(measurementView); - //measurementModelOther.clear(); - } - } + /** + * Getter for measurement model + * + * @return the measurement model + */ + public MeasurementModel getMeasurementModel(){ + return this.measurementModel; + } - /** - * Getter for measurement model - * - * @return the measurement model - */ - public MeasurementModel getMeasurementModel(){ - return this.measurementModel; - } + /** + * Gibt an ob verbunden oder nicht verbunden + * + * @return true wenn ja, false sonst + */ + public boolean isConnected(){ + return (this.serverManager != null && this.serverManager.isConnected()); + } - /** - * Gibt an ob verbunden oder nicht verbunden - * - * @return true wenn ja, false sonst - */ - public boolean isConnected(){ - return (this.serverManager != null && this.serverManager.isConnected()); - } + /** + * Liefert Kartenbeschreibung der aktuell geladenen Karte + * + * @return Kartenbeschreibung (MapInfo) oder null, wenn keine Karte aktiv + */ + public MapInfo getCurrentMap(){ + return this.currentMap; + } - /** - * Liefert Kartenbeschreibung der aktuell geladenen Karte - * - * @return Kartenbeschreibung (MapInfo) oder null, wenn keine Karte aktiv - */ - public MapInfo getCurrentMap(){ - return this.currentMap; - } + /** + * Setzt aktuelle Karte und startet dabei das ServerPolling + * + * @param map + */ + public void setCurrentMap(MapInfo map){ + if (isMapLoaded()) closeMap(); + this.currentMap = map; + try { + this.serverManager.reloadMap(); + this.nodeModel.addNode(this.client); + this.mapView.loadMap(map); + } catch (MalformedURLException e) { + System.out.println("Map loading failed." + e.getMessage()); + closeMap(); + } + if (isMapLoaded() && isConnected()) { + this.nodeModel.addNodeModelListener(this.mapView); + this.serverManager.resetTimestamp(); + setMeasurementViewLocal(true); + this.poller.start(); + // initializeScanner(); // Scanner neu initialisieren + this.scannerAllocator.startAllScanner(); + PluginHandler.getInstance().loadMap(); + this.pluginManager.loadMap(); + if (this.currentMap.realheight > 0 && this.currentMap.realwidth > 0) + getMapView().setTitle( + GUIUtils.i18n("map", false) + " - " + this.currentMap.name + " Gr\xF6\xDFe: " + + this.currentMap.realwidth + " X " + this.currentMap.realheight + " cm"); + } + } - /** - * Setzt aktuelle Karte und startet dabei das ServerPolling - * - * @param map - */ - public void setCurrentMap(MapInfo map){ - if (isMapLoaded()) closeMap(); - this.currentMap = map; - try { - this.serverManager.reloadMap(); - this.nodeModel.addNode(this.client); - this.mapView.loadMap(map); - } catch (MalformedURLException e) { - System.out.println("Map loading failed." + e.getMessage()); - closeMap(); - } - if (isMapLoaded() && isConnected()) { - this.nodeModel.addNodeModelListener(this.mapView); - this.serverManager.resetTimestamp(); - setMeasurementViewLocal(true); - this.poller.start(); - // initializeScanner(); // Scanner neu initialisieren - this.scannerAllocator.startAllScanner(); - PluginHandler.getInstance().loadMap(); - this.pluginManager.loadMap(); - if (this.currentMap.realheight > 0 && this.currentMap.realwidth > 0) - getMapView().setTitle( - GUIUtils.i18n("map", false) + " - " + this.currentMap.name + " Gr\xF6\xDFe: " - + this.currentMap.realwidth + " X " + this.currentMap.realheight + " cm"); - } - } + /** + * Restart server poller + */ + public void restartServerPoller(){ + if (isMapLoaded() && isConnected()) { + this.poller.stop(); + this.poller.start(); + } + } - /** - * Restart server poller - */ - public void restartServerPoller(){ - if (isMapLoaded() && isConnected()) { - this.poller.stop(); - this.poller.start(); - } - } + /** + * Check whether map is loaded + * + * @return <code>true</code> if map loaded, <code>false</code> else + */ + public boolean isMapLoaded(){ + return this.currentMap != null; + } - /** - * Check whether map is loaded - * - * @return <code>true</code> if map loaded, <code>false</code> else - */ - public boolean isMapLoaded(){ - return this.currentMap != null; - } + /** + * Schlie\xDFt Karte und beendet Polling vom Server + * + */ + public void closeMap(){ + this.scannerAllocator.stopAllScanner(); + try { + Thread.sleep(1000); + } catch (InterruptedException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + this.currentMap = null; + this.mapView.unloadMap(); + this.serverManager.closeMap(); + this.poller.stop(); + this.nodeModel.clear(); + this.nodeModel.removeNodeModelListener(this.mapView); + // nodeModel.addNode(client); + } - /** - * Schlie\xDFt Karte und beendet Polling vom Server - * - */ - public void closeMap(){ - this.scannerAllocator.stopAllScanner(); - try { - Thread.sleep(1000); - } catch (InterruptedException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - this.currentMap = null; - this.mapView.unloadMap(); - this.serverManager.closeMap(); - this.poller.stop(); - this.nodeModel.clear(); - this.nodeModel.removeNodeModelListener(this.mapView); - // nodeModel.addNode(client); - } + /** + * Liefert X-Position des Clients auf der Karte + * + * @return client x position + */ + public int getClientPosX(){ + return this.mapView.getX(this.client); + } - /** - * Liefert X-Position des Clients auf der Karte - * - * @return client x position - */ - public int getClientPosX(){ - return this.mapView.getX(this.client); - } + /** + * Liefert Y-Position des Clients auf der Karte + * + * @return + */ + public int getClientPosY(){ + return this.mapView.getY(this.client); + } - /** - * Liefert Y-Position des Clients auf der Karte - * - * @return - */ - public int getClientPosY(){ - return this.mapView.getY(this.client); - } + /** + * Liefert Z-Position des Clients + * + * @return + */ + public int getClientPosZ(){ + return this.mapView.getZ(this.client); + } - /** - * Liefert Z-Position des Clients - * - * @return - */ - public int getClientPosZ(){ - return this.mapView.getZ(this.client); - } + /** + * Check for invisibility + * + * @return <code>true</code> if invisible, <code>false</code> else + */ + public boolean isInvisible(){ + return this.invisble; + } - /** - * Check for invisibility - * - * @return <code>true</code> if invisible, <code>false</code> else - */ - public boolean isInvisible(){ - return this.invisble; - } + /** + * Setter for invisibility + * + * @param value - + * boolean value for invisibility + */ + public void setInvisible(boolean value){ + this.invisble = value; + } - /** - * Setter for invisibility - * - * @param value - - * boolean value for invisibility - */ - public void setInvisible(boolean value){ - this.invisble = value; - } + /*************************************************************************** + * + * API f\xFCr die GUI + * + **************************************************************************/ - /*************************************************************************** - * - * API f\xFCr die GUI - * - **************************************************************************/ + public void connect(ServerConnectCallback callback){ + // Wir selber... + this.client = new ClientNode(this.nodeModel); + this.client.setName(Settings.getClientName()); + this.client.setMacAddress(Settings.getClientMAC()); + // this.nodeModel.addNode(client); - public void connect(ServerConnectCallback callback){ - // Wir selber... - this.client = new ClientNode(this.nodeModel); - this.client.setName(Settings.getClientName()); - this.client.setMacAddress(Settings.getClientMAC()); - // this.nodeModel.addNode(client); + if (Settings.isStandAlone()) + this.serverManager = new VirtualServerManager(this); + else + this.serverManager = new SOAPServerManager(this); + // Poller erzeugen (ben\xF6tigt ServerManager) + this.poller = new ServerPoller(this.serverManager, this.pollhandler); + this.serverManager.connect(callback); - if (Settings.isStandAlone()) - this.serverManager = new VirtualServerManager(this); - else - this.serverManager = new SOAPServerManager(this); - // Poller erzeugen (ben\xF6tigt ServerManager) - this.poller = new ServerPoller(this.serverManager, this.pollhandler); - this.serverManager.connect(callback); + // Start all plugins + PluginHandler.getInstance().connect(); + this.pluginManager.connect(); + } - // Start all plugins - PluginHandler.getInstance().connect(); - this.pluginManager.connect(); - } + public void disconnect(ServerDisconnectCallback callback){ + // Stop all plugins + PluginHandler.getInstance().dispose(); + this.pluginManager.dispose(); - public void disconnect(ServerDisconnectCallback callback){ - // Stop all plugins - PluginHandler.getInstance().dispose(); - this.pluginManager.dispose(); + if (isMapLoaded()) closeMap(); - if (isMapLoaded()) closeMap(); + this.serverManager.disconnect(callback); + } - this.serverManager.disconnect(callback); - } + /** + * Erzeugt einen Referenzpunkt auf der aktuellen Karte mit den aktuellen + * Messwerten des Clients mit den angegebenen Koordinaten. + */ + public void createLocation(int x, int y, int z, String name, boolean fixed, 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); + } - /** - * 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){ - if (!isConnected() || !isMapLoaded()) - callback.positionCreationError(new Exception("Nicht verbunden oder keine Karte geladen.")); - else - this.serverManager.createLocation(x, y, z, fixed, name, callback); - } + /** + * Erzeugt eine Geokoordinate auf der aktuellen Karte mit den angegebenen + * Koordinaten. + */ + public void createGeoPos(int x, int y, GeoPos geoPos, String mapName, boolean fixed, CreatePositionCallback callback){ + if (!isConnected() || !isMapLoaded()) + callback.positionCreationError(new Exception("Nicht verbunden oder keine Karte geladen.")); + else { + this.serverManager.createGeoPos(x, y, fixed, geoPos, mapName, callback); + this.poller.geomapTimerTask().run(); + } + } - /** - * Erzeugt eine Geokoordinate auf der aktuellen Karte mit den angegebenen - * Koordinaten. - */ - public void createGeoPos(int x, int y, GeoPos geoPos, String mapName, boolean fixed, CreatePositionCallback callback){ - if (!isConnected() || !isMapLoaded()) - callback.positionCreationError(new Exception("Nicht verbunden oder keine Karte geladen.")); - else { - this.serverManager.createGeoPos(x, y, fixed, geoPos, mapName, callback); - this.poller.geomapTimerTask().run(); - } - } + /** + * Creates an InfoObject on the current map with the supplied parameters + * @param x + * @param y + * @param z + * @param infoObject + * @param mapName + * @param fixed + * @param callback + */ + public void createInfoObject(int x, int y, int z, InfoObject infoObject, String mapName, boolean fixed, + CreatePositionCallback callback){ + if (!isConnected() || !isMapLoaded()) + callback.positionCreationError(new Exception("Nicht verbunden oder keine Karte geladen.")); + else { + // serverManager.createInfoObject(x, y, z, fixed, infoObject, + // mapName, callback); + INodeModel model = Controller.getInstance().getNodeModel(); + if (infoObject instanceof InfoObjectNode) { + InfoObjectNode node = (InfoObjectNode) infoObject; + model.addNode(node); + node.setPosition(x, y, z); + node.setFix(false); + System.out.println("Added Info:\n -> " + node.toString()); + } else { + InfoObjectNode node = new InfoObjectNode(model, infoObject); + model.addNode(node); + node.setPosition(x, y, z); + node.setFix(false); + System.out.println("Added Info:\n -> " + node.toString()); + } - /** - * Creates an InfoObject on the current map with the supplied parameters - * - * @param lastX - * @param lastY - * @param infoObject - * @param string - * @param b - * @param panel - */ - public void createInfoObject(int x, int y, int z, InfoObject infoObject, String mapName, boolean fixed, - CreatePositionCallback callback){ - if (!isConnected() || !isMapLoaded()) - callback.positionCreationError(new Exception("Nicht verbunden oder keine Karte geladen.")); - else { - // serverManager.createInfoObject(x, y, z, fixed, infoObject, - // mapName, callback); - INodeModel model = Controller.getInstance().getNodeModel(); - if (infoObject instanceof InfoObjectNode) { - InfoObjectNode node = (InfoObjectNode) infoObject; - model.addNode(node); - node.setPosition(x, y, z); - node.setFix(false); - System.out.println("Added Info:\n -> " + node.toString()); - } else { - InfoObjectNode node = new InfoObjectNode(model, infoObject); - model.addNode(node); - node.setPosition(x, y, z); - node.setFix(false); - System.out.println("Added Info:\n -> " + node.toString()); - } + } + } - } - } + /** + * + * @param name + * @param mapname + * @param callback + */ + public void deletePosition(String name, String mapname, DeletePositionCallback callback){ + Node node = this.nodeModel.findNode(name); + if (node != null) if (node.getId() != -1) + this.serverManager.deletePosition(node.getId(), Controller.getInstance().getCurrentMap().name, callback); + else + System.out.println("Node has no positionId, so its position cannot be deleted."); + } - /** - * Entfernt einen - * - * @param node - */ - public void deletePosition(String name, String mapname, DeletePositionCallback callback){ - Node node = this.nodeModel.findNode(name); - if (node != null) if (node.getId() != -1) - this.serverManager.deletePosition(node.getId(), Controller.getInstance().getCurrentMap().name, callback); - else - System.out.println("Node has no positionId, so its position cannot be deleted."); - } + /** + * + * @param name + * @param string + * @param callback + */ + public void deleteGeoPoint(String name, String string, DeletePositionCallback callback){ + Node node = this.nodeModel.findNode(name); + if (node != null) if (node.getId() != -1) + this.serverManager.deleteGeoPoint(node.getId(), Controller.getInstance().getCurrentMap().name, callback); + else + System.out.println("Node has no positionId, so its position cannot be deleted."); + } - /** - * @param name - * @param string - * @param panel - */ - public void deleteGeoPoint(String name, String string, DeletePositionCallback callback){ - Node node = this.nodeModel.findNode(name); - if (node != null) if (node.getId() != -1) - this.serverManager.deleteGeoPoint(node.getId(), Controller.getInstance().getCurrentMap().name, callback); - else - System.out.println("Node has no positionId, so its position cannot be deleted."); - } + public void setClientPosition(final int x, final int y, final int z, final boolean fixed, final String clientMac, + final PositionCallback callback){ - public void setClientPosition(final int x, final int y, final int z, final boolean fixed, final String clientMac, - final PositionCallback callback){ + this.serverManager.setClientPosition(x, y, z, fixed, clientMac, callback); + } - this.serverManager.setClientPosition(x, y, z, fixed, clientMac, callback); - } + public void setAccessPointPosition(final int x, final int y, final int z, boolean fixed, + final String accessPointMac, final PositionCallback callback){ - public void setAccessPointPosition(final int x, final int y, final int z, boolean fixed, - final String accessPointMac, final PositionCallback callback){ + this.serverManager.setAccessPointPosition(x, y, z, fixed, accessPointMac, callback); + } - this.serverManager.setAccessPointPosition(x, y, z, fixed, accessPointMac, callback); - } + public void setAccessPointHiddenStatus(String accessPointMac, boolean hidden, PositionCallback callback){ - public void setAccessPointHiddenStatus(String accessPointMac, boolean hidden, PositionCallback callback){ + this.serverManager.setAccessPointHiddenStatus(accessPointMac, hidden, callback); + } - this.serverManager.setAccessPointHiddenStatus(accessPointMac, hidden, callback); - } + public void movePosition(final long positionId, final String mapname, final int x, final int y, final int z, + boolean fixed, final MovePositionCallback callback){ - public void movePosition(final long positionId, final String mapname, final int x, final int y, final int z, - boolean fixed, final MovePositionCallback callback){ + this.serverManager.movePosition(positionId, mapname, x, y, z, fixed, callback); + } - this.serverManager.movePosition(positionId, mapname, x, y, z, fixed, callback); - } + /** + * Holt Karte vom Server. Ergebnis via Callback + * + * @param name + * @param callback + */ + public void retrieveMap(String name, MapCallback callback){ + this.serverManager.retrieveMap(name, callback); + getMapView().setTitle(GUIUtils.i18n("map", false) + " - " + name); + } - /** - * Holt Karte vom Server. Ergebnis via Callback - * - * @param name - * @param callback - */ - public void retrieveMap(String name, MapCallback callback){ - this.serverManager.retrieveMap(name, callback); - getMapView().setTitle(GUIUtils.i18n("map", false) + " - " + name); - } + public void retrieveMapNames(MapNamesCallback callback, boolean openMapDialog){ + this.serverManager.retrieveMapNames(callback, openMapDialog); + } - public void retrieveMapNames(MapNamesCallback callback, boolean openMapDialog){ - this.serverManager.retrieveMapNames(callback, openMapDialog); - } + public void createNewMap(final String name, final String URL, final int imageWidth, final int imageHeight, + final int width, final int height, final CreateNewMapCallback callback){ - public void createNewMap(final String name, final String URL, final int imageWidth, final int imageHeight, - final int width, final int height, final CreateNewMapCallback callback){ + this.serverManager.createNewMap(name, URL, imageWidth, imageHeight, width, height, callback); + } - this.serverManager.createNewMap(name, URL, imageWidth, imageHeight, width, height, callback); - } + public Collection<InfoObject> getInfoObjects(){ + return this.infoObjects; + } - public Collection<InfoObject> getInfoObjects(){ - return this.infoObjects; - } + public void handleRoundComplete(AbstractScanner scanner){ + this.scannerAllocator.handleRoundComplete(scanner); + } - public void handleRoundComplete(AbstractScanner scanner){ - this.scannerAllocator.handleRoundComplete(scanner); - } + public void handleScanResult(AbstractScanResult scanResult, AbstractScanner scanner){ + this.scannerAllocator.handleScanResult(scanResult, scanner); + } - public void handleScanResult(AbstractScanResult scanResult, AbstractScanner scanner){ - this.scannerAllocator.handleScanResult(scanResult, scanner); - } + public void addScannerHandler(AbstractScannerHandler handler){ + this.scannerAllocator.addScanResultHandler(handler); + } - public void addScannerHandler(AbstractScannerHandler handler){ - this.scannerAllocator.addScanResultHandler(handler); - } - - public InfoObjectProviderRegistry getInfoProviderRegistry(){ - return this.infoServiceRegistry; - } + public InfoObjectProviderRegistry getInfoProviderRegistry(){ + return this.infoServiceRegistry; + } } Added: trunk/magicmapclient/src/net/sf/magicmap/client/gui/forms/AbstractForm.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/forms/AbstractForm.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/forms/AbstractForm.java 2006-11-07 18:53:59 UTC (rev 477) @@ -0,0 +1,32 @@ +package net.sf.magicmap.client.gui.forms; + +import javax.swing.*; +import java.util.*; + +/** + * Created by IntelliJ IDEA. + * User: Jan + * Date: 03.11.2006 + * Time: 14:18:25 + * To change this template use File | Settings | File Templates. + */ +public abstract class AbstractForm<C> implements Form<C>, Iterable<Attribute<C>>{ + + private final Collection<Attribute<C>> attributes = new LinkedList<Attribute<C>>(); + + public void addAttribute(String attributeName, String className, C constraints) { + this.attributes.add(new Attribute<C>(attributeName, className, constraints)); + } + + public void addLabel(String forAttribute, JComponent component, C constraints) { + this.attributes.add(new Attribute<C>(forAttribute, "", constraints, component)); + } + + public void addForm(Form form, C constraints) { + attributes.add(new Attribute<C>( "", constraints, form)); + } + public Iterator<Attribute<C>> iterator(){ + return attributes.iterator(); + } + +} Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/forms/Attribute.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/forms/Attribute.java 2006-10-31 15:55:58 UTC (rev 476) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/forms/Attribute.java 2006-11-07 18:53:59 UTC (rev 477) @@ -8,61 +8,91 @@ * @see net.sf.magicmap.client.gui.forms.UserInterface * @see net.sf.magicmap.client.gui.forms.Form */ -public final class Attribute { +public class Attribute<C> { - private final String name; - private final String className; - private final Object constrains; - private final JComponent component; + private final String name; + private final String className; + private final C constrains; + private final JComponent component; + private final Form form; - /** - * creates an attribute. - * - * @param name the attributes name - * @param className not used - far later - * @param constrains the layout constraints - */ - public Attribute(String name, String className, Object constrains) { - this(name, className, constrains, null); - } - /** - * Create an Label for an Attribute - * - * @param name the attributes name this label is for - * @param className not used - * @param constrains the layout constraints - * @param component the label. - */ - public Attribute(String name, String className, Object constrains, JComponent component) { - this.name = name; - this.className = className; - this.constrains = constrains; - this.component = component; - } - public String getAttributeName(){ - return this.name; - } + /** + * creates an attribute. + * + * @param name the attributes name + * @param className not used - far later + * @param constrains the layout constraints + */ + public Attribute(String name, String className, C constrains) { + this(name, className, constrains, (JComponent)null); + } - public String getClassName(){ - return this.className; - } + /** + * Create an Label for an Attribute + * + * @param name the attributes name this label is for + * @param className not used + * @param constrains the layout constraints + * @param component the label. + */ + public Attribute(String name, String className, C constrains, JComponent component) { + this.name = name; + this.className = className; + this.constrains = constrains; + this.component = component; + form = null; + } - public Object getConstraints(){ - return this.constrains; - } + /** + * + * @param className + * @param constrains + * @param form + */ + public Attribute(String className, C constrains, Form form) { + this.name = ""; + this.className = className; + this.constrains = constrains; + this.form = form; + this.component = null; + } - public JComponent getComponent(){ - return this.component; - } + public String getAttributeName(){ + return this.name; + } - @Override - public String toString(){ - return ""; - } + public String getClassName(){ + return this.className; + } - public String toXml(){ - return ""; - } + public C getConstraints(){ + return this.constrains; + } + + /** + * Returns the attributes visual proxy. + * @param ui + * @return + */ + public JComponent getComponent(UserInterface ui){ + if (this.component != null) + return this.component; + else if (this.form != null) + return this.form.attatch((ui)); + else return ui.visualProxy(this.name, null); + } + + public Form getForm(){ + return form; + } + @Override + public String toString(){ + return ""; + } + + public String toXml(){ + return ""; + } } Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/forms/Form.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/forms/Form.java 2006-10-31 15:55:58 UTC (rev 476) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/forms/Form.java 2006-11-07 18:53:59 UTC (rev 477) @@ -8,7 +8,7 @@ * * Attribute sind keine Properties..... */ -public interface Form { +public interface Form<C> { /** * @@ -16,7 +16,7 @@ * @param className * @param constraints */ - public void addAttribute(String attributeName, String className, Object constraints); + public void addAttribute(String attributeName, String className, C constraints); /** * @@ -24,11 +24,13 @@ * @param component * @param constraints */ - public void addLabel(String forAttribute, JComponent component, Object constraints); + public void addLabel(String forAttribute, JComponent component, C constraints); - /** + public void addForm(Form form, C constraints); + + /** * Attatch this form to a model. * @param ui */ - public JComponent attatch(UserInterface ui); + public JComponent attatch (UserInterface ui); } Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/forms/FormLayoutForm.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/forms/FormLayoutForm.java 2006-10-31 15:55:58 UTC (rev 476) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/forms/FormLayoutForm.java 2006-11-07 18:53:59 UTC (rev 477) @@ -1,11 +1,9 @@ package net.sf.magicmap.client.gui.forms; -import java.util.Collection; -import java.util.LinkedList; +import javax.swing.*; import javax.swing.JComponent; - import com.jgoodies.forms.builder.PanelBuilder; import com.jgoodies.forms.layout.CellConstraints; import com.jgoodies.forms.layout.FormLayout; @@ -13,67 +11,47 @@ /** * */ -public class FormLayoutForm implements Form, Cloneable { +public class FormLayoutForm extends AbstractForm<CellConstraints>{ - private final FormLayout layout; - private final Collection<Attribute> attributes = new LinkedList<Attribute>(); - private JComponent form = null; - public FormLayoutForm(String colSpecs, String rowSpecs) { - this.layout = new FormLayout(colSpecs, rowSpecs); - } + private final FormLayout layout; + private JComponent form = null; - public FormLayoutForm(FormLayout layout) { - this.layout = layout; - } + public FormLayoutForm(String colSpecs, String rowSpecs) { + this.layout = new FormLayout(colSpecs, rowSpecs); + } - /** - * - * @param attributeName - * @param className - * @param constraints - */ - public void addAttribute(String attributeName, String className, Object constraints){ - this.attributes.add(new Attribute(attributeName, className, constraints)); - } + public FormLayoutForm(FormLayout layout) { + this.layout = layout; + } - /** - * - * @param forAttribute - * @param component - * @param constraints - */ - public void addLabel(String forAttribute, JComponent component, Object constraints){ - this.attributes.add(new Attribute(forAttribute, "", constraints, component)); - } - /** - * - * @param ui - * @return - */ - public JComponent attatch(UserInterface ui){ - PanelBuilder pb = new PanelBuilder(this.layout); - CellConstraints cc = null; + /** + * + * @param ui + * @return + */ + public JComponent attatch(UserInterface ui){ + PanelBuilder pb = new PanelBuilder(this.layout); + CellConstraints cc; - for (Attribute attribute : this.attributes) - if (attribute.getComponent() != null) { - cc = new CellConstraints(attribute.getConstraints().toString()); - pb.add(attribute.getComponent(), cc); - } else { - cc = new CellConstraints(attribute.getConstraints().toString()); - JComponent component = ui.visualProxy(attribute.getAttributeName(), null); - pb.add(component, cc); - } - this.form = pb.getPanel(); - return this.form; - } - - /** - * - * @return - */ - protected final FormLayout getLayout(){ - return this.layout; - } + /** + * + */ + for (Attribute<CellConstraints> attribute : this){ + cc = attribute.getConstraints(); + JComponent c = attribute.getComponent(ui); + pb.add(c,cc); + } + form = pb.getPanel(); + return this.form; + } + /** + * + * @return + */ + protected final FormLayout getLayout(){ + return this.layout; + } } + Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/forms/FormLayoutReader.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/forms/FormLayoutReader.java 2006-10-31 15:55:58 UTC (rev 476) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/forms/FormLayoutReader.java 2006-11-07 18:53:59 UTC (rev 477) @@ -17,107 +17,94 @@ import org.dom4j.Element; import org.dom4j.Node; import org.dom4j.io.SAXReader; +import com.jgoodies.forms.layout.CellConstraints; /** */ public class FormLayoutReader { - private Document document; - private ResourceBu... [truncated message content] |
From: <jan...@us...> - 2006-11-30 20:29:34
|
Revision: 488 http://svn.sourceforge.net/magicmap/?rev=488&view=rev Author: jan_fride Date: 2006-11-30 12:29:03 -0800 (Thu, 30 Nov 2006) Log Message: ----------- missing classes Modified Paths: -------------- trunk/magicmapclient/res/log4j.xml Added Paths: ----------- trunk/magicmapclient/res/log4j.dtd trunk/magicmapclient/src/net/sf/magicmap/plugin/ui/PluginTableModel.java Added: trunk/magicmapclient/res/log4j.dtd =================================================================== --- trunk/magicmapclient/res/log4j.dtd (rev 0) +++ trunk/magicmapclient/res/log4j.dtd 2006-11-30 20:29:03 UTC (rev 488) @@ -0,0 +1,166 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<!-- Authors: Chris Taylor, Ceki Gulcu. --> + +<!-- Version: 1.2 --> + +<!-- A configuration element consists of optional renderer +elements,appender elements, categories and an optional root +element. --> + +<!ELEMENT log4j:configuration (renderer*, appender*,(category|logger)*,root?, + categoryFactory?)> + +<!-- The "threshold" attribute takes a level value such that all --> +<!-- logging statements with a level equal or below this value are --> +<!-- disabled. --> + +<!-- Setting the "debug" enable the printing of internal log4j logging --> +<!-- statements. --> + +<!-- By default, debug attribute is "null", meaning that we not do touch --> +<!-- internal log4j logging settings. The "null" value for the threshold --> +<!-- attribute can be misleading. The threshold field of a repository --> +<!-- cannot be set to null. The "null" value for the threshold attribute --> +<!-- simply means don't touch the threshold field, the threshold field --> +<!-- keeps its old value. --> + +<!ATTLIST log4j:configuration + xmlns:log4j CDATA #FIXED "http://jakarta.apache.org/log4j/" + threshold (all|debug|info|warn|error|fatal|off|null) "null" + debug (true|false|null) "null" +> + +<!-- renderer elements allow the user to customize the conversion of --> +<!-- message objects to String. --> + +<!ELEMENT renderer EMPTY> +<!ATTLIST renderer + renderedClass CDATA #REQUIRED + renderingClass CDATA #REQUIRED +> + +<!-- Appenders must have a name and a class. --> +<!-- Appenders may contain an error handler, a layout, optional parameters --> +<!-- and filters. They may also reference (or include) other appenders. --> +<!ELEMENT appender (errorHandler?, param*, layout?, filter*, appender-ref*)> +<!ATTLIST appender + name ID #REQUIRED + class CDATA #REQUIRED +> + +<!ELEMENT layout (param*)> +<!ATTLIST layout + class CDATA #REQUIRED +> + +<!ELEMENT filter (param*)> +<!ATTLIST filter + class CDATA #REQUIRED +> + +<!-- ErrorHandlers can be of any class. They can admit any number of --> +<!-- parameters. --> + +<!ELEMENT errorHandler (param*, root-ref?, logger-ref*, appender-ref?)> +<!ATTLIST errorHandler + class CDATA #REQUIRED +> + +<!ELEMENT root-ref EMPTY> + +<!ELEMENT logger-ref EMPTY> +<!ATTLIST logger-ref + ref IDREF #REQUIRED +> + +<!ELEMENT param EMPTY> +<!ATTLIST param + name CDATA #REQUIRED + value CDATA #REQUIRED +> + + +<!-- The priority class is org.apache.log4j.Level by default --> +<!ELEMENT priority (param*)> +<!ATTLIST priority + class CDATA #IMPLIED + value CDATA #REQUIRED +> + +<!-- The level class is org.apache.log4j.Level by default --> +<!ELEMENT level (param*)> +<!ATTLIST level + class CDATA #IMPLIED + value CDATA #REQUIRED +> + + +<!-- If no level element is specified, then the configurator MUST not --> +<!-- touch the level of the named category. --> +<!ELEMENT category (param*,(priority|level)?,appender-ref*)> +<!ATTLIST category + class CDATA #IMPLIED + name CDATA #REQUIRED + additivity (true|false) "true" +> + +<!-- If no level element is specified, then the configurator MUST not --> +<!-- touch the level of the named logger. --> +<!ELEMENT logger (level?,appender-ref*)> +<!ATTLIST logger + name ID #REQUIRED + additivity (true|false) "true" +> + + +<!ELEMENT categoryFactory (param*)> +<!ATTLIST categoryFactory + class CDATA #REQUIRED> + +<!ELEMENT appender-ref EMPTY> +<!ATTLIST appender-ref + ref IDREF #REQUIRED +> + +<!-- If no priority element is specified, then the configurator MUST not --> +<!-- touch the priority of root. --> +<!-- The root category always exists and cannot be subclassed. --> +<!ELEMENT root (param*, (priority|level)?, appender-ref*)> + + +<!-- ==================================================================== --> +<!-- A logging event --> +<!-- ==================================================================== --> +<!ELEMENT log4j:eventSet (log4j:event*)> +<!ATTLIST log4j:eventSet + xmlns:log4j CDATA #FIXED "http://jakarta.apache.org/log4j/" + version (1.1|1.2) "1.2" + includesLocationInfo (true|false) "true" +> + + + +<!ELEMENT log4j:event (log4j:message, log4j:NDC?, log4j:throwable?, + log4j:locationInfo?) > + +<!-- The timestamp format is application dependent. --> +<!ATTLIST log4j:event + logger CDATA #REQUIRED + level CDATA #REQUIRED + thread CDATA #REQUIRED + timestamp CDATA #REQUIRED +> + +<!ELEMENT log4j:message (#PCDATA)> +<!ELEMENT log4j:NDC (#PCDATA)> + +<!ELEMENT log4j:throwable (#PCDATA)> + +<!ELEMENT log4j:locationInfo EMPTY> +<!ATTLIST log4j:locationInfo + class CDATA #REQUIRED + method CDATA #REQUIRED + file CDATA #REQUIRED + line CDATA #REQUIRED +> Modified: trunk/magicmapclient/res/log4j.xml =================================================================== --- trunk/magicmapclient/res/log4j.xml 2006-11-30 20:24:22 UTC (rev 487) +++ trunk/magicmapclient/res/log4j.xml 2006-11-30 20:29:03 UTC (rev 488) @@ -3,27 +3,25 @@ <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> - <appender name="MeinAppender" class="org.apache.log4j.FileAppender"> - <param name="file" value="magicmapclient.log" /> - <param name="Append" value="true" /> - <layout class="org.apache.log4j.PatternLayout"> - <param name="ConversionPattern" - value="%d{ISO8601} %-5p [%t] %c: %m%n" /> - </layout> - </appender> -<appender name="MeinAppender2" class="org.apache.log4j.ConsoleAppender"> - - <layout class="org.apache.log4j.PatternLayout"> - <param name="ConversionPattern" - value="%d{ISO8601} %-5p %c: %m%n" /> - </layout> - </appender> + <appender name="MeinAppender" class="org.apache.log4j.FileAppender"> + <param name="file" value="magicmapclient.log" /> + <param name="Append" value="true" /> + <layout class="org.apache.log4j.PatternLayout"> + <param name="ConversionPattern" + value="%d{ISO8601} %-5p [%t] %c: %m%n" /> + </layout> + </appender> + <appender name="MeinAppender2" class="org.apache.log4j.ConsoleAppender"> + <layout class="org.apache.log4j.PatternLayout"> + <param name="ConversionPattern" + value="%d{ISO8601} %-5p %c: %m%n" /> + </layout> + </appender> - <root> - <priority value="INFO" /> - <appender-ref ref="MeinAppender" /> - <appender-ref ref="MeinAppender2" /> - </root> - + <root> + <priority value="INFO" /> + <appender-ref ref="MeinAppender" /> + <appender-ref ref="MeinAppender2" /> + </root> </log4j:configuration> Added: trunk/magicmapclient/src/net/sf/magicmap/plugin/ui/PluginTableModel.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/plugin/ui/PluginTableModel.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/plugin/ui/PluginTableModel.java 2006-11-30 20:29:03 UTC (rev 488) @@ -0,0 +1,118 @@ + +package net.sf.magicmap.plugin.ui; + +import java.beans.PropertyChangeSupport; +import java.util.Collections; +import java.util.LinkedList; + +import javax.swing.event.TableModelEvent; +import javax.swing.event.TableModelListener; + +import net.sf.magicmap.client.gui.ISortableTableModel; +import net.sf.magicmap.plugin.IPlugin; +import net.sf.magicmap.plugin.PluginManager; +import net.sf.magicmap.plugin.util.PluginComparator; +import net.sf.magicmap.artifact.ArtifactComparator; + +/** + * The list of all installed plugins. + * @author Jan + * + */ +public class PluginTableModel implements ISortableTableModel { + + private final PropertyChangeSupport support; + private final LinkedList<TableModelListener> listener = new LinkedList<TableModelListener>(); + private final LinkedList<IPlugin> plugins = new LinkedList<IPlugin>(); + + private static final Class[] clazzes = new Class[]{String.class, String.class, String.class, + Boolean.class }; + private final String[] names = new String[]{"Gruppe", "Plugin", "Version", "Aktiv"}; + private boolean descending; + private int sortColumn; + + public PluginTableModel(PluginManager manager) { + this.support = new PropertyChangeSupport(this); +// for (IPlugin plugin : manager) +// this.plugins.add(plugin); + } + + public void addTableModelListener(TableModelListener l){ + this.listener.add(l); + + } + + public Class<?> getColumnClass(int columnIndex){ + return PluginTableModel.clazzes[columnIndex]; + } + + public int getColumnCount(){ + return PluginTableModel.clazzes.length; + } + + public String getColumnName(int columnIndex){ + return this.names[columnIndex]; + } + + public int getRowCount(){ + return this.plugins.size(); + } + + public void sortByComlumn(int column, boolean descending){ + this.sortColumn = column; + this.descending = descending; + + Collections.sort(this.plugins, new ArtifactComparator()); //(new int[]{column}, descending)); + + TableModelEvent e = new TableModelEvent(this); + for (TableModelListener l : this.listener) + l.tableChanged(e); + System.err.println(column); + } + + public Object getValueAt(int rowIndex, int columnIndex){ + if (rowIndex > this.plugins.size()) throw new IllegalArgumentException("Invalid Row: " + rowIndex); + IPlugin plugin = this.plugins.get(rowIndex); + switch (columnIndex) { + case 0 : + return plugin.getGroupId(); + case 1 : + return plugin.getPluginInfos().getName(); + case 2 : + return plugin.getVersion(); + case 3 : + return true; + default : + throw new IllegalArgumentException("Invalid col: " + columnIndex); + } + + } + + /** + * @return false + */ + public boolean isCellEditable(int rowIndex, int columnIndex){ + return false; + } + + public void removeTableModelListener(TableModelListener l){ + this.listener.remove(l); + } + + /** + * Does nothing! + */ + public void setValueAt(Object aValue, int rowIndex, int columnIndex){ + // TODO Auto-generated method stub + + } + + public int getSortColumn(){ + return this.sortColumn; + } + + public boolean isDecending(){ + return this.descending; + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jan...@us...> - 2006-12-13 13:47:00
|
Revision: 493 http://svn.sourceforge.net/magicmap/?rev=493&view=rev Author: jan_fride Date: 2006-12-13 05:46:52 -0800 (Wed, 13 Dec 2006) Log Message: ----------- made some members private, added javadoc (minimal) Modified Paths: -------------- trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/MapPanel.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/package.html trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineTree.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineView.java trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeModel.java Removed Paths: ------------- trunk/magicmapclient/test/net/sf/magicmap/plugin/util/PluginTableModelTest.java Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java 2006-12-13 13:23:14 UTC (rev 492) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java 2006-12-13 13:46:52 UTC (rev 493) @@ -111,7 +111,7 @@ private AbstractAction exitAction; private AbstractAction aboutAction; private AbstractAction onlineHelp; - MapView mapView; + private MapView mapView; private MagicAction invisibleAction; private MagicAction simpleView; private MagicAction normalView; Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/MapPanel.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/MapPanel.java 2006-12-13 13:23:14 UTC (rev 492) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/MapPanel.java 2006-12-13 13:46:52 UTC (rev 493) @@ -37,7 +37,7 @@ /** * Komponente des Programmes, welches die Karte verwaltet und auf das NodeModel * gesteuert durch Benutzeraktionen zugreift. - * + * * @author thuebner */ public class MapPanel extends JPanel implements IMapPanel { @@ -55,7 +55,7 @@ private int lastY; - Node selectedNode; + private Node selectedNode; private AbstractAction createLocationAction; @@ -87,7 +87,7 @@ /** * Getter for selected node - * + * * @return the selected node */ public Node getSelectedNode(){ @@ -275,7 +275,7 @@ } /** - * + * * @return */ private JPopupMenu buildMapMenu(){ @@ -291,7 +291,7 @@ } /** - * + * * @param node * @return */ @@ -348,7 +348,7 @@ /* * (non-Javadoc) - * + * * @see net.sf.magicmap.client.interfaces.MapListener#vertexRightClicked(edu.uci.ics.jung.graph.Vertex, * int, int) */ @@ -364,7 +364,7 @@ /* * (non-Javadoc) - * + * * @see net.sf.magicmap.client.interfaces.MapListener#rightClicked(int, int) */ public void rightClicked(int x, int y){ @@ -377,7 +377,7 @@ } /** - * + * * @return */ public int getLastX(){ @@ -385,7 +385,7 @@ } /** - * + * * @return */ public int getLastY(){ @@ -395,7 +395,7 @@ /** * Referenzpunkt mit aktuell gemessenen Werten anlegen. Dies geschieht \xFCber * den Controller, so dass dieser am Server gespeichert werden kann. - * + * */ void createLocation(){ @@ -411,7 +411,7 @@ * \xC4nderung, daher sollte die Information \xFCber den Client und der * Zeitpunkt des Anlegens einer Position !!!NICHT!!! in ihrem Namen * gespeichert werden!!!! - * + * * todo: Hier den Client und den Zeitpunkt aus dem Namen entfernen, * Information nur beim Darstellen auf der Karte aus dem PositionDTO * nehmen! @@ -424,7 +424,7 @@ /** * Create a geo pos for the current selected location - * + * */ void createGeoPos(){ // TODO \xDCber den Dialog auch die H\xF6he einlesen @@ -436,7 +436,7 @@ /** * Create an info object for the current selected location - * + * */ void createInfoObject(){ // TODO \xDCber den Dialog auch die H\xF6he einlesen @@ -448,7 +448,7 @@ /** * Create an info object for the current selected location - * + * */ protected void measureLocation(){ if (this.selectedNode != null) { @@ -485,7 +485,7 @@ /** * Zuletzt angeklicketen Knoten umbennen - * + * */ void renameNode(){ // Ort benenen @@ -500,7 +500,7 @@ * Fixiert oder unfixiert einen Knoten, so wie der User es w�nscht und * teilt dies dem Server mit. Das lokale Modell aktualisiert sich dann erst * �ber den Poller. - * + * * @param b */ protected void setFix(boolean b){ @@ -552,7 +552,7 @@ /** * Liefert die in diesem Panel gesetzte MapView zur�ck - * + * * @return */ public AbstractMapView getMapView(){ @@ -561,7 +561,7 @@ /** * Setzt MapView - * + * * @param mapView */ public void setMapView(AbstractMapView mapView){ @@ -595,7 +595,7 @@ } /** - * + * */ protected void hideAP(){ if (this.selectedNode != null) { @@ -615,7 +615,7 @@ } /** - * + * */ protected void nohideAP(){ if (this.selectedNode != null) { @@ -628,7 +628,7 @@ /* * (non-Javadoc) - * + * * @see net.sf.magicmap.client.interfaces.CreatePositionCallback#positionCreated() */ public void positionCreated(){ @@ -639,7 +639,7 @@ /* * (non-Javadoc) - * + * * @see net.sf.magicmap.client.interfaces.CreatePositionCallback#positionCreationError(java.lang.Exception) */ public void positionCreationError(Exception e){ @@ -648,7 +648,7 @@ } /** - * + * */ protected void fetchLocations(){ // Controller.getInstance().fetchPositionsFromServer(); @@ -656,7 +656,7 @@ /* * (non-Javadoc) - * + * * @see net.sf.magicmap.client.interfaces.DeletePositionCallback#positionDeleted() */ @@ -667,7 +667,7 @@ /* * (non-Javadoc) - * + * * @see net.sf.magicmap.client.interfaces.DeletePositionCallback#positionDeleteError(java.lang.Exception) */ public void positionDeleteError(Exception e){ @@ -677,7 +677,7 @@ /* * (non-Javadoc) - * + * * @see net.sf.magicmap.client.interfaces.PositionCallback#positionUpdated(java.lang.String) */ public void positionUpdated(String name){ @@ -687,7 +687,7 @@ /* * (non-Javadoc) - * + * * @see net.sf.magicmap.client.interfaces.PositionCallback#positionError(java.lang.Exception) */ public void positionError(Exception e){ @@ -697,7 +697,7 @@ /* * (non-Javadoc) - * + * * @see net.sf.magicmap.client.interfaces.MapViewListener#nodeFixiated(net.sf.magicmap.client.model.node.Node) */ public void nodeFixiated(Node node){ @@ -707,7 +707,7 @@ /* * (non-Javadoc) - * + * * @see net.sf.magicmap.client.interfaces.MovePositionCallback#positionMoved(long) */ public void positionMoved(long positionId){ @@ -717,7 +717,7 @@ /* * (non-Javadoc) - * + * * @see net.sf.magicmap.client.interfaces.MovePositionCallback#positionMoveError(java.lang.Exception) */ public void positionMoveError(Exception e){ Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/package.html =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/package.html 2006-12-13 13:23:14 UTC (rev 492) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/package.html 2006-12-13 13:46:52 UTC (rev 493) @@ -0,0 +1,25 @@ +<html> +<head> +<title>Package gui</title> +</head> +<body> +The following tree shows the structure of the most +importante clients components: +<ul><li> MainGUI +<ul><li> UIFSplitPane +<ul><li> OutlineView +</li><li> UIFSplitPane +<ul><li> MapPanel +<ul><li> AbstractMapView +</li></ul> +</li><li> ViewTabPanel +<ul><li> MeasurementView +</li><li> ConsoleView +</li></ul> +</li></ul> +</li></ul> +</li></ul> +</li></ul> + +</body> +</html> \ No newline at end of file Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineTree.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineTree.java 2006-12-13 13:23:14 UTC (rev 492) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineTree.java 2006-12-13 13:46:52 UTC (rev 493) @@ -18,14 +18,24 @@ import net.sf.magicmap.client.model.outline.OutlineTreeNode; /** - * + * The tree for all MagicNodes. + * * @author Jan Friderici * @author thuebner * @author Johannes Zapotoczky (joh...@za...) - * + * @see OutlineModel */ public class OutlineTree extends JTree { + /** + * + */ + private static final long serialVersionUID = 1L; + + /** + * + * @param model + */ public OutlineTree(OutlineModel model) { super(model); setRootVisible(false); @@ -35,6 +45,10 @@ setBorder(new EmptyBorder(new Insets(3, 3, 3, 3))); } + /** + * + * @param nodeModel + */ public OutlineTree(INodeModel nodeModel) { this(new OutlineModel(nodeModel)); @@ -42,7 +56,7 @@ /** * Private class for the outline rendering - * + * * @author (vermutlich) thuebner * @author Johannes Zapotoczky (joh...@za...) */ Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineView.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineView.java 2006-12-13 13:23:14 UTC (rev 492) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineView.java 2006-12-13 13:46:52 UTC (rev 493) @@ -1,5 +1,5 @@ /* - * Created on 26.11.2004 + * Created on 26.11.2004 */ package net.sf.magicmap.client.gui.views; @@ -32,8 +32,8 @@ /** * View for the outline (left side list view of the application) - * - * @author thuebner + * + * @author thuebner */ public class OutlineView extends View implements TreeSelectionListener, NodeModelSelectionListener { @@ -49,7 +49,7 @@ private OutlineTreeNode rootNode; /** - * Constructor + * Constructor */ public OutlineView(INodeModel nodeModel) { super("OutlineView"); @@ -153,7 +153,7 @@ /** * Find OutlineNode for given Node * @param node - the Node to find - * @return the OutlineNode if exists, else null + * @return the OutlineNode if exists, else null */ public OutlineTreeNode findOutlineNode(Node node){ return ((OutlineModel) this.tree.getModel()).findOutlineNode(node); @@ -165,6 +165,7 @@ * @param node - the OutlineNode to find out the index * @return the index of node in parent */ + @Deprecated private int getAlphabeticalIndex(OutlineTreeNode node){ OutlineTreeNode parent = (OutlineTreeNode) node.getParent(); int index = 0; Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeModel.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeModel.java 2006-12-13 13:23:14 UTC (rev 492) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeModel.java 2006-12-13 13:46:52 UTC (rev 493) @@ -11,6 +11,10 @@ import java.util.List; import java.util.Map; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + + import net.sf.magicmap.client.interfaces.NodeModelListener; /** @@ -25,6 +29,7 @@ * (maps (as a special case), geopoints, info objects, rfid antennas, etc.) * * @author Johannes Zapotoczky (joh...@za...) + * @author Jan Friderici * */ public class NodeModel implements INodeModel { @@ -36,6 +41,7 @@ private Node selectedNode = Node.EMPTY_NODE; + private final Log log = LogFactory.getLog(NodeModel.class); /** * Erzeugt neues leeres Model * @@ -51,10 +57,12 @@ /** * Add a new node and notifies all listeners about it. - * - * @param node + * DOes nothing if a node with the model contains a node with the same name. + * @param node the node to add. */ public void addNode(Node node){ + if (this.nodes.containsKey(node.getName())) return; + log.info("Adding Node: " + node.getName()); this.nodes.put(node.getName(), node); // special handling for APs if (node.getType() == NodeModelConstants.NODETYPE_ACCESSPOINT) // Wenn AccessPoint, dann nach MAC-Adresse extra hashen Deleted: trunk/magicmapclient/test/net/sf/magicmap/plugin/util/PluginTableModelTest.java =================================================================== --- trunk/magicmapclient/test/net/sf/magicmap/plugin/util/PluginTableModelTest.java 2006-12-13 13:23:14 UTC (rev 492) +++ trunk/magicmapclient/test/net/sf/magicmap/plugin/util/PluginTableModelTest.java 2006-12-13 13:46:52 UTC (rev 493) @@ -1,84 +0,0 @@ -package net.sf.magicmap.plugin.util; - -import java.awt.BorderLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.Locale; - -import javax.swing.JButton; -import javax.swing.JFrame; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.JTable; -import javax.swing.ListSelectionModel; - -import net.sf.magicmap.client.controller.Controller; -import net.sf.magicmap.client.gui.utils.GUIUtils; -import net.sf.magicmap.client.utils.Settings; -import net.sf.magicmap.plugin.PluginManager; -import net.sf.magicmap.plugin.ui.PluginTableModel; -import junit.framework.TestCase; - - -public class PluginTableModelTest extends TestCase { - - PluginTableModel pluginModel; - PluginManager manager; - - public PluginTableModelTest(String arg0) { - super(arg0); - Settings.setup(new String[0]); - GUIUtils.setPlasticLookAndFeel(); - GUIUtils.setLocale(Locale.getDefault()); - } - - protected void setUp() throws Exception{ - - - manager = new PluginManager(new Settings(), Controller.getInstance()); - pluginModel = new PluginTableModel (manager); - super.setUp(); - } - - protected void tearDown() throws Exception{ - super.tearDown(); - } - - public void testModel() throws Exception{ - JFrame f = new JFrame(); - f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - JPanel p = new JPanel(new BorderLayout()); - JTable t = new SortableTable (pluginModel); - t.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - p.add(new JScrollPane(t), BorderLayout.CENTER); - JButton b = new JButton("Sort"); - b.addActionListener(new DoffiListener()); - p.add(b, BorderLayout.SOUTH); - f.setContentPane(p); - f.pack(); - f.setVisible(true); - } - public static void main(String[] args){ - PluginTableModelTest test = new PluginTableModelTest("ll"); - try { - test.manager = new PluginManager(new Settings(), Controller.getInstance()); - test.pluginModel = new PluginTableModel (test.manager); - test.testModel(); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - class DoffiListener implements ActionListener{ - int sort = 0; - public DoffiListener(){ - - } - public void actionPerformed(ActionEvent e){ - pluginModel.sortByComlumn(sort, true); - sort = (sort+1) %4; - - } - } - -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jan...@us...> - 2007-01-14 19:57:34
|
Revision: 504 http://svn.sourceforge.net/magicmap/?rev=504&view=rev Author: jan_fride Date: 2007-01-14 11:57:31 -0800 (Sun, 14 Jan 2007) Log Message: ----------- removed old pluginsystem Modified Paths: -------------- trunk/magicmapclient/magicmapclient.iml trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java Removed Paths: ------------- trunk/magicmapclient/src/net/sf/magicmap/client/plugin/IClientPlugin.java trunk/magicmapclient/src/net/sf/magicmap/client/plugin/InfoPlugin.java trunk/magicmapclient/src/net/sf/magicmap/client/plugin/PluginHandler.java trunk/magicmapclient/src/net/sf/magicmap/client/plugin/udpscanner/ Modified: trunk/magicmapclient/magicmapclient.iml =================================================================== --- trunk/magicmapclient/magicmapclient.iml 2007-01-14 19:09:55 UTC (rev 503) +++ trunk/magicmapclient/magicmapclient.iml 2007-01-14 19:57:31 UTC (rev 504) @@ -4,37 +4,301 @@ <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$/perl" isTestSource="false" /> <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$/.settings" /> - <excludeFolder url="file://$MODULE_DIR$/dist" /> <excludeFolder url="file://$MODULE_DIR$/inf" /> + <excludeFolder url="file://$MODULE_DIR$/lib" /> + <excludeFolder url="file://$MODULE_DIR$/lib-dev" /> </content> - <orderEntry type="jdk" jdkName="1.5" jdkType="JavaSDK" /> + <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> - <orderEntry type="module-library" exported=""> + <orderEntry type="library" name="Groovy from GroovyJ 0.1.8 (Demetra)" level="application" /> + <orderEntry type="library" name="magicmap-server" level="application" /> + <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/magicmap.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/nekohtml.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> </library> </orderEntry> - <orderEntry type="library" exported="" name="client-libs" level="project" /> - <orderEntry type="library" exported="" name="lib-dev" level="project" /> - <orderEntry type="module-library" exported=""> + <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/../magicmapserver/dist/magicmap-server.jar!/" /> + <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/concurrent.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/jaxen-1.1-beta-9.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/xml-apis.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/jung-1.5.2.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/mail.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/foxtrot.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/dom4j-1.6.1.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/RelativeLayout.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/log4j-1.2.8.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/xercesImpl.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/axis.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/jpox-20041204.032009.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/colt.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-dev/axis-ant.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="file://$MODULE_DIR$/build" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> <orderEntryProperties /> </component> <component name="VcsManagerConfiguration"> Modified: trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java 2007-01-14 19:09:55 UTC (rev 503) +++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java 2007-01-14 19:57:31 UTC (rev 504) @@ -125,9 +125,6 @@ this.infoObjects = new ArrayList<InfoObject>(); // initializeScanner(); this.infoServiceRegistry = new InfoObjectProviderRegistry(this.nodeModel); - PluginHandler.getInstance(); - - //TODO try { this.pluginManager = new PluginManager(new Settings(), this); } catch (MalformedURLException e) { Deleted: trunk/magicmapclient/src/net/sf/magicmap/client/plugin/IClientPlugin.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/plugin/IClientPlugin.java 2007-01-14 19:09:55 UTC (rev 503) +++ trunk/magicmapclient/src/net/sf/magicmap/client/plugin/IClientPlugin.java 2007-01-14 19:57:31 UTC (rev 504) @@ -1,24 +0,0 @@ - -package net.sf.magicmap.client.plugin; - -/** - * Wird durch die neue Architektur ersetzt. - * - * - * - */ -@Deprecated -public interface IClientPlugin { - - public boolean canStartup(); - - public void connect(); - - public void loadMap(); - - public void dispose(); - - public void setId(String id); - - public String getId(); -} Deleted: trunk/magicmapclient/src/net/sf/magicmap/client/plugin/InfoPlugin.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/plugin/InfoPlugin.java 2007-01-14 19:09:55 UTC (rev 503) +++ trunk/magicmapclient/src/net/sf/magicmap/client/plugin/InfoPlugin.java 2007-01-14 19:57:31 UTC (rev 504) @@ -1,30 +0,0 @@ - -package net.sf.magicmap.client.plugin; - -import net.sf.magicmap.client.model.node.InfoObjectNode; - -@Deprecated -public interface InfoPlugin extends IClientPlugin { - - /** - * - * @param node - * @throws Exception - */ - public void expandNode(InfoObjectNode node) throws Exception; - - /** - * - * @return - * @throws Exception - */ - public InfoObjectNode createNode() throws Exception; - - /** - * - * @param source - * @param target - * @param data - */ - public void addEdge(InfoObjectNode source, InfoObjectNode target, String[][] data); -} Deleted: trunk/magicmapclient/src/net/sf/magicmap/client/plugin/PluginHandler.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/plugin/PluginHandler.java 2007-01-14 19:09:55 UTC (rev 503) +++ trunk/magicmapclient/src/net/sf/magicmap/client/plugin/PluginHandler.java 2007-01-14 19:57:31 UTC (rev 504) @@ -1,113 +0,0 @@ - -package net.sf.magicmap.client.plugin; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.LinkedList; -import java.util.List; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -import net.sf.magicmap.client.gui.utils.GUIUtils; - -@Deprecated -public class PluginHandler { - - private static PluginHandler instance = null; - private List<IClientPlugin> plugins; - private ResourceBundle pluginBundle; - private static final String PLUGIN_KEY = "plugins"; - private static final String BUNDLE_NAME = "plugins"; - - private PluginHandler() { - this.plugins = new ArrayList<IClientPlugin>(); - - // Instantiate all availlable plugins - initPlugins(); - } - - public static PluginHandler getInstance(){ - if (PluginHandler.instance == null) PluginHandler.instance = new PluginHandler(); - return PluginHandler.instance; - } - - public void initPlugins(){ - if (this.pluginBundle == null) initBundle(); - - String pluginNames; - String[] pluginNamesArray; - if (((pluginNames = this.pluginBundle.getString(PluginHandler.PLUGIN_KEY)) != null) - && (pluginNames.trim().length() > 0)) { - pluginNamesArray = pluginNames.split(","); - - Class clazz = null; - IClientPlugin clientPlugin = null; - for (String pluginName : pluginNamesArray) - // init Plugin - try { - clazz = Class.forName(pluginName.trim()); - clientPlugin = (IClientPlugin) clazz.newInstance(); - clientPlugin.setId(clientPlugin.getClass().getName()); - this.plugins.add(clientPlugin); - System.out.println("Neuer Plugin: " + clientPlugin); - } catch (ClassNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (InstantiationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IllegalAccessException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - } - - public void initBundle() throws MissingResourceException{ - try { - this.pluginBundle = ResourceBundle.getBundle(PluginHandler.BUNDLE_NAME, GUIUtils.getLocale()); - } catch (MissingResourceException e) { - throw e; - } - } - - public void connect(){ - for (IClientPlugin plugin : this.plugins) - plugin.connect(); - } - - public void loadMap(){ - for (IClientPlugin plugin : this.plugins) - plugin.loadMap(); - } - - public void dispose(){ - for (IClientPlugin plugin : this.plugins) - plugin.dispose(); - } - - public IClientPlugin getPlugin(Class clazz){ - for (IClientPlugin plugin : this.plugins) - if (plugin.getClass().isAssignableFrom(clazz)) return plugin; - return null; - } - - public Collection<IClientPlugin> getPlugins(Class clazz){ - LinkedList<IClientPlugin> pluginList = new LinkedList<IClientPlugin>(); - for (IClientPlugin plugin : this.plugins) - if (clazz.isAssignableFrom(plugin.getClass())) - pluginList.add(plugin); - else - System.err.println(clazz + " not assignable to " + plugin.getClass()); - return pluginList; - } - - public List<IClientPlugin> getPlugins(){ - return this.plugins; - } - - public void setPlugins(List<IClientPlugin> plugins){ - this.plugins = plugins; - } - -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fle...@us...> - 2007-01-16 14:06:30
|
Revision: 512 http://svn.sourceforge.net/magicmap/?rev=512&view=rev Author: flederohr Date: 2007-01-16 06:06:27 -0800 (Tue, 16 Jan 2007) Log Message: ----------- standard udp plugin added Added Paths: ----------- trunk/magicmapclient/plugins/ trunk/magicmapclient/plugins/udpplugin-plugin.jar Added: trunk/magicmapclient/plugins/udpplugin-plugin.jar =================================================================== (Binary files differ) Property changes on: trunk/magicmapclient/plugins/udpplugin-plugin.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. |
From: <fle...@us...> - 2007-01-25 14:01:26
|
Revision: 515 http://svn.sourceforge.net/magicmap/?rev=515&view=rev Author: flederohr Date: 2007-01-25 06:01:01 -0800 (Thu, 25 Jan 2007) Log Message: ----------- Fixed Bugs in Measurement Modified Paths: -------------- trunk/magicmapclient/plugins/udpplugin-plugin.jar trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java trunk/magicmapclient/src/net/sf/magicmap/client/model/location/INodePlacer.java trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java trunk/magicmapclient/src/net/sf/magicmap/client/model/measurement/IMeasurementModel.java trunk/magicmapclient/src/net/sf/magicmap/client/model/measurement/MeasurementModel.java trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeModel.java Modified: trunk/magicmapclient/plugins/udpplugin-plugin.jar =================================================================== (Binary files differ) Modified: trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java 2007-01-21 16:35:03 UTC (rev 514) +++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java 2007-01-25 14:01:01 UTC (rev 515) @@ -35,526 +35,526 @@ */ public class Controller implements IController { - private static int numCalled = 0; + private static int numCalled = 0; - /** - * Die Instanz. - */ - private static Controller controller = null; + /** + * Die Instanz. + */ + private static Controller controller = null; - /** - * Das Knotenmodel. - */ - private INodeModel nodeModel; // Model f\xFCr Graphen + /** + * Das Knotenmodel. + */ + private INodeModel nodeModel; // Model f\xFCr Graphen - private IMeasurementModel measurementModel; // Model f\xFCr Messungen + private IMeasurementModel measurementModel; // Model f\xFCr Messungen - private ClientNode client; // Ausgezeichneter Knoten + private ClientNode client; // Ausgezeichneter Knoten - 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 CallbackHandler callbackHandler; // S\xE4mtliche callbacks werden dort behandelt - private MapInfo currentMap; + private MapInfo currentMap; - private OutlineView outlineView; + private OutlineView outlineView; - private ConsoleView consoleView; + private ConsoleView consoleView; - private MapView mapView; + private MapView mapView; - private MeasurementView measurementView; + private MeasurementView measurementView; - private boolean invisble; // Invisible-Modus (keine Daten an Server) + private boolean invisble; // Invisible-Modus (keine Daten an Server) - // pseudo server items - private Collection<InfoObject> infoObjects; + // pseudo server items + private Collection<InfoObject> infoObjects; - private ScannerAllocator scannerAllocator; - private final InfoObjectProviderRegistry infoServiceRegistry; - private final PluginManager pluginManager; + private ScannerAllocator scannerAllocator; + private final InfoObjectProviderRegistry infoServiceRegistry; + private final PluginManager pluginManager; - /** - * Private constructor for singleton instance - */ - private Controller() { - DOMConfigurator.configureAndWatch("log4j.xml"); + /** + * Private constructor for singleton instance + */ + private Controller() { + DOMConfigurator.configureAndWatch("log4j.xml"); - // - // Das Model der Knoten. - // - this.nodeModel = new NodeModel(); + // + // Das Model der Knoten. + // + this.nodeModel = new NodeModel(); - /** - * Messungen f\xFCr den eigenen clienten - */ - this.measurementModel = new MeasurementModel(); + /** + * Messungen f\xFCr den eigenen clienten + */ + this.measurementModel = new MeasurementModel(); + this.scannerAllocator = new ScannerAllocator(); + this.currentMap = null; + this.serverManager = null; - this.scannerAllocator = new ScannerAllocator(); - this.currentMap = null; - this.serverManager = null; + this.pollhandler = new PollHandler(this); - this.pollhandler = new PollHandler(this); + buildViews(); - buildViews(); - - // pseudo server items - this.infoObjects = new ArrayList<InfoObject>(); - // initializeScanner(); - this.infoServiceRegistry = new InfoObjectProviderRegistry(this.nodeModel); - try { - this.pluginManager = new PluginManager(new Settings(), this); + // pseudo server items + this.infoObjects = new ArrayList<InfoObject>(); + // initializeScanner(); + this.infoServiceRegistry = new InfoObjectProviderRegistry(this.nodeModel); + try { + this.pluginManager = new PluginManager(new Settings(), this); } catch (MalformedURLException e) { - throw new RuntimeException(e.getMessage()); - } - } + throw new RuntimeException(e.getMessage()); + } + } - /** - * Getter for client node - * - * @return the client node - */ - public ClientNode getClient(){ - return this.client; - } + /** + * Getter for client node + * + * @return the client node + */ + public ClientNode getClient(){ + return this.client; + } - /** - * Erzeugt die Hauptviews der Anwendung - */ - private void buildViews(){ - this.outlineView = new OutlineView(this.nodeModel); - this.consoleView = new ConsoleView(); - this.mapView = new MapView(this.nodeModel, null); - this.measurementView = new MeasurementView(getMeasurementModel(), this.nodeModel); - // registerMeasurementModelListener(measurementView); - setMeasurementViewLocal(true); - this.nodeModel.addNodeModelListener(this.mapView); - //registerNodeModelListener(outlineView); + /** + * Erzeugt die Hauptviews der Anwendung + */ + private void buildViews(){ + this.outlineView = new OutlineView(this.nodeModel); + this.consoleView = new ConsoleView(); + this.mapView = new MapView(this.nodeModel, null); + this.measurementView = new MeasurementView(getMeasurementModel(), this.nodeModel); + // registerMeasurementModelListener(measurementView); + setMeasurementViewLocal(true); + this.nodeModel.addNodeModelListener(this.mapView); + //registerNodeModelListener(outlineView); } - /** - * Getter for the map view - * - * @return the map view - */ - public MapView getMapView(){ - return this.mapView; - } + /** + * Getter for the map view + * + * @return the map view + */ + public MapView getMapView(){ + return this.mapView; + } - /** - * Getter for the outline view - * - * @return the outline view - */ - public OutlineView getOutlineView(){ - return this.outlineView; - } + /** + * Getter for the outline view + * + * @return the outline view + */ + public OutlineView getOutlineView(){ + return this.outlineView; + } - /** - * Getter for the console view - * - * @return the console view - */ - public ConsoleView getConsoleView(){ - return this.consoleView; - } + /** + * Getter for the console view + * + * @return the console view + */ + public ConsoleView getConsoleView(){ + return this.consoleView; + } - /** - * Getter for the measurement view - * - * @return the measurement view - */ - public MeasurementView getMeasurementView(){ - return this.measurementView; - } + /** + * Getter for the measurement view + * + * @return the measurement view + */ + public MeasurementView getMeasurementView(){ + return this.measurementView; + } - /** - * Provides the singleton controller instance (creates a new one if null) - * - * @return the singleton controller instance - */ - public static Controller getInstance(){ - if (Controller.controller == null) { - ++Controller.numCalled; - Controller.controller = new Controller(); - } - return Controller.controller; - } + /** + * Provides the singleton controller instance (creates a new one if null) + * + * @return the singleton controller instance + */ + public static Controller getInstance(){ + if (Controller.controller == null) { + ++Controller.numCalled; + Controller.controller = new Controller(); + } + return Controller.controller; + } - /** - * Getter for the node model - * - * @return the node model - */ - public INodeModel getNodeModel(){ - return this.nodeModel; - } + /** + * Getter for the node model + * + * @return the node model + */ + public INodeModel getNodeModel(){ + return this.nodeModel; + } - /** - * Baut das MeasurementModelOther neu auf. - * - * @param ap - - * the access point seer node - */ - public void buildOtherMeasurement(AccessPointSeerNode ap){ -// System.out.println("Building measurement model..."); -// this.measurementModelOther.clear(); -// ArrayList aes = ap.getApEdges(); -// for (int i = 0; i < aes.size(); i++) { -// AccessPointEdge ae = (AccessPointEdge) aes.get(i); -// SeenAccessPoint sp = new SeenAccessPoint(ae.getAccessPoint().getMacAddress(), ae.getSignalLevel()); -// this.measurementModelOther.addAccessPoint(sp); -// } - } + /** + * Baut das MeasurementModelOther neu auf. + * + * @param ap - + * the access point seer node + */ + public void buildOtherMeasurement(AccessPointSeerNode ap){ + // System.out.println("Building measurement model..."); + // this.measurementModelOther.clear(); + // ArrayList aes = ap.getApEdges(); + // for (int i = 0; i < aes.size(); i++) { + // AccessPointEdge ae = (AccessPointEdge) aes.get(i); + // SeenAccessPoint sp = new SeenAccessPoint(ae.getAccessPoint().getMacAddress(), ae.getSignalLevel()); + // this.measurementModelOther.addAccessPoint(sp); + // } + } - /** - * \xC4nndert die Anzeige des Measurement-Views - * - * @param local - * true, wenn lokale St\xE4rken angezeigt werden sollen - */ - public void setMeasurementViewLocal(boolean local){ - if (local) { - // measurementModelOther.removeMeasurementModelListener(measurementView); - // measurementModel.addMeasurementModelListener(measurementView); - //measurementModel.clear(); - } else { - // measurementModel.removeMeasurementModelListener(measurementView); - // measurementModelOther.addMeasurementModelListener(measurementView); - //measurementModelOther.clear(); - } - } + /** + * \xC4nndert die Anzeige des Measurement-Views + * + * @param local + * true, wenn lokale St\xE4rken angezeigt werden sollen + */ + public void setMeasurementViewLocal(boolean local){ + if (local) { + // measurementModelOther.removeMeasurementModelListener(measurementView); + // measurementModel.addMeasurementModelListener(measurementView); + //measurementModel.clear(); + } else { + // measurementModel.removeMeasurementModelListener(measurementView); + // measurementModelOther.addMeasurementModelListener(measurementView); + //measurementModelOther.clear(); + } + } - /** - * Getter for measurement model - * - * @return the measurement model - */ - public IMeasurementModel getMeasurementModel(){ - return this.measurementModel; - } + /** + * Getter for measurement model + * + * @return the measurement model + */ + public IMeasurementModel getMeasurementModel(){ + return this.measurementModel; + } - /** - * Gibt an ob verbunden oder nicht verbunden - * - * @return true wenn ja, false sonst - */ - public boolean isConnected(){ - return (this.serverManager != null && this.serverManager.isConnected()); - } + /** + * Gibt an ob verbunden oder nicht verbunden + * + * @return true wenn ja, false sonst + */ + public boolean isConnected(){ + return (this.serverManager != null && this.serverManager.isConnected()); + } - /** - * Liefert Kartenbeschreibung der aktuell geladenen Karte - * - * @return Kartenbeschreibung (MapInfo) oder null, wenn keine Karte aktiv - */ - public MapInfo getCurrentMap(){ - return this.currentMap; - } + /** + * Liefert Kartenbeschreibung der aktuell geladenen Karte + * + * @return Kartenbeschreibung (MapInfo) oder null, wenn keine Karte aktiv + */ + public MapInfo getCurrentMap(){ + return this.currentMap; + } - /** - * Setzt aktuelle Karte und startet dabei das ServerPolling - * - * @param map - */ - public void setCurrentMap(MapInfo map){ - if (isMapLoaded()) closeMap(); - this.currentMap = map; - try { - this.serverManager.reloadMap(); - this.nodeModel.addNode(this.client); - this.mapView.loadMap(map); - } catch (MalformedURLException e) { - System.out.println("Map loading failed." + e.getMessage()); - closeMap(); - } - if (isMapLoaded() && isConnected()) { - this.nodeModel.addNodeModelListener(this.mapView); - this.serverManager.resetTimestamp(); - setMeasurementViewLocal(true); - this.poller.start(); - // initializeScanner(); // Scanner neu initialisieren - this.scannerAllocator.startAllScanner(); + /** + * Setzt aktuelle Karte und startet dabei das ServerPolling + * + * @param map + */ + public void setCurrentMap(MapInfo map){ + if (isMapLoaded()) closeMap(); + this.currentMap = map; + try { + this.serverManager.reloadMap(); + this.nodeModel.addNode(this.client); + this.mapView.loadMap(map); + } catch (MalformedURLException e) { + System.out.println("Map loading failed." + e.getMessage()); + closeMap(); + } + if (isMapLoaded() && isConnected()) { + this.nodeModel.addNodeModelListener(this.mapView); + this.serverManager.resetTimestamp(); + setMeasurementViewLocal(true); + this.poller.start(); + // initializeScanner(); // Scanner neu initialisieren + this.scannerAllocator.startAllScanner(); - this.pluginManager.loadMap(); - if (this.currentMap.realheight > 0 && this.currentMap.realwidth > 0) - getMapView().setTitle( - GUIUtils.i18n("map", false) + " - " + this.currentMap.name + " Gr\xF6\xDFe: " - + this.currentMap.realwidth + " X " + this.currentMap.realheight + " cm"); - } - } + this.pluginManager.loadMap(); + if (this.currentMap.realheight > 0 && this.currentMap.realwidth > 0) + getMapView().setTitle( + GUIUtils.i18n("map", false) + " - " + this.currentMap.name + " Gr\xF6\xDFe: " + + this.currentMap.realwidth + " X " + this.currentMap.realheight + " cm"); + } + } - /** - * Restart server poller - */ - public void restartServerPoller(){ - if (isMapLoaded() && isConnected()) { - this.poller.stop(); - this.poller.start(); - } - } + /** + * Restart server poller + */ + public void restartServerPoller(){ + if (isMapLoaded() && isConnected()) { + this.poller.stop(); + this.poller.start(); + } + } - /** - * Check whether map is loaded - * - * @return <code>true</code> if map loaded, <code>false</code> else - */ - public boolean isMapLoaded(){ - return this.currentMap != null; - } + /** + * Check whether map is loaded + * + * @return <code>true</code> if map loaded, <code>false</code> else + */ + public boolean isMapLoaded(){ + return this.currentMap != null; + } - /** - * Schlie\xDFt Karte und beendet Polling vom Server - * - */ - public void closeMap(){ - this.scannerAllocator.stopAllScanner(); - try { - Thread.sleep(1000); - } catch (InterruptedException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - this.currentMap = null; - this.mapView.unloadMap(); - this.serverManager.closeMap(); - this.poller.stop(); - this.nodeModel.clear(); - this.nodeModel.removeNodeModelListener(this.mapView); - // nodeModel.addNode(client); - } + /** + * Schlie\xDFt Karte und beendet Polling vom Server + * + */ + public void closeMap(){ + this.scannerAllocator.stopAllScanner(); + try { + Thread.sleep(1000); + } catch (InterruptedException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + this.currentMap = null; + this.mapView.unloadMap(); + this.serverManager.closeMap(); + this.poller.stop(); + this.measurementModel.clear(); + this.nodeModel.clear(); + this.nodeModel.removeNodeModelListener(this.mapView); + this.client = null; + } - /** - * Liefert X-Position des Clients auf der Karte - * - * @return client x position - */ - public int getClientPosX(){ - return this.mapView.getX(this.client); - } + /** + * Liefert X-Position des Clients auf der Karte + * + * @return client x position + */ + public int getClientPosX(){ + return this.mapView.getX(this.client); + } - /** - * Liefert Y-Position des Clients auf der Karte - * - * @return - */ - public int getClientPosY(){ - return this.mapView.getY(this.client); - } + /** + * Liefert Y-Position des Clients auf der Karte + * + * @return + */ + public int getClientPosY(){ + return this.mapView.getY(this.client); + } - /** - * Liefert Z-Position des Clients - * - * @return - */ - public int getClientPosZ(){ - return this.mapView.getZ(this.client); - } + /** + * Liefert Z-Position des Clients + * + * @return + */ + public int getClientPosZ(){ + return this.mapView.getZ(this.client); + } - /** - * Check for invisibility - * - * @return <code>true</code> if invisible, <code>false</code> else - */ - public boolean isInvisible(){ - return this.invisble; - } + /** + * Check for invisibility + * + * @return <code>true</code> if invisible, <code>false</code> else + */ + public boolean isInvisible(){ + return this.invisble; + } - /** - * Setter for invisibility - * - * @param value - - * boolean value for invisibility - */ - public void setInvisible(boolean value){ - this.invisble = value; - } + /** + * Setter for invisibility + * + * @param value - + * boolean value for invisibility + */ + public void setInvisible(boolean value){ + this.invisble = value; + } - /*************************************************************************** - * - * API f\xFCr die GUI - * - **************************************************************************/ + /*************************************************************************** + * + * API f\xFCr die GUI + * + **************************************************************************/ - public void connect(ServerConnectCallback callback){ - // Wir selber... - this.client = new ClientNode(this.nodeModel); - this.client.setName(Settings.getClientName()); - this.client.setMacAddress(Settings.getClientMAC()); - // this.nodeModel.addNode(client); + public void connect(ServerConnectCallback callback){ + // Wir selber... + this.client = new ClientNode(this.nodeModel); + this.client.setName(Settings.getClientName()); + this.client.setMacAddress(Settings.getClientMAC()); + // this.nodeModel.addNode(client); - if (Settings.isStandAlone()) - this.serverManager = new VirtualServerManager(this); - else - this.serverManager = new SOAPServerManager(this); - // Poller erzeugen (ben\xF6tigt ServerManager) - this.poller = new ServerPoller(this.serverManager, this.pollhandler); - this.serverManager.connect(callback); + if (Settings.isStandAlone()) + this.serverManager = new VirtualServerManager(this); + else + this.serverManager = new SOAPServerManager(this); + // Poller erzeugen (ben\xF6tigt ServerManager) + this.poller = new ServerPoller(this.serverManager, this.pollhandler); + this.serverManager.connect(callback); - this.pluginManager.connect(); - } + this.pluginManager.connect(); + } - public void disconnect(ServerDisconnectCallback callback){ - this.pluginManager.dispose(); + public void disconnect(ServerDisconnectCallback callback){ + this.pluginManager.dispose(); - if (isMapLoaded()) closeMap(); + if (isMapLoaded()) closeMap(); - this.serverManager.disconnect(callback); - } + this.serverManager.disconnect(callback); + } - /** - * Erzeugt einen Referenzpunkt auf der aktuellen Karte mit den aktuellen - * Messwerten des Clients mit den angegebenen Koordinaten. - */ - public void createLocation(int x, int y, int z, String name, boolean fixed, 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); - } + /** + * 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){ + if (!isConnected() || !isMapLoaded()) + callback.positionCreationError(new Exception("Nicht verbunden oder keine Karte geladen.")); + else + this.serverManager.createLocation(x, y, z, fixed, name, callback); + } - /** - * Erzeugt eine Geokoordinate auf der aktuellen Karte mit den angegebenen - * Koordinaten. - */ - public void createGeoPos(int x, int y, GeoPos geoPos, String mapName, boolean fixed, CreatePositionCallback callback){ - if (!isConnected() || !isMapLoaded()) - callback.positionCreationError(new Exception("Nicht verbunden oder keine Karte geladen.")); - else { - this.serverManager.createGeoPos(x, y, fixed, geoPos, mapName, callback); - this.poller.geomapTimerTask().run(); - } - } + /** + * Erzeugt eine Geokoordinate auf der aktuellen Karte mit den angegebenen + * Koordinaten. + */ + public void createGeoPos(int x, int y, GeoPos geoPos, String mapName, boolean fixed, CreatePositionCallback callback){ + if (!isConnected() || !isMapLoaded()) + callback.positionCreationError(new Exception("Nicht verbunden oder keine Karte geladen.")); + else { + this.serverManager.createGeoPos(x, y, fixed, geoPos, mapName, callback); + this.poller.geomapTimerTask().run(); + } + } - /** - * Creates an InfoObject on the current map with the supplied parameters - * @param x - * @param y - * @param z - * @param infoObject - * @param mapName - * @param fixed - * @param callback - */ - public void createInfoObject(int x, int y, int z, InfoObject infoObject, String mapName, boolean fixed, - CreatePositionCallback callback){ - if (!isConnected() || !isMapLoaded()) - callback.positionCreationError(new Exception("Nicht verbunden oder keine Karte geladen.")); - else { - // serverManager.createInfoObject(x, y, z, fixed, infoObject, - // mapName, callback); - INodeModel model = Controller.getInstance().getNodeModel(); - if (infoObject instanceof InfoObjectNode) { - InfoObjectNode node = (InfoObjectNode) infoObject; - model.addNode(node); - node.setPosition(x, y, z); - node.setFix(false); - System.out.println("Added Info:\n -> " + node.toString()); - } else { - InfoObjectNode node = new InfoObjectNode(model, infoObject); - model.addNode(node); - node.setPosition(x, y, z); - node.setFix(false); - System.out.println("Added Info:\n -> " + node.toString()); - } + /** + * Creates an InfoObject on the current map with the supplied parameters + * @param x + * @param y + * @param z + * @param infoObject + * @param mapName + * @param fixed + * @param callback + */ + public void createInfoObject(int x, int y, int z, InfoObject infoObject, String mapName, boolean fixed, + CreatePositionCallback callback){ + if (!isConnected() || !isMapLoaded()) + callback.positionCreationError(new Exception("Nicht verbunden oder keine Karte geladen.")); + else { + // serverManager.createInfoObject(x, y, z, fixed, infoObject, + // mapName, callback); + INodeModel model = Controller.getInstance().getNodeModel(); + if (infoObject instanceof InfoObjectNode) { + InfoObjectNode node = (InfoObjectNode) infoObject; + model.addNode(node); + node.setPosition(x, y, z); + node.setFix(false); + System.out.println("Added Info:\n -> " + node.toString()); + } else { + InfoObjectNode node = new InfoObjectNode(model, infoObject); + model.addNode(node); + node.setPosition(x, y, z); + node.setFix(false); + System.out.println("Added Info:\n -> " + node.toString()); + } - } - } + } + } - /** - * - * @param name - * @param mapname - * @param callback - */ - public void deletePosition(String name, String mapname, DeletePositionCallback callback){ - Node node = this.nodeModel.findNode(name); - if (node != null) if (node.getId() != -1) - this.serverManager.deletePosition(node.getId(), Controller.getInstance().getCurrentMap().name, callback); - else - System.out.println("Node has no positionId, so its position cannot be deleted."); - } + /** + * + * @param name + * @param mapname + * @param callback + */ + public void deletePosition(String name, String mapname, DeletePositionCallback callback){ + Node node = this.nodeModel.findNode(name); + if (node != null) if (node.getId() != -1) + this.serverManager.deletePosition(node.getId(), Controller.getInstance().getCurrentMap().name, callback); + else + System.out.println("Node has no positionId, so its position cannot be deleted."); + } - /** - * - * @param name - * @param string - * @param callback - */ - public void deleteGeoPoint(String name, String string, DeletePositionCallback callback){ - Node node = this.nodeModel.findNode(name); - if (node != null) if (node.getId() != -1) - this.serverManager.deleteGeoPoint(node.getId(), Controller.getInstance().getCurrentMap().name, callback); - else - System.out.println("Node has no positionId, so its position cannot be deleted."); - } + /** + * + * @param name + * @param string + * @param callback + */ + public void deleteGeoPoint(String name, String string, DeletePositionCallback callback){ + Node node = this.nodeModel.findNode(name); + if (node != null) if (node.getId() != -1) + this.serverManager.deleteGeoPoint(node.getId(), Controller.getInstance().getCurrentMap().name, callback); + else + System.out.println("Node has no positionId, so its position cannot be deleted."); + } - public void setClientPosition(final int x, final int y, final int z, final boolean fixed, final String clientMac, - final PositionCallback callback){ + public void setClientPosition(final int x, final int y, final int z, final boolean fixed, final String clientMac, + final PositionCallback callback){ - this.serverManager.setClientPosition(x, y, z, fixed, clientMac, callback); - } + this.serverManager.setClientPosition(x, y, z, fixed, clientMac, callback); + } - public void setAccessPointPosition(final int x, final int y, final int z, boolean fixed, - final String accessPointMac, final PositionCallback callback){ + public void setAccessPointPosition(final int x, final int y, final int z, boolean fixed, + final String accessPointMac, final PositionCallback callback){ - this.serverManager.setAccessPointPosition(x, y, z, fixed, accessPointMac, callback); - } + this.serverManager.setAccessPointPosition(x, y, z, fixed, accessPointMac, callback); + } - public void setAccessPointHiddenStatus(String accessPointMac, boolean hidden, PositionCallback callback){ + public void setAccessPointHiddenStatus(String accessPointMac, boolean hidden, PositionCallback callback){ - this.serverManager.setAccessPointHiddenStatus(accessPointMac, hidden, callback); - } + this.serverManager.setAccessPointHiddenStatus(accessPointMac, hidden, callback); + } - public void movePosition(final long positionId, final String mapname, final int x, final int y, final int z, - boolean fixed, final MovePositionCallback callback){ + public void movePosition(final long positionId, final String mapname, final int x, final int y, final int z, + boolean fixed, final MovePositionCallback callback){ - this.serverManager.movePosition(positionId, mapname, x, y, z, fixed, callback); - } + this.serverManager.movePosition(positionId, mapname, x, y, z, fixed, callback); + } - /** - * Holt Karte vom Server. Ergebnis via Callback - * - * @param name - * @param callback - */ - public void retrieveMap(String name, MapCallback callback){ - this.serverManager.retrieveMap(name, callback); - getMapView().setTitle(GUIUtils.i18n("map", false) + " - " + name); - } + /** + * Holt Karte vom Server. Ergebnis via Callback + * + * @param name + * @param callback + */ + public void retrieveMap(String name, MapCallback callback){ + this.serverManager.retrieveMap(name, callback); + getMapView().setTitle(GUIUtils.i18n("map", false) + " - " + name); + } - public void retrieveMapNames(MapNamesCallback callback, boolean openMapDialog){ - this.serverManager.retrieveMapNames(callback, openMapDialog); - } + public void retrieveMapNames(MapNamesCallback callback, boolean openMapDialog){ + this.serverManager.retrieveMapNames(callback, openMapDialog); + } - public void createNewMap(final String name, final String URL, final int imageWidth, final int imageHeight, - final int width, final int height, final CreateNewMapCallback callback){ + public void createNewMap(final String name, final String URL, final int imageWidth, final int imageHeight, + final int width, final int height, final CreateNewMapCallback callback){ - this.serverManager.createNewMap(name, URL, imageWidth, imageHeight, width, height, callback); - } + this.serverManager.createNewMap(name, URL, imageWidth, imageHeight, width, height, callback); + } - public Collection<InfoObject> getInfoObjects(){ - return this.infoObjects; - } + public Collection<InfoObject> getInfoObjects(){ + return this.infoObjects; + } - public void handleRoundComplete(AbstractScanner scanner){ - this.scannerAllocator.handleRoundComplete(scanner); - } + public void handleRoundComplete(AbstractScanner scanner){ + this.scannerAllocator.handleRoundComplete(scanner); + } - public void handleScanResult(AbstractScanResult scanResult, AbstractScanner scanner){ - this.scannerAllocator.handleScanResult(scanResult, scanner); - } + public void handleScanResult(AbstractScanResult scanResult, AbstractScanner scanner){ + this.scannerAllocator.handleScanResult(scanResult, scanner); + } - public void addScannerHandler(AbstractScannerHandler handler){ - this.scannerAllocator.addScanResultHandler(handler); - } + public void addScannerHandler(AbstractScannerHandler handler){ + this.scannerAllocator.addScanResultHandler(handler); + } - public InfoObjectProviderRegistry getInfoProviderRegistry(){ - return this.infoServiceRegistry; - } + public InfoObjectProviderRegistry getInfoProviderRegistry(){ + return this.infoServiceRegistry; + } } Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/location/INodePlacer.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/location/INodePlacer.java 2007-01-21 16:35:03 UTC (rev 514) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/location/INodePlacer.java 2007-01-25 14:01:01 UTC (rev 515) @@ -120,5 +120,6 @@ public NodeUpdateHandler getHandler(int type){ return this.handlerMap.get(type); } - }; + } + public void clear();; } Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java 2007-01-21 16:35:03 UTC (rev 514) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java 2007-01-25 14:01:01 UTC (rev 515) @@ -31,390 +31,396 @@ */ public class JungNodePlacer extends DirectedSparseGraph implements INodePlacer, NodeModelConstants { - /** - * Logger - */ - private static final Log log = LogFactory.getLog(JungNodePlacer.class); + /** + * Logger + */ + private static final Log log = LogFactory.getLog(JungNodePlacer.class); - /** - * - */ - private static final class DefaultSettings extends LayoutSettings { + /** + * + */ + private static final class DefaultSettings extends LayoutSettings { - } + } - /** - * - */ - public static final LayoutSettings DEFAULT_SETTINGS = new DefaultSettings(); + /** + * + */ + public static final LayoutSettings DEFAULT_SETTINGS = new DefaultSettings(); - /** - * Used to find the Vertex representing a node. - */ - private final Map<Node, Vertex> nodeVertexMapping = new HashMap<Node, Vertex>(); + /** + * Used to find the Vertex representing a node. + */ + private final Map<Node, Vertex> nodeVertexMapping = new HashMap<Node, Vertex>(); - /** - * - */ - private final SpringLayout layout; + /** + * + */ + private final SpringLayout layout; - /** - * Calculates the layout in a background thread. - */ - private final LayoutWorker worker; + /** + * Calculates the layout in a background thread. + */ + private final LayoutWorker worker; - private boolean workerPaused; + private boolean workerPaused; - private boolean workerRunning; + private boolean workerRunning; - /** - * Werden f\xFCr die Handler ben\xF6tigt - */ - private HashMap<ClientNode, HashSet<LocationNode>> clientLocationMap; + /** + * Werden f\xFCr die Handler ben\xF6tigt + */ + private HashMap<ClientNode, HashSet<LocationNode>> clientLocationMap; - /** - * Werden f\xFCr die Handler ben\xF6tigt - */ - private HashMap<LocationNode, HashSet<LocationNode>> locationLocationMap; + /** + * Werden f\xFCr die Handler ben\xF6tigt + */ + private HashMap<LocationNode, HashSet<LocationNode>> locationLocationMap; - /** - * Werden f\xFCr die Handler ben\xF6tigt - */ - private StringLabeller labeller; + /** + * Werden f\xFCr die Handler ben\xF6tigt + */ + private StringLabeller labeller; - /** - * A Factory for the NodeUpdateHandler. - * @see NodeUpdateHandler - */ - private final NodeHandlerFactory nodeHandler = new NodeHandlerFactory(); + /** + * A Factory for the NodeUpdateHandler. + * @see NodeUpdateHandler + */ + private final NodeHandlerFactory nodeHandler = new NodeHandlerFactory(); + public JungNodePlacer() { + this(JungNodePlacer.DEFAULT_SETTINGS, new MagicMetric()); + } - public JungNodePlacer() { - this(JungNodePlacer.DEFAULT_SETTINGS, new MagicMetric()); - } + /** + * + * @param settings + * @param metric + */ + public JungNodePlacer(LayoutSettings settings, NodeModelMetric metric) { + super(); - /** - * - * @param settings - * @param metric - */ - public JungNodePlacer(LayoutSettings settings, NodeModelMetric metric) { - super(); + this.clientLocationMap = new HashMap<ClientNode, HashSet<LocationNode>>(); + this.locationLocationMap = new HashMap<LocationNode, HashSet<LocationNode>>(); + this.layout = new MagicLayout(this, metric, settings); + this.worker = new LayoutWorker(this.layout, new Dimension(800, 600)); + this.workerRunning = false; + this.workerPaused = false; - this.clientLocationMap = new HashMap<ClientNode, HashSet<LocationNode>>(); - this.locationLocationMap = new HashMap<LocationNode, HashSet<LocationNode>>(); - this.layout = new MagicLayout(this, metric, settings); - this.worker = new LayoutWorker(this.layout, new Dimension(800, 600)); - this.workerRunning = false; - this.workerPaused = false; + this.labeller = StringLabeller.getLabeller(this); - this.labeller = StringLabeller.getLabeller(this); + initNodeHandler(); + } - initNodeHandler(); - } + /** + * Initilisiert die Handler + * + */ + private void initNodeHandler(){ + addNodeUpdateHandler(new FixStateHandler(this.nodeVertexMapping, this.layout)); + addNodeUpdateHandler(new LabelChangeHandler(this.labeller, this.nodeVertexMapping)); + addNodeUpdateHandler(new PositionUpdateHandler(this.nodeVertexMapping, this.layout)); + addNodeUpdateHandler(new SeeAccessPointHandler(this.clientLocationMap, this.locationLocationMap)); + addNodeUpdateHandler(new NotSeeAccessPointHandler(this.clientLocationMap, this.locationLocationMap)); + addNodeUpdateHandler(new InfoNodeHandler()); + addNodeUpdateHandler(new AccessPointHiddenStateHandler()); + } - /** - * Initilisiert die Handler - * - */ - private void initNodeHandler(){ - addNodeUpdateHandler(new FixStateHandler(this.nodeVertexMapping, this.layout)); - addNodeUpdateHandler(new LabelChangeHandler(this.labeller, this.nodeVertexMapping)); - addNodeUpdateHandler(new PositionUpdateHandler(this.nodeVertexMapping, this.layout)); - addNodeUpdateHandler(new SeeAccessPointHandler(this.clientLocationMap, this.locationLocationMap)); - addNodeUpdateHandler(new NotSeeAccessPointHandler(this.clientLocationMap, this.locationLocationMap)); - addNodeUpdateHandler(new InfoNodeHandler()); - addNodeUpdateHandler(new AccessPointHiddenStateHandler()); - } + /** + * Den Hintergrundthread zum Berechnen der Positionen starten! ;-) + * + */ + public void start(){ + this.worker.init(); + this.workerRunning = true; + this.workerPaused = false; + } - /** - * Den Hintergrundthread zum Berechnen der Positionen starten! ;-) - * - */ - public void start(){ - this.worker.init(); - this.workerRunning = true; - this.workerPaused = false; - } + /** + * Sets the size of our layout. should be the same as the current map. + * @param width shoulde be the maps width. + * @param height + */ + public void setSize(int width, int height){ + this.layout.resize(new Dimension(width, height)); + } - /** - * Sets the size of our layout. should be the same as the current map. - * @param width shoulde be the maps width. - * @param height - */ - public void setSize(int width, int height){ - this.layout.resize(new Dimension(width, height)); - } + /** + * F\xFCgt einen neuen Knoten ein. + */ + public void insertNode(Node node){ + Vertex v = null; + int type = node.getType(); + // TODO das hier ist wahrlich haesslich.... - /** - * F\xFCgt einen neuen Knoten ein. - */ - public void insertNode(Node node){ - Vertex v = null; - int type = node.getType(); - // TODO das hier ist wahrlich haesslich.... + if (type == NodeModelConstants.NODETYPE_CLIENT || type == NodeModelConstants.NODETYPE_LOCATION + || type == NodeModelConstants.NODETYPE_ACCESSPOINT || type == NodeModelConstants.NODETYPE_GEOPOS + || type == NodeModelConstants.NODETYPE_INFO || type == NodeModelConstants.NODETYPE_RFID_ANTENNA) + v = addVertex(node); + if (v != null) if (node.isFix()) + this.layout.setFix(v); + else + this.layout.unsetFix(v); + } - if (type == NodeModelConstants.NODETYPE_CLIENT || type == NodeModelConstants.NODETYPE_LOCATION - || type == NodeModelConstants.NODETYPE_ACCESSPOINT || type == NodeModelConstants.NODETYPE_GEOPOS - || type == NodeModelConstants.NODETYPE_INFO || type == NodeModelConstants.NODETYPE_RFID_ANTENNA) - v = addVertex(node); - if (v != null) if (node.isFix()) - this.layout.setFix(v); - else - this.layout.unsetFix(v); - } + public void deleteNode(Node node){ + Vertex v = findVertex(node); + if (v != null) { - public void deleteNode(Node node){ - Vertex v = findVertex(node); - if (v != null){ + } + super.removeVertex(v); + this.nodeVertexMapping.remove(node); + } - } - super.removeVertex(v); - this.nodeVertexMapping.remove(node); - } + public SpringLayout getLayout(){ + return this.layout; + } - public SpringLayout getLayout(){ - return this.layout; - } + /** + * F\xFCgt den Knoten ein um seine Position etc zu berechnen. + * + * @param node der neue Knoten. + * @see NodeModelListener + */ + public void nodeAddedEvent(Node node){ + insertNode(node); + } - /** - * F\xFCgt den Knoten ein um seine Position etc zu berechnen. - * - * @param node der neue Knoten. - * @see NodeModelListener - */ - public void nodeAddedEvent(Node node){ - insertNode(node); - } + /** + * Reagiert auf ver\xE4nderungen in den Knoten oder im Model. + * Leitet die Anfragen an einen nodeHandler weiter. Wird vom NodeModel aufgerufen. + * + * @param node der neue oder ge\xE4nderte Knoten + * @param type der Typ des Events. (Enum nutzen)? + * @param data ---? + * @see NodeModelListener, INodeModel, NodeModel + */ + public void updateNode(Node node, int type, Object data){ + // first try if we have a handler for this event. + if (!this.nodeHandler.handleNodeUpdated(node, type, data, this)) { + if (type == NodeModelConstants.UPDATE_CLEAR) { + this.worker.suspend(); // stopGraph(); + // this.CALIBRATION_FACTOR_AP = 1.0; + // this.CALIBRATION_FACTOR_LC = 1.0; + this.clientLocationMap.clear(); + this.removeAllEdges(); + this.removeAllVertices(); + this.layout.update(); + this.nodeVertexMapping.clear(); + this.worker.unsuspend(); + } else if (type == NodeModelConstants.UPDATE_RESCAN) + this.layout.update(); + else + JungNodePlacer.log.debug("Event von typ: " + type + " ist unbekannt"); + } + } - /** - * Reagiert auf ver\xE4nderungen in den Knoten oder im Model. - * Leitet die Anfragen an einen nodeHandler weiter. Wird vom NodeModel aufgerufen. - * - * @param node der neue oder ge\xE4nderte Knoten - * @param type der Typ des Events. (Enum nutzen)? - * @param data ---? - * @see NodeModelListener, INodeModel, NodeModel - */ - public void updateNode(Node node, int type, Object data){ - // first try if we have a handler for this event. - if (!this.nodeHandler.handleNodeUpdated(node, type, data, this)) { - if (type == NodeModelConstants.UPDATE_CLEAR) { - this.worker.suspend(); // stopGraph(); - // this.CALIBRATION_FACTOR_AP = 1.0; - // this.CALIBRATION_FACTOR_LC = 1.0; - this.clientLocationMap.clear(); - this.removeAllEdges(); - this.removeAllVertices(); - this.layout.update(); - this.nodeVertexMapping.clear(); - this.worker.unsuspend(); - } else if (type == NodeModelConstants.UPDATE_RESCAN) - this.layout.update(); - else - JungNodePlacer.log.debug("Event von typ: " + type + " ist unbekannt"); - } - } + public void nodeRemovedEvent(Node node){ + removeVertex(node); + this.nodeVertexMapping.remove(node); + } - public void nodeRemovedEvent(Node node){ - removeVertex(node); - this.nodeVertexMapping.remove(node); - } + public Vertex findVertex(Node node){ + return this.nodeVertexMapping.get(node); + } - public Vertex findVertex(Node node){ - return this.nodeVertexMapping.get(node); - } + /** + * Verwandelt Node in Vertex und fuegt diesen in den Graphen ein. Es wird + * keine Ruecksicht auf den Typ des Knotens genommen. Eventuelle implizite + * Kanten muss der Aufrufer erstellen. + * + * @param node + * @return + */ + public Vertex addVertex(Node node){ + if (findVertex(node) == null) { - /** - * Verwandelt Node in Vertex und fuegt diesen in den Graphen ein. Es wird - * keine Ruecksicht auf den Typ des Knotens genommen. Eventuelle implizite - * Kanten muss der Aufrufer erstellen. - * - * @param node - * @return - */ - public Vertex addVertex(Node node){ - if (findVertex(node) == null) { + System.out.println("Adding " + node.getDisplayName()); - System.out.println("Adding " + node.getDisplayName()); + Vertex v = new DirectedSparseVertex(); + synchronized (this) { + this.worker.suspend(); + this.nodeVertexMapping.put(node, v); + v.addUserDatum(LayoutSettings.NODE_KEY, node, UserData.SHARED); - Vertex v = new DirectedSparseVertex(); - synchronized (this) { - this.worker.suspend(); - this.nodeVertexMapping.put(node, v); - v.addUserDatum(LayoutSettings.NODE_KEY, node, UserData.SHARED); + addVertex(v); - addVertex(v); + ((SpringLayout) this.worker.getGraphLayout()).update(); + if (node.getX() >= 0 && node.getY() >= 0) this.layout.forceMove(v, node.getX(), node.getY()); + this.worker.unsuspend(); - ((SpringLayout) this.worker.getGraphLayout()).update(); - if (node.getX() >= 0 && node.getY() >= 0) this.layout.forceMove(v, node.getX(), node.getY()); - this.worker.unsuspend(); + } + return v; + } else { + System.err.print("Vertex exists:"); + return null; + } - } - return v; - } else { - System.err.print("Vertex exists:"); - return null; - } + } - } + /** + * + */ + public void startNodePlacer(){ + start(); + } - /** - * - */ - public void startNodePlacer(){ - start(); - } + /** + * + */ + public void stopNodePlacer(){ + this.worker.stop(); - /** - * - */ - public void stopNodePlacer(){ - this.worker.stop(); + } - } + /** + * + */ + public void pauseNodePlacer(boolean pause){ + if (pause && !isPaused()) { + this.worker.suspend(); + this.workerPaused = true; + } else if (!pause && isPaused()) { + this.worker.unsuspend(); + this.workerPaused = false; - /** - * - */ - public void pauseNodePlacer(boolean pause){ - if (pause && !isPaused()) { - this.worker.suspend(); - this.workerPaused = true; - } else if (!pause && isPaused()) { - this.worker.unsuspend(); - this.workerPaused = false; + } + } - } - } + public boolean isPaused(){ + return this.workerRunning && this.workerPaused; + } - public boolean isPaused(){ - return this.workerRunning && this.workerPaused; - } + /** + * F\xFCgt eine gerichtete Kante von Knoten node1 zu node2 hinzu. + * + * Das Gewicht der Kante + * @param node1 + * @param node2 + * @return + */ + public IMagicEdge addEdge(Node node1, Node node2){ + if (node1 == node2) return null; + Vertex v = findVertex(node1); + Vertex w = findVertex(node2); - /** - * F\xFCgt eine gerichtete Kante von Knoten node1 zu node2 hinzu. - * - * Das Gewicht der Kante - * @param node1 - * @param node2 - * @return - */ - public IMagicEdge addEdge(Node node1, Node node2){ - if (node1 == node2) return null; - Vertex v = findVertex(node1); - Vertex w = findVertex(node2); + Edge e = v.findEdge(w); + if (e != null) + return (IMagicEdge) e; + else { + JungEdge edge = new JungEdge(v, w); + this.worker.suspend(); // stopGraph(); + addEdge(edge); + this.layout.update(); + this.worker.unsuspend(); // resumeGraph(); + return edge; + } + } - Edge e = v.findEdge(w); - if (e != null) - return (IMagicEdge) e; - else { - JungEdge edge = new JungEdge(v,w); - this.worker.suspend(); // stopGraph(); - addEdge(edge); - this.layout.update(); - this.worker.unsuspend(); // resumeGraph(); - return edge; - } - } + /** + * F\xFCgt eine Jungkante hinzu. wird intern verwendet. + * + * @param v1 + * @param v2 + * @return + */ + private Edge addEdge(Vertex v1, Vertex v2){ + if (v1 == v2) return null; + Edge e = v1.findEdge(v2); + if (e != null) + return e; + else { + DirectedSparseEdge edge = new DirectedSparseEdge(v1, v2); + this.worker.suspend(); // stopGraph(); + addEdge(edge); + this.layout.update(); + this.worker.unsuspend(); // resumeGraph(); + return edge; + } + } - /** - * F\xFCgt eine Jungkante hinzu. wird intern verwendet. - * - * @param v1 - * @param v2 - * @return - */ - private Edge addEdge(Vertex v1, Vertex v2){ - if (v1 == v2) return null; - Edge e = v1.findEdge(v2); - if (e != null) - return e; - else { - DirectedSparseEdge edge = new DirectedSparseEdge(v1, v2); - this.worker.suspend(); // stopGraph(); - addEdge(edge); - this.layout.update(); - this.worker.unsuspend(); // resumeGraph(); - return edge; - } - } + /** + * L\xF6scht eine Kantew zwischen den beiden Knoten. + * @param node1 Quelle der Kante. + * @param node2 Ziel der Kante. + */ + public void removeEdge(Node node1, Node node2){ + Vertex v = findVertex(node1); + Vertex w = findVertex(node2); + if (v != null && w != null) { + this.worker.suspend(); + Set edges = getEdges(); + for (Object edge : edges) { + Edge e = (Edge) edge; + if (e.getIncidentVertices().contains(v) && e.getIncidentVertices().contains(w)) { + removeEdge(e); + break; + } + } + this.layout.update(); + this.worker.unsuspend(); // resumeGraph(); + } + } - /** - * L\xF6scht eine Kantew zwischen den beiden Knoten. - * @param node1 Quelle der Kante. - * @param node2 Ziel der Kante. - */ - public void removeEdge(Node node1, Node node2){ - Vertex v = findVertex(node1); - Vertex w = findVertex(node2); - if (v != null && w != null) { - this.worker.suspend(); - Set edges = getEdges(); - for (Object edge : edges) { - Edge e = (Edge) edge; - if (e.getIncidentVertices().contains(v) && e.getIncidentVertices().contains(w)) { - removeEdge(e); - break; - } - } - this.layout.update(); - this.worker.unsuspend(); // resumeGraph(); - } - } + /** + * Entfernt alle Kanten an denen der Knoten beteiligt ist. + * + * @param node + */ + @SuppressWarnings("unchecked") + public void removeEdges(Node node){ + Vertex v = findVertex(node); + if (v != null) { + this.worker.suspend(); + Set edges = getEdges(); + // Kein Iterator direkt auf die Sets des + // Graphen => Concurrent modification! + ArrayList list = new ArrayList(edges); + for (Object aList : list) { + Edge e = (Edge) aList; + if (e.getIncidentVertices().contains(v)) { + super.removeEdge(e); + } + } + this.layout.update(); + this.worker.unsuspend(); + } + } - /** - * Entfernt alle Kanten an denen der Knoten beteiligt ist. - * - * @param node - */ - @SuppressWarnings("unchecked") - public void removeEdges(Node node){ - Vertex v = findVertex(node); - if (v != null) { - this.worker.suspend(); - Set edges = getEdges(); - // Kein Iterator direkt auf die Sets des - // Graphen => Concurrent modification! - ArrayList list = new ArrayList(edges); - for (Object aList : list) { - Edge e = (Edge) aList; - if (e.getIncidentVertices().contains(v)){ - super.removeEdge(e); - } - } - this.layout.update(); - this.worker.unsuspend(); - } - } + /** + * Entfernt Knoten aus dem Graph und eventuelle Kanten + * + * @param node + */ + public void removeVertex(Node node){ + removeEdges(node); + Vertex v = findVertex(node); + if (v != null) { + nodeVertexMapping.remove(node); + this.worker.suspend(); + this.labeller.removeLabel(node.getDisplayName()); + super.removeVertex(v); + this.layout.update(); + this.worker.unsuspend(); - /** - * Entfernt Knoten aus dem Graph und eventuelle Kanten - * - * @param node - */ - public void removeVertex(Node node){ - removeEdges(node); - Vertex v = findVertex(node); - if (v != null) { - nodeVertexMapping.remove(node); - this.worker.suspend(); - this.labeller.removeLabel(node.getDisplayName()); - super.removeVertex(v); - this.layout.update(); - this.worker.unsuspend(); + } + } - } - } + /** + * + * @param handler + */ - /** - * - * @param handler - */ + public void addNodeUpdateHandler(NodeUpdateHandler handler){ + this.nodeHandler.addNodeUpdateHandler(handler); - public void addNodeUpdateHandler(NodeUpdateHandler handler){ - this.nodeHandler.addNodeUpdateHandler(handler); + } - } + public void clear(){ + stopNodePlacer(); + this.removeAllEdges(); + this.removeAllVertices(); + nodeVertexMapping.clear(); + } } Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/measurement/IMeasurementModel.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/measurement/IMeasurementModel.java 2007-01-21 16:35:03 UTC (rev 514) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/measurement/IMeasurementModel.java 2007-01-25 14:01:01 UTC (rev 515) @@ -43,4 +43,10 @@ void addMeasurementModelListener(MeasurementModelListener listener); void removeMeasurementModelListener(MeasurementModelListener listener); + + /** + * Clears the MeasurementModel + * + */ + public void clear(); } Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/measurement/MeasurementModel.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/measurement/MeasurementModel.java 2007-01-21 16:35:03 UTC (rev 514) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/measurement/MeasurementModel.java 2007-01-25 14:01:01 UTC (rev 515) @@ -1,3 +1,4 @@ + package net.sf.magicmap.client.model.measurement; import net.sf.magicmap.client.interfaces.MeasurementModelListener; @@ -18,166 +19,171 @@ */ public class MeasurementModel implements IMeasurementModel { - private final EventListenerList listeners = new EventListenerList(); - private final MeasurementMap apMap = new MeasurementMap(); + private final EventListenerList listeners = new EventListenerList(); + private final MeasurementMap apMap = new MeasurementMap(); - public MeasurementModel(){ + public MeasurementModel() { - } + } - /** - * 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. - */ - public void addAccessPoint(AccessPointSeerNode client, SeenAccessPoint ap) { - if (apMap.put(client, ap)){ - fireAccessPointAdded(client,ap); - } - //client.getModel().updateNode(client, NodeModelConstants.UPDATE_SEESACCESSPOINT, null); - } + /** + * 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. + */ + public void addAccessPoint(AccessPointSeerNode client, SeenAccessPoint ap){ + if (apMap.put(client, ap)) { + fireAccessPointAdded(client, ap); + } + //client.getModel().updateNode(client, NodeModelConstants.UPDATE_SEESACCESSPOINT, null); + } - public void updateScanResult(AccessPointSeerNode client, String apMac, double signalLevel){ - SeenAccessPoint accessPoint = getAccessPoint(client, apMac); - final INodeModel nodeModel = client.getModel(); + public void updateScanResult(AccessPointSeerNode client, String apMac, double signalLevel){ + SeenAccessPoint accessPoint = getAccessPoint(client, apMac); + final INodeModel nodeModel = client.getModel(); + if (accessPoint == null) { + // ein toter ap..... + if (signalLevel <= -Constants.MIN_SIGNALLEVEL) return; + accessPoint = new SeenAccessPoint(apMac, signalLevel); + addAccessPoint(client, accessPoint); + AccessPointNode apNode = nodeModel.findAccessPoint(apMac); + if (apNode == null) { + nodeModel.addNode(new AccessPointNode(apMac, nodeModel)); + apNode = nodeModel.findAccessPoint(apMac); + } + client.setSignalLevelForAcessPoint(apNode, signalLevel); + } else { + if (signalLevel > -Constants.MIN_SIGNALLEVEL) { + accessPoint.addSignalLevel(signalLevel); + } else { + accessPoint.addDeadSignal(); + } + if (accessPoint.isTotallyDead()) { + removeAccessPoint(client, accessPoint); + client.notSeesAccessPoint(nodeModel.findAccessPoint(apMac)); + } else { + updateAccessPoint(client, accessPoint); + client.setSignalLevelForAcessPoint(nodeModel.findAccessPoint(apMac), signalLevel); + } + } + } - if (accessPoint == null) { - // ein toter ap..... - if (signalLevel <= -Constants.MIN_SIGNALLEVEL) return; + public void updateScanResult(Acce... [truncated message content] |
From: <Jan...@us...> - 2007-02-14 15:48:45
|
Revision: 533 http://svn.sourceforge.net/magicmap/?rev=533&view=rev Author: Jan_fride Date: 2007-02-14 07:48:36 -0800 (Wed, 14 Feb 2007) Log Message: ----------- infoobjects Modified Paths: -------------- trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java Removed Paths: ------------- trunk/magicmapclient/src/net/sf/magicmap/client/model/node/InfoObjectNode.java trunk/magicmapclient/src/net/sf/magicmap/client/model/node/InfoObjectTag.java trunk/magicmapclient/src/net/sf/magicmap/client/model/node/SimpleInfoObject.java trunk/magicmapclient/test/net/sf/magicmap/client/model/info/InfoObjectBuilderTest.java Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java 2007-02-14 10:30:38 UTC (rev 532) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java 2007-02-14 15:48:36 UTC (rev 533) @@ -139,21 +139,21 @@ if (!showLocations) { return null; } - break; + //break; // TODO: InfonodeIcon in NodeIcons behandeln - case INodeModel.NODETYPE_INFO : - if (((InfoObjectNode) node).getDepiction() != null) { - ImageIcon icon; - try { - icon = new ImageIcon(new URL(((InfoObjectNode) node).getDepiction()), "<Depiction>"); - if (icon != null && icon.getIconHeight() > 0) { - return icon; - } - } catch (MalformedURLException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } +// case INodeModel.NODETYPE_INFO : +// if (((InfoObjectNode) node).getDepiction() != null) { +// ImageIcon icon; +// try { +// icon = new ImageIcon(new URL(((InfoObjectNode) node).getDepiction()), "<Depiction>"); +// if (icon != null && icon.getIconHeight() > 0) { +// return icon; +// } +// } catch (MalformedURLException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } break; } log.debug("Nodename: " + node.getClass().getSimpleName()); Deleted: trunk/magicmapclient/src/net/sf/magicmap/client/model/node/InfoObjectNode.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/node/InfoObjectNode.java 2007-02-14 10:30:38 UTC (rev 532) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/node/InfoObjectNode.java 2007-02-14 15:48:36 UTC (rev 533) @@ -1,190 +0,0 @@ -/** - * - */ - -package net.sf.magicmap.client.model.node; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Set; -import java.util.TreeSet; - -/** - * Wir nehmen ersteinmal NUR flickr dinger.... - * @author Johannes Zapotoczky (joh...@za...), Jan Friderici - * - */ -public class InfoObjectNode extends Node implements InfoObject { - - private String infoUrl; - private String serviceUrl; - private String infoType; - private String depiction; - private String description; - private String infoTitle; - - private transient boolean expanded; - private static Object service; - - private java.util.Set<InfoObjectTag> tags = new TreeSet<InfoObjectTag>(); - - private ArrayList neighbours = new ArrayList<InfoObjectNode>(); - - public static final InfoObjectNode EMPTY_INFO_NODE = new InfoObjectNode(null); - - public static final int UPDATE_TAG_ADDED = 23567; - public static final int UPDATE_TAG_CHANGED = InfoObjectNode.UPDATE_TAG_ADDED + 1; - public static final int UPDATE_TAG_DELETED = InfoObjectNode.UPDATE_TAG_ADDED + 2; - public static final int UPDATE_TAGS_CHANGED = InfoObjectNode.UPDATE_TAG_ADDED + 3; - - /** - * @param model - */ - public InfoObjectNode(INodeModel model) { - super(model); - this.expanded = false; - } - - public InfoObjectNode(INodeModel model, InfoObject info) { - super(model); - setName(info.getInfoUrl()); - this.expanded = false; - this.infoUrl = info.getInfoUrl(); - this.serviceUrl = info.getServiceUrl(); - this.infoType = info.getInfoType(); - this.depiction = info.getDepiction(); - this.description = info.getDepiction(); - this.infoTitle = info.getInfoTitle(); - setDisplayName(this.infoTitle); - setPhysical(false); - // Will call the update method in our model! - } - - /* (non-Javadoc) - * @see net.sf.magicmap.client.model.node.Node#getNeighbors() - */ - @Override - public ArrayList getNeighbors(){ - if (this.neighbours.size() == 0) { - - } - return this.neighbours; - } - - /* (non-Javadoc) - * @see net.sf.magicmap.client.model.node.Node#getType() - */ - @Override - public int getType(){ - return NodeModelConstants.NODETYPE_INFO; - } - - private void loadNeighbours(){ - - } - - public boolean isExpanded(){ - return this.expanded; - } - - public void setExpanded(boolean b) throws IOException{ - if (!this.expanded && b) explode(); - this.expanded = b; - - } - - public Set<InfoObjectTag> getTags(){ - return this.tags; - } - - public void addTag(InfoObjectTag tag){ - this.tags.add(tag); - getModel().updateNode(this, InfoObjectNode.UPDATE_TAG_ADDED, tag); - - } - - public Iterator<InfoObjectTag> iterator(){ - return this.tags.iterator(); - } - - protected void explode() throws IOException{ - try { - //Controller.getInstance().getInfoProviderRegistry().expandNode(this); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public String getDepiction(){ - return this.depiction; - } - - public void setDepiction(String depiction){ - this.depiction = depiction; - } - - public String getDescription(){ - return this.description; - } - - public void setDescription(String description){ - this.description = description; - } - - public String getInfoType(){ - return this.infoType; - } - - public void setInfoType(String infoType){ - this.infoType = infoType; - } - - public String getInfoUrl(){ - return this.infoUrl; - } - - public void setInfoUrl(String infoUrl){ - this.infoUrl = infoUrl; - } - - public ArrayList getNeighbours(){ - return this.neighbours; - } - - public void setNeighbours(ArrayList neighbours){ - this.neighbours = neighbours; - this.getModel().updateNode(this, NodeModelConstants.NODETYPE_INFO, neighbours); - } - - /** - * - * @param n - */ - public void addNeighbours(Node n){ - this.neighbours.add(n); - this.getModel().updateNode(this, NodeModelConstants.NODETYPE_INFO, n); - } - - public String getServiceUrl(){ - return this.serviceUrl; - } - - public void setServiceUrl(String serviceUrl){ - this.serviceUrl = serviceUrl; - } - - public void setTags(java.util.Set<InfoObjectTag> tags){ - this.tags = tags; - getModel().updateNode(this, InfoObjectNode.UPDATE_TAGS_CHANGED, tags); - } - - @Override - public String toString(){ - return super.toString() + " [depiction:" + getDepiction() + ", infoUrl" + this.infoUrl + "] "; - } - - public String getInfoTitle(){ - return this.infoTitle; - } -} Deleted: trunk/magicmapclient/src/net/sf/magicmap/client/model/node/InfoObjectTag.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/node/InfoObjectTag.java 2007-02-14 10:30:38 UTC (rev 532) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/node/InfoObjectTag.java 2007-02-14 15:48:36 UTC (rev 533) @@ -1,65 +0,0 @@ - -package net.sf.magicmap.client.model.node; - -/** - * Ein Tag beschreibt eine Eigenschaft eines Informationsobjektes. - * Tags sind immutable. - * - */ -public abstract class InfoObjectTag implements Comparable { - - /** - * Der Typ... obertyp/untertyp_1/.../untertype_n - */ - public final String type; - /** - * Der Wert, eine URL, ein Schlagwort etc. - */ - public final String value; - /** - * Eine Beschreibung. - */ - public final String description; - - public InfoObjectTag(String type, String value, String description) { - this.type = type; - this.value = value; - this.description = description; - - } - - public InfoObjectTag(String type, String value) { - this(type, value, value); - } - - /** - * Two tags are equal if their type and theri value are equal. - * @param other - * @return true if other is a tag and both value und type are equal. - */ - @Override - public boolean equals(Object other){ - if (other instanceof InfoObjectTag) { - InfoObjectTag otherTag = (InfoObjectTag) other; - return (type.equals(otherTag.type) && value.equals(otherTag.value)); - } else - return super.equals(other); - } - - /** - * - * @param other - * @return 0 if both value and type are equal. - */ - public int compareTo(Object other){ - if (other instanceof InfoObjectTag) { - InfoObjectTag otherTag = (InfoObjectTag) other; - int i = type.compareTo(otherTag.type); - if (i == 0) { - return (value.compareTo(otherTag.value)); - } else - return i; - } - return 0; - } -} Deleted: trunk/magicmapclient/src/net/sf/magicmap/client/model/node/SimpleInfoObject.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/node/SimpleInfoObject.java 2007-02-14 10:30:38 UTC (rev 532) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/node/SimpleInfoObject.java 2007-02-14 15:48:36 UTC (rev 533) @@ -1,93 +0,0 @@ - -package net.sf.magicmap.client.model.node; - -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; - -public class SimpleInfoObject implements InfoObject { - - private Set<InfoObjectTag> tags = new HashSet<InfoObjectTag>(); - private String depiction; - private String description; - private String title; - private String type; - private String url; - private String serviceUrl; - - public SimpleInfoObject() { - - } - - public void addTag(InfoObjectTag tag){ - tags.add(tag); - } - - public String getDepiction(){ - - return depiction; - } - - public String getDescription(){ - - return description; - } - - public String getInfoTitle(){ - - return title; - } - - public String getInfoType(){ - - return type; - } - - public String getInfoUrl(){ - - return url; - } - - public String getServiceUrl(){ - - return serviceUrl; - } - - public Set<InfoObjectTag> getTags(){ - - return tags; - } - - public Iterator<InfoObjectTag> iterator(){ - return tags.iterator(); - } - - public void setDepiction(String depiction){ - this.depiction = depiction; - } - - public void setDescription(String description){ - this.description = description; - } - - public void setServiceUrl(String serviceUrl){ - this.serviceUrl = serviceUrl; - } - - public void setTags(Set<InfoObjectTag> tags){ - this.tags = (tags); - } - - public void setTitle(String title){ - this.title = title; - } - - public void setType(String type){ - this.type = type; - } - - public void setUrl(String url){ - this.url = url; - } - -} Deleted: trunk/magicmapclient/test/net/sf/magicmap/client/model/info/InfoObjectBuilderTest.java =================================================================== --- trunk/magicmapclient/test/net/sf/magicmap/client/model/info/InfoObjectBuilderTest.java 2007-02-14 10:30:38 UTC (rev 532) +++ trunk/magicmapclient/test/net/sf/magicmap/client/model/info/InfoObjectBuilderTest.java 2007-02-14 15:48:36 UTC (rev 533) @@ -1,63 +0,0 @@ -package net.sf.magicmap.client.model.info; - -/** - * Created by IntelliJ IDEA. - * User: jan - * Date: 24.09.2006 - * Time: 15:30:20 - * To change this template use File | Settings | File Templates. - */ - -import junit.framework.*; -//import net.sf.magicmap.client.model.info.InfoObjectBuilder; -import net.sf.magicmap.client.model.node.InfoObject; -import net.sf.magicmap.client.model.node.InfoObjectTag; -import net.sf.magicmap.client.model.node.SimpleInfoObject; - -import java.net.URL; -import java.net.MalformedURLException; - -public class InfoObjectBuilderTest extends TestCase { -// InfoObjectBuilder infoObjectBuilder; - - /** - * Testet ob die Suche mit Google funktioniert. - * - * @throws Exception - */ - public void testCheckLinks() throws Exception { - //URL url = new URL("http://www.google.de/search?hl=de&q=related%3Ahttp%3A%2F%2Fwww.golem.de%2F&btnG=Suche&meta="); - URL url = new URL("http://www.golem.de"); -// infoObjectBuilder = new InfoObjectBuilder(); - InfoObject o = new SimpleInfoObject(); - //InfoObject o =infoObjectBuilder.buildNode(url); -// infoObjectBuilder.checkLinks(o,url); - assertTrue("Keine Related sites!", o.getTags().size() > 0); - for (InfoObjectTag infoObjectTag : o) { - assertNotNull("Wert darf nicht null sein", infoObjectTag.value); - assertNotNull("Typ darf nicht null sein", infoObjectTag.type); - - try { - URL relatedUrl = new URL(infoObjectTag.value); - } catch (MalformedURLException e) { - fail("Url nicht g\xFCltig: '" + infoObjectTag.value + "'"); - } - - System.out.println("Value: " + infoObjectTag.value); - } - assertNotNull(o); - } - - /** - * - * @throws Exception - */ - public void testBuildNode() throws Exception{ - URL url = new URL("http://www.golem.de"); -// infoObjectBuilder = new InfoObjectBuilder(); -// InfoObject infoObject = infoObjectBuilder.buildNode(url); -// assertNotNull("Infoobjekt null:", infoObject); -// assertEquals(infoObject.getInfoType(), "text/html"); -// assertEquals(infoObject.getInfoTitle(), "Golem.de: IT-News f\xFCr Profis"); - } -} \ 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...> - 2007-02-16 12:39:27
|
Revision: 537 http://svn.sourceforge.net/magicmap/?rev=537&view=rev Author: jan_fride Date: 2007-02-16 04:39:13 -0800 (Fri, 16 Feb 2007) Log Message: ----------- made OutlineModel accessable through OutlineView Modified Paths: -------------- trunk/magicmapclient/plugins/udpplugin-plugin.jar trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineView.java trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java trunk/magicmapclient/src/net/sf/magicmap/client/model/outline/OutlineModel.java Modified: trunk/magicmapclient/plugins/udpplugin-plugin.jar =================================================================== (Binary files differ) Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineView.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineView.java 2007-02-16 10:37:27 UTC (rev 536) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineView.java 2007-02-16 12:39:13 UTC (rev 537) @@ -79,7 +79,6 @@ return panel; } - public void selectionChanged(NodeModelSelectionEvent selectEvent){ Node selectedNode = selectEvent.getSelectedNode(); if (selectedNode != Node.EMPTY_NODE) tree.setSelectionPath(getOutlineNodePath(selectedNode)); @@ -227,4 +226,8 @@ public void collapseRPs(boolean b){ collapseCategory(NodeModelConstants.NODETYPE_LOCATION, b); } + + public OutlineModel getOutlineModel(){ + return this.outlineModel; + } } \ No newline at end of file Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java 2007-02-16 10:37:27 UTC (rev 536) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java 2007-02-16 12:39:13 UTC (rev 537) @@ -96,7 +96,7 @@ } /** - * + * * @return */ public NodeMetricManager getMetricManager() { @@ -159,14 +159,15 @@ * F\xFCgt einen neuen Knoten ein. */ public void insertNode(Node node){ - Vertex v = null; int type = node.getType(); - // TODO das hier ist wahrlich haesslich.... + if (node.getClass().equals(MapNode.class)) return; - if (type == NodeModelConstants.NODETYPE_CLIENT || type == NodeModelConstants.NODETYPE_LOCATION - || type == NodeModelConstants.NODETYPE_ACCESSPOINT || type == NodeModelConstants.NODETYPE_GEOPOS - || type == NodeModelConstants.NODETYPE_INFO || type == NodeModelConstants.NODETYPE_RFID_ANTENNA) - v = addVertex(node); +// if (type == NodeModelConstants.NODETYPE_CLIENT || type == NodeModelConstants.NODETYPE_LOCATION +// || type == NodeModelConstants.NODETYPE_ACCESSPOINT || type == NodeModelConstants.NODETYPE_GEOPOS +// || type == NodeModelConstants.NODETYPE_INFO || type == NodeModelConstants.NODETYPE_RFID_ANTENNA) +// + Vertex v = addVertex(node); + if (v != null) if (node.isFix()) this.layout.setFix(v); else Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/outline/OutlineModel.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/outline/OutlineModel.java 2007-02-16 10:37:27 UTC (rev 536) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/outline/OutlineModel.java 2007-02-16 12:39:13 UTC (rev 537) @@ -15,7 +15,7 @@ /** * A TreeModel for the NodeModel. - * + * * @author Jan * */ @@ -27,7 +27,7 @@ private final Map<Node, OutlineTreeNode> nodes; /** - * + * * @param nodeModel */ public OutlineModel(INodeModel nodeModel) { @@ -42,10 +42,9 @@ addCategory(NodeModelConstants.NODETYPE_CLIENT, GUIUtils.i18n("clients")); addCategory(NodeModelConstants.NODETYPE_LOCATION, GUIUtils.i18n("locations")); addCategory(NodeModelConstants.NODETYPE_GEOPOS, GUIUtils.i18n("Geokoordinaten")); - addCategory(NodeModelConstants.NODETYPE_INFO, GUIUtils.i18n("Infoobjekte")); + //addCategory(NodeModelConstants.NODETYPE_INFO, GUIUtils.i18n("Infoobjekte")); nodeModel.addNodeModelListener(this); - } public OutlineTreeNode getCategoryNode(int category){ @@ -53,20 +52,21 @@ } /** - * + * * @param category * @param title */ public void addCategory(int category, String title){ if (this.categories.containsKey(category)) return; OutlineTreeNode outlineTreeNode = new OutlineTreeNode(title); - this.rootNode.add(outlineTreeNode); + this.categories.put(category, outlineTreeNode); + this.insertNodeInto(outlineTreeNode, rootNode, 0); } /** - * + * */ public void nodeAddedEvent(Node node){ OutlineTreeNode parent = this.categories.get(node.getType()); @@ -87,7 +87,7 @@ } /** - * + * */ public void nodeUpdatedEvent(Node node, int type, Object data){ if (type == NodeModelConstants.UPDATE_CLEAR) { @@ -101,7 +101,7 @@ /** * Find OutlineNode for given Node and root OutlineNode * @param node - the Node to find - * @return the OutlineNode if exists, else null + * @return the OutlineNode if exists, else null */ public OutlineTreeNode findOutlineNode(Node node){ if (this.nodes.containsKey(node)) return this.nodes.get(node); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fle...@us...> - 2007-02-24 02:03:32
|
Revision: 564 http://svn.sourceforge.net/magicmap/?rev=564&view=rev Author: flederohr Date: 2007-02-23 18:03:29 -0800 (Fri, 23 Feb 2007) Log Message: ----------- changed Handling of NodeIcons 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/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 Removed Paths: ------------- trunk/magicmapclient/res/icons.properties trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/NodeIcons.java Deleted: trunk/magicmapclient/res/icons.properties =================================================================== --- trunk/magicmapclient/res/icons.properties 2007-02-24 01:53:49 UTC (rev 563) +++ trunk/magicmapclient/res/icons.properties 2007-02-24 02:03:29 UTC (rev 564) @@ -1,39 +0,0 @@ -#################################################################### -# # -# This file stores the combination between magicmap nodetypes and # -# theirs visualisation. By adding a new node class to the magicmap # -# nodemodell it would displayed with a default symbol in the GUI. # -# If you wish, that it should use it's own symbol, you have to # -# make an entry to this resource file: # -# # -# <name of your node class> = <path to your icon image> # -# # -# Symbolnames for fixed nodes are created by the class name # -# followed by the word 'Anchor': # -# # -# <name of your node class>Anchor = <path to your icon image> # -# # -# The images must be placed in the resource folder: # -# # -# 'toolBarButtonGraphics' # -# # -#################################################################### - - -Node = custom/default.png -AccessPointNode = custom/accesspoint.png -ClientNode = custom/client.png -GeoPosNode = custom/geopos.png -InfoObjectNode = custom/info.png -LocationNode = custom/location.png -MapNode = custom/image.png - -NodeAnchor = custom/default.png -AccessPointNodeAnchor = custom/accesspoint_anchor.png -AccessPointNodeHidden = custom/accesspoint_hidden.png -AccessPointNodeHiddenAnchor = custom/accesspoint_hidden_anchor.png -ClientNodeAnchor = custom/client_anchor.png -LocationNodeAnchor = custom/location_anchor.png -LocationNodeRescan = custom/location_rescan.png -GeoPosNodeAnchor = custom/geopos.png -InfoObjectNodeAnchor = custom/info.png \ No newline at end of file Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java 2007-02-24 01:53:49 UTC (rev 563) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java 2007-02-24 02:03:29 UTC (rev 564) @@ -35,10 +35,16 @@ import net.sf.magicmap.client.gui.dialogs.NewMapDialog; import net.sf.magicmap.client.gui.dialogs.SetProxyDialog; import net.sf.magicmap.client.gui.dialogs.ViewOptionsDialog; +import net.sf.magicmap.client.gui.utils.AccessPointNodeIcon; +import net.sf.magicmap.client.gui.utils.ClientNodeIcon; 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.GeoPosNodeIcon; +import net.sf.magicmap.client.gui.utils.LocationNodeIcon; import net.sf.magicmap.client.gui.utils.MagicAction; +import net.sf.magicmap.client.gui.utils.MapNodeIcon; +import net.sf.magicmap.client.gui.utils.NodeIcons; import net.sf.magicmap.client.gui.views.ConsoleView; import net.sf.magicmap.client.gui.views.MapView; import net.sf.magicmap.client.gui.views.MeasurementView; @@ -69,6 +75,7 @@ /** * The main GUI window * @author thuebner + * @author Florian Lederer */ @SuppressWarnings({"JavadocReference"}) public class MainGUI extends JFrame @@ -122,6 +129,7 @@ private MagicAction expertView; private MagicAction userDefinedView; private INodeSelectionModel nodeSelectionModel; + private NodeIcons nodeIcons; private static final int numberOfdataInvocationRateAction = 10; private MagicAction[] dataInvocationRateAction; @@ -134,7 +142,15 @@ // 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()); + // Aktionen erstellen buildActions(); @@ -574,7 +590,7 @@ */ public JComponent buildMainPane(){ buildViews(); - + UIFSplitPane pane2; this.bottomRightTabPanel = new ViewTabPanel(); @@ -687,7 +703,7 @@ nodeSelectionModel.addNodeModelSelectionListener(mapView); nodeSelectionModel.addNodeModelSelectionListener(measurementView); nodeSelectionModel.addNodeModelSelectionListener(measurementView.getMeasurementTable().getModel()); - + viewMap.put("outlineView", outlineView); viewMap.put("consoleView", consoleView); viewMap.put("mapView", mapView); @@ -898,4 +914,9 @@ public INodeSelectionModel getNodeSelectionModel(){ return nodeSelectionModel; } + + + public NodeIcons getNodeIcons(){ + return nodeIcons; + } } Added: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/AccessPointNodeIcon.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/AccessPointNodeIcon.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/AccessPointNodeIcon.java 2007-02-24 02:03:29 UTC (rev 564) @@ -0,0 +1,100 @@ + +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.gui.MainGUI; +import net.sf.magicmap.client.gui.views.MapView; +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; + } +} Added: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/ClientNodeIcon.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/ClientNodeIcon.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/ClientNodeIcon.java 2007-02-24 02:03:29 UTC (rev 564) @@ -0,0 +1,68 @@ + +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.gui.MainGUI; +import net.sf.magicmap.client.gui.views.MapView; +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; + } + +} Added: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/GeoPosNodeIcon.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/GeoPosNodeIcon.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/GeoPosNodeIcon.java 2007-02-24 02:03:29 UTC (rev 564) @@ -0,0 +1,51 @@ +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; + } + +} Added: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/INodeIcon.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/INodeIcon.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/INodeIcon.java 2007-02-24 02:03:29 UTC (rev 564) @@ -0,0 +1,23 @@ +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); +} Added: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/LocationNodeIcon.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/LocationNodeIcon.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/LocationNodeIcon.java 2007-02-24 02:03:29 UTC (rev 564) @@ -0,0 +1,78 @@ + +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.gui.MainGUI; +import net.sf.magicmap.client.gui.views.MapView; +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 getLocationFixed(){ + if (locationFixed == null) { + final ImageIcon anchor = GUIBuilder.getToolIcon("anchor_white.png", "NodeIcons"); + locationFixed = new ImageIcon(getLocation().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 locationFixed; + } + + 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 { + if (node.isFix()) + return getLocationFixed(); + else + return getLocation(); + } + } + + public Class getNodeClass(){ + return LocationNode.class; + } + + public int getNodeType(){ + return INodeModel.NODETYPE_LOCATION; + } +} Added: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/MapNodeIcon.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/MapNodeIcon.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/MapNodeIcon.java 2007-02-24 02:03:29 UTC (rev 564) @@ -0,0 +1,45 @@ + +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 2007-02-24 01:53:49 UTC (rev 563) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/NodeIcons.java 2007-02-24 02:03:29 UTC (rev 564) @@ -1,101 +0,0 @@ - -package net.sf.magicmap.client.gui.utils; - -import java.util.Collections; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.Map; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -import javax.swing.Icon; - -import net.sf.magicmap.client.model.node.AccessPointNode; -import net.sf.magicmap.client.model.node.Node; - -import org.apache.log4j.Logger; - -public class NodeIcons { - - private static NodeIcons ni = null; - - private static final String RESOURCE = "icons"; - - private static ResourceBundle iconBundle; - - private static Map<String, Icon> icons; - - private static Logger log = Logger.getLogger(NodeIcons.class); - - // TODO better use a default Icon object - private static final String DEFAULT_ICON = "Node"; - - private static final String ANCHOR = "Anchor"; - - private static final String RESCAN = "Rescan"; - - private static final String HIDDEN = "Hidden"; - - private final Map<Class, NodeIcon> iconMap = new HashMap<Class, NodeIcon>(); - - private NodeIcons() { - init(); - } - - public static Icon getIconForNode(Node node){ - String name = node.getClass().getSimpleName(); - if (node instanceof AccessPointNode && ((AccessPointNode) node).isHidden()) { - if (node.isFix()) return NodeIcons.getIconIntern(name + NodeIcons.HIDDEN + NodeIcons.ANCHOR); - return NodeIcons.getIconIntern(name + NodeIcons.HIDDEN); - } - if (node.isUpdate()) return NodeIcons.getIconIntern(name + NodeIcons.RESCAN); - if (node.isFix()) return NodeIcons.getIconIntern(name + NodeIcons.ANCHOR); - return NodeIcons.getIconIntern(name); - } - - private static Icon getIconIntern(String name){ - Icon i = NodeIcons.icons.get(name); - if (i != null) - return i; - else { - //NodeIcons.log.warn("No icon found for: " + name); - return NodeIcons.icons.get(NodeIcons.DEFAULT_ICON); - } - } - - private void init(){ - - NodeIcons.icons = Collections.synchronizedMap(new HashMap<String, Icon>()); - - try { - NodeIcons.iconBundle = ResourceBundle.getBundle(NodeIcons.RESOURCE, GUIUtils.getLocale()); - NodeIcons.log.info("Bundle loaded!"); - } catch (MissingResourceException e) { - NodeIcons.log.error("Missing Bundle: " + NodeIcons.RESOURCE); - return; - } - Enumeration en = NodeIcons.iconBundle.getKeys(); - while (en.hasMoreElements()) { - String key = en.nextElement().toString(); - NodeIcons.log.info(key + " " + NodeIcons.iconBundle.getObject(key).toString()); - Icon i = GUIBuilder.getToolIcon(NodeIcons.iconBundle.getObject(key).toString()); - if (i == null) - NodeIcons.log.error("Icon for " + key + " not created!"); - else - NodeIcons.icons.put(key, i); - } - } - - public static NodeIcons getInstance(){ - if (NodeIcons.ni == null) NodeIcons.ni = new NodeIcons(); - return NodeIcons.ni; - } - - public NodeIcon getNodeIcon(Node node){ - return iconMap.get(node.getClass()); - } - public void registerNodeIcon(NodeIcon icon){ - iconMap.put(icon.getNodeClass(), icon); - } - -} Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java 2007-02-24 01:53:49 UTC (rev 563) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java 2007-02-24 02:03:29 UTC (rev 564) @@ -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.NodeIcon; +import net.sf.magicmap.client.gui.utils.INodeIcon; import net.sf.magicmap.client.gui.utils.NodeIcons; import net.sf.magicmap.client.meta.MapInfo; import net.sf.magicmap.client.model.location.INodePlacer; @@ -105,8 +105,6 @@ private static Logger log = Logger.getLogger(NodeIcons.class); - private static NodeIcons ni; - // @TODO TEST LAYOUT! JungNodePlacer layoutModel; @@ -119,7 +117,6 @@ this.setFrameIcon(GUIBuilder.getToolIcon(GUIConstants.ICON_MAP)); - ni = NodeIcons.getInstance(); initializeGraph(); } @@ -137,101 +134,6 @@ graphdraw.getVisualizationViewer().suspend(); } - public Icon getIconForNode(Node node){ - if (node == null) return null; - switch (node.getType()) { - case INodeModel.NODETYPE_CLIENT : - if (!showClients) { - return null; - } - break; - case INodeModel.NODETYPE_ACCESSPOINT : - if (!showAccessPoints) { - return null; - } - break; - case INodeModel.NODETYPE_LOCATION : - if (!showLocations) { - return null; - } - //break; - // TODO: InfonodeIcon in NodeIcons behandeln - // case INodeModel.NODETYPE_INFO : - // if (((InfoObjectNode) node).getDepiction() != null) { - // ImageIcon icon; - // try { - // icon = new ImageIcon(new URL(((InfoObjectNode) node).getDepiction()), "<Depiction>"); - // if (icon != null && icon.getIconHeight() > 0) { - // return icon; - // } - // } catch (MalformedURLException e) { - // // TODO Auto-generated catch block - // e.printStackTrace(); - // } - // } - break; - } - log.debug("Nodename: " + node.getClass().getSimpleName()); - final NodeIcon nodeIcon = NodeIcons.getInstance().getNodeIcon(node); - if (nodeIcon != null) return nodeIcon.getIcon(node); - return ni.getIconForNode(node); - } - - public Color getFgColorForNode(Node node){ - if (node == null) return null; - switch (node.getType()) { - case INodeModel.NODETYPE_CLIENT : - if (!showClients) { - return null; - } - return Color.BLACK; - case INodeModel.NODETYPE_ACCESSPOINT : - if (!showAccessPoints) { - return null; - } - return Color.BLACK; - case INodeModel.NODETYPE_LOCATION : - if (!showLocations) { - return null; - } - return Color.BLACK; - default : - return Color.BLACK; - } - } - - public Color getBgColorForNode(Node node){ - if (node == null) return null; - switch (node.getType()) { - case INodeModel.NODETYPE_CLIENT : - if (!showClients) { - return null; - } - if (node.isFix()) - return Color.BLACK; - else - return Color.BLACK; - case INodeModel.NODETYPE_ACCESSPOINT : - if (!showAccessPoints) { - return null; - } - if (node.isFix()) - return Color.BLACK; - else - return Color.BLACK; - case INodeModel.NODETYPE_LOCATION : - if (!showLocations) { - return null; - } - if (node.isFix()) - return Color.BLACK; - else - return Color.BLACK; - default : - return Color.BLACK; - } - } - public void resumeGraph(){ graphdraw.getVisualizationViewer().unsuspend(); } @@ -295,17 +197,50 @@ public Color getForeColor(Vertex v){ Node node = findNode(v); - return getFgColorForNode(node); + switch (node.getType()) { + case INodeModel.NODETYPE_CLIENT : + if (!showClients) return null; + break; + case INodeModel.NODETYPE_ACCESSPOINT : + if (!showAccessPoints) return null; + break; + case INodeModel.NODETYPE_LOCATION : + if (!showLocations) return null; + break; + } + return MainGUI.getInstance().getNodeIcons().getNodeIcon(node).getFgColor(node); } public Color getBackColor(Vertex v){ Node node = findNode(v); - return getBgColorForNode(node); + switch (node.getType()) { + case INodeModel.NODETYPE_CLIENT : + if (!showClients) return null; + break; + case INodeModel.NODETYPE_ACCESSPOINT : + if (!showAccessPoints) return null; + break; + case INodeModel.NODETYPE_LOCATION : + if (!showLocations) return null; + break; + } + return MainGUI.getInstance().getNodeIcons().getNodeIcon(node).getBgColor(node); } public Icon getIcon(Vertex v){ Node node = findNode(v); - return getIconForNode(node); + switch (node.getType()) { + case INodeModel.NODETYPE_CLIENT : + if (!showClients) return null; + break; + case INodeModel.NODETYPE_ACCESSPOINT : + if (!showAccessPoints) return null; + break; + case INodeModel.NODETYPE_LOCATION : + if (!showLocations) return null; + break; + } + return MainGUI.getInstance().getNodeIcons().getNodeIcon(node).getIcon(node); } }); @@ -571,7 +506,7 @@ * @see edu.uci.ics.jung.graph.event.VertexListener#vertexSelected(edu.uci.ics.jung.graph.Vertex) */ public void vertexSelected(Vertex v){ - INodeSelectionModel nodeSelectionModel = MainGUI.getInstance().getNodeSelectionModel(); + INodeSelectionModel nodeSelectionModel = MainGUI.getInstance().getNodeSelectionModel(); if (v == null) { nodeSelectionModel.selectNode(Node.EMPTY_NODE); } else { Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineTree.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineTree.java 2007-02-24 01:53:49 UTC (rev 563) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineTree.java 2007-02-24 02:03:29 UTC (rev 564) @@ -23,6 +23,7 @@ * @author Jan Friderici * @author thuebner * @author Johannes Zapotoczky (joh...@za...) + * @author Florian Lederer * @see OutlineModel */ public class OutlineTree extends JTree { @@ -87,7 +88,7 @@ } else { c = (JLabel) super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); c.setText(node.getDisplayName()); - Icon icon = ((MapView) MainGUI.getInstance().getViewComponent("mapView")).getIconForNode(node); + Icon icon = MainGUI.getInstance().getNodeIcons().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...> - 2007-02-25 22:21:38
|
Revision: 578 http://svn.sourceforge.net/magicmap/?rev=578&view=rev Author: flederohr Date: 2007-02-25 14:21:37 -0800 (Sun, 25 Feb 2007) Log Message: ----------- removed old splash-image and moved new one to resource directory Modified Paths: -------------- trunk/magicmapclient/src/net/sf/magicmap/client/core/MagicMapApplication.java Added Paths: ----------- trunk/magicmapclient/res/magicmap-splash.png Removed Paths: ------------- trunk/magicmapclient/magicmap-splash.png trunk/magicmapclient/res/magicmap-splash_src.png Deleted: trunk/magicmapclient/magicmap-splash.png =================================================================== (Binary files differ) Added: trunk/magicmapclient/res/magicmap-splash.png =================================================================== (Binary files differ) Property changes on: trunk/magicmapclient/res/magicmap-splash.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Deleted: trunk/magicmapclient/res/magicmap-splash_src.png =================================================================== (Binary files differ) Modified: trunk/magicmapclient/src/net/sf/magicmap/client/core/MagicMapApplication.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/core/MagicMapApplication.java 2007-02-25 22:18:47 UTC (rev 577) +++ trunk/magicmapclient/src/net/sf/magicmap/client/core/MagicMapApplication.java 2007-02-25 22:21:37 UTC (rev 578) @@ -30,7 +30,7 @@ JWindow splashScreen = new JWindow(); - JLabel splashLabel = new JLabel(new ImageIcon("magicmap-splash.png")) { + JLabel splashLabel = new JLabel(new ImageIcon(MagicMapApplication.class.getClassLoader().getResource("magicmap-splash.png"))) { private static final long serialVersionUID = 5735447445835224982L; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fle...@us...> - 2007-03-01 19:02:45
|
Revision: 588 http://svn.sourceforge.net/magicmap/?rev=588&view=rev Author: flederohr Date: 2007-03-01 11:02:36 -0800 (Thu, 01 Mar 2007) Log Message: ----------- moved graphics in seperate folder fixing issue of resourceloading deleted unused graphics Modified Paths: -------------- trunk/magicmapclient/src/net/sf/magicmap/client/core/MagicMapApplication.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainFrame.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/AboutDialog.java Added Paths: ----------- trunk/magicmapclient/res/magicmapGraphics/ trunk/magicmapclient/res/magicmapGraphics/MagicMap.png trunk/magicmapclient/res/magicmapGraphics/magicmap-splash.png Removed Paths: ------------- trunk/magicmapclient/res/MagicMap.png trunk/magicmapclient/res/MagicMapLogo.gif trunk/magicmapclient/res/magicmap-splash.png trunk/magicmapclient/res/magicmap_header.png Deleted: trunk/magicmapclient/res/MagicMap.png =================================================================== (Binary files differ) Deleted: trunk/magicmapclient/res/MagicMapLogo.gif =================================================================== (Binary files differ) Deleted: trunk/magicmapclient/res/magicmap-splash.png =================================================================== (Binary files differ) Added: trunk/magicmapclient/res/magicmapGraphics/MagicMap.png =================================================================== (Binary files differ) Property changes on: trunk/magicmapclient/res/magicmapGraphics/MagicMap.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/magicmapclient/res/magicmapGraphics/magicmap-splash.png =================================================================== (Binary files differ) Property changes on: trunk/magicmapclient/res/magicmapGraphics/magicmap-splash.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Deleted: trunk/magicmapclient/res/magicmap_header.png =================================================================== (Binary files differ) Modified: trunk/magicmapclient/src/net/sf/magicmap/client/core/MagicMapApplication.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/core/MagicMapApplication.java 2007-03-01 18:25:55 UTC (rev 587) +++ trunk/magicmapclient/src/net/sf/magicmap/client/core/MagicMapApplication.java 2007-03-01 19:02:36 UTC (rev 588) @@ -7,13 +7,13 @@ import java.awt.Toolkit; import java.util.Locale; -import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JWindow; import net.sf.magicmap.client.controller.Controller; import net.sf.magicmap.client.gui.MainGUI; +import net.sf.magicmap.client.gui.utils.GUIBuilder; import net.sf.magicmap.client.gui.utils.GUIUtils; import net.sf.magicmap.client.utils.Settings; import net.sf.magicmap.client.utils.Version; @@ -30,7 +30,7 @@ JWindow splashScreen = new JWindow(); - JLabel splashLabel = new JLabel(new ImageIcon(MagicMapApplication.class.getClassLoader().getResource("magicmap-splash.png"))) { + JLabel splashLabel = new JLabel(GUIBuilder.getToolIcon("magicmap-splash.png", "magicmapGraphics")) { private static final long serialVersionUID = 5735447445835224982L; @@ -56,14 +56,14 @@ GUIUtils.setPlasticLookAndFeel(); GUIUtils.setLocale(Locale.getDefault()); - + JFrame frame = MainGUI.getInstance().getMainFrame(); GUIUtils.locateOnScreen(frame); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // plugins laden. Controller.getInstance().initializePlugins(); - + splashScreen.setVisible(false); splashScreen.dispose(); Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainFrame.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainFrame.java 2007-03-01 18:25:55 UTC (rev 587) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainFrame.java 2007-03-01 19:02:36 UTC (rev 588) @@ -5,16 +5,13 @@ import java.awt.Cursor; import java.awt.Dimension; import java.awt.HeadlessException; -import java.awt.Image; import java.awt.event.ActionEvent; -import java.awt.image.VolatileImage; import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; import java.rmi.RemoteException; import javax.swing.AbstractAction; -import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JFrame; @@ -58,50 +55,50 @@ import com.brunchboy.util.swing.relativelayout.RelativeLayout; import com.jgoodies.uif_lite.component.UIFSplitPane; -public class MainFrame extends JFrame -implements -ServerConnectCallback, -ServerDisconnectCallback, -CreateNewMapCallback, -MapNamesCallback, -LoadMapDialogListener { +public class MainFrame extends JFrame + implements + ServerConnectCallback, + ServerDisconnectCallback, + CreateNewMapCallback, + MapNamesCallback, + LoadMapDialogListener { /** * serial version id */ - private static final long serialVersionUID = -3842976532877305041L; - private JMenuBar menuBar; - private JToolBar toolBar; - private StatusPanel statusBar; - private MapPanel mapPanel; - private OutlineView outlineView; - private ConsoleView consoleView; - private MapView mapView; - private MeasurementView measurementView; - private ViewTabPanel bottomRightTabPanel; - private RelativeLayout layout; - private AbstractAction connectAction; - private AbstractAction setProxyAction; - private AbstractAction disconnectAction; - private AbstractAction newMapAction; - private AbstractAction loadMapAction; - private AbstractAction exitAction; - private AbstractAction aboutAction; - private AbstractAction onlineHelp; - private MagicAction invisibleAction; - private MagicAction simpleView; - private MagicAction normalView; - private MagicAction expertView; - private MagicAction userDefinedView; - private static final int numberOfdataInvocationRateAction = 10; - private MagicAction[] dataInvocationRateAction; - + private static final long serialVersionUID = -3842976532877305041L; + private JMenuBar menuBar; + private JToolBar toolBar; + private StatusPanel statusBar; + private MapPanel mapPanel; + private OutlineView outlineView; + private ConsoleView consoleView; + private MapView mapView; + private MeasurementView measurementView; + private ViewTabPanel bottomRightTabPanel; + private RelativeLayout layout; + private AbstractAction connectAction; + private AbstractAction setProxyAction; + private AbstractAction disconnectAction; + private AbstractAction newMapAction; + private AbstractAction loadMapAction; + private AbstractAction exitAction; + private AbstractAction aboutAction; + private AbstractAction onlineHelp; + private MagicAction invisibleAction; + private MagicAction simpleView; + private MagicAction normalView; + private MagicAction expertView; + private MagicAction userDefinedView; + private static final int numberOfdataInvocationRateAction = 10; + private MagicAction[] dataInvocationRateAction; + public MainFrame() throws HeadlessException { super(); // Aktionen erstellen buildActions(); - + // Layout vorbereiten this.layout = new RelativeLayout(); Container pane = this.getContentPane(); @@ -110,7 +107,7 @@ // Hauptfenstereigenschaften setzen this.setSize(new Dimension(1024, 768)); this.setTitle("MagicMap - Version " + Version.getVersion()); - this.setIconImage(new ImageIcon(this.getClass().getClassLoader().getResource("MagicMap.png")).getImage()); + this.setIconImage(GUIBuilder.getToolIcon("MagicMap.png", "magicmapGraphics").getImage()); //Menu erstellen this.menuBar = new JMenuBar(); @@ -166,7 +163,7 @@ AttributeType.BOTTOM, GUIConstants.DIVIDER_SIZE)); } - + /** * Build the main panel * @return the main panel @@ -191,7 +188,7 @@ pane2.setDividerLocation(1.0); return pane; } - + /** * Build the file menu * @return the file menu @@ -292,7 +289,7 @@ .getInstance().getNodeModel(), "measurementView"); this.mapPanel = new MapPanel("mapPanel"); this.mapPanel.setMapView(this.mapView); - } + } /** * Add buttons to main toolbar @@ -314,7 +311,7 @@ // bar.addSeparator(); } - + /* (non-Javadoc) * @see net.sf.magicmap.client.interfaces.ServerConnectCallback#connected(long) */ @@ -439,7 +436,6 @@ Controller.getInstance().connect(this); } - /** * Action builder for the action of the GUI * @@ -613,7 +609,6 @@ } }; - this.simpleView = new MagicAction("simpleview") { /** Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/AboutDialog.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/AboutDialog.java 2007-03-01 18:25:55 UTC (rev 587) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/AboutDialog.java 2007-03-01 19:02:36 UTC (rev 588) @@ -7,13 +7,13 @@ import java.awt.event.ActionListener; import java.io.IOException; -import javax.swing.ImageIcon; import javax.swing.JDialog; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.event.HyperlinkEvent; import javax.swing.event.HyperlinkListener; +import net.sf.magicmap.client.gui.utils.GUIBuilder; import net.sf.magicmap.client.gui.utils.GUIUtils; import net.sf.magicmap.client.utils.Version; @@ -37,7 +37,7 @@ private AboutDialog(Frame owner) { super(owner, GUIUtils.filterMnemonic(GUIUtils.i18n("about"))); - JLabel splashLabel = new JLabel(new ImageIcon("magicmap-splash.png")) { + JLabel splashLabel = new JLabel(GUIBuilder.getToolIcon("magicmap-splash.png", "magicmapGraphics")) { private static final long serialVersionUID = 5735447445835224982L; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fle...@us...> - 2007-03-07 23:37:58
|
Revision: 595 http://svn.sourceforge.net/magicmap/?rev=595&view=rev Author: flederohr Date: 2007-03-07 15:37:34 -0800 (Wed, 07 Mar 2007) Log Message: ----------- header and uninstall-icon for the installer Modified Paths: -------------- trunk/magicmapclient/MagicMapSetup.nsi Added Paths: ----------- trunk/magicmapclient/MagicMap_InstallHeader.bmp trunk/magicmapclient/MagicMap_Uninst.ico Modified: trunk/magicmapclient/MagicMapSetup.nsi =================================================================== --- trunk/magicmapclient/MagicMapSetup.nsi 2007-03-04 17:28:09 UTC (rev 594) +++ trunk/magicmapclient/MagicMapSetup.nsi 2007-03-07 23:37:34 UTC (rev 595) @@ -36,8 +36,11 @@ ;Interface Settings !define MUI_HEADERIMAGE - !define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\win.bmp" ; optional + !define MUI_HEADERIMAGE_BITMAP "MagicMap_InstallHeader.bmp" + !define MUI_ICON "MagicMap.ico" + !define MUI_UNICON "MagicMap_Uninst.ico" !define MUI_ABORTWARNING + ;-------------------------------- ;Pages @@ -78,7 +81,6 @@ ;ADD YOUR OWN FILES HERE... File LICENSE.txt File magicmap.jar - File magicmap-splash.png File MagicMap.ico File /r /x .svn lib File /oname=lib\magicmap-server.jar "..\magicmapserver\dist\magicmap-server.jar" @@ -140,7 +142,6 @@ Delete "$INSTDIR\lib\*.*" Delete "$INSTDIR\MagicMap.ico" Delete "$INSTDIR\magicmap.jar" - Delete "$INSTDIR\magicmap-splash.png" ; Delete "$INSTDIR\start.bat" ; Delete "$INSTDIR\start_nightly.bat" Delete "$INSTDIR\LICENSE.txt" Added: trunk/magicmapclient/MagicMap_InstallHeader.bmp =================================================================== (Binary files differ) Property changes on: trunk/magicmapclient/MagicMap_InstallHeader.bmp ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/magicmapclient/MagicMap_Uninst.ico =================================================================== (Binary files differ) Property changes on: trunk/magicmapclient/MagicMap_Uninst.ico ___________________________________________________________________ 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. |
From: <fle...@us...> - 2007-03-09 15:00:39
|
Revision: 598 http://svn.sourceforge.net/magicmap/?rev=598&view=rev Author: flederohr Date: 2007-03-09 07:00:34 -0800 (Fri, 09 Mar 2007) Log Message: ----------- moved MeasurementModelClass to AccesssPoinSeerNode as inner class modified MeasurementTable, make it possible to register TableModels for custom Nodes updated udpplugin 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/controller/PollHandler.java trunk/magicmapclient/src/net/sf/magicmap/client/controller/ServerManager.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainFrame.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MeasurementTable.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MeasurementView.java trunk/magicmapclient/src/net/sf/magicmap/client/model/measurement/IMeasurementModel.java trunk/magicmapclient/src/net/sf/magicmap/client/model/measurement/MeasurementTableModel.java trunk/magicmapclient/src/net/sf/magicmap/client/model/node/AccessPointSeerNode.java trunk/magicmapclient/src/net/sf/magicmap/client/model/node/ClientNode.java trunk/magicmapclient/src/net/sf/magicmap/client/model/node/INodeModel.java trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeModel.java Added Paths: ----------- trunk/magicmapclient/plugins/udpplugin-plugin.jar trunk/magicmapclient/src/net/sf/magicmap/client/model/measurement/AbstractMeasurementTableModel.java Removed Paths: ------------- trunk/magicmapclient/plugins/udpplugin-plugin.jar trunk/magicmapclient/src/net/sf/magicmap/client/model/measurement/MeasurementModel.java Deleted: trunk/magicmapclient/plugins/udpplugin-plugin.jar =================================================================== (Binary files differ) Added: trunk/magicmapclient/plugins/udpplugin-plugin.jar =================================================================== --- trunk/magicmapclient/plugins/udpplugin-plugin.jar (rev 0) +++ trunk/magicmapclient/plugins/udpplugin-plugin.jar 2007-03-09 15:00:34 UTC (rev 598) @@ -0,0 +1,83 @@ +PK + |
From: <fle...@us...> - 2007-03-14 21:17:48
|
Revision: 602 http://svn.sourceforge.net/magicmap/?rev=602&view=rev Author: flederohr Date: 2007-03-14 14:17:39 -0700 (Wed, 14 Mar 2007) Log Message: ----------- replace NSIS installer setup file for MagicMap Added Paths: ----------- trunk/magicmapclient/MagicMapSetup.nsi Removed Paths: ------------- trunk/magicmapclient/MagicMapSetup.nsi Deleted: trunk/magicmapclient/MagicMapSetup.nsi =================================================================== --- trunk/magicmapclient/MagicMapSetup.nsi 2007-03-14 21:15:10 UTC (rev 601) +++ trunk/magicmapclient/MagicMapSetup.nsi 2007-03-14 21:17:39 UTC (rev 602) @@ -1,234 +0,0 @@ -;NSIS Modern User Interface -;Welcome/Finish Page Example Script -;Written by Joost Verburg - -;-------------------------------- -;Include Modern UI - - !include "MUI.nsh" - -;-------------------------------- -;General - - ;Name and file - Name "MagicMap" - OutFile "MagicMapSetup.exe" - - ;Default installation folder - InstallDir "$PROGRAMFILES\MagicMap" - - SetCompressor ZLIB - - ;Default icon for installer (does not work yet) -; Icon "MagicMap2.ico" - - ;Get installation folder from registry if available - InstallDirRegKey HKCU "Software\MagicMap" "" - - -;-------------------------------- -;Variables - - Var MUI_TEMP - Var STARTMENU_FOLDER - -;-------------------------------- -;Interface Settings - - !define MUI_HEADERIMAGE - !define MUI_HEADERIMAGE_BITMAP "MagicMap_InstallHeader.bmp" - !define MUI_ICON "MagicMap.ico" - !define MUI_UNICON "MagicMap_Uninst.ico" - !define MUI_ABORTWARNING - - -;-------------------------------- -;Pages - - !insertmacro MUI_PAGE_WELCOME - !insertmacro MUI_PAGE_LICENSE "LICENSE.txt" -; !insertmacro MUI_PAGE_COMPONENTS - !insertmacro MUI_PAGE_DIRECTORY - - ;Start Menu Folder Page Configuration - !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU" - !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Modern UI Test" - !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder" - - !insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER - - !insertmacro MUI_PAGE_INSTFILES - !insertmacro MUI_PAGE_FINISH - - !insertmacro MUI_UNPAGE_WELCOME - !insertmacro MUI_UNPAGE_CONFIRM - !insertmacro MUI_UNPAGE_INSTFILES - !insertmacro MUI_UNPAGE_FINISH - -;-------------------------------- -;Languages - - !insertmacro MUI_LANGUAGE "German" - -;-------------------------------- -;Installer Sections - -Section "MagicMap Client" SecDummy - - SetOutPath "$INSTDIR" - - - ;ADD YOUR OWN FILES HERE... - File LICENSE.txt - File magicmap.jar - File MagicMap.ico - File /r /x .svn lib - File /oname=lib\magicmap-server.jar "..\magicmapserver\dist\magicmap-server.jar" - -; File /r $EXEDIR\*.ico $INSTDIR 4 -; CreateDirectory $INSTDIR\dist -; File /r /FILESONLY $EXEDIR\dist\*.* $INSTDIR\dist 465 -; CreateDirectory $INSTDIR\lib -; File /r /FILESONLY $EXEDIR\lib\*.* $INSTDIR\lib 9930 - - ;Store installation folder - WriteRegStr HKCU "Software\Modern UI Test" "" $INSTDIR - - ;Add uninstall to Software overview - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MagicMap" "DisplayName" "MagicMap Client" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MagicMap" "DisplayIcon" "$INSTDIR\MagicMap.ico" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MagicMap" "DisplayVersion" "0.8.1" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MagicMap" "HelpLink" "http://wiki.informatik.hu-berlin.de/nomads/index.php/MagicMapHelp" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MagicMap" "InstallLocation" "$INSTDIR" - WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MagicMap" "NoModify" 0x00000001 - WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MagicMap" "NoRepair" 0x00000001 - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MagicMap" "UninstallString" "$INSTDIR\Uninstall.exe" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MagicMap" "URLInfoAbout" "http://www2.informatik.hu-berlin.de/rok/MagicMap" - - ;Create uninstaller - WriteUninstaller "$INSTDIR\Uninstall.exe" - - !insertmacro MUI_STARTMENU_WRITE_BEGIN Application - - ;Create shortcuts - CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER" - - CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\MagicMap Client.lnk" "$INSTDIR\magicmap.jar" "" "$INSTDIR\MagicMap.ico" - CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Lizenz.lnk" "$INSTDIR\LICENSE.txt" - CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe" - - !insertmacro MUI_STARTMENU_WRITE_END - -SectionEnd - -;-------------------------------- -;Descriptions - - ;Language strings -; LangString DESC_SecDummy ${LANG_ENGLISH} "Die MagicMap Clientkomponenten." - - ;Assign language strings to sections -; !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN -; !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy) -; !insertmacro MUI_FUNCTION_DESCRIPTION_END - -;-------------------------------- -;Uninstaller Section - -Section "Uninstall" - - ;ADD YOUR OWN FILES HERE... -; Delete "$INSTDIR\dist\*.*" - Delete "$INSTDIR\lib\*.*" - Delete "$INSTDIR\MagicMap.ico" - Delete "$INSTDIR\magicmap.jar" -; Delete "$INSTDIR\start.bat" -; Delete "$INSTDIR\start_nightly.bat" - Delete "$INSTDIR\LICENSE.txt" - Delete "$INSTDIR\Uninstall.exe" - - RMDir "$INSTDIR\dist" - RMDir "$INSTDIR\lib" - RMDir "$INSTDIR" - - !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP - - Delete "$SMPROGRAMS\$MUI_TEMP\MagicMap Client.lnk" - Delete "$SMPROGRAMS\$MUI_TEMP\Lizenz.lnk" - Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk" - - - ;Delete empty start menu parent diretories - StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP" - - startMenuDeleteLoop: - ClearErrors - RMDir $MUI_TEMP - GetFullPathName $MUI_TEMP "$MUI_TEMP\.." - - IfErrors startMenuDeleteLoopDone - - StrCmp $MUI_TEMP $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop - startMenuDeleteLoopDone: - - DeleteRegKey /ifempty HKCU "Software\Modern UI Test" - - ;Remove uninstall to Software overview - DeleteRegKey /ifempty HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MagicMap" - -SectionEnd - -Function IsJava15Installed - Push $R0 - ClearErrors - ReadRegStr $R0 HKCR ".jar" "" - IfErrors lbl_na - StrCpy $R0 1 - Goto lbl_end - lbl_na: - StrCpy $R0 0 - lbl_end: - Exch $R0 - FunctionEnd - -Function IsJarExecutable - Push $R0 - ClearErrors - ReadRegStr $R0 HKCR ".jar" "" - IfErrors lbl_na - StrCpy $R0 1 - Goto lbl_end - lbl_na: - StrCpy $R0 0 - lbl_end: - Exch $R0 - FunctionEnd - - Function GetParent - - Exch $R0 - Push $R1 - Push $R2 - Push $R3 - - StrCpy $R1 0 - StrLen $R2 $R0 - - loop: - IntOp $R1 $R1 + 1 - IntCmp $R1 $R2 get 0 get - StrCpy $R3 $R0 1 -$R1 - StrCmp $R3 "\" get - Goto loop - - get: - StrCpy $R0 $R0 -$R1 - - Pop $R3 - Pop $R2 - Pop $R1 - Exch $R0 - - FunctionEnd - - \ No newline at end of file Added: trunk/magicmapclient/MagicMapSetup.nsi =================================================================== --- trunk/magicmapclient/MagicMapSetup.nsi (rev 0) +++ trunk/magicmapclient/MagicMapSetup.nsi 2007-03-14 21:17:39 UTC (rev 602) @@ -0,0 +1,160 @@ +# Auto-generated by EclipseNSIS Script Wizard +# 08-Mar-2007 01:26:38 + +Name MagicMap + +SetCompressor /SOLID zlib + +# Defines +!define REGKEY "SOFTWARE\$(^Name)" +!define VERSION 0.8.1 +!define COMPANY "Humbold Universit\xE4t zu Berlin" +!define URL http://www2.informatik.hu-berlin.de/rok/MagicMap + +# MUI defines +!define MUI_HEADERIMAGE +!define MUI_HEADERIMAGE_BITMAP "MagicMap_InstallHeader.bmp" +!define MUI_ICON MagicMap.ico +#!define MUI_FINISHPAGE_NOAUTOCLOSE +!define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM +!define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY} +!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup +!define MUI_STARTMENUPAGE_DEFAULTFOLDER MagicMap +!define MUI_UNICON MagicMap_Uninst.ico +!define MUI_ABORTWARNING + +# Included files +!include Sections.nsh +!include MUI.nsh + +# Variables +Var StartMenuGroup + +# Installer pages +!insertmacro MUI_PAGE_WELCOME +!insertmacro MUI_PAGE_LICENSE LICENSE.txt +!insertmacro MUI_PAGE_DIRECTORY +!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup +!insertmacro MUI_PAGE_INSTFILES +!insertmacro MUI_PAGE_FINISH +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES +!insertmacro MUI_UNPAGE_FINISH + +# Installer languages +!insertmacro MUI_LANGUAGE German + +# Installer attributes +OutFile MagicMapsetup.exe +InstallDir $PROGRAMFILES\MagicMap +CRCCheck on +XPStyle on +ShowInstDetails show +#BGGradient 004080 000040 FFFFFF +VIProductVersion ${VERSION}.0 +VIAddVersionKey /LANG=${LANG_GERMAN} ProductName MagicMap +VIAddVersionKey ProductVersion "${VERSION}" +VIAddVersionKey /LANG=${LANG_GERMAN} CompanyName "${COMPANY}" +VIAddVersionKey /LANG=${LANG_GERMAN} CompanyWebsite "${URL}" +VIAddVersionKey /LANG=${LANG_GERMAN} FileVersion "" +VIAddVersionKey /LANG=${LANG_GERMAN} FileDescription "" +VIAddVersionKey /LANG=${LANG_GERMAN} LegalCopyright "" +InstallDirRegKey HKLM "${REGKEY}" Path +ShowUninstDetails show + +# Installer sections +Section -Main SEC0000 + SetOutPath $INSTDIR + SetOverwrite on + File MagicMap.ico + File magicmap.jar + File LICENSE.txt + SetOutPath $INSTDIR\lib + File /r /x .svn lib\* + File ..\magicmapserver\dist\magicmap-server.jar + WriteRegStr HKLM "${REGKEY}\Components" Main 1 +SectionEnd + +Section -post SEC0001 + WriteRegStr HKLM "${REGKEY}" Path $INSTDIR + SetOutPath $INSTDIR + WriteUninstaller $INSTDIR\uninstall.exe + !insertmacro MUI_STARTMENU_WRITE_BEGIN Application + CreateDirectory "$SMPROGRAMS\$StartMenuGroup" + SetOutPath $INSTDIR + CreateShortCut "$SMPROGRAMS\$StartMenuGroup\MagicMap Client.lnk" $INSTDIR\magicmap.jar "" $INSTDIR\MagicMap.ico + CreateShortCut "$SMPROGRAMS\$StartMenuGroup\Lizenz.lnk" $INSTDIR\LICENSE.txt + CreateShortcut "$SMPROGRAMS\$StartMenuGroup\$(^UninstallLink).lnk" $INSTDIR\uninstall.exe + !insertmacro MUI_STARTMENU_WRITE_END + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayVersion "${VERSION}" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" Publisher "${COMPANY}" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" URLInfoAbout "${URL}" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" HelpLink "http://wiki.informatik.hu-berlin.de/nomads/index.php/MagicMapHelp" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon $INSTDIR\MagicMap.ico + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\uninstall.exe + WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1 + WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1 +SectionEnd + +# Macro for selecting uninstaller sections +!macro SELECT_UNSECTION SECTION_NAME UNSECTION_ID + Push $R0 + ReadRegStr $R0 HKLM "${REGKEY}\Components" "${SECTION_NAME}" + StrCmp $R0 1 0 next${UNSECTION_ID} + !insertmacro SelectSection "${UNSECTION_ID}" + GoTo done${UNSECTION_ID} +next${UNSECTION_ID}: + !insertmacro UnselectSection "${UNSECTION_ID}" +done${UNSECTION_ID}: + Pop $R0 +!macroend + +# Uninstaller sections +Section /o un.Main UNSEC0000 + RmDir /r /REBOOTOK $INSTDIR\lib + Delete /REBOOTOK $INSTDIR\LICENSE.txt + Delete /REBOOTOK $INSTDIR\magicmap.jar + Delete /REBOOTOK $INSTDIR\MagicMap.ico + DeleteRegValue HKLM "${REGKEY}\Components" Main +SectionEnd + +Section un.post UNSEC0001 + DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" + Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\MagicMap Client.lnk" + Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Lizenz.lnk" + Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\$(^UninstallLink).lnk" + Delete /REBOOTOK $INSTDIR\uninstall.exe + DeleteRegValue HKLM "${REGKEY}" StartMenuGroup + DeleteRegValue HKLM "${REGKEY}" Path + DeleteRegKey /IfEmpty HKLM "${REGKEY}\Components" + DeleteRegKey /IfEmpty HKLM "${REGKEY}" + RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup + RmDir /REBOOTOK $INSTDIR + Push $R0 + StrCpy $R0 $StartMenuGroup 1 + StrCmp $R0 ">" no_smgroup +no_smgroup: + Pop $R0 +SectionEnd + +# Installer functions +Function .onInit + InitPluginsDir +FunctionEnd + + +# Uninstaller functions +Function un.onInit + SetAutoClose true + ReadRegStr $INSTDIR HKLM "${REGKEY}" Path + !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup + !insertmacro SELECT_UNSECTION Main ${UNSEC0000} +FunctionEnd + + + +# Installer Language Strings +# TODO Update the Language Strings with the appropriate translations. + +LangString ^UninstallLink ${LANG_GERMAN} "Deinstalliere $(^Name)" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-03-23 12:06:45
|
Revision: 609 http://svn.sourceforge.net/magicmap/?rev=609&view=rev Author: anweiss Date: 2007-03-23 05:06:22 -0700 (Fri, 23 Mar 2007) Log Message: ----------- more cleaning of i18n files Modified Paths: -------------- trunk/magicmapclient/res/screentext.properties trunk/magicmapclient/res/screentext_de_DE.properties trunk/magicmapclient/src/net/sf/magicmap/client/model/outline/OutlineModel.java Modified: trunk/magicmapclient/res/screentext.properties =================================================================== --- trunk/magicmapclient/res/screentext.properties 2007-03-23 12:03:15 UTC (rev 608) +++ trunk/magicmapclient/res/screentext.properties 2007-03-23 12:06:22 UTC (rev 609) @@ -1,6 +1,6 @@ file=&File map=&Map -connect=&Connect +connect=C&onnect disconnect=&Disconnect exit=E&xit view=&View @@ -13,8 +13,6 @@ normalview=Advanced expertview=Expert userdefinedview=&User-defined... -connect_to_server=Connect to server -disconnect_from_server=Disconnect from server createlocation=New Referencepoint creategeopos=New Geocoordinate fetchlocations=Fetch all locations from server @@ -23,18 +21,11 @@ properties=Properties... connectserver=Connect with server ok=&OK -cancel=Cancel -finish=&Finish +cancel=&Cancel hostname=&Hostname port=&Port createconnectiontopacwserver=Create connection with MagicMap server createconnectiontopacwserverhint=Please enter connection settings -addvertex=Add a vertex to graph -test=Test -addclient=Add client -addaccesspoint=Add access point -addlocation=Add location -seesaccesspoints=Sees Access Point outline=Outline console=Console measurement=Measurement @@ -42,7 +33,6 @@ accesspoints=Access Points locations=Locations clients=Clients -signalstrength=Signalstrength nodewiththisnamealreadyexists=A node with this name already exists macaddress=MAC address signallevel=Signallevel @@ -51,17 +41,14 @@ avgsignallevel=Mean avgstrength=Avg. Strength password=P&assword -clientname=&Clientname +clientname=C&lientname connected=Connected connecting=Connecting... disconnected=Disconnected newmap=&New map loadmap=&Load map -width=Width -height=Height imageurl=Image-URL choosemapimage=Choose map image -browse=Browse name=&Name maps=&Maps cantconnectretry=Can't establish connection.\n\nDo you want to retry? @@ -97,13 +84,13 @@ setanhttpproxy=Set an HTTP-Proxy setanhttpproxyhint=Please enter name and port of your proxy server setproxytooltip=Set Proxy-server +geocoordinates=Geopoints geopos=Set a geocoordinate setgeopos=Set a geocoordinate setgeoposhint=Please enter a geocoordonate nonserverconnect=Use local connection only showedgesforselectednode=Show only edges for the selected node datainvocationrate=Updaterate -datainvocationratetooltip=Sets the rate for getting data from the server dataInvocationRate1=1 sec dataInvocationRate2=2 sec dataInvocationRate3=3 sec @@ -117,9 +104,6 @@ heightNode = set node's height input.dialog.height = Height (in cm) above the map message.dialog.wrong.height = Error! The Node's height wasn't updated! -new.map.dialog.real.width = Width of Map(cm) -new.map.dialog.real.height = Height of Map(cm) -new.map.dialog.scale = scale factors map.panel.context.hide.ap = hide accesspoint map.panel.context.hide.ap.off = compute accesspoint node.accesspoint.is.hide = OFF Modified: trunk/magicmapclient/res/screentext_de_DE.properties =================================================================== --- trunk/magicmapclient/res/screentext_de_DE.properties 2007-03-23 12:03:15 UTC (rev 608) +++ trunk/magicmapclient/res/screentext_de_DE.properties 2007-03-23 12:06:22 UTC (rev 609) @@ -13,8 +13,6 @@ normalview=Fortgeschritten expertview=Experte userdefinedview=&Benutzerdefiniert... -connect_to_server=Mit Server verbinden -disconnect_from_server=Vom Server trennen createlocation=Neuer Referenzpunkt creategeopos=Neue Geokoordinate fetchlocations=Hole alle Orte vom Server @@ -23,18 +21,11 @@ properties=Eigenschaften... connectserver=Mit Server verbinden ok=&OK -cancel=Abbruch -finish=&Schlie\xDFen +cancel=&Abbruch hostname=&Rechnername port=&Port createconnectiontopacwserver=Verbindung mit MagicMap-Server herstellen createconnectiontopacwserverhint=Geben Sie bitte die Verbindungsoptionen an -addvertex=Einen Knoten hinzuf\xFCgen -test=Test -addclient=Client hinzuf\xFCgen -addaccesspoint=Access Point hinzuf\xFCgen -addlocation=Referenzpunkt hinzuf\xFCgen -seesaccesspoints=Sieht Access Point outline=\xDCbersicht console=Konsole measurement=Messung @@ -42,7 +33,6 @@ accesspoints=Access Points locations=Referenzpunkte clients=Clients -signalstrength=Signalst\xE4rke nodewiththisnamealreadyexists=Es existiert bereits ein Knoten mit diesem Namen macaddress=MAC-Adresse signallevel=Signallevel @@ -51,17 +41,14 @@ avgsignallevel=Mittelwert avgstrength=Durchschn. St\xE4rke password=P&asswort -clientname=&Clientname +clientname=C&lientname connected=Verbunden connecting=Verbinde... disconnected=Nicht verbunden newmap=&Neue Karte loadmap=Karte &laden -width=Breite -height=H\xF6he imageurl=Bildadresse choosemapimage=Kartenbild w\xE4hlen -browse=Durchsuchen name=&Name maps=&Karten cantconnectretry=Verbindung zum Server kann nicht hergestellt werden. \n\nVerbindungsvorgang wiederholen? @@ -97,13 +84,13 @@ setanhttpproxy=Einen HTTP-Proxy setzen setanhttpproxyhint=Geben Sie bitte die Daten ihres Proxy-Servers an setproxytooltip=Proxy-Server einstellen +geocoordinates=Geokoordinaten geopos=Geokoordinate setzen setgeopos=Eine Geokoordinate setzen setgeoposhint=Geben Sie bitte eine Geokoordinate an nonserverconnect=Kein Server (Standalone) showedgesforselectednode=Zeige nur die Kanten f\xFCr den selektierten Knoten datainvocationrate=Updaterate -datainvocationratetooltip=Stellt ein wie oft die Daten vom Server abgerufen werden dataInvocationRate1=1 Sek dataInvocationRate2=2 Sek dataInvocationRate3=3 Sek @@ -117,9 +104,6 @@ heightNode = H\xF6henkote setzen input.dialog.height = H\xF6he (in cm) \xFCber der Kartenebene message.dialog.wrong.height = H\xF6he wurde nicht ge\xE4ndert! -new.map.dialog.real.width = Kartenbreite(cm) -new.map.dialog.real.height = Kartenh\xF6he(cm) -new.map.dialog.scale = Skalierungsfaktoren map.panel.context.hide.ap = Accesspoint bei Berechnung ausblenden map.panel.context.hide.ap.off = Accesspoint bei Berechnung ber\xFCcksichtigen node.accesspoint.is.hide = AUS Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/outline/OutlineModel.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/model/outline/OutlineModel.java 2007-03-23 12:03:15 UTC (rev 608) +++ trunk/magicmapclient/src/net/sf/magicmap/client/model/outline/OutlineModel.java 2007-03-23 12:06:22 UTC (rev 609) @@ -21,6 +21,11 @@ */ public class OutlineModel extends DefaultTreeModel implements NodeModelListener { + + /** + * + */ + private static final long serialVersionUID = 1L; private final INodeModel nodeModel; private final OutlineTreeNode rootNode; private final Map<Integer, OutlineTreeNode> categories; @@ -41,8 +46,7 @@ addCategory(NodeModelConstants.NODETYPE_ACCESSPOINT, GUIUtils.i18n("accesspoints")); addCategory(NodeModelConstants.NODETYPE_CLIENT, GUIUtils.i18n("clients")); addCategory(NodeModelConstants.NODETYPE_LOCATION, GUIUtils.i18n("locations")); - addCategory(NodeModelConstants.NODETYPE_GEOPOS, GUIUtils.i18n("Geokoordinaten")); - //addCategory(NodeModelConstants.NODETYPE_INFO, GUIUtils.i18n("Infoobjekte")); + addCategory(NodeModelConstants.NODETYPE_GEOPOS, GUIUtils.i18n("geocoordinates")); nodeModel.addNodeModelListener(this); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fle...@us...> - 2007-04-02 11:47:55
|
Revision: 625 http://svn.sourceforge.net/magicmap/?rev=625&view=rev Author: flederohr Date: 2007-04-02 04:47:31 -0700 (Mon, 02 Apr 2007) Log Message: ----------- changed location NodeIcon updated Version Number to 0.9.0 Modified Paths: -------------- trunk/magicmapclient/build.xml trunk/magicmapclient/plugins/udpplugin-plugin.jar trunk/magicmapclient/res/NodeIcons/location.png trunk/magicmapclient/res/NodeIcons/location_rescan.png trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/MapPanel.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/LocationNodeIcon.java Modified: trunk/magicmapclient/build.xml =================================================================== --- trunk/magicmapclient/build.xml 2007-03-29 10:00:34 UTC (rev 624) +++ trunk/magicmapclient/build.xml 2007-04-02 11:47:31 UTC (rev 625) @@ -2,7 +2,7 @@ <project name="magicmapclient" default="jar" basedir="."> <property name="application" value="magicmap" /> <!-- Version Information --> - <property name="version.number" value="0.8.1" /> + <property name="version.number" value="0.9.0" /> <property name="jar.name" value="${application}.jar" /> <property name="main.class" value="net.sf.magicmap.client.core.MagicMapApplication" /> Modified: trunk/magicmapclient/plugins/udpplugin-plugin.jar =================================================================== --- trunk/magicmapclient/plugins/udpplugin-plugin.jar 2007-03-29 10:00:34 UTC (rev 624) +++ trunk/magicmapclient/plugins/udpplugin-plugin.jar 2007-04-02 11:47:31 UTC (rev 625) @@ -1,21 +1,21 @@ PK - |
From: <fle...@us...> - 2007-04-12 13:46:04
|
Revision: 648 http://svn.sourceforge.net/magicmap/?rev=648&view=rev Author: flederohr Date: 2007-04-12 06:45:52 -0700 (Thu, 12 Apr 2007) Log Message: ----------- include plugins in distribution and delete plugins at uninstallation Modified Paths: -------------- trunk/magicmapclient/MagicMapSetup.nsi trunk/magicmapclient/build.xml Modified: trunk/magicmapclient/MagicMapSetup.nsi =================================================================== --- trunk/magicmapclient/MagicMapSetup.nsi 2007-04-11 14:37:55 UTC (rev 647) +++ trunk/magicmapclient/MagicMapSetup.nsi 2007-04-12 13:45:52 UTC (rev 648) @@ -115,6 +115,7 @@ # Uninstaller sections Section /o un.Main UNSEC0000 RmDir /r /REBOOTOK $INSTDIR\lib + RMDir /r /REBOOTOK $INSTDIR\plugins Delete /REBOOTOK $INSTDIR\LICENSE.txt Delete /REBOOTOK $INSTDIR\magicmap.jar Delete /REBOOTOK $INSTDIR\MagicMap.ico Modified: trunk/magicmapclient/build.xml =================================================================== --- trunk/magicmapclient/build.xml 2007-04-11 14:37:55 UTC (rev 647) +++ trunk/magicmapclient/build.xml 2007-04-12 13:45:52 UTC (rev 648) @@ -132,6 +132,7 @@ <target name="dist" depends="jar"> <zip destfile="dist/${application}-${version.number}.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" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-07-19 15:00:04
|
Revision: 662 http://svn.sourceforge.net/magicmap/?rev=662&view=rev Author: anweiss Date: 2007-07-19 07:59:59 -0700 (Thu, 19 Jul 2007) Log Message: ----------- added "Homepage" Menu Modified Paths: -------------- trunk/magicmapclient/res/screentext.properties trunk/magicmapclient/res/screentext_de_DE.properties trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainFrame.java trunk/magicmapclient/src/net/sf/magicmap/client/net/WindowsNetworkInfo.java Modified: trunk/magicmapclient/res/screentext.properties =================================================================== --- trunk/magicmapclient/res/screentext.properties 2007-07-19 12:19:35 UTC (rev 661) +++ trunk/magicmapclient/res/screentext.properties 2007-07-19 14:59:59 UTC (rev 662) @@ -9,6 +9,7 @@ help=&Help onlinehelp=Online help onlinehelptooltip=Help at MagicMap wiki +homepage=Homepage simpleview=Beginner normalview=Advanced expertview=Expert Modified: trunk/magicmapclient/res/screentext_de_DE.properties =================================================================== --- trunk/magicmapclient/res/screentext_de_DE.properties 2007-07-19 12:19:35 UTC (rev 661) +++ trunk/magicmapclient/res/screentext_de_DE.properties 2007-07-19 14:59:59 UTC (rev 662) @@ -9,6 +9,7 @@ help=&Hilfe onlinehelp=Online Hilfe onlinehelptooltip=Hilfe im MagicMap Wiki +homepage=Homepage simpleview=Anf\xE4nger normalview=Fortgeschritten expertview=Experte Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainFrame.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainFrame.java 2007-07-19 12:19:35 UTC (rev 661) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainFrame.java 2007-07-19 14:59:59 UTC (rev 662) @@ -10,7 +10,6 @@ import java.io.PrintWriter; import java.io.StringWriter; import java.rmi.RemoteException; -import java.rmi.UnknownHostException; import javax.swing.AbstractAction; import javax.swing.JButton; @@ -37,11 +36,7 @@ import net.sf.magicmap.client.gui.views.MapView; import net.sf.magicmap.client.gui.views.MeasurementView; import net.sf.magicmap.client.gui.views.OutlineView; -import net.sf.magicmap.client.interfaces.CreateNewMapCallback; import net.sf.magicmap.client.interfaces.LoadMapDialogListener; -import net.sf.magicmap.client.interfaces.MapNamesCallback; -import net.sf.magicmap.client.interfaces.ServerConnectCallback; -import net.sf.magicmap.client.interfaces.ServerDisconnectCallback; import net.sf.magicmap.client.meta.MapInfo; import net.sf.magicmap.client.meta.ServerConnectionInfo; import net.sf.magicmap.client.utils.Settings; @@ -80,6 +75,7 @@ private AbstractAction exitAction; private AbstractAction aboutAction; private AbstractAction onlineHelp; + private AbstractAction homepageAction; private MagicAction invisibleAction; private MagicAction simpleView; private MagicAction normalView; @@ -268,6 +264,7 @@ Browser.init(); JMenu menu = GUIBuilder.createMenu("help"); menu.add(GUIBuilder.createMenuItem(this.onlineHelp)); + menu.add(GUIBuilder.createMenuItem(this.homepageAction)); menu.addSeparator(); menu.add(GUIBuilder.createMenuItem(this.aboutAction)); return menu; @@ -588,7 +585,27 @@ } } }; + + this.homepageAction = new MagicAction("homepage") { + /** + * serial version id + */ + private static final long serialVersionUID = -2931521125912428814L; + + /* (non-Javadoc) + * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) + */ + @Override + public void actionPerformed(ActionEvent e){ + try { + Browser.displayURL("http://www.magicmap.de"); + } catch (IOException e1) { + //TODO: exception handling + } + } + }; + this.aboutAction = new MagicAction("about") { /** Modified: trunk/magicmapclient/src/net/sf/magicmap/client/net/WindowsNetworkInfo.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/net/WindowsNetworkInfo.java 2007-07-19 12:19:35 UTC (rev 661) +++ trunk/magicmapclient/src/net/sf/magicmap/client/net/WindowsNetworkInfo.java 2007-07-19 14:59:59 UTC (rev 662) @@ -34,6 +34,7 @@ // see if line contains IP address, this means stop if we've already // seen a MAC address + // the "(" occurs in vista, if this is a preferred connection if ((line.contains(localHost + "/r/n")||line.contains(localHost + "(")) && lastMacAddress != null) return lastMacAddress; // see if line might contain a MAC address int macAddressPosition = line.indexOf(":"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-07-26 14:17:03
|
Revision: 664 http://magicmap.svn.sourceforge.net/magicmap/?rev=664&view=rev Author: anweiss Date: 2007-07-26 07:17:01 -0700 (Thu, 26 Jul 2007) Log Message: ----------- added menus for bugs and forum under "help" Modified Paths: -------------- trunk/magicmapclient/res/screentext.properties trunk/magicmapclient/res/screentext_de_DE.properties trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainFrame.java Modified: trunk/magicmapclient/res/screentext.properties =================================================================== --- trunk/magicmapclient/res/screentext.properties 2007-07-26 12:01:20 UTC (rev 663) +++ trunk/magicmapclient/res/screentext.properties 2007-07-26 14:17:01 UTC (rev 664) @@ -10,6 +10,8 @@ onlinehelp=Online help onlinehelptooltip=Help at MagicMap wiki homepage=Homepage +forum=Forum +submitBug=Submit bug... simpleview=Beginner normalview=Advanced expertview=Expert Modified: trunk/magicmapclient/res/screentext_de_DE.properties =================================================================== --- trunk/magicmapclient/res/screentext_de_DE.properties 2007-07-26 12:01:20 UTC (rev 663) +++ trunk/magicmapclient/res/screentext_de_DE.properties 2007-07-26 14:17:01 UTC (rev 664) @@ -10,6 +10,8 @@ onlinehelp=Online Hilfe onlinehelptooltip=Hilfe im MagicMap Wiki homepage=Homepage +forum=Forum +submitBug=Bug melden... simpleview=Anf\xE4nger normalview=Fortgeschritten expertview=Experte Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainFrame.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainFrame.java 2007-07-26 12:01:20 UTC (rev 663) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainFrame.java 2007-07-26 14:17:01 UTC (rev 664) @@ -76,6 +76,8 @@ private AbstractAction aboutAction; private AbstractAction onlineHelp; private AbstractAction homepageAction; + private AbstractAction forumAction; + private AbstractAction bugAction; private MagicAction invisibleAction; private MagicAction simpleView; private MagicAction normalView; @@ -263,9 +265,12 @@ public JMenu buildHelpMenu(){ Browser.init(); JMenu menu = GUIBuilder.createMenu("help"); - menu.add(GUIBuilder.createMenuItem(this.onlineHelp)); menu.add(GUIBuilder.createMenuItem(this.homepageAction)); menu.addSeparator(); + menu.add(GUIBuilder.createMenuItem(this.onlineHelp)); + menu.add(GUIBuilder.createMenuItem(this.forumAction)); + menu.add(GUIBuilder.createMenuItem(this.bugAction)); + menu.addSeparator(); menu.add(GUIBuilder.createMenuItem(this.aboutAction)); return menu; } @@ -605,7 +610,45 @@ } } }; + this.forumAction = new MagicAction("forum") { + /** + * serial version id + */ + private static final long serialVersionUID = -2931521125912428814L; + + /* (non-Javadoc) + * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) + */ + @Override + public void actionPerformed(ActionEvent e){ + try { + Browser.displayURL("http://sourceforge.net/forum/?group_id=127844"); + } catch (IOException e1) { + //TODO: exception handling + } + } + }; + this.bugAction = new MagicAction("submitBug") { + + /** + * serial version id + */ + private static final long serialVersionUID = -2931521125912428814L; + + /* (non-Javadoc) + * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) + */ + @Override + public void actionPerformed(ActionEvent e){ + try { + Browser.displayURL("http://sourceforge.net/tracker/?atid=711047&group_id=127844&func=browse"); + } catch (IOException e1) { + //TODO: exception handling + } + } + }; + this.aboutAction = new MagicAction("about") { /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-07-26 14:23:15
|
Revision: 665 http://magicmap.svn.sourceforge.net/magicmap/?rev=665&view=rev Author: anweiss Date: 2007-07-26 07:23:14 -0700 (Thu, 26 Jul 2007) Log Message: ----------- added iso encoding to build.xml and added wifistumblerplugin to svn.ignore Modified Paths: -------------- trunk/magicmapclient/build.xml Property Changed: ---------------- trunk/magicmapclient/plugins/ Modified: trunk/magicmapclient/build.xml =================================================================== --- trunk/magicmapclient/build.xml 2007-07-26 14:17:01 UTC (rev 664) +++ trunk/magicmapclient/build.xml 2007-07-26 14:23:14 UTC (rev 665) @@ -94,7 +94,7 @@ </target> <target name="compile" depends="axis"> - <javac destdir="${build}" target="1.5" debug="true" deprecation="true" debuglevel="lines,vars,source" fork="true"> + <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}" /> @@ -102,7 +102,7 @@ </target> <target name="compile-tests" depends="compile"> - <javac destdir="${build-test}" debug="true" deprecation="true" debuglevel="lines,vars,source" fork="true"> + <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> Property changes on: trunk/magicmapclient/plugins ___________________________________________________________________ Name: svn:ignore + wifiscannerplugin-1.0.jar This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fle...@us...> - 2007-10-02 16:52:41
|
Revision: 670 http://magicmap.svn.sourceforge.net/magicmap/?rev=670&view=rev Author: flederohr Date: 2007-10-02 09:52:38 -0700 (Tue, 02 Oct 2007) Log Message: ----------- Modified Paths: -------------- trunk/magicmapclient/build.xml trunk/magicmapclient/src/net/sf/magicmap/client/core/MagicMapApplication.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainFrame.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/AboutDialog.java trunk/magicmapclient/src/net/sf/magicmap/client/utils/Version.java Added Paths: ----------- trunk/magicmapclient/plugins/udpscanner-1.0.jar Removed Paths: ------------- trunk/magicmapclient/plugins/udpplugin-plugin.jar Modified: trunk/magicmapclient/build.xml =================================================================== --- trunk/magicmapclient/build.xml 2007-10-02 15:49:35 UTC (rev 669) +++ trunk/magicmapclient/build.xml 2007-10-02 16:52:38 UTC (rev 670) @@ -2,7 +2,8 @@ <project name="magicmapclient" default="jar" basedir="."> <property name="application" value="magicmap" /> <!-- Version Information --> - <property name="version.number" value="0.9.0" /> + <property name="version.number" value="0.9.1" /> + <property name="version.appendix" value="beta" /> <property name="jar.name" value="${application}.jar" /> <property name="main.class" value="net.sf.magicmap.client.core.MagicMapApplication" /> @@ -114,6 +115,7 @@ </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> Deleted: trunk/magicmapclient/plugins/udpplugin-plugin.jar =================================================================== --- trunk/magicmapclient/plugins/udpplugin-plugin.jar 2007-10-02 15:49:35 UTC (rev 669) +++ trunk/magicmapclient/plugins/udpplugin-plugin.jar 2007-10-02 16:52:38 UTC (rev 670) @@ -1,70 +0,0 @@ -PK - |
From: <fle...@us...> - 2007-10-25 11:03:17
|
Revision: 679 http://magicmap.svn.sourceforge.net/magicmap/?rev=679&view=rev Author: flederohr Date: 2007-10-25 03:00:27 -0700 (Thu, 25 Oct 2007) Log Message: ----------- Version to 0.9.1 beta 4 Modified Paths: -------------- trunk/magicmapclient/.project trunk/magicmapclient/build.xml Property Changed: ---------------- trunk/magicmapclient/ Property changes on: trunk/magicmapclient ___________________________________________________________________ Name: svn:ignore - build dist magicmap derby.log src-gen MagicMap nightly.launch bin magicmap.jar referenzpunkt.txt client.txt MagicMap.launch settings.ini build-test + build dist magicmap derby.log src-gen MagicMap nightly.launch bin magicmap.jar referenzpunkt.txt client.txt MagicMap.launch settings.ini build-test MagicMapsetup.exe Modified: trunk/magicmapclient/.project =================================================================== --- trunk/magicmapclient/.project 2007-10-12 15:00:08 UTC (rev 678) +++ trunk/magicmapclient/.project 2007-10-25 10:00:27 UTC (rev 679) @@ -11,14 +11,8 @@ <arguments> </arguments> </buildCommand> - <buildCommand> - <name>org.springframework.ide.eclipse.core.springbuilder</name> - <arguments> - </arguments> - </buildCommand> </buildSpec> <natures> - <nature>org.springframework.ide.eclipse.core.springnature</nature> <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> <nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.jem.beaninfo.BeanInfoNature</nature> Modified: trunk/magicmapclient/build.xml =================================================================== --- trunk/magicmapclient/build.xml 2007-10-12 15:00:08 UTC (rev 678) +++ trunk/magicmapclient/build.xml 2007-10-25 10:00:27 UTC (rev 679) @@ -3,7 +3,7 @@ <property name="application" value="magicmap" /> <!-- Version Information --> <property name="version.number" value="0.9.1" /> - <property name="version.appendix" value="beta 2" /> + <property name="version.appendix" value="beta 4" /> <property name="jar.name" value="${application}.jar" /> <property name="main.class" value="net.sf.magicmap.client.core.MagicMapApplication" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-11-08 14:14:09
|
Revision: 688 http://magicmap.svn.sourceforge.net/magicmap/?rev=688&view=rev Author: anweiss Date: 2007-11-08 05:30:41 -0800 (Thu, 08 Nov 2007) Log Message: ----------- Tooltips for the connection dialogue. Modified Paths: -------------- trunk/magicmapclient/res/screentext.properties trunk/magicmapclient/res/screentext_de_DE.properties trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/ConnectServerDialog.java Modified: trunk/magicmapclient/res/screentext.properties =================================================================== --- trunk/magicmapclient/res/screentext.properties 2007-11-06 11:59:40 UTC (rev 687) +++ trunk/magicmapclient/res/screentext.properties 2007-11-08 13:30:41 UTC (rev 688) @@ -25,8 +25,10 @@ connectserver=Connect with server ok=&OK cancel=&Cancel -hostname=&Hostname +hostname=&Server +hostnametooltip=Please enter here the URL of the the server you want to connect to. port=&Port +porttooltip=The port for the MagicMap-Server. createconnectiontopacwserver=Create connection with MagicMap server createconnectiontopacwserverhint=Please enter connection settings outline=Outline @@ -44,7 +46,9 @@ avgsignallevel=Mean avgstrength=Avg. Strength password=P&assword -clientname=C&lientname +passwordtooltip=Please enter your password here. If you run MagicMap for the first time you can choose a new password here. +clientname=&Login +clientnametooltip=Please enter your username here. This will be your displayed name in MagicMap. connected=Connected connecting=Connecting... disconnected=Disconnected Modified: trunk/magicmapclient/res/screentext_de_DE.properties =================================================================== --- trunk/magicmapclient/res/screentext_de_DE.properties 2007-11-06 11:59:40 UTC (rev 687) +++ trunk/magicmapclient/res/screentext_de_DE.properties 2007-11-08 13:30:41 UTC (rev 688) @@ -25,8 +25,10 @@ connectserver=Mit Server verbinden ok=&OK cancel=&Abbruch -hostname=&Rechnername +hostname=&Server +hostnametooltip=Bitte geben Sie hier die URL f\xFCr den Server ein, zu dem Sie sich verbinden wollen. port=&Port +porttooltip=Tragen Sie hier den Port ein, \xFCber den der MagicMap-Server erreichbar ist. createconnectiontopacwserver=Verbindung mit MagicMap-Server herstellen createconnectiontopacwserverhint=Geben Sie bitte die Verbindungsoptionen an outline=\xDCbersicht @@ -44,7 +46,9 @@ avgsignallevel=Mittelwert avgstrength=Durchschn. St\xE4rke password=P&asswort -clientname=C&lientname +passwordtooltip=Geben Sie hier ihr Passwort ein. Sollten Sie MagicMap das erste mal benutzten, dann k\xF6nnen Sie hier ein beliebiges Passwort w\xE4hlen. +clientname=&Login +clientnametooltip=Geben Sie hier ihren Benutzernamen ein, mit dem Sie in MagicMap angezeigt werden. connected=Verbunden connecting=Verbinde... disconnected=Nicht verbunden Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/ConnectServerDialog.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/ConnectServerDialog.java 2007-11-06 11:59:40 UTC (rev 687) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/ConnectServerDialog.java 2007-11-08 13:30:41 UTC (rev 688) @@ -104,6 +104,7 @@ builder.setRightRightDistance("clientname", null, -20); builder.setTopBottomDistance("clientlabel", "header", 20); builder.setTopBottomDistance("clientname", "header", 20); + clientname.setToolTipText(GUIUtils.i18n("clientnametooltip")); // Password password = new JPasswordField(); @@ -113,7 +114,8 @@ builder.setRightRightDistance("password", null, -20); builder.setTopBottomDistance("passwordlabel", "clientlabel,clientname", 5); builder.setTopBottomDistance("password", "clientlabel,clientname", 5); - + password.setToolTipText(GUIUtils.i18n("passwordtooltip")); + // Hostname hostname = builder.addComboBox(Settings.getDefaultServerList(), "hostcombo"); builder.addLabel(GUIUtils.i18n("hostname"), "hostlabel", hostname); @@ -124,6 +126,7 @@ builder.setTopBottomDistance("hostcombo", "passwordlabel,password", 10); hostname.setActionCommand("HOSTNAME"); hostname.addActionListener(this); + hostname.setToolTipText(GUIUtils.i18n("hostnametooltip")); // Port port = builder.addTextField("portedit"); @@ -136,6 +139,7 @@ builder.setLeftRightDistance("hostcombo", "portlabel,hostlabel,clientlabel,passwordlabel", 5); builder.setLeftRightDistance("clientname", "portlabel,hostlabel,clientlabel,passwordlabel", 5); builder.setLeftRightDistance("password", "portlabel,hostlabel,clientlabel,passwordlabel", 5); + port.setToolTipText(GUIUtils.i18n("porttooltip")); // CheckBox f\xFCr "lokale Verbindung" useNoServer = builder.addCheckBox(GUIUtils.i18n("nonserverconnect"), "nonserver", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fle...@us...> - 2007-12-20 12:59:54
|
Revision: 696 http://magicmap.svn.sourceforge.net/magicmap/?rev=696&view=rev Author: flederohr Date: 2007-12-20 04:59:48 -0800 (Thu, 20 Dec 2007) Log Message: ----------- introduced optional distributed computation of the client positions Modified Paths: -------------- trunk/magicmapclient/res/screentext.properties trunk/magicmapclient/res/screentext_de_DE.properties trunk/magicmapclient/src/edu/uci/ics/jung/visualization/AbstractLayout.java trunk/magicmapclient/src/edu/uci/ics/jung/visualization/SpringLayout.java trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java trunk/magicmapclient/src/net/sf/magicmap/client/controller/PollHandler.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/MapPanel.java trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java trunk/magicmapclient/src/net/sf/magicmap/client/model/node/ClientNode.java trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeModelConstants.java Added Paths: ----------- trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/handler/CalculationStateHandler.java Modified: trunk/magicmapclient/res/screentext.properties =================================================================== --- trunk/magicmapclient/res/screentext.properties 2007-12-20 12:51:48 UTC (rev 695) +++ trunk/magicmapclient/res/screentext.properties 2007-12-20 12:59:48 UTC (rev 696) @@ -113,19 +113,22 @@ message.dialog.wrong.height = Error! The Node's height wasn't updated! map.panel.context.hide.ap = hide accesspoint map.panel.context.hide.ap.off = compute accesspoint +map.panel.context.calculate.client = calculate client node.accesspoint.is.hide = OFF continue=C&ontinue plugins.show=Plugins plugins.show.tooltip=Shows all plugins plugins.installed=Installed Plugins -plugins.load=Show Plugins +plugins.load=Reload Repository plugins.install=Install Plugins plugins.uninstall=Deinstall Plugins -plugins.load.tooltip=Load the Plugin List +plugins.uninstall.dialog=The plugin $pluginname can only be deleted after a restart.\nDo you want to restart MagicMap now? +plugins.load.tooltip=Reloads the Plugin List from the repository plugins.install.tooltip=Installs the selected Plugin plugins.uninstall.tooltip=Deinstalls the selected Plugin plugins.available=Additional Plugins plugins.dependencies=Dependencies +plugins.description=Description plugins.detailview=Detail View plugins.name=Name plugins.version=Version Modified: trunk/magicmapclient/res/screentext_de_DE.properties =================================================================== --- trunk/magicmapclient/res/screentext_de_DE.properties 2007-12-20 12:51:48 UTC (rev 695) +++ trunk/magicmapclient/res/screentext_de_DE.properties 2007-12-20 12:59:48 UTC (rev 696) @@ -113,19 +113,22 @@ message.dialog.wrong.height = H\xF6he wurde nicht ge\xE4ndert! map.panel.context.hide.ap = Accesspoint bei Berechnung ausblenden map.panel.context.hide.ap.off = Accesspoint bei Berechnung ber\xFCcksichtigen +map.panel.context.calculate.client = Berechne Client node.accesspoint.is.hide = AUS continue=&Weiter plugins.show=Plugins plugins.show.tooltip=Zeige alle Plugins plugins.installed=Installierte Plugins -plugins.load=Zeige Plugins +plugins.load=Erneuere Repository plugins.install=Installiere Plugin plugins.uninstall=Deinstalliere Plugin -plugins.load.tooltip=L\xE4dt die Pluginliste +plugins.uninstall.dialog=Das Plugin $pluginname kann erst nach einem Neustart gel\xF6scht werden.\nM\xF6chten sie MagicMap jetzt neu starten? +plugins.load.tooltip=L\xE4dt erneut den Inhalt des Plugin-Repositories plugins.install.tooltip=Installiert ausgew\xE4hltes Plugin plugins.uninstall.tooltip=Deinstalliert ausgew\xE4hltes Plugin plugins.available=Weitere Plugins plugins.dependencies=Abh\xE4ngigkeiten +plugins.description=Beschreibung plugins.detailview=Detailansicht plugins.name=Name plugins.version=Version Modified: trunk/magicmapclient/src/edu/uci/ics/jung/visualization/AbstractLayout.java =================================================================== --- trunk/magicmapclient/src/edu/uci/ics/jung/visualization/AbstractLayout.java 2007-12-20 12:51:48 UTC (rev 695) +++ trunk/magicmapclient/src/edu/uci/ics/jung/visualization/AbstractLayout.java 2007-12-20 12:59:48 UTC (rev 696) @@ -1,14 +1,11 @@ /* * Copyright (c) 2003, the JUNG Project and the Regents of the University of - * California All rights reserved. - * - * This software is open-source under the BSD license; see either "license.txt" - * or http://jung.sourceforge.net/license.txt for a description. + * California All rights reserved. This software is open-source under the BSD + * license; see either "license.txt" or http://jung.sourceforge.net/license.txt + * for a description. */ /* - * Created on Jul 7, 2003 - * - * To change the template for this generated file go to + * Created on Jul 7, 2003 To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ @@ -36,479 +33,515 @@ */ abstract public class AbstractLayout implements Layout { - /** - * The set of vertices that have been locked. When running layout, it is - * important to check - * - * <pre> - * if (dontmove( v )) { ... } - * </pre> - * - * @return whether this vertex may be legally moved or not - */ - public boolean dontMove(Vertex v){ - return dontmove.contains(v); - } + /** + * The set of vertices that have been locked. When running layout, it is + * important to check + * + * <pre> + * if (dontmove( v )) { ... } + * </pre> + * + * @return whether this vertex may be legally moved or not + */ + public boolean dontMove(Vertex v){ + return dontmove.contains(v); + } - /** - * Support for explicit fix nodes. - * @param v - * @return - */ - public boolean fix(Vertex v){ - return fix.contains(v); - } + /** + * Support for explicit fix nodes. + * @param v + * @return + */ + public boolean fix(Vertex v){ + return fix.contains(v); + } - // private boolean initialized = false; + // private boolean initialized = false; - private Set dontmove; - private Set fix; + private Set dontmove; + private Set fix; - private static final Object BASE_KEY = "edu.uci.ics.jung.Base_Visualization_Key"; + private static final Object BASE_KEY = "edu.uci.ics.jung.Base_Visualization_Key"; - private Dimension currentSize; - private Graph baseGraph; - private Graph visibleGraph; + private Dimension currentSize; + private Graph baseGraph; + private Graph visibleGraph; - /** - * Constructor. Initializes the current size to be 100x100, both the graph - * and the showing graph to the argument, and creates the <tt>dontmove</tt> - * set. - * - * @param g - */ - public AbstractLayout(Graph g) { - // this.currentSize = new Dimension(100, 100); - this.baseGraph = g; - this.visibleGraph = g; - this.visibleEdges = g.getEdges(); - this.visibleVertices = g.getVertices(); - this.dontmove = new HashSet(); - this.fix = new HashSet(); - } + /** + * Constructor. Initializes the current size to be 100x100, both the graph + * and the showing graph to the argument, and creates the <tt>dontmove</tt> + * set. + * + * @param g + */ + public AbstractLayout(Graph g) { + // this.currentSize = new Dimension(100, 100); + this.baseGraph = g; + this.visibleGraph = g; + this.visibleEdges = g.getEdges(); + this.visibleVertices = g.getVertices(); + this.notCalculatedVertices = new HashSet(); //FLAW + this.dontmove = new HashSet(); + this.fix = new HashSet(); + } - /** - * Initializer, calls <tt>intialize_local</tt> and <tt>initializeLocations</tt> - * to start construction process. - */ - public void initialize(Dimension size){ - // System.out.println("Initialize " + this + size ); - this.currentSize = size; - initialize_local(); - initializeLocations(); - // this.initialized = true; - } + /** + * Initializer, calls <tt>intialize_local</tt> and <tt>initializeLocations</tt> + * to start construction process. + */ + public void initialize(Dimension size){ + // System.out.println("Initialize " + this + size ); + this.currentSize = size; + initialize_local(); + initializeLocations(); + // this.initialized = true; + } - /** - * Initializes all local information, and is called immediately within the - * <tt>initialize()</tt> process. The user is responsible for overriding - * this method to do any construction that may be necessary: for example, - * to initialize local per-edge or graph-wide data. - */ - protected abstract void initialize_local(); + /** + * Initializes all local information, and is called immediately within the + * <tt>initialize()</tt> process. The user is responsible for overriding + * this method to do any construction that may be necessary: for example, + * to initialize local per-edge or graph-wide data. + */ + protected abstract void initialize_local(); - /** - * Initializes the local information on a single vertex. The user is - * responsible for overriding this method to do any vertex-level - * construction that may be necessary: for example, to attach vertex-level - * information to each vertex. - */ - protected abstract void initialize_local_vertex(Vertex v); + /** + * Initializes the local information on a single vertex. The user is + * responsible for overriding this method to do any vertex-level + * construction that may be necessary: for example, to attach vertex-level + * information to each vertex. + */ + protected abstract void initialize_local_vertex(Vertex v); - private Object key; + private Object key; - private Set visibleVertices; - private Set visibleEdges; + private Set visibleVertices; + private Set visibleEdges; - /** - * Returns a visualization-specific key (that is, specific both to this - * instance and <tt>AbstractLayout</tt>) that can be used to access - * UserData related to the <tt>AbstractLayout</tt>. - */ - public Object getBaseKey(){ - if (key == null) key = new Pair(this, BASE_KEY); - return key; - } + private Set notCalculatedVertices; //FLAW - /** - * This method calls <tt>initialize_local_vertex</tt> for each vertex, - * and also adds initial coordinate information for each vertex. (The - * vertex's initial location is set by calling <tt>initializeLocation</tt>. - */ - protected void initializeLocations(){ - for (Iterator iter = baseGraph.getVertices().iterator(); iter.hasNext();){ - Vertex v = (Vertex) iter.next(); + /** + * Returns a visualization-specific key (that is, specific both to this + * instance and <tt>AbstractLayout</tt>) that can be used to access + * UserData related to the <tt>AbstractLayout</tt>. + */ + public Object getBaseKey(){ + if (key == null) key = new Pair(this, BASE_KEY); + return key; + } - Coordinates coord = (Coordinates) v.getUserDatum(getBaseKey()); - if (coord == null){ - coord = new Coordinates(); - v.addUserDatum(getBaseKey(), coord, UserData.REMOVE); - } - if (!dontmove.contains(v)) initializeLocation(v, coord, currentSize); - initialize_local_vertex(v); + /** + * This method calls <tt>initialize_local_vertex</tt> for each vertex, + * and also adds initial coordinate information for each vertex. (The + * vertex's initial location is set by calling <tt>initializeLocation</tt>. + */ + protected void initializeLocations(){ + for (Iterator iter = baseGraph.getVertices().iterator(); iter.hasNext();) { + Vertex v = (Vertex) iter.next(); + + Coordinates coord = (Coordinates) v.getUserDatum(getBaseKey()); + if (coord == null) { + coord = new Coordinates(); + v.addUserDatum(getBaseKey(), coord, UserData.REMOVE); + } + if (!dontmove.contains(v)) initializeLocation(v, coord, currentSize); + initialize_local_vertex(v); + } } - } - /* ------------------------- */ + /* ------------------------- */ - /** - * Sets random locations for a vertex within the dimensions of the space. - * If you want to initialize in some different way, override this method. - * - * @param coord - * @param d - */ - protected void initializeLocation(Vertex v, Coordinates coord, Dimension d){ - double x = Math.random() * d.getWidth(); - double y = Math.random() * d.getHeight(); - coord.setX(x); - coord.setY(y); - } + /** + * Sets random locations for a vertex within the dimensions of the space. + * If you want to initialize in some different way, override this method. + * + * @param coord + * @param d + */ + protected void initializeLocation(Vertex v, Coordinates coord, Dimension d){ + double x = Math.random() * d.getWidth(); + double y = Math.random() * d.getHeight(); + coord.setX(x); + coord.setY(y); + } - /** - * {@inheritDoc}By default, an <tt>AbstractLayout</tt> returns null for - * its status. - */ - public String getStatus(){ - return null; - } + /** + * {@inheritDoc}By default, an <tt>AbstractLayout</tt> returns null for + * its status. + */ + public String getStatus(){ + return null; + } - /** - * Implementors must override this method in order to create a Layout. If - * the Layout is the sort that only calculates locations once, this method - * may be overridden with an empty method. - * <p> - * Note that "locked" vertices are not to be moved; however, it is the - * policy of the visualization to decide how to handle them, and what to do - * with the vertices around them. Prototypical code might include a - * clipping like - * - * <pre> - * for (Iterator i = getVertices().iterator(); i.hasNext() ) { Vertex v = (Vertex) i.next(); if (! dontmove.contains( v ) ) { ... // handle the node } else { // ignore the node } } - * </pre> - * - * @see Layout#advancePositions() - */ - public abstract void advancePositions(); + /** + * Implementors must override this method in order to create a Layout. If + * the Layout is the sort that only calculates locations once, this method + * may be overridden with an empty method. + * <p> + * Note that "locked" vertices are not to be moved; however, it is the + * policy of the visualization to decide how to handle them, and what to do + * with the vertices around them. Prototypical code might include a + * clipping like + * + * <pre> + * for (Iterator i = getVertices().iterator(); i.hasNext() ) { Vertex v = (Vertex) i.next(); if (! dontmove.contains( v ) ) { ... // handle the node } else { // ignore the node } } + * </pre> + * + * @see Layout#advancePositions() + */ + public abstract void advancePositions(); - /** - * Accessor for the graph that represets all visible vertices. <b>Warning: - * </b> This graph consists of vertices that are equivalent to, but are <b> - * not the same as</b> the vertices in <tt>getGraph()</tt>, nor the - * vertices in <tt>getAllVertices()</tt>. Rather, it returns the - * vertices and edges that were passed in during a call to <tt>applyFilter</tt>. - * The call <tt>getVisibleGraph().getVertices()</tt>, is almost - * indubitably incorrect. - * <p> - * - * @return the current visible graph. - * @see #getVisibleEdges - * @see #getVisibleVertices - */ - protected Graph getVisibleGraph(){ - return visibleGraph; - } + /** + * Accessor for the graph that represets all visible vertices. <b>Warning: + * </b> This graph consists of vertices that are equivalent to, but are <b> + * not the same as</b> the vertices in <tt>getGraph()</tt>, nor the + * vertices in <tt>getAllVertices()</tt>. Rather, it returns the + * vertices and edges that were passed in during a call to <tt>applyFilter</tt>. + * The call <tt>getVisibleGraph().getVertices()</tt>, is almost + * indubitably incorrect. + * <p> + * + * @return the current visible graph. + * @see #getVisibleEdges + * @see #getVisibleVertices + */ + protected Graph getVisibleGraph(){ + return visibleGraph; + } - /** - * Returns the current size of the visualization space, accoring to the - * last call to resize(). - * - * @return the current size of the screen - */ - public Dimension getCurrentSize(){ - return currentSize; - } + /** + * Returns the current size of the visualization space, accoring to the + * last call to resize(). + * + * @return the current size of the screen + */ + public Dimension getCurrentSize(){ + return currentSize; + } - /** - * Utility method, gets a single vertex from this edge. The utility's - * implementation is to get the iterator from the edge's <tt>getIncidentVertices()</tt> - * and then return the first element. - */ - protected Vertex getAVertex(Edge e){ - Vertex v = (Vertex) e.getIncidentVertices().iterator().next(); - return v; - } + /** + * Utility method, gets a single vertex from this edge. The utility's + * implementation is to get the iterator from the edge's <tt>getIncidentVertices()</tt> + * and then return the first element. + */ + protected Vertex getAVertex(Edge e){ + Vertex v = (Vertex) e.getIncidentVertices().iterator().next(); + return v; + } - /** - * Returns the Coordinates object that stores the vertex' x and y location. - * - * @param v - * A Vertex that is a part of the Graph being visualized. - * @return A Coordinates object with x and y locations. - */ - public Coordinates getCoordinates(Vertex v){ - return (Coordinates) v.getUserDatum(getBaseKey()); - } + /** + * Returns the Coordinates object that stores the vertex' x and y location. + * + * @param v + * A Vertex that is a part of the Graph being visualized. + * @return A Coordinates object with x and y locations. + */ + public Coordinates getCoordinates(Vertex v){ + return (Coordinates) v.getUserDatum(getBaseKey()); + } - /** - * Returns the x coordinate of the vertex from the Coordiantes object. - * - * @see edu.uci.ics.jung.visualization.Layout#getX(edu.uci.ics.jung.graph.Vertex) - */ - public double getX(Vertex v){ - return ((Coordinates) v.getUserDatum(getBaseKey())).getX(); - } + /** + * Returns the x coordinate of the vertex from the Coordiantes object. + * + * @see edu.uci.ics.jung.visualization.Layout#getX(edu.uci.ics.jung.graph.Vertex) + */ + public double getX(Vertex v){ + return ((Coordinates) v.getUserDatum(getBaseKey())).getX(); + } - /** - * Returns the y coordinate of the vertex from the Coordiantes object. - * - * @see edu.uci.ics.jung.visualization.Layout#getX(edu.uci.ics.jung.graph.Vertex) - */ - public double getY(Vertex v){ - return ((Coordinates) v.getUserDatum(getBaseKey())).getY(); - } + /** + * Returns the y coordinate of the vertex from the Coordiantes object. + * + * @see edu.uci.ics.jung.visualization.Layout#getX(edu.uci.ics.jung.graph.Vertex) + */ + public double getY(Vertex v){ + return ((Coordinates) v.getUserDatum(getBaseKey())).getY(); + } - // TH: - /** - * Returns the x coordinate of the vertex from the Coordiantes object. - * - * @see edu.uci.ics.jung.visualization.Layout#getX(edu.uci.ics.jung.graph.Vertex) - */ - public void setX(Vertex v, double x){ - ((Coordinates) v.getUserDatum(getBaseKey())).setX(x); - } + // TH: + /** + * Returns the x coordinate of the vertex from the Coordiantes object. + * + * @see edu.uci.ics.jung.visualization.Layout#getX(edu.uci.ics.jung.graph.Vertex) + */ + public void setX(Vertex v, double x){ + ((Coordinates) v.getUserDatum(getBaseKey())).setX(x); + } - /** - * Returns the y coordinate of the vertex from the Coordiantes object. - * - * @see edu.uci.ics.jung.visualization.Layout#getX(edu.uci.ics.jung.graph.Vertex) - */ - public void setY(Vertex v, double y){ - ((Coordinates) v.getUserDatum(getBaseKey())).setY(y); - } + /** + * Returns the y coordinate of the vertex from the Coordiantes object. + * + * @see edu.uci.ics.jung.visualization.Layout#getX(edu.uci.ics.jung.graph.Vertex) + */ + public void setY(Vertex v, double y){ + ((Coordinates) v.getUserDatum(getBaseKey())).setY(y); + } - /** - * When a visualizetion is resized, it presumably wants to fix the - * locations of the vertices and possibly to reinitialize its data. The - * current method calls <tt>initializeLocations</tt> followed by <tt>initialize_local</tt>. - * TODO: A better implementation wouldn't destroy the current information, - * but would either scale the current visualization, or move the nodes - * toward the new center. - */ - public void resize(Dimension size){ - // are we initialized yet? + /** + * When a visualizetion is resized, it presumably wants to fix the + * locations of the vertices and possibly to reinitialize its data. The + * current method calls <tt>initializeLocations</tt> followed by <tt>initialize_local</tt>. + * TODO: A better implementation wouldn't destroy the current information, + * but would either scale the current visualization, or move the nodes + * toward the new center. + */ + public void resize(Dimension size){ + // are we initialized yet? - if (currentSize == null){ - currentSize = size; - return; + if (currentSize == null) { + currentSize = size; + return; + } + + Dimension oldSize; + synchronized (currentSize) { + if (currentSize.equals(size)) return; + oldSize = currentSize; + this.currentSize = size; + } + + int xOffset = (size.width - oldSize.width) / 2; + int yOffset = (size.height - oldSize.height) / 2; + + // now, move each vertex to be at the new screen center + for (Iterator iter = getVisibleVertices().iterator(); iter.hasNext();) { + Vertex e = (Vertex) iter.next(); + offsetVertex(e, xOffset, yOffset); + } + // optionally, we may want to restart } - Dimension oldSize; - synchronized (currentSize){ - if (currentSize.equals(size)) return; - oldSize = currentSize; - this.currentSize = size; + /** + * @param v + * @param xOffset + * @param yOffset + */ + protected void offsetVertex(Vertex v, int xOffset, int yOffset){ + Coordinates c = getCoordinates(v); + c.add(xOffset, yOffset); + forceMove(v, (int) c.getX(), (int) c.getY()); } - int xOffset = (size.width - oldSize.width) / 2; - int yOffset = (size.height - oldSize.height) / 2; + /** + * Restarts the visualization entirely, as if the the user had pressed the + * "scramble" button. Calls <tt>initializeLocation</tt> for each vertex. + * TODO: Is this enough? Should it call the whole initialization process? + * Why does resize do more? + */ + public void restart(){ + initializeLocations(); + initialize_local(); + } - // now, move each vertex to be at the new screen center - for (Iterator iter = getVisibleVertices().iterator(); iter.hasNext();){ - Vertex e = (Vertex) iter.next(); - offsetVertex(e, xOffset, yOffset); + // /** + // * Returns the set of all visible vertices known to the + // * visualization. + // * @return the list of all vertices in the visible graph + // */ + // protected Set getAllVertices() { + // return getVisibleGraph().getVertices(); + // } + + /** + * Gets the vertex nearest to the location of the (x,y) location selected. + * Calls the longer form of the call. + */ + public Vertex getVertex(double x, double y){ + return getVertex(x, y, Math.sqrt(Double.MAX_VALUE - 1000)); } - // optionally, we may want to restart - } - /** - * @param v - * @param xOffset - * @param yOffset - */ - protected void offsetVertex(Vertex v, int xOffset, int yOffset){ - Coordinates c = getCoordinates(v); - c.add(xOffset, yOffset); - forceMove(v, (int) c.getX(), (int) c.getY()); - } + /** + * Gets the vertex nearest to the location of the (x,y) location selected, + * within a distance of <tt>maxDistance</tt>. Iterates through all + * visible vertices and checks their distance from the click. Override this + * method to provde a more efficient implementation. + */ + public Vertex getVertex(double x, double y, double maxDistance){ + double minDistance = maxDistance * maxDistance; + Vertex closest = null; + for (Iterator iter = getVisibleVertices().iterator(); iter.hasNext();) { + Vertex v = (Vertex) iter.next(); + double dx = getX(v) - x; + double dy = getY(v) - y; + double dist = dx * dx + dy * dy; + if (dist < minDistance) { + minDistance = dist; + closest = v; + } + } + return closest; + } - /** - * Restarts the visualization entirely, as if the the user had pressed the - * "scramble" button. Calls <tt>initializeLocation</tt> for each vertex. - * TODO: Is this enough? Should it call the whole initialization process? - * Why does resize do more? - */ - public void restart(){ - initializeLocations(); - initialize_local(); - } + /** + * Gets the edge nearest to the location of the (x,y) location selected. + * Calls the longer form of the call. + */ + public Edge getEdge(double x, double y){ + return getEdge(x, y, Math.sqrt(Double.MAX_VALUE - 1000)); + } - // /** - // * Returns the set of all visible vertices known to the - // * visualization. - // * @return the list of all vertices in the visible graph - // */ - // protected Set getAllVertices() { - // return getVisibleGraph().getVertices(); - // } + /** + * Gets the edge nearest to the location of the (x,y) location selected, + * within a distance of <tt>maxDistance</tt>, Iterates through all + * visible edges and checks their distance from the click. Override this + * method to provide a more efficient implementation. + * + * @param x + * @param y + * @param maxDistance + * @return Edge closest to the click. + */ + public Edge getEdge(double x, double y, double maxDistance){ + double minDistance = maxDistance * maxDistance; + Edge closest = null; + for (Iterator iter = getVisibleEdges().iterator(); iter.hasNext();) { + Edge e = (Edge) iter.next(); + // if anyone uses a hyperedge, this is too complex. + if (e.numVertices() != 2) continue; + // Could replace all this set stuff with getFrom_internal() etc. + Set vertices = e.getIncidentVertices(); + Iterator vertexIterator = vertices.iterator(); + Vertex v1 = (Vertex) vertexIterator.next(); + Vertex v2 = (Vertex) vertexIterator.next(); + // Get coords + double x1 = getX(v1); + double y1 = getY(v1); + double x2 = getX(v2); + double y2 = getY(v2); + // Calculate location on line closest to (x,y) + // First, check that v1 and v2 are not coincident. + if (x1 == x2 && y1 == y2) continue; + double b = ((y - y1) * (y2 - y1) + (x - x1) * (x2 - x1)) / ((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)); + // + double distance2; // square of the distance + if (b <= 0) + distance2 = (x - x1) * (x - x1) + (y - y1) * (y - y1); + else if (b >= 1) + distance2 = (x - x2) * (x - x2) + (y - y2) * (y - y2); + else { + double x3 = x1 + b * (x2 - x1); + double y3 = y1 + b * (y2 - y1); + distance2 = (x - x3) * (x - x3) + (y - y3) * (y - y3); + } - /** - * Gets the vertex nearest to the location of the (x,y) location selected. - * Calls the longer form of the call. - */ - public Vertex getVertex(double x, double y){ - return getVertex(x, y, Math.sqrt(Double.MAX_VALUE - 1000)); - } + if (distance2 < minDistance) { + minDistance = distance2; + closest = e; + } + } + return closest; + } - /** - * Gets the vertex nearest to the location of the (x,y) location selected, - * within a distance of <tt>maxDistance</tt>. Iterates through all - * visible vertices and checks their distance from the click. Override this - * method to provde a more efficient implementation. - */ - public Vertex getVertex(double x, double y, double maxDistance){ - double minDistance = maxDistance * maxDistance; - Vertex closest = null; - for (Iterator iter = getVisibleVertices().iterator(); iter.hasNext();){ - Vertex v = (Vertex) iter.next(); - double dx = getX(v) - x; - double dy = getY(v) - y; - double dist = dx * dx + dy * dy; - if (dist < minDistance){ - minDistance = dist; - closest = v; - } + /** + * Accessor for the graph that represets all vertices. + * + * @return the graph that contains all vertices. + */ + public Graph getGraph(){ + return baseGraph; } - return closest; - } - /** - * Gets the edge nearest to the location of the (x,y) location selected. - * Calls the longer form of the call. - */ - public Edge getEdge(double x, double y){ - return getEdge(x, y, Math.sqrt(Double.MAX_VALUE - 1000)); - } + /** + * Returns the set of edges from the original <tt>getGraph</tt> that are + * now visible. These edges are equivalent to the ones passed in from the + * <tt>Graph</tt> argument to <tt>applyFilter()</tt>. + */ + public Set getVisibleEdges(){ + return visibleEdges; + } - /** - * Gets the edge nearest to the location of the (x,y) location selected, - * within a distance of <tt>maxDistance</tt>, Iterates through all - * visible edges and checks their distance from the click. Override this - * method to provide a more efficient implementation. - * - * @param x - * @param y - * @param maxDistance - * @return Edge closest to the click. - */ - public Edge getEdge(double x, double y, double maxDistance){ - double minDistance = maxDistance * maxDistance; - Edge closest = null; - for (Iterator iter = getVisibleEdges().iterator(); iter.hasNext();){ - Edge e = (Edge) iter.next(); - // if anyone uses a hyperedge, this is too complex. - if (e.numVertices() != 2) continue; - // Could replace all this set stuff with getFrom_internal() etc. - Set vertices = e.getIncidentVertices(); - Iterator vertexIterator = vertices.iterator(); - Vertex v1 = (Vertex) vertexIterator.next(); - Vertex v2 = (Vertex) vertexIterator.next(); - // Get coords - double x1 = getX(v1); - double y1 = getY(v1); - double x2 = getX(v2); - double y2 = getY(v2); - // Calculate location on line closest to (x,y) - // First, check that v1 and v2 are not coincident. - if (x1 == x2 && y1 == y2) continue; - double b = ((y - y1) * (y2 - y1) + (x - x1) * (x2 - x1)) / ((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)); - // - double distance2; // square of the distance - if (b <= 0) - distance2 = (x - x1) * (x - x1) + (y - y1) * (y - y1); - else if (b >= 1) - distance2 = (x - x2) * (x - x2) + (y - y2) * (y - y2); - else{ - double x3 = x1 + b * (x2 - x1); - double y3 = y1 + b * (y2 - y1); - distance2 = (x - x3) * (x - x3) + (y - y3) * (y - y3); - } + /** + * Returns the set of vertices from the original <tt>getGraph</tt> that + * are now visible. These vertices are equivalent to the ones passed in + * from the <tt>Graph</tt> argument to <tt>applyFilter()</tt>. + */ + public Set getVisibleVertices(){ + return visibleVertices; + } - if (distance2 < minDistance){ - minDistance = distance2; - closest = e; - } + /** + * Forcibly moves a vertex to the (x,y) location by setting its x and y + * locations to the inputted location. Does not add the vertex to the + * "dontmove" list, and (in the default implementation) does not make any + * adjustments to the rest of the graph. + */ + public void forceMove(Vertex picked, int x, int y){ + if (!fix(picked)) { + Coordinates coord = getCoordinates(picked); + coord.setX(x); + coord.setY(y); + } } - return closest; - } - /** - * Accessor for the graph that represets all vertices. - * - * @return the graph that contains all vertices. - */ - public Graph getGraph(){ - return baseGraph; - } + /** + * Adds the vertex to the DontMove list + */ + public void lockVertex(Vertex v){ + dontmove.add(v); + } - /** - * Returns the set of edges from the original <tt>getGraph</tt> that are - * now visible. These edges are equivalent to the ones passed in from the - * <tt>Graph</tt> argument to <tt>applyFilter()</tt>. - */ - public Set getVisibleEdges(){ - return visibleEdges; - } + /** + * Removes the vertex from the DontMove list + */ + public void unlockVertex(Vertex v){ + if (!fix(v)) { + dontmove.remove(v); + } + } - /** - * Returns the set of vertices from the original <tt>getGraph</tt> that - * are now visible. These vertices are equivalent to the ones passed in - * from the <tt>Graph</tt> argument to <tt>applyFilter()</tt>. - */ - public Set getVisibleVertices(){ - return visibleVertices; - } + public void setFix(Vertex v){ + fix.add(v); + dontmove.add(v); + } - /** - * Forcibly moves a vertex to the (x,y) location by setting its x and y - * locations to the inputted location. Does not add the vertex to the - * "dontmove" list, and (in the default implementation) does not make any - * adjustments to the rest of the graph. - */ - public void forceMove(Vertex picked, int x, int y){ - if (!fix(picked)){ - Coordinates coord = getCoordinates(picked); - coord.setX(x); - coord.setY(y); + public void unsetFix(Vertex v){ + fix.remove(v); + dontmove.remove(v); } - } - /** - * Adds the vertex to the DontMove list - */ - public void lockVertex(Vertex v){ - dontmove.add(v); - } + /** + * Applies the filter to the current graph. The default implementation + * merely makes fewer vertices available to the <tt>getVisibleVertices</tt> + * and <tt>getVisibleEdges</tt> methods. + * + * @see Layout#applyFilter(Graph g) + */ + public synchronized void applyFilter(Graph g){ + this.visibleGraph = g; + this.visibleVertices = GraphUtils.getEqualVertices(g.getVertices(), baseGraph); + this.visibleEdges = GraphUtils.getEqualEdges(g.getEdges(), baseGraph); + } - /** - * Removes the vertex from the DontMove list - */ - public void unlockVertex(Vertex v){ - if (!fix(v)){ - dontmove.remove(v); + /** + * @author FLAW + * @return the notCalculatedVertices + */ + public Set getNotCalculatedVertices(){ + return notCalculatedVertices; } - } - public void setFix(Vertex v){ - fix.add(v); - dontmove.add(v); - } + /** + * @author FLAW + * @param v + * @return is Vertex not calculated + */ + public boolean isNotCalculatedVertx(Vertex v){ + return notCalculatedVertices.contains(v); + } - public void unsetFix(Vertex v){ - fix.remove(v); - dontmove.remove(v); - } + /** + * @author FLAW + * @param v + */ + public void addNotCalculatedVertex(Vertex v){ + notCalculatedVertices.add(v); + } - /** - * Applies the filter to the current graph. The default implementation - * merely makes fewer vertices available to the <tt>getVisibleVertices</tt> - * and <tt>getVisibleEdges</tt> methods. - * - * @see Layout#applyFilter(Graph g) - */ - public synchronized void applyFilter(Graph g){ - this.visibleGraph = g; - this.visibleVertices = GraphUtils.getEqualVertices(g.getVertices(), baseGraph); - this.visibleEdges = GraphUtils.getEqualEdges(g.getEdges(), baseGraph); - } + /** + * @author FLAW + * @param v + */ + public void removeNotCalculatedVertex(Vertex v){ + notCalculatedVertices.remove(v); + } } \ No newline at end of file Modified: trunk/magicmapclient/src/edu/uci/ics/jung/visualization/SpringLayout.java =================================================================== --- trunk/magicmapclient/src/edu/uci/ics/jung/visualization/SpringLayout.java 2007-12-20 12:51:48 UTC (rev 695) +++ trunk/magicmapclient/src/edu/uci/ics/jung/visualization/SpringLayout.java 2007-12-20 12:59:48 UTC (rev 696) @@ -1,9 +1,8 @@ /* * Copyright (c) 2003, the JUNG Project and the Regents of the University of - * California All rights reserved. - * - * This software is open-source under the BSD license; see either "license.txt" - * or http://jung.sourceforge.net/license.txt for a description. + * California All rights reserved. This software is open-source under the BSD + * license; see either "license.txt" or http://jung.sourceforge.net/license.txt + * for a description. */ package edu.uci.ics.jung.visualization; @@ -34,508 +33,521 @@ */ public class SpringLayout extends AbstractLayout implements LayoutMutable { - private static final Object SPRING_KEY = "temp_edu.uci.ics.jung.Spring_Visualization_Key"; - protected double stretch = 85.0; //70; // 0.70; + private static final Object SPRING_KEY = "temp_edu.uci.ics.jung.Spring_Visualization_Key"; + protected double stretch = 85.0; //70; // 0.70; - protected LengthFunction lengthFunction; - protected RepulsionFunction repulsionFunction; // TH - protected ForceFunction forceFunction; //TH - protected CanLeaveMapFunction leaveFunction; + protected LengthFunction lengthFunction; + protected RepulsionFunction repulsionFunction; // TH + protected ForceFunction forceFunction; //TH + protected CanLeaveMapFunction leaveFunction; - //protected int repulsion_range = 100; - //protected double force_multiplier = 1.0 / 3.0; + //protected int repulsion_range = 100; + //protected double force_multiplier = 1.0 / 3.0; - /** - * Returns the status. - */ - public String getStatus(){ - return null; - } + /** + * Returns the status. + */ + public String getStatus(){ + return null; + } - /** - * Constructor for a SpringLayout for a raw graph with associated - * dimension--the input knows how big the graph is. Defaults to the unit - * length function. - */ - public SpringLayout(Graph g) { - this(g, UNITLENGTHFUNCTION, NoRepulsionFunction); - } + /** + * Constructor for a SpringLayout for a raw graph with associated + * dimension--the input knows how big the graph is. Defaults to the unit + * length function. + */ + public SpringLayout(Graph g) { + this(g, UNITLENGTHFUNCTION, NoRepulsionFunction); + } - /** - * Constructor for a SpringLayout for a raw graph with associated component. - * - * @param g - * the input Graph - * @param f - * the length function - */ - public SpringLayout(Graph g, LengthFunction f) { - this(g,f,NoRepulsionFunction); - } + /** + * Constructor for a SpringLayout for a raw graph with associated component. + * + * @param g + * the input Graph + * @param f + * the length function + */ + public SpringLayout(Graph g, LengthFunction f) { + this(g, f, NoRepulsionFunction); + } - /** - * Constructor for a SpringLayout for a raw graph with associated component. - * - * @param g - * the input Graph - * @param f - * the length function - * @param r - * the repulsion function - */ - public SpringLayout(Graph g, LengthFunction f, RepulsionFunction r) { - super(g); - this.lengthFunction = f; - this.repulsionFunction = r; - this.forceFunction = DefaultForceFunction; - this.leaveFunction = new CanLeaveMapFunction() { + /** + * Constructor for a SpringLayout for a raw graph with associated component. + * + * @param g + * the input Graph + * @param f + * the length function + * @param r + * the repulsion function + */ + public SpringLayout(Graph g, LengthFunction f, RepulsionFunction r) { + super(g); + this.lengthFunction = f; + this.repulsionFunction = r; + this.forceFunction = DefaultForceFunction; + this.leaveFunction = new CanLeaveMapFunction() { - public boolean canLeave(Vertex v){ - return false; - } - }; - } + public boolean canLeave(Vertex v){ + return false; + } + }; + } - /** - * @return the current value for the stretch parameter - * @see #setStretch(double) - */ - public double getStretch(){ - return stretch; - } + /** + * @return the current value for the stretch parameter + * @see #setStretch(double) + */ + public double getStretch(){ + return stretch; + } - /** - * <p>Sets the stretch parameter for this instance. This value - * specifies how much the degrees of an edge's incident vertices - * should influence how easily the endpoints of that edge - * can move (that is, that edge's tendency to change its length).</p> - * - * <p>The default value is 0.70. Positive values less than 1 cause - * high-degree vertices to move less than low-degree vertices, and - * values > 1 cause high-degree vertices to move more than - * low-degree vertices. Negative values will have unpredictable - * and inconsistent results.</p> - * @param stretch - */ - public void setStretch(double stretch){ - this.stretch = stretch; - } + /** + * <p>Sets the stretch parameter for this instance. This value + * specifies how much the degrees of an edge's incident vertices + * should influence how easily the endpoints of that edge + * can move (that is, that edge's tendency to change its length).</p> + * + * <p>The default value is 0.70. Positive values less than 1 cause + * high-degree vertices to move less than low-degree vertices, and + * values > 1 cause high-degree vertices to move more than + * low-degree vertices. Negative values will have unpredictable + * and inconsistent results.</p> + * @param stretch + */ + public void setStretch(double stretch){ + this.stretch = stretch; + } - public CanLeaveMapFunction getLeaveFunction(){ - return leaveFunction; - } + public CanLeaveMapFunction getLeaveFunction(){ + return leaveFunction; + } - public void setLeaveFunction(CanLeaveMapFunction leaveFunction){ - this.leaveFunction = leaveFunction; - } + public void setLeaveFunction(CanLeaveMapFunction leaveFunction){ + this.leaveFunction = leaveFunction; + } - protected void initialize_local(){ - for (Iterator iter = getGraph().getEdges().iterator(); iter.hasNext();){ - Edge e = (Edge) iter.next(); - SpringEdgeData sed = getSpringData(e); - if (sed == null){ - sed = new SpringEdgeData(e); - e.addUserDatum(getSpringKey(), sed, UserData.REMOVE); - } - calcEdgeLength(sed, lengthFunction); + protected void initialize_local(){ + for (Iterator iter = getGraph().getEdges().iterator(); iter.hasNext();) { + Edge e = (Edge) iter.next(); + SpringEdgeData sed = getSpringData(e); + if (sed == null) { + sed = new SpringEdgeData(e); + e.addUserDatum(getSpringKey(), sed, UserData.REMOVE); + } + calcEdgeLength(sed, lengthFunction); + } } - } - Object key = null; + Object key = null; - public Object getSpringKey(){ - if (key == null) key = new Pair(this, SPRING_KEY); - return key; - } + public Object getSpringKey(){ + if (key == null) key = new Pair(this, SPRING_KEY); + return key; + } - /** - * (non-Javadoc) - * - * @see edu.uci.ics.jung.visualization.AbstractLayout#initialize_local_vertex(edu.uci.ics.jung.graph.Vertex) - */ - protected void initialize_local_vertex(Vertex v){ - SpringVertexData vud = getSpringData(v); - if (vud == null){ - vud = new SpringVertexData(); - v.addUserDatum(getSpringKey(), vud, UserData.REMOVE); + /** + * (non-Javadoc) + * + * @see edu.uci.ics.jung.visualization.AbstractLayout#initialize_local_vertex(edu.uci.ics.jung.graph.Vertex) + */ + protected void initialize_local_vertex(Vertex v){ + SpringVertexData vud = getSpringData(v); + if (vud == null) { + vud = new SpringVertexData(); + v.addUserDatum(getSpringKey(), vud, UserData.REMOVE); + } } - } - /* ------------------------- */ + /* ------------------------- */ - protected void calcEdgeLength(SpringEdgeData sed, LengthFunction f){ - sed.length = f.getLength(sed.e); - } + protected void calcEdgeLength(SpringEdgeData sed, LengthFunction f){ + sed.length = f.getLength(sed.e); + } - /* ------------------------- */ + /* ------------------------- */ - /** - * Relaxation step. Moves all nodes a smidge. - */ - public void advancePositions(){ - for (Iterator iter = getVisibleVertices().iterator(); iter.hasNext();){ - Vertex v = (Vertex) iter.next(); - SpringVertexData svd = getSpringData(v); - if (svd == null){ - System.out.println("How confusing!"); - continue; - } - svd.dx /= 4; - svd.dy /= 4; - svd.edgedx = svd.edgedy = 0; - svd.repulsiondx = svd.repulsiondy = 0; - } + /** + * Relaxation step. Moves all nodes a smidge. + */ + public void advancePositions(){ + for (Iterator iter = getVisibleVertices().iterator(); iter.hasNext();) { + Vertex v = (Vertex) iter.next(); + if (isNotCalculatedVertx(v)) { + continue; + } + SpringVertexData svd = getSpringData(v); + if (svd == null) { + System.out.println("How confusing!"); + continue; + } + svd.dx /= 4; + svd.dy /= 4; + svd.edgedx = svd.edgedy = 0; + svd.repulsiondx = svd.repulsiondy = 0; + } - try{ - SwingUtilities.invokeAndWait(new Runnable() { + try { + SwingUtilities.invokeAndWait(new Runnable() { - public void run(){ - relaxEdges(); - calculateRepulsion(); - moveNodes(); + public void run(){ + relaxEdges(); + calculateRepulsion(); + moveNodes(); + } + }); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (InvocationTargetException e) { + // TODO Auto-generated catch block + e.printStackTrace(); } - }); - } catch (InterruptedException e){ - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (InvocationTargetException e){ - // TODO Auto-generated catch block - e.printStackTrace(); + } - } + protected Vertex getAVertex(Edge e){ + Vertex v = (Vertex) e.getIncidentVertices().iterator().next(); + return v; + } - protected Vertex getAVertex(Edge e){ - Vertex v = (Vertex) e.getIncidentVertices().iterator().next(); - return v; - } + protected void relaxEdges(){ + for (Iterator i = getVisibleEdges().iterator(); i.hasNext();) { + Edge e = (Edge) i.next(); - protected void relaxEdges(){ - for (Iterator i = getVisibleEdges().iterator(); i.hasNext();){ - Edge e = (Edge) i.next(); + Vertex v1 = getAVertex(e); + Vertex v2 = e.getOpposite(v1); - Vertex v1 = getAVertex(e); - Vertex v2 = e.getOpposite(v1); + double vx = getX(v1) - getX(v2); + double vy = getY(v1) - getY(v2); + double len = Math.sqrt(vx * vx + vy * vy); - double vx = getX(v1) - getX(v2); - double vy = getY(v1) - getY(v2); - double len = Math.sqrt(vx * vx + vy * vy); + double desiredLen = getLength(e); - double desiredLen = getLength(e); + // round from zero, if needed [zero would be Bad.]. + len = (len == 0) ? .0001 : len; - // round from zero, if needed [zero would be Bad.]. - len = (len == 0) ? .0001 : len; + double force_multiplier = forceFunction.getForce(v1, v2); - double force_multiplier = forceFunction.getForce(v1, v2); + double f = force_multiplier * (desiredLen - len) / len; - double f = force_multiplier * (desiredLen - len) / len; + f = f * Math.pow(stretch / 100.0, (v1.degree() + v2.degree() - 2)); - f = f * Math.pow(stretch / 100.0, (v1.degree() + v2.degree() - 2)); + // the actual movement distance 'dx' is the force multiplied by the + // distance to go. + double dx = f * vx; + double dy = f * vy; + SpringVertexData v1D, v2D; + v1D = getSpringData(v1); + v2D = getSpringData(v2); - // the actual movement distance 'dx' is the force multiplied by the - // distance to go. - double dx = f * vx; - double dy = f * vy; - SpringVertexData v1D, v2D; - v1D = getSpringData(v1); - v2D = getSpringData(v2); + SpringEdgeData sed = getSpringData(e); + sed.f = f; - SpringEdgeData sed = getSpringData(e); - sed.f = f; + v1D.edgedx += dx; + v1D.edgedy += dy; + v2D.edgedx += -dx; + v2D.edgedy += -dy; + } - v1D.edgedx += dx; - v1D.edgedy += dy; - v2D.edgedx += -dx; - v2D.edgedy += -dy; } - } + protected void calculateRepulsion(){ + for (Iterator iter = getVisibleVertices().iterator(); iter.hasNext();) { + Vertex v = (Vertex) iter.next(); + if (isNotCalculatedVertx(v)) { + continue; + } + if (dontMove(v)) continue; - protected void calculateRepulsion(){ - for (Iterator iter = getVisibleVertices().iterator(); iter.hasNext();){ - Vertex v = (Vertex) iter.next(); - if (dontMove(v)) continue; + SpringVertexData svd = getSpringData(v); + double dx = 0, dy = 0; - SpringVertexData svd = getSpringData(v); - double dx = 0, dy = 0; + double repulsion_range = 0; - double repulsion_range = 0; + for (Iterator iter2 = getVisibleVertices().iterator(); iter2.hasNext();) { - for (Iterator iter2 = getVisibleVertices().iterator(); iter2.hasNext();){ + Vertex v2 = (Vertex) iter2.next(); + if (v == v2) continue; - Vertex v2 = (Vertex) iter2.next(); - if (v == v2) continue; + // TH + repulsion_range = this.repulsionFunction.getRepulsion(v, v2); - // TH - repulsion_range = this.repulsionFunction.getRepulsion(v, v2); - - double vx = getX(v) - getX(v2); - double vy = getY(v) - getY(v2); - double distance = vx * vx + vy * vy; - if (distance == 0){ - dx += Math.random(); - dy += Math.random(); - } else if (distance < repulsion_range * repulsion_range){ - double factor = 1; - dx += factor * vx / Math.pow(distance, 2); - dy += factor * vy / Math.pow(distance, 2); + double vx = getX(v) - getX(v2); + double vy = getY(v) - getY(v2); + double distance = vx * vx + vy * vy; + if (distance == 0) { + dx += Math.random(); + dy += Math.random(); + } else if (distance < repulsion_range * repulsion_range) { + double factor = 1; + dx += factor * vx / Math.pow(distance, 2); + dy += factor * vy / Math.pow(distance, 2); + } + } + double dlen = dx * dx + dy * dy; + if (dlen > 0) { + dlen = Math.sqrt(dlen) / 2; + svd.repulsiondx += dx / dlen; + svd.repulsiondy += dy / dlen; + } } - } - double dlen = dx * dx + dy * dy; - if (dlen > 0){ - dlen = Math.sqrt(dlen) / 2; - svd.repulsiondx += dx / dlen; - svd.repulsiondy += dy / dlen; - } } - } - protected void moveNodes(){ + protected void moveNodes(){ - synchronized (getCurrentSize()){ + synchronized (getCurrentSize()) { - for (Iterator i = getVisibleVertices().iterator(); i.hasNext();){ - Vertex v = (Vertex) i.next(); - if (dontMove(v)) continue; - SpringVertexData vd = getSpringData(v); - Coordinates xyd = getCoordinates(v); + for (Iterator i = getVisibleVertices().iterator(); i.hasNext();) { + Vertex v = (Vertex) i.next(); + if (isNotCalculatedVertx(v)) { + continue; + } + if (dontMove(v)) continue; + SpringVertexData vd = getSpringData(v); + Coordinates xyd = getCoordinates(v); - vd.dx += vd.repulsiondx + vd.edgedx; - vd.dy += vd.repulsiondy + vd.edgedy; + vd.dx += vd.repulsiondx + vd.edgedx; + vd.dy += vd.repulsiondy + vd.edgedy; - // keeps nodes from moving any faster than 5 per time unit - xyd.addX(Math.max(-5, Math.min(5, vd.dx))); - xyd.addY(Math.max(-5, Math.min(5, vd.dy))); + // keeps nodes from moving any faster than 5 per time unit + xyd.addX(Math.max(-5, Math.min(5, vd.dx))); + xyd.addY(Math.max(-5, Math.min(5, vd.dy))); - int width = getCurrentSize().width; - int height = getCurrentSize().height; + int width = getCurrentSize().width; + int height = getCurrentSize().height; - // Bestimmte Knoten sollen die Karte verlassen dr\xFCfen - if (!leaveFunction.canLeave(v)){ - if (xyd.getX() < 0){ - xyd.setX(0); - } else if (xyd.getX() > width){ - xyd.setX(width); - } - if (xyd.getY() < 0){ - xyd.setY(0); - } else if (xyd.getY() > height){ - xyd.setY(height); - } + // Bestimmte Knoten sollen die Karte verlassen dr\xFCfen + if (!leaveFunction.canLeave(v)) { + if (xyd.getX() < 0) { + xyd.setX(0); + } else if (xyd.getX() > width) { + xyd.setX(width); + } + if (xyd.getY() < 0) { + xyd.setY(0); + } else if (xyd.getY() > height) { + xyd.setY(height); + } + } + + } } - } } - } + public SpringVertexData getSpringData(Vertex v){ + return (SpringVertexData) (v.getUserDatum(getSpringKey())); + } - public SpringVertexData getSpringData(Vertex v){ - return (SpringVertexData) (v.getUserDatum(getSpringKey())); - } + public SpringEdgeData getSpringData(Edge e){ + try { + return (SpringEdgeData) (e.getUserDatum(getSpringKey())); + } catch (ClassCastException cce) { + System.out.println(e.getUserDatum(getSpringKey()).getClass()); + throw cce; + } + } - public SpringEdgeData getSpringData(Edge e){ - try{ - return (SpringEdgeData) (e.getUserDatum(getSpringKey())); - } catch (ClassCastException cce){ - System.out.println(e.getUserDatum(getSpringKey()).getClass()); - throw cce; + public double getLength(Edge e){ + double d = ((SpringEdgeData) e.getUserDatum(getSpringKey())).length; + return d; } - } - public double getLength(Edge e){ - double d = ((SpringEdgeData) e.getUserDatum(getSpringKey())).length; - return d; - } + public void setLength(Edge e, double length){ + ((SpringEdgeData) e.getUserDatum(getSpringKey())).length = length; + } - public void setLength(Edge e, double length){ - ((SpringEdgeData) e.getUserDatum(getSpringKey())).length = length; - } + /* --------------- Repulsion Function------------------ */ - /* --------------- Repulsion Function------------------ */ + /** + * Extension for PACW: Make the Repulsion configurable. + * + * + * @author thuebner + */ + public static interface RepulsionFunction { - /** - * Extension for PACW: Make the Repulsion configurable. - * - * - * @author thuebner - */ - public static interface RepulsionFunction { + public double getRepulsion(Vertex v1, Vertex v2); + } + public static RepulsionFunction NoRepulsionFunction = new RepulsionFunction() { - public double getRepulsion(Vertex v1, Vertex v2); - } - public static RepulsionFunction NoRepulsionFunction = new RepulsionFunction(){ - public double getRepulsion(Vertex v1, Vertex v2) { - return 0; - } - }; - /** - * Extension for PACW: Make the Repulsion configurable. - * - * - * @author thuebner - */ - public static interface ForceFunction { + public double getRepulsion(Vertex v1, Vertex v2){ + return 0; + } + }; /** - * Sets the force multiplier for this instance. This value is used to - * specify how strongly an edge "wants" to be its default length - * (higher values indicate a greater attraction for the default length), - * which affects how much its endpoints move at each timestep. - * The default value is 1/3. A value of 0 turns off any attempt by the - * layout to cause edges to conform to the default length. Negative - * values cause long edges to get longer and short edges to get shorter; use - * at your own risk. - * @param v1 - * @param v2 + * Extension for PACW: Make the Repulsion configurable. + * + * + * @author thuebner */ + public static interface ForceFunction { - public double getForce(Vertex v1, Vertex v2); - } + /** + * Sets the force multiplier for this instance. This value is used to + * specify how strongly an edge "wants" to be its default length + * (higher values indicate a greater attraction for the default length), + * which affects how much its... [truncated message content] |
From: <fle...@us...> - 2007-12-20 14:32:53
|
Revision: 697 http://magicmap.svn.sourceforge.net/magicmap/?rev=697&view=rev Author: flederohr Date: 2007-12-20 06:32:48 -0800 (Thu, 20 Dec 2007) Log Message: ----------- version incremented improved building scripts Modified Paths: -------------- trunk/magicmapclient/MagicMapSetup.nsi trunk/magicmapclient/build.xml Modified: trunk/magicmapclient/MagicMapSetup.nsi =================================================================== --- trunk/magicmapclient/MagicMapSetup.nsi 2007-12-20 12:59:48 UTC (rev 696) +++ trunk/magicmapclient/MagicMapSetup.nsi 2007-12-20 14:32:48 UTC (rev 697) @@ -7,7 +7,8 @@ # Defines !define REGKEY "SOFTWARE\$(^Name)" -!define VERSION 0.9.0 +!define VERSION 0.9.2 +!define APPENDIX "beta1" !define COMPANY "Humboldt Universit\xE4t zu Berlin" !define URL http://www2.informatik.hu-berlin.de/rok/MagicMap @@ -45,7 +46,7 @@ !insertmacro MUI_LANGUAGE German # Installer attributes -OutFile MagicMapsetup.exe +OutFile dist\MagicMap-${VERSION}-${APPENDIX}.exe InstallDir $PROGRAMFILES\MagicMap CRCCheck on XPStyle on Modified: trunk/magicmapclient/build.xml =================================================================== --- trunk/magicmapclient/build.xml 2007-12-20 12:59:48 UTC (rev 696) +++ trunk/magicmapclient/build.xml 2007-12-20 14:32:48 UTC (rev 697) @@ -2,8 +2,8 @@ <project name="magicmapclient" default="jar" basedir="."> <property name="application" value="magicmap" /> <!-- Version Information --> - <property name="version.number" value="0.9.1" /> - <property name="version.appendix" value="beta 5" /> + <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" /> @@ -132,7 +132,7 @@ </target> <target name="dist" depends="jar"> - <zip destfile="dist/${application}-${version.number}.zip"> + <zip destfile="dist/${application}-${version.number}-${version.appendix}.zip"> <fileset dir="." includes="lib/*" /> <fileset dir="." includes="plugins/*" /> <fileset dir="." includes="${jar.name}" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |