From: <fle...@us...> - 2007-02-23 17:26:35
|
Revision: 557 http://svn.sourceforge.net/magicmap/?rev=557&view=rev Author: flederohr Date: 2007-02-23 09:26:24 -0800 (Fri, 23 Feb 2007) Log Message: ----------- Use of NodeSelectionModel in MainGUI 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/core/MagicMapApplication.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/ViewOptionsDialog.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.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/gui/views/OutlineTree.java trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineView.java trunk/magicmapclient/src/net/sf/magicmap/client/model/measurement/MeasurementTableModel.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/client/plugin/PluginManager.java Removed Paths: ------------- trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeModelSelectionListener.java Modified: trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java 2007-02-23 15:27:57 UTC (rev 556) +++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java 2007-02-23 17:26:24 UTC (rev 557) @@ -8,11 +8,9 @@ import java.util.ArrayList; import java.util.Collection; +import net.sf.magicmap.client.gui.MainGUI; import net.sf.magicmap.client.gui.utils.GUIUtils; -import net.sf.magicmap.client.gui.views.ConsoleView; 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.CreatePositionCallback; import net.sf.magicmap.client.interfaces.DeletePositionCallback; @@ -74,21 +72,13 @@ private MapInfo currentMap; - private OutlineView outlineView; - - private ConsoleView consoleView; - - private MapView mapView; - - private MeasurementView measurementView; - private boolean invisble; // Invisible-Modus (keine Daten an Server) // pseudo server items private Collection<InfoObject> infoObjects; private ScannerAllocator scannerAllocator; - private final PluginManager pluginManager; + private PluginManager pluginManager; /** * Private constructor for singleton instance @@ -112,16 +102,9 @@ this.pollhandler = new PollHandler(this); - buildViews(); - // pseudo server items this.infoObjects = new ArrayList<InfoObject>(); // initializeScanner(); - try { - this.pluginManager = new PluginManager(new Settings(), this); - } catch (MalformedURLException e) { - throw new RuntimeException(e.getMessage()); - } } /** @@ -134,55 +117,6 @@ } /** - * 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); - //registerNodeModelListener(outlineView); - } - - /** - * Getter for the map view - * - * @return the map view - */ - public MapView getMapView(){ - return this.mapView; - } - - /** - * Getter for the outline view - * - * @return the outline view - */ - public OutlineView getOutlineView(){ - return this.outlineView; - } - - /** - * Getter for the console view - * - * @return the console view - */ - public ConsoleView getConsoleView(){ - return this.consoleView; - } - - /** - * Getter for the measurement view - * - * @return the measurement view - */ - public MeasurementView getMeasurementView(){ - return this.measurementView; - } - - /** * Provides the singleton controller instance (creates a new one if null) * * @return the singleton controller instance @@ -205,24 +139,6 @@ } /** - * \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 @@ -262,23 +178,25 @@ this.nodeModel.setCurrentMap(map); this.nodeModel.addNode(this.client); - this.mapView.loadMap(map); + // TODO: Interface f\xFCr GUI mit methode loadMap() + ((MapView) MainGUI.getInstance().getViewComponent("mapView")).loadMap(map); } catch (MalformedURLException e) { System.out.println("Map loading failed." + e.getMessage()); closeMap(); } if (isMapLoaded() && isConnected()) { 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"); + + // TODO: Interface f\xFCr GUI mit methode setMapTitle() + ((MapView) MainGUI.getInstance().getViewComponent("mapView")).setTitle(GUIUtils.i18n("map", false) + + " - " + this.currentMap.name + " Gr\xF6\xDFe: " + this.currentMap.realwidth + " X " + + this.currentMap.realheight + " cm"); } } @@ -314,7 +232,8 @@ e1.printStackTrace(); } this.currentMap = null; - this.mapView.unloadMap(); + // TODO: Interface f\xFCr GUI mit methode unloadMap() + ((MapView) MainGUI.getInstance().getViewComponent("mapView")).unloadMap(); this.serverManager.closeMap(); this.poller.stop(); this.measurementModel.clear(); @@ -330,7 +249,7 @@ * @return client x position */ public int getClientPosX(){ - return this.mapView.getX(this.client); + return client.getX(); } /** @@ -339,7 +258,7 @@ * @return */ public int getClientPosY(){ - return this.mapView.getY(this.client); + return client.getY(); } /** @@ -348,7 +267,7 @@ * @return */ public int getClientPosZ(){ - return this.mapView.getZ(this.client); + return client.getZ(); } /** @@ -520,7 +439,9 @@ */ public void retrieveMap(String name, MapCallback callback){ this.serverManager.retrieveMap(name, callback); - getMapView().setTitle(GUIUtils.i18n("map", false) + " - " + name); + // TODO: Interface f\xFCr GUI mit methode setMapTitle() + ((MapView) MainGUI.getInstance().getViewComponent("mapView")).setTitle(GUIUtils.i18n("map", false) + " - " + + name); } public void retrieveMapNames(MapNamesCallback callback, boolean openMapDialog){ @@ -549,4 +470,13 @@ this.scannerAllocator.addScanResultHandler(handler); } + public void initializePlugins(){ + try { + this.pluginManager = new PluginManager(new Settings(), this); + } catch (MalformedURLException e) { + throw new RuntimeException(e.getMessage()); + } + + } + } Modified: trunk/magicmapclient/src/net/sf/magicmap/client/controller/IController.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/controller/IController.java 2007-02-23 15:27:57 UTC (rev 556) +++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/IController.java 2007-02-23 17:26:24 UTC (rev 557) @@ -39,50 +39,13 @@ ClientNode getClient(); /** - * Getter for the map view - * - * @return the map view - */ - MapView getMapView(); - - /** - * Getter for the outline view - * - * @return the outline view - */ - OutlineView getOutlineView(); - - /** - * Getter for the console view - * - * @return the console view - */ - ConsoleView getConsoleView(); - - /** - * Getter for the measurement view - * - * @return the measurement view - */ - MeasurementView getMeasurementView(); - - /** * Getter for the node model * * @return the node model */ INodeModel getNodeModel(); - /** - * \xC4nndert die Anzeige des Measurement-Views - * - * @param local - * true, wenn lokale St\xE4rken angezeigt werden sollen - */ - void setMeasurementViewLocal(boolean local); - - /** * Getter for measurement model * * @return the measurement model @@ -186,18 +149,18 @@ */ void createGeoPos(int x, int y, GeoPos geoPos, String mapName, boolean fixed, CreatePositionCallback callback); -// /** -// * Creates an InfoObject on the current map with the supplied parameters -// * -// * @param lastX -// * @param lastY -// * @param infoObject -// * @param string -// * @param b -// * @param panel -// */ -// void createInfoObject(int x, int y, int z, InfoObject infoObject, String mapName, boolean fixed, -// CreatePositionCallback callback); + // /** + // * Creates an InfoObject on the current map with the supplied parameters + // * + // * @param lastX + // * @param lastY + // * @param infoObject + // * @param string + // * @param b + // * @param panel + // */ + // void createInfoObject(int x, int y, int z, InfoObject infoObject, String mapName, boolean fixed, + // CreatePositionCallback callback); /** * Entfernt einen @@ -241,4 +204,10 @@ void handleScanResult(AbstractScanResult scanResult, AbstractScanner scanner); void addScannerHandler(AbstractScannerHandler handler); + + /** + * Initialisiert die Plugins + * + */ + void initializePlugins(); } Modified: trunk/magicmapclient/src/net/sf/magicmap/client/core/MagicMapApplication.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/core/MagicMapApplication.java 2007-02-23 15:27:57 UTC (rev 556) +++ trunk/magicmapclient/src/net/sf/magicmap/client/core/MagicMapApplication.java 2007-02-23 17:26:24 UTC (rev 557) @@ -12,6 +12,7 @@ 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.GUIUtils; import net.sf.magicmap.client.utils.Settings; @@ -55,17 +56,17 @@ GUIUtils.setPlasticLookAndFeel(); GUIUtils.setLocale(Locale.getDefault()); - // GUIUtils.setLocale(Locale.US); + JFrame frame = MainGUI.getInstance(); GUIUtils.locateOnScreen(frame); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + // plugins laden. + Controller.getInstance().initializePlugins(); + splashScreen.setVisible(false); splashScreen.dispose(); - // plugins laden. - //PluginManager pm = new PluginManager(new Settings(), Controller.getInstance()); - frame.setVisible(true); } Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java 2007-02-23 15:27:57 UTC (rev 556) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java 2007-02-23 17:26:24 UTC (rev 557) @@ -5,39 +5,66 @@ package net.sf.magicmap.client.gui; -import com.Ostermiller.util.Browser; -import com.brunchboy.util.swing.relativelayout.AttributeConstraint; -import com.brunchboy.util.swing.relativelayout.AttributeType; -import com.brunchboy.util.swing.relativelayout.DependencyManager; -import com.brunchboy.util.swing.relativelayout.RelativeLayout; -import com.jgoodies.uif_lite.component.UIFSplitPane; +import java.awt.Container; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.event.ActionEvent; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.rmi.RemoteException; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +import javax.swing.AbstractAction; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JComponent; +import javax.swing.JFrame; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JOptionPane; +import javax.swing.JSplitPane; +import javax.swing.JToolBar; + import net.sf.magicmap.client.controller.Controller; -import net.sf.magicmap.client.gui.dialogs.*; +import net.sf.magicmap.client.gui.dialogs.AboutDialog; +import net.sf.magicmap.client.gui.dialogs.ConnectServerDialog; +import net.sf.magicmap.client.gui.dialogs.LoadMapDialog; +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.GUIBuilder; import net.sf.magicmap.client.gui.utils.GUIConstants; import net.sf.magicmap.client.gui.utils.GUIUtils; import net.sf.magicmap.client.gui.utils.MagicAction; -import net.sf.magicmap.client.gui.views.*; -import net.sf.magicmap.client.interfaces.*; +import net.sf.magicmap.client.gui.views.ConsoleView; +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.model.node.INodeSelectionModel; import net.sf.magicmap.client.model.node.MapNode; import net.sf.magicmap.client.model.node.NodeModel; +import net.sf.magicmap.client.model.node.NodeSelectionModel; import net.sf.magicmap.client.utils.Settings; import net.sf.magicmap.client.utils.Version; + import org.apache.axis.AxisFault; -import javax.swing.*; -import java.awt.*; -import java.awt.event.ActionEvent; -import java.io.IOException; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.rmi.RemoteException; -import java.util.Map; -import java.util.HashMap; -import java.util.Collection; -import java.util.Set; +import com.Ostermiller.util.Browser; +import com.brunchboy.util.swing.relativelayout.AttributeConstraint; +import com.brunchboy.util.swing.relativelayout.AttributeType; +import com.brunchboy.util.swing.relativelayout.DependencyManager; +import com.brunchboy.util.swing.relativelayout.RelativeLayout; +import com.jgoodies.uif_lite.component.UIFSplitPane; /** * The main GUI window @@ -45,808 +72,830 @@ */ @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; - } - private Map<String, JComponent> viewMap = new HashMap<String, JComponent>(); - 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; - private MapView mapView; - private MagicAction invisibleAction; - private MagicAction simpleView; - private MagicAction normalView; - private MagicAction expertView; - private MagicAction userDefinedView; + /** + * 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 Map<String, JComponent> viewMap = new HashMap<String, JComponent>(); + 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 INodeSelectionModel nodeSelectionModel; - 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(); + // NodeSelectionModel + nodeSelectionModel = new NodeSelectionModel(); + + // 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)); - - viewMap.put("outlineView", outlineView); - viewMap.put("mapPanel", mapPanel); - viewMap.put("mapView", mapView); - viewMap.put("consoleView", consoleView); - viewMap.put("bottomRightTabPanel", bottomRightTabPanel); + // 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(){ + buildViews(); + + UIFSplitPane pane2; - /** - * 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); + this.bottomRightTabPanel = new ViewTabPanel(); + this.bottomRightTabPanel.addView(this.measurementView); + this.bottomRightTabPanel.addView(this.consoleView); + this.bottomRightTabPanel.selectView(this.measurementView); - UIFSplitPane pane2; + 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; + } - this.bottomRightTabPanel = new ViewTabPanel(); - this.bottomRightTabPanel.addView(this.measurementView); - this.bottomRightTabPanel.addView(this.consoleView); - this.bottomRightTabPanel.selectView(this.measurementView); + /** + * 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; + } - 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 map menu + * @return the map menu + */ + public JMenu buildMapMenu(){ + JMenu menu = GUIBuilder.createMenu("map"); + 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 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 map menu - * @return the map menu - */ - public JMenu buildMapMenu(){ - JMenu menu = GUIBuilder.createMenu("map"); - menu.add(GUIBuilder.createMenuItem(this.exitAction)); - 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 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 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); - 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; - } + return menu; + ... [truncated message content] |