|
From: <jan...@us...> - 2006-11-29 09:34:17
|
Revision: 486
http://svn.sourceforge.net/magicmap/?rev=486&view=rev
Author: jan_fride
Date: 2006-11-29 01:33:47 -0800 (Wed, 29 Nov 2006)
Log Message:
-----------
gui zum instalieren von plugins
Modified Paths:
--------------
trunk/magicmapclient/src/net/sf/magicmap/artifact/Artifact.java
trunk/magicmapclient/src/net/sf/magicmap/artifact/ArtifactComparator.java
trunk/magicmapclient/src/net/sf/magicmap/artifact/IArtifact.java
trunk/magicmapclient/src/net/sf/magicmap/artifact/IVendor.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/MainGUI.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/TabForm.java
trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/VisualList.java
trunk/magicmapclient/src/net/sf/magicmap/client/model/measurement/MeasurementTableModel.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/PluginLoader.java
trunk/magicmapclient/src/net/sf/magicmap/plugin/PluginManager.java
trunk/magicmapclient/src/net/sf/magicmap/plugin/PluginRepository.java
trunk/magicmapclient/src/net/sf/magicmap/plugin/SimplePluginDescriptor.java
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
Added Paths:
-----------
trunk/magicmapclient/src/net/sf/magicmap/artifact/ArtifactTools.java
trunk/magicmapclient/src/net/sf/magicmap/artifact/Version.java
trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/DocumentUtils.java
trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/table/
trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/table/AndFilter.java
trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/table/FilteredTableModel.java
trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/table/NotFilter.java
trunk/magicmapclient/src/net/sf/magicmap/plugin/action/
trunk/magicmapclient/src/net/sf/magicmap/plugin/action/InstallPluginAction.java
trunk/magicmapclient/src/net/sf/magicmap/plugin/action/LoadPluginsAction.java
trunk/magicmapclient/src/net/sf/magicmap/plugin/action/ShowPluginsAction.java
trunk/magicmapclient/src/net/sf/magicmap/plugin/ui/PluginDescriptorModel.java
trunk/magicmapclient/src/net/sf/magicmap/plugin/ui/PluginTableRenderer.java
trunk/magicmapclient/src/net/sf/magicmap/plugin/util/DirWalker.java
Removed Paths:
-------------
trunk/magicmapclient/src/net/sf/magicmap/plugin/ui/PluginDescriptorView.java
trunk/magicmapclient/src/net/sf/magicmap/plugin/ui/PluginTableModel.java
Modified: trunk/magicmapclient/src/net/sf/magicmap/artifact/Artifact.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/artifact/Artifact.java 2006-11-17 11:02:55 UTC (rev 485)
+++ trunk/magicmapclient/src/net/sf/magicmap/artifact/Artifact.java 2006-11-29 09:33:47 UTC (rev 486)
@@ -5,16 +5,16 @@
private final String groupid;
private final String artifactid;
- private final String version;
+ private final Version 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;
+ this.version = new Version(version);
}
- public String getVersion(){
+ public Version getVersion(){
return this.version;
}
Modified: trunk/magicmapclient/src/net/sf/magicmap/artifact/ArtifactComparator.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/artifact/ArtifactComparator.java 2006-11-17 11:02:55 UTC (rev 485)
+++ trunk/magicmapclient/src/net/sf/magicmap/artifact/ArtifactComparator.java 2006-11-29 09:33:47 UTC (rev 486)
@@ -2,6 +2,7 @@
package net.sf.magicmap.artifact;
import java.util.Comparator;
+import java.util.StringTokenizer;
public class ArtifactComparator implements Comparator<IArtifact> {
Added: trunk/magicmapclient/src/net/sf/magicmap/artifact/ArtifactTools.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/artifact/ArtifactTools.java (rev 0)
+++ trunk/magicmapclient/src/net/sf/magicmap/artifact/ArtifactTools.java 2006-11-29 09:33:47 UTC (rev 486)
@@ -0,0 +1,26 @@
+package net.sf.magicmap.artifact;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: Jan
+ * Date: 09.11.2006
+ * Time: 19:36:25
+ * To change this template use File | Settings | File Templates.
+ */
+public class ArtifactTools {
+
+ public String getPath(IArtifact artifact){
+ return artifact.getGroupId() + "/" + artifact.getArtifactId() + "/"+artifact.getVersion();
+ }
+
+ public IArtifact fromString(String str){
+ String[] tokens = str.split("/");
+ if (tokens == null || tokens.length != 3) return new Artifact("","","");
+ else return new Artifact(tokens[0], tokens[1], tokens[2]);
+ }
+
+ public String getFileName(IArtifact artifact){
+ return artifact.getArtifactId() + "-" + artifact.getVersion()+".jar";
+ }
+
+}
Modified: trunk/magicmapclient/src/net/sf/magicmap/artifact/IArtifact.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/artifact/IArtifact.java 2006-11-17 11:02:55 UTC (rev 485)
+++ trunk/magicmapclient/src/net/sf/magicmap/artifact/IArtifact.java 2006-11-29 09:33:47 UTC (rev 486)
@@ -3,6 +3,6 @@
public interface IArtifact extends IUniqueIdentity<IArtifact> {
- public String getVersion();
+ public Version getVersion();
}
Modified: trunk/magicmapclient/src/net/sf/magicmap/artifact/IVendor.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/artifact/IVendor.java 2006-11-17 11:02:55 UTC (rev 485)
+++ trunk/magicmapclient/src/net/sf/magicmap/artifact/IVendor.java 2006-11-29 09:33:47 UTC (rev 486)
@@ -3,10 +3,24 @@
/**
* Beschreibt einen Hersteller.
- *
+ *
*/
public interface IVendor {
+ IVendor EMPTY = new IVendor(){
+ public String getName() {
+ return "";
+ }
+
+ public String getEmail() {
+ return "";
+ }
+
+ public String getHomePage() {
+ return "";
+ }
+ };
+
public String getName();
public String getEmail();
Added: trunk/magicmapclient/src/net/sf/magicmap/artifact/Version.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/artifact/Version.java (rev 0)
+++ trunk/magicmapclient/src/net/sf/magicmap/artifact/Version.java 2006-11-29 09:33:47 UTC (rev 486)
@@ -0,0 +1,58 @@
+package net.sf.magicmap.artifact;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: jan
+ * Date: 11.11.2006
+ * Time: 16:48:25
+ * To change this template use File | Settings | File Templates.
+ */
+public class Version implements Comparable<Version> {
+
+ private final String versionString;
+ private final long version;
+ private final long snapShot;
+
+ public Version(String versionStr){
+ this.versionString = versionStr;
+
+ String[] tokens = versionStr.split("-");
+ if (tokens.length != 0){
+ version = parseVersion(versionStr.split("\\."));
+ snapShot = 0;
+ }else{
+ version = parseVersion(tokens[0].split("\\."));
+ snapShot = parseSnaphsot(tokens[1]);
+ }
+
+ }
+
+ private long parseVersion(String[] str) {
+ int pow = str.length * 100;
+ long result = 0;
+ for (String s: str){
+ result += Integer.parseInt(s) * pow;
+ pow = pow / 100;
+ }
+ return result;
+ }
+ private long parseSnaphsot(String snap){
+ long result = 0;
+ if("SNAPSHOT".equals(snap)) return 1;
+ return Long.parseLong(snap);
+ }
+
+
+ public int compareTo(Version o) {
+ int comp = version == o.version ? 0 :
+ version < o.version ? -1 : 1;
+ if (comp != 0) return comp;
+ return snapShot == o.snapShot ? 0 :
+ snapShot < o.snapShot ? -1 : 1;
+ }
+ @Override
+ public String toString(){
+ return versionString;
+ }
+
+}
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java 2006-11-17 11:02:55 UTC (rev 485)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java 2006-11-29 09:33:47 UTC (rev 486)
@@ -45,6 +45,8 @@
import org.apache.log4j.xml.DOMConfigurator;
+import javax.swing.*;
+
/**
* Kann \xC4nderungen an View und am Modell vornehmen und zieht alle F\xE4den
* der Anwendung.
@@ -136,7 +138,7 @@
//TODO
try {
this.pluginManager = new PluginManager(new Settings(), this);
- } catch (MalformedURLException e) {
+ } catch (MalformedURLException e) {
throw new RuntimeException(e.getMessage());
}
}
@@ -162,7 +164,7 @@
setMeasurementViewLocal(true);
this.nodeModel.addNodeModelListener(this.mapView);
//registerNodeModelListener(outlineView);
- }
+ }
/**
* Getter for the map view
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/controller/PollHandler.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/controller/PollHandler.java 2006-11-17 11:02:55 UTC (rev 485)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/PollHandler.java 2006-11-29 09:33:47 UTC (rev 486)
@@ -243,7 +243,7 @@
// if (position.getGeoPoint() != null) {
// GeoPointDTO gpdto = position.getGeoPoint();
// GeoPosNode geoNode = (GeoPosNode)
- // nodeModel.findNode(gpdto.toString());
+ // nodeModel.findNode(gpdto.getPath());
// if (geoNode == null) {
// geoNode.setPosition(position.getPosX(),
// position.getPosY());
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java 2006-11-17 11:02:55 UTC (rev 485)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java 2006-11-29 09:33:47 UTC (rev 486)
@@ -51,6 +51,7 @@
import net.sf.magicmap.client.model.node.NodeModel;
import net.sf.magicmap.client.utils.Settings;
import net.sf.magicmap.client.utils.Version;
+import net.sf.magicmap.plugin.action.ShowPluginsAction;
import org.apache.axis.AxisFault;
@@ -65,795 +66,797 @@
* The main GUI window
* @author thuebner
*/
+@SuppressWarnings({"JavadocReference"})
public class MainGUI extends JFrame
- implements
- ServerConnectCallback,
- ServerDisconnectCallback,
- CreateNewMapCallback,
- MapNamesCallback,
- LoadMapDialogListener {
+ implements
+ ServerConnectCallback,
+ ServerDisconnectCallback,
+ CreateNewMapCallback,
+ MapNamesCallback,
+ LoadMapDialogListener {
- /**
- * serial version id
- */
- private static final long serialVersionUID = -3842976532877305041L;
+ /**
+ * serial version id
+ */
+ private static final long serialVersionUID = -3842976532877305041L;
- /**
- * singleton instance of the main GUI
- */
- private static MainGUI mainGUI = null;
+ /**
+ * singleton instance of the main GUI
+ */
+ private static MainGUI mainGUI = null;
- /**
- * Getter for the singleton instance of the main GUI
- * @return the main GUI (creates a new one if none exists)
- */
- public static MainGUI getInstance(){
- if (MainGUI.mainGUI == null) MainGUI.mainGUI = new MainGUI();
- return MainGUI.mainGUI;
- }
+ /**
+ * Getter for the singleton instance of the main GUI
+ * @return the main GUI (creates a new one if none exists)
+ */
+ public static MainGUI getInstance(){
+ if (MainGUI.mainGUI == null) MainGUI.mainGUI = new MainGUI();
+ return MainGUI.mainGUI;
+ }
- private JMenuBar menuBar;
- private JToolBar toolBar;
- private StatusPanel statusBar;
- private OutlineView outlineView;
- private MapPanel mapPanel;
- private ConsoleView consoleView;
- 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;
- MapView mapView;
- private MagicAction invisibleAction;
- private MagicAction simpleView;
- private MagicAction normalView;
- private MagicAction expertView;
- private MagicAction userDefinedView;
+ private JMenuBar menuBar;
+ private JToolBar toolBar;
+ private StatusPanel statusBar;
+ private OutlineView outlineView;
+ private MapPanel mapPanel;
+ private ConsoleView consoleView;
+ 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;
+ MapView mapView;
+ 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 int numberOfdataInvocationRateAction = 10;
+ private MagicAction[] dataInvocationRateAction;
- /**
- * Erzeugt Hauptfenster der Anwendung.
- * Private constructor, only used by getInstance() to fulfill singleton pattern
- */
- private MainGUI() {
+ /**
+ * Erzeugt Hauptfenster der Anwendung.
+ * Private constructor, only used by getInstance() to fulfill singleton pattern
+ */
+ private MainGUI() {
- // Aktionen erstellen
- buildActions();
+ // Aktionen erstellen
+ buildActions();
- // Layout vorbereiten
- this.layout = new RelativeLayout();
- Container pane = this.getContentPane();
- pane.setLayout(this.layout);
+ // Layout vorbereiten
+ this.layout = new RelativeLayout();
+ Container pane = this.getContentPane();
+ pane.setLayout(this.layout);
- // 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());
+ // 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());
- //Menu erstellen
- this.menuBar = new JMenuBar();
- this.setJMenuBar(this.menuBar);
- this.menuBar.add(buildFileMenu());
- this.menuBar.add(buildViewMenu());
- this.menuBar.add(buildOptionsMenu());
- this.menuBar.add(buildHelpMenu());
+ //Menu erstellen
+ this.menuBar = new JMenuBar();
+ this.setJMenuBar(this.menuBar);
+ this.menuBar.add(buildFileMenu());
+ this.menuBar.add(buildViewMenu());
+ this.menuBar.add(buildOptionsMenu());
+ this.menuBar.add(buildHelpMenu());
- // Statusleiste erstelelen
- this.statusBar = new StatusPanel();
- this.statusBar.setMessage(GUIUtils.i18n(GUIConstants.STATE_DISCONNECTED));
+ // Statusleiste erstelelen
+ this.statusBar = new StatusPanel();
+ this.statusBar.setMessage(GUIUtils.i18n(GUIConstants.STATE_DISCONNECTED));
- // ToolBar erstellen
- this.toolBar = new JToolBar();
- this.toolBar.setRollover(true);
- // toolBar.putClientProperty(com.jgoodies.plaf.plastic.PlasticLookAndFeel.IS_3D_KEY, Boolean.TRUE);
- // menuBar.putClientProperty(com.jgoodies.plaf.plastic.PlasticLookAndFeel.IS_3D_KEY, Boolean.TRUE);
- addMainToolBarButtons(this.toolBar);
+ // ToolBar erstellen
+ this.toolBar = new JToolBar();
+ this.toolBar.setRollover(true);
+ // toolBar.putClientProperty(com.jgoodies.plaf.plastic.PlasticLookAndFeel.IS_3D_KEY, Boolean.TRUE);
+ // menuBar.putClientProperty(com.jgoodies.plaf.plastic.PlasticLookAndFeel.IS_3D_KEY, Boolean.TRUE);
+ addMainToolBarButtons(this.toolBar);
- // Komponenten einf\xFCgen in das ContentPane
- pane.add(this.toolBar, "toolbar");
- pane.add(buildMainPane(), "mainpane");
- pane.add(this.statusBar, "status");
+ // Komponenten einf\xFCgen in das ContentPane
+ pane.add(this.toolBar, "toolbar");
+ pane.add(buildMainPane(), "mainpane");
+ pane.add(this.statusBar, "status");
- // Einige Constrains bzgl. Layout definieren:
+ // Einige Constrains bzgl. Layout definieren:
- // ToolBar ganz oben
- this.layout.addConstraint("toolbar", AttributeType.RIGHT, new AttributeConstraint(DependencyManager.ROOT_NAME,
- AttributeType.RIGHT, 0));
- this.layout.addConstraint("toolbar", AttributeType.LEFT, new AttributeConstraint(DependencyManager.ROOT_NAME,
- AttributeType.LEFT, 0));
- this.layout.addConstraint("toolbar", AttributeType.TOP, new AttributeConstraint(DependencyManager.ROOT_NAME,
- AttributeType.TOP, 0));
+ // ToolBar ganz oben
+ this.layout.addConstraint("toolbar", AttributeType.RIGHT, new AttributeConstraint(DependencyManager.ROOT_NAME,
+ AttributeType.RIGHT, 0));
+ this.layout.addConstraint("toolbar", AttributeType.LEFT, new AttributeConstraint(DependencyManager.ROOT_NAME,
+ AttributeType.LEFT, 0));
+ this.layout.addConstraint("toolbar", AttributeType.TOP, new AttributeConstraint(DependencyManager.ROOT_NAME,
+ AttributeType.TOP, 0));
- // StatusBar ganz unten
- this.layout.addConstraint("status", AttributeType.RIGHT, new AttributeConstraint(DependencyManager.ROOT_NAME,
- AttributeType.RIGHT, -2));
- this.layout.addConstraint("status", AttributeType.LEFT, new AttributeConstraint(DependencyManager.ROOT_NAME,
- AttributeType.LEFT, 2));
- this.layout.addConstraint("status", AttributeType.BOTTOM, new AttributeConstraint(DependencyManager.ROOT_NAME,
- AttributeType.BOTTOM, -2));
+ // StatusBar ganz unten
+ this.layout.addConstraint("status", AttributeType.RIGHT, new AttributeConstraint(DependencyManager.ROOT_NAME,
+ AttributeType.RIGHT, -2));
+ this.layout.addConstraint("status", AttributeType.LEFT, new AttributeConstraint(DependencyManager.ROOT_NAME,
+ AttributeType.LEFT, 2));
+ this.layout.addConstraint("status", AttributeType.BOTTOM, new AttributeConstraint(DependencyManager.ROOT_NAME,
+ AttributeType.BOTTOM, -2));
- // Hauptpanel dazwischen mit gewissem Abstand zum ToolBar
- this.layout.addConstraint("mainpane", AttributeType.RIGHT, new AttributeConstraint(DependencyManager.ROOT_NAME,
- AttributeType.RIGHT, -GUIConstants.WINDOW_MARGIN));
- this.layout.addConstraint("mainpane", AttributeType.LEFT, new AttributeConstraint(DependencyManager.ROOT_NAME,
- AttributeType.LEFT, GUIConstants.WINDOW_MARGIN));
- this.layout.addConstraint("mainpane", AttributeType.BOTTOM, new AttributeConstraint("status",
- AttributeType.TOP, -5));
- this.layout.addConstraint("mainpane", AttributeType.TOP, new AttributeConstraint("toolbar",
- AttributeType.BOTTOM, GUIConstants.DIVIDER_SIZE));
- }
+ // Hauptpanel dazwischen mit gewissem Abstand zum ToolBar
+ this.layout.addConstraint("mainpane", AttributeType.RIGHT, new AttributeConstraint(DependencyManager.ROOT_NAME,
+ AttributeType.RIGHT, -GUIConstants.WINDOW_MARGIN));
+ this.layout.addConstraint("mainpane", AttributeType.LEFT, new AttributeConstraint(DependencyManager.ROOT_NAME,
+ AttributeType.LEFT, GUIConstants.WINDOW_MARGIN));
+ this.layout.addConstraint("mainpane", AttributeType.BOTTOM, new AttributeConstraint("status",
+ AttributeType.TOP, -5));
+ this.layout.addConstraint("mainpane", AttributeType.TOP, new AttributeConstraint("toolbar",
+ AttributeType.BOTTOM, GUIConstants.DIVIDER_SIZE));
+ }
- /**
- * Action builder for the action of the GUI
- *
- */
- public void buildActions(){
+ /**
+ * Action builder for the action of the GUI
+ *
+ */
+ public void buildActions(){
- this.connectAction = new MagicAction("connect", GUIConstants.ICON_CONNECT, "connecttooltip") {
+ this.connectAction = new MagicAction("connect", GUIConstants.ICON_CONNECT, "connecttooltip") {
- /**
- * serial version id
- */
- private static final long serialVersionUID = 8256739041910656216L;
+ /**
+ * serial version id
+ */
+ private static final long serialVersionUID = 8256739041910656216L;
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- */
- @Override
- public void actionPerformed(ActionEvent e){
- ServerConnectionInfo info = new ServerConnectionInfo();
- info.hostname = Settings.getHostname();
- info.port = Settings.getPort();
- info.name = Settings.getClientName();
- info.password = Settings.getClientPassword();
- info.useNoServer = Settings.isStandAlone();
- info = ConnectServerDialog.showDialog(MainGUI.this, info);
- if (info != null) {
+ /* (non-Javadoc)
+ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+ */
+ @Override
+ public void actionPerformed(ActionEvent e){
+ ServerConnectionInfo info = new ServerConnectionInfo();
+ info.hostname = Settings.getHostname();
+ info.port = Settings.getPort();
+ info.name = Settings.getClientName();
+ info.password = Settings.getClientPassword();
+ info.useNoServer = Settings.isStandAlone();
+ info = ConnectServerDialog.showDialog(MainGUI.this, info);
+ if (info != null) {
- Settings.setClientName(info.name);
- Settings.setClientPassword(info.password);
- Settings.setServerURL(info.hostname, info.port);
- Settings.setStandAlone(info.useNoServer);
- connect();
- }
- //TODO: hier die Mapnamen einlesen und im Tree
- }
- };
+ Settings.setClientName(info.name);
+ Settings.setClientPassword(info.password);
+ Settings.setServerURL(info.hostname, info.port);
+ Settings.setStandAlone(info.useNoServer);
+ connect();
+ }
+ //TODO: hier die Mapnamen einlesen und im Tree
+ }
+ };
- this.setProxyAction = new MagicAction("setproxy", GUIConstants.ICON_CONNECT, "setproxytooltip") {
+ this.setProxyAction = new MagicAction("setproxy", GUIConstants.ICON_CONNECT, "setproxytooltip") {
- /**
- * serial version id
- */
- private static final long serialVersionUID = 8620117054998094069L;
+ /**
+ * serial version id
+ */
+ private static final long serialVersionUID = 8620117054998094069L;
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- */
- @Override
- public void actionPerformed(ActionEvent e){
- SetProxyDialog.showDialog(MainGUI.this);
- }
- };
+ /* (non-Javadoc)
+ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+ */
+ @Override
+ public void actionPerformed(ActionEvent e){
+ SetProxyDialog.showDialog(MainGUI.this);
+ }
+ };
- this.disconnectAction = new MagicAction("disconnect", GUIConstants.ICON_DISCONNECT, "disconnecttooltip") {
+ this.disconnectAction = new MagicAction("disconnect", GUIConstants.ICON_DISCONNECT, "disconnecttooltip") {
- /**
- * serial version id
- */
- private static final long serialVersionUID = 6776875394862327956L;
+ /**
+ * serial version id
+ */
+ private static final long serialVersionUID = 6776875394862327956L;
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- */
- @Override
- public void actionPerformed(ActionEvent e){
- Controller.getInstance().disconnect(MainGUI.this);
- }
- };
+ /* (non-Javadoc)
+ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+ */
+ @Override
+ public void actionPerformed(ActionEvent e){
+ Controller.getInstance().disconnect(MainGUI.this);
+ }
+ };
- this.newMapAction = new MagicAction("newmap", GUIConstants.ICON_NEWMAP, "newmaptooltip") {
+ this.newMapAction = new MagicAction("newmap", GUIConstants.ICON_NEWMAP, "newmaptooltip") {
- /**
- * serial version id
- */
- private static final long serialVersionUID = 1585869732523539705L;
+ /**
+ * serial version id
+ */
+ private static final long serialVersionUID = 1585869732523539705L;
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- */
- @Override
- public void actionPerformed(ActionEvent e){
- MapInfo info = NewMapDialog.showDialog(MainGUI.this);
- if (info != null)
- Controller.getInstance().createNewMap(info.name, info.imageURL, info.width, info.height,
- info.realwidth, info.realheight, MainGUI.this);
- }
- };
+ /* (non-Javadoc)
+ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+ */
+ @Override
+ public void actionPerformed(ActionEvent e){
+ MapInfo info = NewMapDialog.showDialog(MainGUI.this);
+ if (info != null)
+ Controller.getInstance().createNewMap(info.name, info.imageURL, info.width, info.height,
+ info.realwidth, info.realheight, MainGUI.this);
+ }
+ };
- this.loadMapAction = new MagicAction("loadmap", GUIConstants.ICON_LOADMAP, "loadmaptooltip") {
+ this.loadMapAction = new MagicAction("loadmap", GUIConstants.ICON_LOADMAP, "loadmaptooltip") {
- /**
- * serial version id
- */
- private static final long serialVersionUID = -4200327439722944761L;
+ /**
+ * serial version id
+ */
+ private static final long serialVersionUID = -4200327439722944761L;
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- */
- @Override
- public void actionPerformed(ActionEvent e){
- Controller.getInstance().retrieveMapNames(MainGUI.this, true);
- }
- };
+ /* (non-Javadoc)
+ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+ */
+ @Override
+ public void actionPerformed(ActionEvent e){
+ Controller.getInstance().retrieveMapNames(MainGUI.this, true);
+ }
+ };
- this.exitAction = new MagicAction("exit", GUIConstants.ICON_EXIT, "exit") {
+ this.exitAction = new MagicAction("exit", GUIConstants.ICON_EXIT, "exit") {
- /**
- * serial version id
- */
- private static final long serialVersionUID = -381509553122027326L;
+ /**
+ * serial version id
+ */
+ private static final long serialVersionUID = -381509553122027326L;
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- */
- @Override
- public void actionPerformed(ActionEvent e){
- MainGUI.this.setVisible(false);
- System.exit(0);
- }
- };
+ /* (non-Javadoc)
+ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+ */
+ @Override
+ public void actionPerformed(ActionEvent e){
+ MainGUI.this.setVisible(false);
+ System.exit(0);
+ }
+ };
- this.onlineHelp = new MagicAction("onlinehelp", GUIConstants.ICON_HELP, "onlinehelptooltip") {
+ this.onlineHelp = new MagicAction("onlinehelp", GUIConstants.ICON_HELP, "onlinehelptooltip") {
- /**
- * serial version id
- */
- private static final long serialVersionUID = -2931521125912428814L;
+ /**
+ * 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://wiki.informatik.hu-berlin.de/nomads/index.php/MagicMapHelp");
- } catch (IOException e1) {
- //TODO: exception handling
- }
- }
- };
+ /* (non-Javadoc)
+ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+ */
+ @Override
+ public void actionPerformed(ActionEvent e){
+ try {
+ Browser.displayURL("http://wiki.informatik.hu-berlin.de/nomads/index.php/MagicMapHelp");
+ } catch (IOException e1) {
+ //TODO: exception handling
+ }
+ }
+ };
- this.aboutAction = new MagicAction("about") {
+ this.aboutAction = new MagicAction("about") {
- /**
- * serial version id
- */
- private static final long serialVersionUID = 817979541337534213L;
+ /**
+ * serial version id
+ */
+ private static final long serialVersionUID = 817979541337534213L;
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- */
- @Override
- public void actionPerformed(ActionEvent e){
- AboutDialog.showDialog(MainGUI.this);
- }
- };
+ /* (non-Javadoc)
+ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+ */
+ @Override
+ public void actionPerformed(ActionEvent e){
+ AboutDialog.showDialog(MainGUI.this);
+ }
+ };
- this.invisibleAction = new MagicAction("invisible", GUIConstants.ICON_INVISIBLE, "invisibletooltip") {
+ this.invisibleAction = new MagicAction("invisible", GUIConstants.ICON_INVISIBLE, "invisibletooltip") {
- /**
- * serial version id
- */
- private static final long serialVersionUID = 5676607442930257839L;
+ /**
+ * serial version id
+ */
+ private static final long serialVersionUID = 5676607442930257839L;
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- */
- @Override
- public void actionPerformed(ActionEvent e){
- toogleInvisible();
- }
- };
+ /* (non-Javadoc)
+ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+ */
+ @Override
+ public void actionPerformed(ActionEvent e){
+ toogleInvisible();
+ }
+ };
- // showAccessPoints = new MagicAction("showaccesspoints") {
- //
- // public void actionPerformed(ActionEvent e){
- // mapView.setShowAccessPoints(showAccessPoints.isSelected());
- // }
- // };
- //
- // showLocations = new MagicAction("showlocations") {
- //
- // public void actionPerformed(ActionEvent e){
- // mapView.setShowLocations(showLocations.isSelected());
- // }
- // };
- //
- // showClients = new MagicAction("showclients") {
- //
- // public void actionPerformed(ActionEvent e){
- // mapView.setShowClients(showClients.isSelected());
- // }
- // };
- //
- // showEdgesBetweenLocations = new MagicAction("showedgesbetweenlocations") {
- //
- // public void actionPerformed(ActionEvent e){
- // mapView.setShowEdgesBetweenLocations(showEdgesBetweenLocations.isSelected());
- //
- // }
- // };
- //
- // showEdges = new MagicAction("showedges") {
- //
- // public void actionPerformed(ActionEvent e){
- // mapView.setShowEdges(showEdges.isSelected());
- //
- // }
- // };
+ // showAccessPoints = new MagicAction("showaccesspoints") {
+ //
+ // public void actionPerformed(ActionEvent e){
+ // mapView.setShowAccessPoints(showAccessPoints.isSelected());
+ // }
+ // };
+ //
+ // showLocations = new MagicAction("showlocations") {
+ //
+ // public void actionPerformed(ActionEvent e){
+ // mapView.setShowLocations(showLocations.isSelected());
+ // }
+ // };
+ //
+ // showClients = new MagicAction("showclients") {
+ //
+ // public void actionPerformed(ActionEvent e){
+ // mapView.setShowClients(showClients.isSelected());
+ // }
+ // };
+ //
+ // showEdgesBetweenLocations = new MagicAction("showedgesbetweenlocations") {
+ //
+ // public void actionPerformed(ActionEvent e){
+ // mapView.setShowEdgesBetweenLocations(showEdgesBetweenLocations.isSelected());
+ //
+ // }
+ // };
+ //
+ // showEdges = new MagicAction("showedges") {
+ //
+ // public void actionPerformed(ActionEvent e){
+ // mapView.setShowEdges(showEdges.isSelected());
+ //
+ // }
+ // };
- this.simpleView = new MagicAction("simpleview") {
+ this.simpleView = new MagicAction("simpleview") {
- /**
- * serial version id
- */
- private static final long serialVersionUID = -4363039701291506753L;
+ /**
+ * serial version id
+ */
+ private static final long serialVersionUID = -4363039701291506753L;
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- */
- @Override
- public void actionPerformed(ActionEvent e){
- /*((JCheckBoxMenuItem)e.getSource()).setSelected(true);
- ((JCheckBoxMenuItem)((JCheckBoxMenuItem)e.getSource()).getParent().getComponent(1)).setSelected(false);
- ((JCheckBoxMenuItem)((JCheckBoxMenuItem)e.getSource()).getParent().getComponent(2)).setSelected(false);
- */
- MainGUI.this.mapView.setShowAccessPoints(false);
- MainGUI.this.outlineView.collapseAPs(true);
- MainGUI.this.mapView.setShowClients(true);
- MainGUI.this.mapView.setShowEdges(false);
- MainGUI.this.mapView.setShowEdgesBetweenLocations(false);
- MainGUI.this.mapView.setShowLocations(false);
- MainGUI.this.outlineView.collapseRPs(true);
- MainGUI.this.mapView.setShowEdgesForSelectedNode(false);
+ /* (non-Javadoc)
+ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+ */
+ @Override
+ public void actionPerformed(ActionEvent e){
+ /*((JCheckBoxMenuItem)e.getSource()).setSelected(true);
+ ((JCheckBoxMenuItem)((JCheckBoxMenuItem)e.getSource()).getParent().getComponent(1)).setSelected(false);
+ ((JCheckBoxMenuItem)((JCheckBoxMenuItem)e.getSource()).getParent().getComponent(2)).setSelected(false);
+ */
+ MainGUI.this.mapView.setShowAccessPoints(false);
+ MainGUI.this.outlineView.collapseAPs(true);
+ MainGUI.this.mapView.setShowClients(true);
+ MainGUI.this.mapView.setShowEdges(false);
+ MainGUI.this.mapView.setShowEdgesBetweenLocations(false);
+ MainGUI.this.mapView.setShowLocations(false);
+ MainGUI.this.outlineView.collapseRPs(true);
+ MainGUI.this.mapView.setShowEdgesForSelectedNode(false);
- MainGUI.this.simpleView.setSelected(true);
- MainGUI.this.normalView.setSelected(false);
- MainGUI.this.expertView.setSelected(false);
- MainGUI.this.userDefinedView.setSelected(false);
- }
- };
+ MainGUI.this.simpleView.setSelected(true);
+ MainGUI.this.normalView.setSelected(false);
+ MainGUI.this.expertView.setSelected(false);
+ MainGUI.this.userDefinedView.setSelected(false);
+ }
+ };
- this.normalView = new MagicAction("normalview") {
+ this.normalView = new MagicAction("normalview") {
- /**
- * serial version id
- */
- private static final long serialVersionUID = -6495547547583532292L;
+ /**
+ * serial version id
+ */
+ private static final long serialVersionUID = -6495547547583532292L;
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- */
- @Override
- public void actionPerformed(ActionEvent e){
+ /* (non-Javadoc)
+ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+ */
+ @Override
+ public void actionPerformed(ActionEvent e){
- MainGUI.this.mapView.setShowAccessPoints(true);
- MainGUI.this.outlineView.collapseAPs(false);
- MainGUI.this.mapView.setShowClients(true);
- MainGUI.this.mapView.setShowEdges(true);
- MainGUI.this.mapView.setShowEdgesBetweenLocations(false);
- MainGUI.this.mapView.setShowLocations(true);
- MainGUI.this.outlineView.collapseRPs(false);
- MainGUI.this.mapView.setShowEdgesForSelectedNode(true);
+ MainGUI.this.mapView.setShowAccessPoints(true);
+ MainGUI.this.outlineView.collapseAPs(false);
+ MainGUI.this.mapView.setShowClients(true);
+ MainGUI.this.mapView.setShowEdges(true);
+ MainGUI.this.mapView.setShowEdgesBetweenLocations(false);
+ MainGUI.this.mapView.setShowLocations(true);
+ MainGUI.this.outlineView.collapseRPs(false);
+ MainGUI.this.mapView.setShowEdgesForSelectedNode(true);
- MainGUI.this.simpleView.setSelected(false);
- MainGUI.this.normalView.setSelected(true);
- MainGUI.this.expertView.setSelected(false);
- MainGUI.this.userDefinedView.setSelected(false);
- }
- };
+ MainGUI.this.simpleView.setSelected(false);
+ MainGUI.this.normalView.setSelected(true);
+ MainGUI.this.expertView.setSelected(false);
+ MainGUI.this.userDefinedView.setSelected(false);
+ }
+ };
- this.expertView = new MagicAction("expertview") {
+ this.expertView = new MagicAction("expertview") {
- /**
- * serial version id
- */
- private static final long serialVersionUID = 2424697947749316174L;
+ /**
+ * serial version id
+ */
+ private static final long serialVersionUID = 2424697947749316174L;
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- */
- @Override
- public void actionPerformed(ActionEvent e){
- MainGUI.this.mapView.setShowAccessPoints(true);
- MainGUI.this.outlineView.collapseAPs(false);
- MainGUI.this.mapView.setShowClients(true);
- MainGUI.this.mapView.setShowEdges(true);
- MainGUI.this.mapView.setShowEdgesBetweenLocations(true);
- MainGUI.this.mapView.setShowLocations(true);
- MainGUI.this.outlineView.collapseRPs(false);
- MainGUI.this.mapView.setShowEdgesForSelectedNode(false);
+ /* (non-Javadoc)
+ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+ */
+ @Override
+ public void actionPerformed(ActionEvent e){
+ MainGUI.this.mapView.setShowAccessPoints(true);
+ MainGUI.this.outlineView.collapseAPs(false);
+ MainGUI.this.mapView.setShowClients(true);
+ MainGUI.this.mapView.setShowEdges(true);
+ MainGUI.this.mapView.setShowEdgesBetweenLocations(true);
+ MainGUI.this.mapView.setShowLocations(true);
+ MainGUI.this.outlineView.collapseRPs(false);
+ MainGUI.this.mapView.setShowEdgesForSelectedNode(false);
- MainGUI.this.simpleView.setSelected(false);
- MainGUI.this.normalView.setSelected(false);
- MainGUI.this.expertView.setSelected(true);
- MainGUI.this.userDefinedView.setSelected(false);
- }
- };
+ MainGUI.this.simpleView.setSelected(false);
+ MainGUI.this.normalView.setSelected(false);
+ MainGUI.this.expertView.setSelected(true);
+ MainGUI.this.userDefinedView.setSelected(false);
+ }
+ };
- this.userDefinedView = new MagicAction("userdefinedview") {
+ this.userDefinedView = new MagicAction("userdefinedview") {
- /**
- * serial version id
- */
- private static final long serialVersionUID = 5375115309634495606L;
+ /**
+ * serial version id
+ */
+ private static final long serialVersionUID = 5375115309634495606L;
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- */
- @Override
- public void actionPerformed(ActionEvent e){
- MainGUI.this.userDefinedView.setSelected(!MainGUI.this.userDefinedView.isSelected());
- ViewOptionsDialog.showDialog(MainGUI.this);
- }
- };
+ /* (non-Javadoc)
+ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+ */
+ @Override
+ public void actionPerformed(ActionEvent e){
+ MainGUI.this.userDefinedView.setSelected(!MainGUI.this.userDefinedView.isSelected());
+ ViewOptionsDialog.showDialog(MainGUI.this);
+ }
+ };
- this.dataInvocationRateAction = new MagicAction[MainGUI.numberOfdataInvocationRateAction];
+ this.dataInvocationRateAction = new MagicAction[MainGUI.numberOfdataInvocationRateAction];
- for (int i = 0; i < MainGUI.numberOfdataInvocationRateAction; i++) {
- final int thisAction = i;
- this.dataInvocationRateAction[thisAction] = new MagicAction("dataInvocationRate" + (thisAction + 1)) {
+ for (int i = 0; i < MainGUI.numberOfdataInvocationRateAction; i++) {
+ final int thisAction = i;
+ this.dataInvocationRateAction[thisAction] = new MagicAction("dataInvocationRate" + (thisAction + 1)) {
- /**
- * serial version id
- */
- private static final long serialVersionUID = 4859524538231496188L;
+ /**
+ * serial version id
+ */
+ private static final long serialVersionUID = 4859524538231496188L;
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- */
- @Override
- public void actionPerformed(ActionEvent e){
- for (int j = 0; j < MainGUI.numberOfdataInvocationRateAction; j++)
- MainGUI.this.dataInvocationRateAction[j].setSelected(false);
- MainGUI.this.dataInvocationRateAction[thisAction].setSelected(true);
- Settings.setPollIntevall((thisAction + 1) * 1000);
- Controller.getInstance().restartServerPoller();
- }
- };
- }
+ /* (non-Javadoc)
+ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+ */
+ @Override
+ public void actionPerformed(ActionEvent e){
+ for (int j = 0; j < MainGUI.numberOfdataInvocationRateAction; j++)
+ MainGUI.this.dataInvocationRateAction[j].setSelected(false);
+ MainGUI.this.dataInvocationRateAction[thisAction].setSelected(true);
+ Settings.setPollIntevall((thisAction + 1) * 1000);
+ Controller.getInstance().restartServerPoller();
+ }
+ };
+ }
- this.invisibleAction.setEnabled(false);
- this.disconnectAction.setEnabled(false);
- this.newMapAction.setEnabled(false);
- this.loadMapAction.setEnabled(false);
- // showClients.setEnabled(false);
- // showAccessPoints.setEnabled(false);
- // showLocations.setEnabled(false);
- // showEdgesBetweenLocations.setEnabled(false);
- // showEdges.setEnabled(false);
- this.simpleView.setEnabled(false);
- this.normalView.setEnabled(false);
- this.expertView.setEnabled(false);
- this.userDefinedView.setEnabled(false);
- }
+ this.invisibleAction.setEnabled(false);
+ this.disconnectAction.setEnabled(false);
+ this.newMapAction.setEnabled(false);
+ this.loadMapAction.setEnabled(false);
+ // showClients.setEnabled(false);
+ // showAccessPoints.setEnabled(false);
+ // showLocations.setEnabled(false);
+ // showEdgesBetweenLocations.setEnabled(false);
+ // showEdges.setEnabled(false);
+ this.simpleView.setEnabled(false);
+ this.normalView.setEnabled(false);
+ this.expertView.setEnabled(false);
+ this.userDefinedView.setEnabled(false);
+ }
- /**
- * Sets the userDefinedView selected
- *
- */
- public void setUserDefinedView(){
- this.simpleView.setSelected(false);
- this.normalView.setSelected(false);
- this.expertView.setSelected(false);
- this.userDefinedView.setSelected(true);
- }
+ /**
+ * Sets the userDefinedView selected
+ *
+ */
+ public void setUserDefinedView(){
+ this.simpleView.setSelected(false);
+ this.normalView.setSelected(false);
+ this.expertView.setSelected(false);
+ this.userDefinedView.setSelected(true);
+ }
- /**
- * Build the main panel
- * @return the main panel
- */
- public JComponent buildMainPane(){
- this.mapPanel = new MapPanel();
- this.consoleView = Controller.getInstance().getConsoleView();
- this.measurementView = Controller.getInstance().getMeasurementView();
- this.outlineView = Controller.getInstance().getOutlineView();
- this.mapView = Controller.getInstance().getMapView();
- this.mapPanel.setMapView(this.mapView);
+ /**
+ * Build the main panel
+ * @return the main panel
+ */
+ public JComponent buildMainPane(){
+ this.mapPanel = new MapPanel();
+ this.consoleView = Controller.getInstance().getConsoleView();
+ this.measurementView = Controller.getInstance().getMeasurementView();
+ this.outlineView = Controller.getInstance().getOutlineView();
+ this.mapView = Controller.getInstance().getMapView();
+ this.mapPanel.setMapView(this.mapView);
- UIFSplitPane pane2;
+ UIFSplitPane pane2;
- this.bottomRightTabPanel = new ViewTabPanel();
- this.bottomRightTabPanel.addView(this.measurementView);
- this.bottomRightTabPanel.addView(this.consoleView);
- this.bottomRightTabPanel.selectView(this.measurementView);
+ this.bottomRightTabPanel = new ViewTabPanel();
+ this.bottomRightTabPanel.addView(this.measurementView);
+ this.bottomRightTabPanel.addView(this.consoleView);
+ this.bottomRightTabPanel.selectView(this.measurementView);
- UIFSplitPane pane = UIFSplitPane.createStrippedSplitPane(JSplitPane.HORIZONTAL_SPLIT, this.outlineView,
- (pane2 = UIFSplitPane.createStrippedSplitPane(JSplitPane.VERTICAL_SPLIT, this.mapPanel,
- this.bottomRightTabPanel)));
- pane.setDividerSize(GUIConstants.DIVIDER_SIZE);
- pane.setDividerBorderVisible(false);
- pane2.setDividerSize(GUIConstants.DIVIDER_SIZE);
- pane2.setDividerBorderVisible(false);
- pane2.setDividerLocation(1.0);
- return pane;
- }
+ UIFSplitPane pane = UIFSplitPane.createStrippedSplitPane(JSplitPane.HORIZONTAL_SPLIT, this.outlineView,
+ (pane2 = UIFSplitPane.createStrippedSplitPane(JSplitPane.VERTICAL_SPLIT, this.mapPanel,
+ this.bottomRightTabPanel)));
+ pane.setDividerSize(GUIConstants.DIVIDER_SIZE);
+ pane.setDividerBorderVisible(false);
+ pane2.setDividerSize(GUIConstants.DIVIDER_SIZE);
+ pane2.setDividerBorderVisible(false);
+ pane2.setDividerLocation(1.0);
+ return pane;
+ }
- /**
- * Build the file menu
- * @return the file menu
- */
- private JMenu buildFileMenu(){
- JMenu menu = GUIBuilder.createMenu("file");
- menu.add(GUIBuilder.createMenuItem(this.connectAction));
- menu.add(GUIBuilder.createMenuItem(this.disconnectAction));
- menu.addSeparator();
- menu.add(GUIBuilder.createMenuItem(this.newMapAction));
- menu.add(GUIBuilder.createMenuItem(this.loadMapAction));
- menu.addSeparator();
- menu.add(GUIBuilder.createMenuItem(this.exitAction));
- return menu;
- }
+ /**
+ * Build the file menu
+ * @return the file menu
+ */
+ private JMenu buildFileMenu(){
+ JMenu menu = GUIBuilder.createMenu("file");
+ menu.add(GUIBuilder.createMenuItem(this.connectAction));
+ menu.add(GUIBuilder.createMenuItem(this.disconnectAction));
+ menu.addSeparator();
+ menu.add(GUIBuilder.createMenuItem(this.newMapAction));
+ menu.add(GUIBuilder.createMenuItem(this.loadMapAction));
+ menu.addSeparator();
+ menu.add(GUIBuilder.createMenuItem(this.exitAction));
+ return menu;
+ }
- /**
- * Build the map menu
- * @return the map menu
- */
- public JMenu buildMapMenu(){
- JMenu menu = GUIBuilder.createMenu("map");
- menu.add(GUIBuilder.createMenuItem(this.exitAction));
- return menu;
- }
+ /**
+ * Build the map menu
+ * @return the map menu
+ */
+ public JMenu buildMapMenu(){
+ JMenu menu = GUIBuilder.createMenu("map");
+ menu.add(GUIBuilder.createMenuItem(this.exitAction));
+ return menu;
+ }
- /**
- * Build the view menu
- * @return the view menu
- */
- public JMenu buildViewMenu(){
- JMenu menu = GUIBuilder.createMenu("view");
- /* menu.add(GUIBuilder.createCheckBoxMenuItem(showAccessPoints, true));
- menu.add(GUIBuilder.createCheckBoxMenuItem(showClients, true));
- menu.add(GUIBuilder.createCheckBoxMenuItem(showLocations, true));
- menu.add(GUIBuilder.createCheckBoxMenuItem(showEdges, true));
- menu.add(GUIBuilder.createCheckBoxMenuItem(showEdgesBetweenLocations, true));
- */
+ /**
+ * Build the view menu
+ * @return the view menu
+ */
+ public JMenu buildViewMenu(){
+ JMenu menu = GUIBuilder.createMenu("view");
+ /* menu.add(GUIBuilder.createCheckBoxMenuItem(showAccessPoints, true));
+ menu.add(GUIBuilder.createCheckBoxMenuItem(showClients, true));
+ menu.add(GUIBuilder.createCheckBoxMenuItem(showLocations, true));
+ menu.add(GUIBuilder.createCheckBoxMenuItem(showEdges, true));
+ menu.add(GUIBuilder.createCheckBoxMenuItem(showEdgesBetweenLocations, true));
+ */
- menu.add(GUIBuilder.createCheckBoxMenuItem(this.simpleView, false));
- menu.add(GUIBuilder.createCheckBoxMenuItem(this.normalView, false));
- menu.add(GUIBuilder.createCheckBoxMenuItem(this.expertView, false));
- menu.addSeparator();
- menu.add(GUIBuilder.createCheckBoxMenuItem(this.userDefinedView, false));
- this.normalView.setSelected(true);
- return menu;
- }
+ menu.add(GUIBuilder.createCheckBoxMenuItem(this.simpleView, false));
+ menu.add(GUIBuilder.createCheckBoxMenuItem(this.normalView, false));
+ menu.add(GUIBuilder.createCheckBoxMenuItem(this.expertView, false));
+ menu.addSeparator();
+ menu.add(GUIBuilder.createCheckBoxMenuItem(this.userDefinedView, false));
+ this.normalView.setSelected(true);
+ return menu;
+ }
- /**
- * Build the options menu
- * @return the options menu
- */
- public JMenu buildOptionsMenu(){
- JMenu menu = GUIBuilder.createMenu("options");
- menu.add(GUIBuilder.createCheckBoxMenuItem(this.invisibleAction, Controller.getInstance().isInvisible()));
- menu.add(GUIBuilder.createMenuItem(this.setProxyAction));
- JMenu dataInvocationRate = GUIBuilder.createMenu("datainvocationrate");
- menu.add(dataInvocationRate);
- for (int i = 0; i < MainGUI.numberOfdataInvocationRateAction; i++)
- dataInvocationRate.add(GUIBuilder.createCheckBoxMenuItem(this.dataInvocationRateAction[i], false));
- this.dataInvocationRateAction[4].setSelected(true);
+ /**
+ * Build the options menu
+ * @return the options menu
+ */
+ public JMenu buildOptionsMenu(){
+ JMenu menu = GUIBuilder.createMenu("options");
+ menu.add(GUIBuilder.createCheckBoxMenuItem(this.invisibleAction, Controller.getInstance().isInvisible()));
+ menu.add(GUIBuilder.createMenuItem(this.setProxyAction));
+ JMenu dataInvocationRate = GUIBuilder.createMenu("datainvocationrate");
+ menu.add(dataInvocationRate);
+ for (int i = 0; i < MainGUI.numberOfdataInvocationRateAction; i++)
+ dataInvocationRate.add(GUIBuilder.createCheckBoxMenuItem(this.dataInvocationRateAction[i], false));
+ this.dataInvocationRateAction[4].setSelected(true);
- return menu;
- }
+ return menu;
+ }
- /**
- * Build the help menu
- * @return the help menu
- */
- public JMenu buildHelpMenu(){
- Browser.init();
- JMenu menu = GUIBuilder.createMenu("help");
- menu.add(GUIBuilder.createMenuItem(this.onlineHelp));
- menu.addSeparator();
- menu.add(GUIBuilder.createMenuItem(this.aboutAction));
- return menu;
- }
+ /**
+ * Build the help menu
+ * @return the help menu
+ */
+ public JMenu buildHelpMenu(){
+ Browser.init();
+ JMenu menu = GUIBuilder.createMenu("help");
+ menu.add(GUIBuilder.createMenuItem(this.onlineHelp));
+ menu.addSeparator();
+ menu.add(GUIBuilder.createMenuItem(this.aboutAction));
+ return menu;
+ }
- /**
- * Add buttons to main toolbar
- * @param bar - the toolbar
- */
- public void addMainToolBarButtons(JToolBar bar){
- JButton button = null;
- button = GUIBuilder.createToolButton(this.connectAction);
- bar.add(button);
- button = GUIBuilder.createToolButton(this.disconnectAction);
- bar.add(button);
- bar.addSeparator();
- button = GUIBuilder.createToolButton(this.newMapAction);
- bar.add(button);
- button = GUIBuilder.createToolButton(this.loadMapAction);
- bar.add(button);
- bar.addSeparator();
- bar.add(GUIBuilder.createToolToggleButton(this.invisibleAction));
- // bar.addSeparator();
- }
+ /**
+ * Add buttons to main toolbar
+ * @param bar - the toolbar
+ */
+ public void addMainToolBarButtons(JToolBar bar){
+ JButton button = null;
+ button = GUIBuilder.createToolButton(this.connectAction);
+ bar.add(button);
+ button = GUIBuilder.createToolButton(this.disconnectAction);
+ bar.add(button);
+ bar.addSeparator();
+ button = GUIBuilder.createToolButton(this.newMapAction);
+ bar.add(button);
+ button = GUIBuilder.createToolButton(this.loadMapAction);
+ bar.add(button);
+ bar.addSeparator();
+ bar.add(GUIBuilder.createToolToggleButton(this.invisibleAction));
- /**
- * Main entry point for the gui and the whole client
- * @param args - startup arguments
- */
- // public static void main(String[] args) {
- //
- // JWindow splashScreen = new JWindow();
- //
- // JLabel splashLabel = new JLabel(new ImageIcon("magicmap-splash.png"));
- //
- // splashScreen.getContentPane().add(splashLabel, BorderLayout.CENTER);
- // splashScreen.pack();
- // Dimension screenSize =
- // Toolkit.getDefaultToolkit().getScreenSize();
- // Dimension labelSize = splashLabel.getPreferredSize();
- // splashScreen.setLocation(screenSize.width/2 - (labelSize.width/2),
- // screenSize.height/2 - (labelSize.height/2));
- // splashScreen.setVisible(true);
- // screenSize = null;
- // labelSize = null;
- //
- // Settings.setup(args);
- // GUIUtils.setPlasticLookAndFeel();
- // GUIUtils.setLocale(Locale.getDefault());
- // //GUIUtils.setLocale(Locale.US);
- // JFrame frame = MainGUI.getInstance();
- // GUIUtils.locateOnScreen(frame);
- // frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- //
- // splashScreen.setVisible(false);
- // splashScreen.dispose();
- //
- // frame.setVisible(true);
- // }
- /* (non-Javadoc)
- * @see net.sf.magicmap.client.interfaces.ServerConnectCallback#connected(long)
- */
- public void connected(long sesssionId){
+ // bar.addSeparator();
+ }
- this.statusBar.setMessage(GUIUtils.i18n(GUIConstants.STATE_CONNECTED));
- this.statusBar.setInvisible(Controller.getInstance().isInvisible());
- this.connectAction.setEnabled(false);
- this.disconnectAction.setEnabled(true);
- this.newMapAction.setEnabled(true);
- this.loadMapAction.setEnabled(true);
- setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
- // Controller.getInstance().retrieveMapNames(MainGUI.this, false);
+ /**
+ * Main entry point for the gui and the whole client
+ * @param args - startup arguments
+ */
+ // public static void main(String[] args) {
+ //
+ // JWindow splashScreen = new JWindow();
+ //
+ // JLabel splashLabel = new JLabel(new ImageIcon("magicmap-splash.png"));
+ //
+ // splashScreen.getContentPane().add(splashLabel, BorderLayout.CENTER);
+ // splashScreen.pack();
+ // Dimension screenSize =
+ // Toolkit.getDefaultToolkit().getScreenSize();
+ // Dimension labelSize = splashLabel.getPreferredSize();
+ // splashScreen.setLocation(screenSize.width/2 - (labelSize.width/2),
+ // screenSize.height/2 - (labelSize.height/2));
+ // splashScreen.setVisible(true);
+ // screenSize = null;
+ // labelSize = null;
+ //
+ // Settings.setup(args);
+ // GUIUtils.setPlasticLookAndFeel();
+ // GUIUtils.setLocale(Locale.getDefault());
+ // //GUIUtils.setLocale(Locale.US);
+ // JFrame frame = MainGUI.getInstance();
+ // GUIUtils.locateOnScreen(frame);
+ // frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ //
+ // splashScreen.setVisi...
[truncated message content] |