You can subscribe to this list here.
| 2005 |
Jan
|
Feb
(14) |
Mar
|
Apr
(4) |
May
(57) |
Jun
(14) |
Jul
(15) |
Aug
(5) |
Sep
(29) |
Oct
(13) |
Nov
(44) |
Dec
(3) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(14) |
Feb
(78) |
Mar
(55) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
(12) |
Dec
(9) |
| 2007 |
Jan
(21) |
Feb
(67) |
Mar
(39) |
Apr
(28) |
May
(7) |
Jun
|
Jul
(6) |
Aug
(2) |
Sep
(1) |
Oct
(18) |
Nov
(8) |
Dec
(11) |
| 2008 |
Jan
(16) |
Feb
(12) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <Jan...@us...> - 2007-02-28 09:55:48
|
Revision: 583
http://svn.sourceforge.net/magicmap/?rev=583&view=rev
Author: Jan_fride
Date: 2007-02-28 01:55:47 -0800 (Wed, 28 Feb 2007)
Log Message:
-----------
copy all edges and vertices before painting in paintComponent to avoid
concurrency problems
Modified Paths:
--------------
trunk/magicmapclient/src/edu/uci/ics/jung/visualization/VisualizationViewer.java
Modified: trunk/magicmapclient/src/edu/uci/ics/jung/visualization/VisualizationViewer.java
===================================================================
--- trunk/magicmapclient/src/edu/uci/ics/jung/visualization/VisualizationViewer.java 2007-02-27 20:56:49 UTC (rev 582)
+++ trunk/magicmapclient/src/edu/uci/ics/jung/visualization/VisualizationViewer.java 2007-02-28 09:55:47 UTC (rev 583)
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, the JUNG Project and the Regents of the University
+ * Copyright (c) 2003, the JUNG Project and the Regents of the University
* of California
* All rights reserved.
*
@@ -157,7 +157,7 @@
repaint();
}
- /**
+ /**
* (non-Javadoc)
* @see javax.swing.JComponent#setVisible(boolean)
*/
@@ -167,7 +167,7 @@
}
/**
- * Runs the visualization forward a few hundred iterations (for half a
+ * Runs the visualization forward a few hundred iterations (for half a
* second)
*/
public void prerelax(){
@@ -398,7 +398,7 @@
/**
* Returns a flag that says whether the visRunner thread is running. If
- * it is not, then you may need to restart the thread (with
+ * it is not, then you may need to restart the thread (with
* @return
*/
public boolean isVisRunnerRunning(){
@@ -447,43 +447,47 @@
}
protected void paintComponent(Graphics g){
- start();
+ start();
- //super.paintComponent(g);
- if (image != null){
- g.drawImage(image, 0, 0, this);
+ //super.paintComponent(g);
+ if (image != null){
+ g.drawImage(image, 0, 0, this);
- } else{}
+ } else{}
- Graphics2D g2d = (Graphics2D) g;
- g2d.setRenderingHints(renderingHints);
- AffineTransform oldXform = g2d.getTransform();
- AffineTransform newXform = new AffineTransform(oldXform);
- newXform.scale(scalex, scaley);
- newXform.translate(-offsetx, -offsety);
- g2d.setTransform(newXform);
+ Graphics2D g2d = (Graphics2D) g;
+ g2d.setRenderingHints(renderingHints);
+ AffineTransform oldXform = g2d.getTransform();
+ AffineTransform newXform = new AffineTransform(oldXform);
+ newXform.scale(scalex, scaley);
+ newXform.translate(-offsetx, -offsety);
+ g2d.setTransform(newXform);
- long start = System.currentTimeMillis();
- // for all edges, paint edge
- for (Iterator iter = layout.getVisibleEdges().iterator(); iter.hasNext();){
- Edge e = (Edge) iter.next();
- Vertex v1 = (Vertex) e.getEndpoints().getFirst();
- Vertex v2 = (Vertex) e.getEndpoints().getSecond();
- renderer.paintEdge(g, e, (int) layout.getX(v1), (int) layout.getY(v1), (int) layout.getX(v2), (int) layout
- .getY(v2));
- }
+ long start = System.currentTimeMillis();
+ // for all edges, paint edge
+ // get a copy of edges!
+ Object[] edges = layout.getVisibleEdges().toArray();
+ Object[] vertices = layout.getVisibleVertices().toArray();
- for (Iterator iter = layout.getVisibleVertices().iterator(); iter.hasNext();){
- Vertex v = (Vertex) iter.next();
- renderer.paintVertex(g, v, (int) layout.getX(v), (int) layout.getY(v));
- }
+ for (Object o: edges){
+ Edge e = (Edge) o;
+ Vertex v1 = (Vertex) e.getEndpoints().getFirst();
+ Vertex v2 = (Vertex) e.getEndpoints().getSecond();
+ renderer.paintEdge(g, e, (int) layout.getX(v1), (int) layout.getY(v1), (int) layout.getX(v2), (int) layout
+ .getY(v2));
+ }
- long delta = System.currentTimeMillis() - start;
- paintTimes[paintIndex++] = delta;
- paintIndex = paintIndex % paintTimes.length;
- paintfps = average(paintTimes);
+ for (Object o: vertices){
+ Vertex v = (Vertex)o;
+ renderer.paintVertex(g, v, (int) layout.getX(v), (int) layout.getY(v));
+ }
- g2d.setTransform(oldXform);
+ long delta = System.currentTimeMillis() - start;
+ paintTimes[paintIndex++] = delta;
+ paintIndex = paintIndex % paintTimes.length;
+ paintfps = average(paintTimes);
+
+ g2d.setTransform(oldXform);
}
/**
@@ -526,7 +530,7 @@
}
/**
- *
+ *
*/
public synchronized void stop(){
System.out.println("> stop.");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Jan...@us...> - 2007-02-27 20:56:51
|
Revision: 582
http://svn.sourceforge.net/magicmap/?rev=582&view=rev
Author: Jan_fride
Date: 2007-02-27 12:56:49 -0800 (Tue, 27 Feb 2007)
Log Message:
-----------
logging exceptions
Modified Paths:
--------------
trunk/magicmapclient/src/net/sf/magicmap/client/plugin/PluginLoader.java
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/plugin/PluginLoader.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/plugin/PluginLoader.java 2007-02-27 20:55:56 UTC (rev 581)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/plugin/PluginLoader.java 2007-02-27 20:56:49 UTC (rev 582)
@@ -65,6 +65,7 @@
}
catch (Exception ex){
brokenUrlList.add(jarUrl);
+ ex.printStackTrace();
}
}
} catch (Exception e) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Jan...@us...> - 2007-02-27 20:56:29
|
Revision: 581
http://svn.sourceforge.net/magicmap/?rev=581&view=rev
Author: Jan_fride
Date: 2007-02-27 12:55:56 -0800 (Tue, 27 Feb 2007)
Log Message:
-----------
getIcon with class
Modified Paths:
--------------
trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/GUIBuilder.java
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/GUIBuilder.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/GUIBuilder.java 2007-02-27 07:21:09 UTC (rev 580)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/GUIBuilder.java 2007-02-27 20:55:56 UTC (rev 581)
@@ -5,9 +5,13 @@
package net.sf.magicmap.client.gui.utils;
import java.awt.Dimension;
+import java.awt.MediaTracker;
import java.awt.event.ActionListener;
+import java.awt.image.BufferedImage;
+import java.io.IOException;
import java.net.URL;
+import javax.imageio.ImageIO;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.ImageIcon;
@@ -101,7 +105,30 @@
imageURL = null;
return new ImageIcon(imageURL, "<>");
+ }
+
+ public static ImageIcon getToolIcon(String imageName, String resourcePackage, Class clazz){
+ String imgLocation;
+ URL imageURL;
+ if (imageName != null) {
+
+ imgLocation = "/" + resourcePackage + "/" + imageName;
+ imageURL = clazz.getResource(imgLocation);
+
+ } else
+ imageURL = null;
+ BufferedImage image;
+ try {
+ image = ImageIO.read(imageURL);
+ image.flush();
+ return new ImageIcon(image, "<>");
+ } catch (IOException e) {
+ e.printStackTrace();
+ return getToolIcon("");
+ }
+
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rad...@us...> - 2007-02-27 07:21:10
|
Revision: 580
http://svn.sourceforge.net/magicmap/?rev=580&view=rev
Author: radetzki09
Date: 2007-02-26 23:21:09 -0800 (Mon, 26 Feb 2007)
Log Message:
-----------
made the search for clients by its mac in the (I)NodeModel possible.
Modified Paths:
--------------
trunk/magicmapclient/src/net/sf/magicmap/client/model/node/INodeModel.java
trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeModel.java
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/node/INodeModel.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/model/node/INodeModel.java 2007-02-26 20:46:14 UTC (rev 579)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/model/node/INodeModel.java 2007-02-27 07:21:09 UTC (rev 580)
@@ -133,6 +133,20 @@
public abstract boolean accessPointExists(String mac);
/**
+ *
+ * @param mac
+ * @return
+ */
+ public abstract ClientNode findClient(String mac);
+
+ /**
+ * Abfrage ob ein Client mit einer mac existiert.
+ * @param mac the mac address of the client
+ * @return true if the model contains client with the given mac.
+ */
+ public abstract boolean clientExists(String mac);
+
+ /**
* Liefert alle Knoten des Models.
* @return alle Knoten des Models.
*/
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeModel.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeModel.java 2007-02-26 20:46:14 UTC (rev 579)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/model/node/NodeModel.java 2007-02-27 07:21:09 UTC (rev 580)
@@ -38,6 +38,7 @@
private final Map<String, Node> nodes;
private final Map<String, AccessPointNode> accesspoints;
+ private final Map<String, ClientNode> clients;
private final List<NodeModelListener> listeners;
private final Map<String, MapNode> mapMap;
@@ -52,6 +53,7 @@
public NodeModel() {
this.nodes = Collections.synchronizedMap(new HashMap<String, Node>());
this.accesspoints = Collections.synchronizedMap(new HashMap<String, AccessPointNode>());
+ this.clients = Collections.synchronizedMap(new HashMap<String, ClientNode>());
this.listeners = Collections.synchronizedList(new ArrayList<NodeModelListener>());
mapMap = Collections.synchronizedMap(new HashMap<String, MapNode>());
setNodePlacer(new JungNodePlacer());
@@ -70,6 +72,9 @@
// special handling for APs
if (node.getType() == NodeModelConstants.NODETYPE_ACCESSPOINT) // Wenn AccessPoint, dann nach MAC-Adresse extra hashen
this.accesspoints.put(((AccessPointNode) node).getMacAddress(), (AccessPointNode) node);
+ // special handling for Clients
+ if (node.getType() == NodeModelConstants.NODETYPE_CLIENT) // Wenn Client, dann nach MAC-Adresse extra hashen
+ this.clients.put(((ClientNode) node).getMacAddress(), (ClientNode) node);
if (MapNode.class.equals(node.getClass())) {
MapNode map = (MapNode) node;
@@ -97,6 +102,9 @@
if (node.getType() == NodeModelConstants.NODETYPE_ACCESSPOINT) {
this.accesspoints.remove(((AccessPointNode) node).getMacAddress());
}
+ if (node.getType() == NodeModelConstants.NODETYPE_CLIENT) {
+ this.clients.remove(((ClientNode) node).getMacAddress());
+ }
// aus dem layout entfernen!
this.placer.deleteNode(node);
@@ -215,6 +223,19 @@
}
/**
+ * Finds client with the given mac
+ * @param mac the mac to search for
+ * @return clientNode or null
+ */
+ public ClientNode findClient(String mac){
+ return this.clients.get(mac);
+ }
+
+ public boolean clientExists(String mac){
+ return this.clients.containsKey(mac);
+ }
+
+ /**
* Finds an access point with the given mac
* @param mac the mac to search for
* @return an ap or null
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Jan...@us...> - 2007-02-26 20:46:36
|
Revision: 579
http://svn.sourceforge.net/magicmap/?rev=579&view=rev
Author: Jan_fride
Date: 2007-02-26 12:46:14 -0800 (Mon, 26 Feb 2007)
Log Message:
-----------
mada the console a console ;-) (a list)
Modified Paths:
--------------
trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/ConsoleView.java
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/ConsoleView.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/ConsoleView.java 2007-02-25 22:21:37 UTC (rev 578)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/ConsoleView.java 2007-02-26 20:46:14 UTC (rev 579)
@@ -4,19 +4,29 @@
package net.sf.magicmap.client.gui.views;
+import java.awt.Color;
+
+import javax.swing.DefaultListModel;
import javax.swing.JComponent;
+import javax.swing.JList;
import javax.swing.JPanel;
+import javax.swing.JScrollPane;
import net.sf.magicmap.client.gui.MainGUI;
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 com.jgoodies.forms.layout.CellConstraints;
+import com.jgoodies.forms.layout.FormLayout;
+
/**
* @author thuebner
*/
public class ConsoleView extends View {
+ private JList list;
+ private DefaultListModel listModel;
/**
* serial version id
*/
@@ -26,9 +36,10 @@
super();
this.setFrameIcon(GUIBuilder.getToolIcon(GUIConstants.ICON_CONSOLE));
MainGUI.getInstance().registerJComponent(this, name);
+
}
- /* (non-Javadoc)
+ /**
* @see java.awt.Component#getName()
*/
@Override
@@ -36,13 +47,34 @@
return GUIUtils.i18n("console", false);
}
- /* (non-Javadoc)
+ /**
* @see net.sf.magicmap.client.views.View#buildViewComponent()
*/
@Override
protected JComponent buildViewComponent(){
JPanel panel = new JPanel();
+ listModel = new DefaultListModel();
+ list = new JList(listModel);
+ panel.setLayout(new FormLayout("p:grow", "p:grow"));
+ final JScrollPane scrollPane = new JScrollPane(list,
+ JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
+ list.setBackground(Color.WHITE);
+
+ panel.add(scrollPane, new CellConstraints().xy(1,1, CellConstraints.FILL, CellConstraints.FILL));
return panel;
}
-
+ /**
+ * Adds a new message to the list
+ * @param message
+ */
+ public void append(String message){
+ synchronized (listModel) {
+ listModel.addElement(message);
+ }
+ }
+ public void clear(String message){
+ synchronized (listModel) {
+ listModel.removeAllElements();
+ }
+ }
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fle...@us...> - 2007-02-25 22:26:20
|
Revision: 577
http://svn.sourceforge.net/magicmap/?rev=577&view=rev
Author: flederohr
Date: 2007-02-25 14:18:47 -0800 (Sun, 25 Feb 2007)
Log Message:
-----------
selection of Nodes over OutlineView now affects the shown edges
Modified Paths:
--------------
trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java 2007-02-25 21:33:26 UTC (rev 576)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java 2007-02-25 22:18:47 UTC (rev 577)
@@ -157,7 +157,7 @@
labeller = StringLabeller.getLabeller(graph);
log.debug(layoutModel.getLayout());
- graphdraw.setGraphLayout((layoutModel.getLayout()));
+ graphdraw.setGraphLayout(layoutModel.getLayout());
// \xDCber L\xF6schaktionen im Bilde bleiben um eigene zus. Resourcen
// freizugeben....
graph.addListener(new GraphEventListener() {
@@ -574,8 +574,8 @@
* Called if a
*/
public void selectionChanged(NodeModelSelectionEvent selectEvent){
- Node newSelectedNode = selectEvent.getSelectedNode();
- graphdraw.getVisualizationViewer().setSelected(findVertex(newSelectedNode));
+ selectedNode = selectEvent.getSelectedNode();
+ graphdraw.setSelected(findVertex(selectedNode));
}
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fle...@us...> - 2007-02-25 22:21:38
|
Revision: 578
http://svn.sourceforge.net/magicmap/?rev=578&view=rev
Author: flederohr
Date: 2007-02-25 14:21:37 -0800 (Sun, 25 Feb 2007)
Log Message:
-----------
removed old splash-image and moved new one to resource directory
Modified Paths:
--------------
trunk/magicmapclient/src/net/sf/magicmap/client/core/MagicMapApplication.java
Added Paths:
-----------
trunk/magicmapclient/res/magicmap-splash.png
Removed Paths:
-------------
trunk/magicmapclient/magicmap-splash.png
trunk/magicmapclient/res/magicmap-splash_src.png
Deleted: trunk/magicmapclient/magicmap-splash.png
===================================================================
(Binary files differ)
Added: trunk/magicmapclient/res/magicmap-splash.png
===================================================================
(Binary files differ)
Property changes on: trunk/magicmapclient/res/magicmap-splash.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: trunk/magicmapclient/res/magicmap-splash_src.png
===================================================================
(Binary files differ)
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/core/MagicMapApplication.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/core/MagicMapApplication.java 2007-02-25 22:18:47 UTC (rev 577)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/core/MagicMapApplication.java 2007-02-25 22:21:37 UTC (rev 578)
@@ -30,7 +30,7 @@
JWindow splashScreen = new JWindow();
- JLabel splashLabel = new JLabel(new ImageIcon("magicmap-splash.png")) {
+ JLabel splashLabel = new JLabel(new ImageIcon(MagicMapApplication.class.getClassLoader().getResource("magicmap-splash.png"))) {
private static final long serialVersionUID = 5735447445835224982L;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fle...@us...> - 2007-02-25 21:33:39
|
Revision: 576
http://svn.sourceforge.net/magicmap/?rev=576&view=rev
Author: flederohr
Date: 2007-02-25 13:33:26 -0800 (Sun, 25 Feb 2007)
Log Message:
-----------
fixed Uncaught fetching image error
Modified Paths:
--------------
trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/ClientNodeIcon.java
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/ClientNodeIcon.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/ClientNodeIcon.java 2007-02-25 20:04:21 UTC (rev 575)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/ClientNodeIcon.java 2007-02-25 21:33:26 UTC (rev 576)
@@ -8,8 +8,6 @@
import javax.swing.Icon;
import javax.swing.ImageIcon;
-import net.sf.magicmap.client.gui.MainGUI;
-import net.sf.magicmap.client.gui.views.MapView;
import net.sf.magicmap.client.model.node.ClientNode;
import net.sf.magicmap.client.model.node.INodeModel;
import net.sf.magicmap.client.model.node.Node;
@@ -23,7 +21,7 @@
private ImageIcon clientFixed;
private ImageIcon getClient(){
- if (client == null) client = GUIBuilder.getToolIcon("Client.png", "NodeIcons");
+ if (client == null) client = GUIBuilder.getToolIcon("client.png", "NodeIcons");
return client;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fle...@us...> - 2007-02-25 20:04:23
|
Revision: 575
http://svn.sourceforge.net/magicmap/?rev=575&view=rev
Author: flederohr
Date: 2007-02-25 12:04:21 -0800 (Sun, 25 Feb 2007)
Log Message:
-----------
fixed Uncaught fetching image error
Modified Paths:
--------------
trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainFrame.java
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainFrame.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainFrame.java 2007-02-25 19:44:05 UTC (rev 574)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainFrame.java 2007-02-25 20:04:21 UTC (rev 575)
@@ -5,13 +5,16 @@
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.HeadlessException;
+import java.awt.Image;
import java.awt.event.ActionEvent;
+import java.awt.image.VolatileImage;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.rmi.RemoteException;
import javax.swing.AbstractAction;
+import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
@@ -107,7 +110,7 @@
// Hauptfenstereigenschaften setzen
this.setSize(new Dimension(1024, 768));
this.setTitle("MagicMap - Version " + Version.getVersion());
- this.setIconImage(GUIBuilder.getToolIcon("MagicMap.png", ".").getImage());
+ this.setIconImage(new ImageIcon(this.getClass().getClassLoader().getResource("MagicMap.png")).getImage());
//Menu erstellen
this.menuBar = new JMenuBar();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rad...@us...> - 2007-02-25 19:44:06
|
Revision: 574
http://svn.sourceforge.net/magicmap/?rev=574&view=rev
Author: radetzki09
Date: 2007-02-25 11:44:05 -0800 (Sun, 25 Feb 2007)
Log Message:
-----------
removed import voidLayout
Modified Paths:
--------------
trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java 2007-02-25 18:47:46 UTC (rev 573)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java 2007-02-25 19:44:05 UTC (rev 574)
@@ -55,7 +55,6 @@
import edu.uci.ics.jung.graph.event.GraphEventType;
import edu.uci.ics.jung.graph.impl.DirectedSparseGraph;
import edu.uci.ics.jung.visualization.SpringLayout;
-import edu.uci.ics.jung.visualization.contrib.VoidLayout;
/**
* Kapselt das JUNG-Framework sowie die Karte
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <Jan...@us...> - 2007-02-25 18:47:57
|
Revision: 573
http://svn.sourceforge.net/magicmap/?rev=573&view=rev
Author: Jan_fride
Date: 2007-02-25 10:47:46 -0800 (Sun, 25 Feb 2007)
Log Message:
-----------
removed voidlayout... should have never been in there anyway ;-)
Modified Paths:
--------------
trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java 2007-02-25 15:50:28 UTC (rev 572)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java 2007-02-25 18:47:46 UTC (rev 573)
@@ -55,6 +55,7 @@
import edu.uci.ics.jung.graph.event.GraphEventType;
import edu.uci.ics.jung.graph.impl.DirectedSparseGraph;
import edu.uci.ics.jung.visualization.SpringLayout;
+import edu.uci.ics.jung.visualization.contrib.VoidLayout;
/**
* Kapselt das JUNG-Framework sowie die Karte
@@ -157,7 +158,7 @@
labeller = StringLabeller.getLabeller(graph);
log.debug(layoutModel.getLayout());
- graphdraw.setGraphLayout(layoutModel.getLayout());
+ graphdraw.setGraphLayout((layoutModel.getLayout()));
// \xDCber L\xF6schaktionen im Bilde bleiben um eigene zus. Resourcen
// freizugeben....
graph.addListener(new GraphEventListener() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fle...@us...> - 2007-02-25 15:50:59
|
Revision: 572
http://svn.sourceforge.net/magicmap/?rev=572&view=rev
Author: flederohr
Date: 2007-02-25 07:50:28 -0800 (Sun, 25 Feb 2007)
Log Message:
-----------
Reconstructed the GUI Components
MainGUI is no longer a JFrame itself but provides a JFrame(MainFrame) as a field
Modified Paths:
--------------
trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java
trunk/magicmapclient/src/net/sf/magicmap/client/controller/SOAPServerManager.java
trunk/magicmapclient/src/net/sf/magicmap/client/controller/ServerPoller.java
trunk/magicmapclient/src/net/sf/magicmap/client/controller/VirtualServerManager.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/MapPanel.java
trunk/magicmapclient/src/net/sf/magicmap/client/gui/ViewTabPanel.java
trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/ConnectServerDialog.java
trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/ViewOptionsDialog.java
trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/GUIConstants.java
trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/GUIUtils.java
trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/ConsoleView.java
trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java
trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MeasurementView.java
trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineView.java
trunk/magicmapclient/src/net/sf/magicmap/client/interfaces/MapNamesCallback.java
trunk/magicmapclient/src/net/sf/magicmap/client/model/measurement/MeasurementTableModel.java
trunk/magicmapclient/src/net/sf/magicmap/client/model/node/MapNode.java
trunk/magicmapclient/src/net/sf/magicmap/client/plugin/PluginManager.java
Added Paths:
-----------
trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainFrame.java
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java 2007-02-24 14:40:57 UTC (rev 571)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java 2007-02-25 15:50:28 UTC (rev 572)
@@ -179,7 +179,7 @@
this.nodeModel.addNode(this.client);
// TODO: Interface f\xFCr GUI mit methode loadMap()
- ((MapView) MainGUI.getInstance().getViewComponent("mapView")).loadMap(map);
+ ((MapView) MainGUI.getInstance().getJComponent("mapView")).loadMap(map);
} catch (MalformedURLException e) {
System.out.println("Map loading failed." + e.getMessage());
closeMap();
@@ -194,7 +194,7 @@
if (this.currentMap.realheight > 0 && this.currentMap.realwidth > 0)
// TODO: Interface f\xFCr GUI mit methode setMapTitle()
- ((MapView) MainGUI.getInstance().getViewComponent("mapView")).setTitle(GUIUtils.i18n("map", false)
+ ((MapView) MainGUI.getInstance().getJComponent("mapView")).setTitle(GUIUtils.i18n("map", false)
+ " - " + this.currentMap.name + " Gr\xF6\xDFe: " + this.currentMap.realwidth + " X "
+ this.currentMap.realheight + " cm");
}
@@ -233,7 +233,7 @@
}
this.currentMap = null;
// TODO: Interface f\xFCr GUI mit methode unloadMap()
- ((MapView) MainGUI.getInstance().getViewComponent("mapView")).unloadMap();
+ ((MapView) MainGUI.getInstance().getJComponent("mapView")).unloadMap();
this.serverManager.closeMap();
this.poller.stop();
this.measurementModel.clear();
@@ -341,7 +341,6 @@
callback.positionCreationError(new Exception("Nicht verbunden oder keine Karte geladen."));
else {
this.serverManager.createGeoPos(x, y, fixed, geoPos, mapName, callback);
- this.poller.geomapTimerTask().run();
}
}
@@ -440,7 +439,7 @@
public void retrieveMap(String name, MapCallback callback){
this.serverManager.retrieveMap(name, callback);
// TODO: Interface f\xFCr GUI mit methode setMapTitle()
- ((MapView) MainGUI.getInstance().getViewComponent("mapView")).setTitle(GUIUtils.i18n("map", false) + " - "
+ ((MapView) MainGUI.getInstance().getJComponent("mapView")).setTitle(GUIUtils.i18n("map", false) + " - "
+ name);
}
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/controller/SOAPServerManager.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/controller/SOAPServerManager.java 2007-02-24 14:40:57 UTC (rev 571)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/SOAPServerManager.java 2007-02-25 15:50:28 UTC (rev 572)
@@ -183,8 +183,6 @@
String[] names = SOAPServerManager.this.mapDelegate.getMapNames();
if (openDialog)
callback.openMapDialog(names);
- else
- callback.addMapNamesToOutline(names);
} catch (Exception e) {
e.printStackTrace();
callback.getMapNamesError(e);
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/controller/ServerPoller.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/controller/ServerPoller.java 2007-02-24 14:40:57 UTC (rev 571)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/ServerPoller.java 2007-02-25 15:50:28 UTC (rev 572)
@@ -11,7 +11,6 @@
import net.sf.magicmap.client.interfaces.FetchGeoPointsCallback;
import net.sf.magicmap.client.interfaces.FetchInfoPointsCallback;
-import net.sf.magicmap.client.interfaces.FetchMapsCallback;
import net.sf.magicmap.client.interfaces.FetchPositionsCallback;
import net.sf.magicmap.client.interfaces.ServerPollerListener;
import net.sf.magicmap.client.model.node.InfoObject;
@@ -26,12 +25,7 @@
* oder vom Anwender erzeugte Referenzpunkte.
* @author thuebner
*/
-public class ServerPoller
- implements
- FetchPositionsCallback,
- FetchGeoPointsCallback,
- FetchMapsCallback,
- FetchInfoPointsCallback {
+public class ServerPoller implements FetchPositionsCallback, FetchGeoPointsCallback, FetchInfoPointsCallback {
private static String syncObj = "TEST";
@@ -48,7 +42,7 @@
public void start(){
this.timer.scheduleAtFixedRate(builderTimerTask(), Settings.POLL_DELAY, Settings.getPollIntevall());
- this.timer.scheduleAtFixedRate(geomapTimerTask(), Settings.POLL_DELAY + 1000, 120000);
+ this.timer.scheduleAtFixedRate(geoPointsTimerTask(), Settings.POLL_DELAY + 1000, 120000);
}
public void stop(){
@@ -80,7 +74,7 @@
};
}
- public TimerTask geomapTimerTask(){
+ public TimerTask geoPointsTimerTask(){
return new TimerTask() {
@Override
@@ -89,7 +83,6 @@
if (!ServerPoller.this.isFetching) {
ServerPoller.this.isFetching = true;
ServerPoller.this.serverManager.fetchGeoPointsFromServer(ServerPoller.this);
- ServerPoller.this.serverManager.fetchMapsFromServer(ServerPoller.this);
}
}
}
@@ -168,16 +161,6 @@
}
/* (non-Javadoc)
- * @see net.sf.magicmap.client.interfaces.FetchMapsCallback#mapFetchError(java.lang.Exception)
- */
- public void mapFetchError(Exception e){
- e.printStackTrace();
- synchronized (ServerPoller.syncObj) {
- this.isFetching = false;
- }
- }
-
- /* (non-Javadoc)
* @see net.sf.magicmap.client.interfaces.FetchInfoPointsCallback#infoPointFetchError(java.lang.Exception)
*/
public void infoPointFetchError(Exception e){
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/controller/VirtualServerManager.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/controller/VirtualServerManager.java 2007-02-24 14:40:57 UTC (rev 571)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/VirtualServerManager.java 2007-02-25 15:50:28 UTC (rev 572)
@@ -185,8 +185,6 @@
if (openDialog) {
callback.openMapDialog(names);
- } else {
- callback.addMapNamesToOutline(names);
}
} catch (Exception e) {
e.printStackTrace();
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/core/MagicMapApplication.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/core/MagicMapApplication.java 2007-02-24 14:40:57 UTC (rev 571)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/core/MagicMapApplication.java 2007-02-25 15:50:28 UTC (rev 572)
@@ -57,7 +57,7 @@
GUIUtils.setPlasticLookAndFeel();
GUIUtils.setLocale(Locale.getDefault());
- JFrame frame = MainGUI.getInstance();
+ JFrame frame = MainGUI.getInstance().getMainFrame();
GUIUtils.locateOnScreen(frame);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Added: trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainFrame.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainFrame.java (rev 0)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainFrame.java 2007-02-25 15:50:28 UTC (rev 572)
@@ -0,0 +1,755 @@
+
+package net.sf.magicmap.client.gui;
+
+import java.awt.Container;
+import java.awt.Cursor;
+import java.awt.Dimension;
+import java.awt.HeadlessException;
+import java.awt.event.ActionEvent;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.rmi.RemoteException;
+
+import javax.swing.AbstractAction;
+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.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.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.utils.Settings;
+import net.sf.magicmap.client.utils.Version;
+
+import org.apache.axis.AxisFault;
+
+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;
+
+public class MainFrame extends JFrame
+implements
+ServerConnectCallback,
+ServerDisconnectCallback,
+CreateNewMapCallback,
+MapNamesCallback,
+LoadMapDialogListener {
+
+ /**
+ * serial version id
+ */
+ private static final long serialVersionUID = -3842976532877305041L;
+ private JMenuBar menuBar;
+ private JToolBar toolBar;
+ private StatusPanel statusBar;
+ private MapPanel mapPanel;
+ private OutlineView outlineView;
+ private ConsoleView consoleView;
+ private MapView mapView;
+ private MeasurementView measurementView;
+ private ViewTabPanel bottomRightTabPanel;
+ private RelativeLayout layout;
+ private AbstractAction connectAction;
+ private AbstractAction setProxyAction;
+ private AbstractAction disconnectAction;
+ private AbstractAction newMapAction;
+ private AbstractAction loadMapAction;
+ private AbstractAction exitAction;
+ private AbstractAction aboutAction;
+ private AbstractAction onlineHelp;
+ private MagicAction invisibleAction;
+ private MagicAction simpleView;
+ private MagicAction normalView;
+ private MagicAction expertView;
+ private MagicAction userDefinedView;
+ private static final int numberOfdataInvocationRateAction = 10;
+ private MagicAction[] dataInvocationRateAction;
+
+ public MainFrame() throws HeadlessException {
+ super();
+
+ // Aktionen erstellen
+ buildActions();
+
+ // 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(GUIBuilder.getToolIcon("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());
+ MainGUI.getInstance().registerJComponent(menuBar, "menuBar");
+
+ // 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);
+
+ // 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:
+
+ // 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));
+
+ // 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));
+
+ }
+
+ /**
+ * Build the main panel
+ * @return the main panel
+ */
+ public JComponent buildMainPane(){
+ buildViews();
+
+ UIFSplitPane pane2;
+
+ this.bottomRightTabPanel = new ViewTabPanel("bottomRightTabPanel");
+ 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;
+ }
+
+ /**
+ * 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;
+ }
+
+ /**
+ * 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 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));
+ */
+
+ 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 < MainFrame.numberOfdataInvocationRateAction; i++)
+ dataInvocationRate.add(GUIBuilder.createCheckBoxMenuItem(this.dataInvocationRateAction[i], false));
+ this.dataInvocationRateAction[4].setSelected(true);
+
+ 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;
+ }
+
+ /**
+ * Erzeugt die Hauptviews der Anwendung
+ */
+ private void buildViews(){
+ this.outlineView = new OutlineView(Controller.getInstance().getNodeModel(), "outlineView");
+ this.consoleView = new ConsoleView("consoleView");
+ this.mapView = new MapView(Controller.getInstance().getNodeModel(), null, "mapView");
+ this.measurementView = new MeasurementView(Controller.getInstance().getMeasurementModel(), Controller
+ .getInstance().getNodeModel(), "measurementView");
+ this.mapPanel = new MapPanel("mapPanel");
+ this.mapPanel.setMapView(this.mapView);
+ }
+
+ /**
+ * 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();
+ }
+
+ /* (non-Javadoc)
+ * @see net.sf.magicmap.client.interfaces.ServerConnectCallback#connected(long)
+ */
+ public void connected(long sesssionId){
+
+ 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);
+
+ }
+
+ /* (non-Javadoc)
+ * @see net.sf.magicmap.client.interfaces.ServerConnectCallback#connectionError(java.lang.Exception)
+ */
+ public void connectionError(Exception e){
+ this.connectAction.setEnabled(true);
+ this.disconnectAction.setEnabled(false);
+ this.statusBar.setMessage(GUIUtils.i18n(GUIConstants.STATE_DISCONNECTED));
+ this.statusBar.setInvisible(Controller.getInstance().isInvisible());
+
+ if (e instanceof AxisFault) {
+ AxisFault f = (AxisFault) e;
+ if (GUIUtils.showAuthentificationError(f.getFaultString()))
+ connect();
+ else
+ this.connectAction.actionPerformed(new ActionEvent(this, 0, ""));
+ } else if (e instanceof RemoteException) if (GUIUtils.showConnectError())
+ connect();
+ else
+ this.connectAction.actionPerformed(new ActionEvent(this, 0, ""));
+ }
+
+ /* (non-Javadoc)
+ * @see net.sf.magicmap.client.interfaces.ServerDisconnectCallback#disconnected()
+ */
+ public void disconnected(){
+ this.connectAction.setEnabled(true);
+ this.statusBar.setInvisible(Controller.getInstance().isInvisible());
+ this.disconnectAction.setEnabled(false);
+ this.newMapAction.setEnabled(false);
+ this.loadMapAction.setEnabled(false);
+ this.statusBar.setMessage(GUIUtils.i18n(GUIConstants.STATE_DISCONNECTED));
+ }
+
+ /* (non-Javadoc)
+ * @see net.sf.magicmap.client.interfaces.ServerDisconnectCallback#disconnectionError(java.lang.Exception)
+ */
+ public void disconnectionError(Exception e){
+ this.connectAction.setEnabled(true);
+ this.disconnectAction.setEnabled(false);
+ this.statusBar.setInvisible(Controller.getInstance().isInvisible());
+ this.statusBar.setMessage(GUIUtils.i18n(GUIConstants.STATE_DISCONNECTED));
+ //JOptionPane.showMessageDialog(this, "Fehler beim Trennen der Verbindung:\n\n " + e.getMessage());
+ }
+
+ /* (non-Javadoc)
+ * @see net.sf.magicmap.client.interfaces.CreateNewMapCallback#newMapCreated()
+ */
+ public void newMapCreated(MapInfo map){
+ Controller.getInstance().setCurrentMap(map);
+ }
+
+ /* (non-Javadoc)
+ * @see net.sf.magicmap.client.interfaces.CreateNewMapCallback#createNewMapError(java.lang.Exception)
+ */
+ public void createNewMapError(Exception e){
+ StringWriter sw = new StringWriter();
+ e.printStackTrace(new PrintWriter(sw));
+ JOptionPane.showMessageDialog(this, "Fehler beim Erzeugen der Karte\n\n " + e.getMessage() + "\n"
+ + sw.toString());
+ }
+
+ /* (non-Javadoc)
+ * @see net.sf.magicmap.client.interfaces.MapNamesCallback#mapNamesReceived(java.lang.String[])
+ */
+ public void openMapDialog(String[] names){
+ LoadMapDialog.showDialog(this, names, this);
+ }
+
+ /* (non-Javadoc)
+ * @see net.sf.magicmap.client.interfaces.MapNamesCallback#getMapNamesError(java.lang.Exception)
+ */
+ public void getMapNamesError(Exception e){
+ // currently no implementation
+ }
+
+ /* (non-Javadoc)
+ * @see net.sf.magicmap.client.interfaces.LoadMapDialogListener#loadMap(net.sf.magicmap.client.meta.MapInfo)
+ */
+ public synchronized void loadMap(MapInfo info){
+ Controller.getInstance().setCurrentMap(info);
+ this.statusBar.setInvisible(Controller.getInstance().isInvisible());
+ this.invisibleAction.setEnabled(true);
+ this.simpleView.setEnabled(true);
+ this.normalView.setEnabled(true);
+ this.expertView.setEnabled(true);
+ this.userDefinedView.setEnabled(true);
+
+ }
+
+ /**
+ * Wechselt zwischen Sichtbar und Unsichtbar
+ *
+ */
+ protected void toogleInvisible(){
+ Controller.getInstance().setInvisible(!Controller.getInstance().isInvisible());
+ this.statusBar.setInvisible(Controller.getInstance().isInvisible());
+ }
+
+ /**
+ * Connect to server
+ */
+ protected void connect(){
+ setCursor(new Cursor(Cursor.WAIT_CURSOR));
+ this.statusBar.setMessage(GUIUtils.i18n(GUIConstants.STATE_CONNECTING));
+ this.statusBar.setInvisible(Controller.getInstance().isInvisible());
+ Controller.getInstance().connect(this);
+ }
+
+
+ /**
+ * Action builder for the action of the GUI
+ *
+ */
+ public void buildActions(){
+
+ this.connectAction = new MagicAction("connect", GUIConstants.ICON_CONNECT, "connecttooltip") {
+
+ /**
+ * 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(MainFrame.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
+ }
+ };
+
+ this.setProxyAction = new MagicAction("setproxy", GUIConstants.ICON_CONNECT, "setproxytooltip") {
+
+ /**
+ * 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(MainFrame.this);
+ }
+ };
+
+ this.disconnectAction = new MagicAction("disconnect", GUIConstants.ICON_DISCONNECT, "disconnecttooltip") {
+
+ /**
+ * 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(MainFrame.this);
+ }
+ };
+
+ this.newMapAction = new MagicAction("newmap", GUIConstants.ICON_NEWMAP, "newmaptooltip") {
+
+ /**
+ * 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(MainFrame.this);
+ if (info != null)
+ Controller.getInstance().createNewMap(info.name, info.imageURL, info.width, info.height,
+ info.realwidth, info.realheight, MainFrame.this);
+ }
+ };
+
+ this.loadMapAction = new MagicAction("loadmap", GUIConstants.ICON_LOADMAP, "loadmaptooltip") {
+
+ /**
+ * 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(MainFrame.this, true);
+ }
+ };
+
+ this.exitAction = new MagicAction("exit", GUIConstants.ICON_EXIT, "exit") {
+
+ /**
+ * 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){
+ MainFrame.this.setVisible(false);
+ System.exit(0);
+ }
+ };
+
+ this.onlineHelp = new MagicAction("onlinehelp", GUIConstants.ICON_HELP, "onlinehelptooltip") {
+
+ /**
+ * 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
+ }
+ }
+ };
+
+ this.aboutAction = new MagicAction("about") {
+
+ /**
+ * 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(MainFrame.this);
+ }
+ };
+
+ this.invisibleAction = new MagicAction("invisible", GUIConstants.ICON_INVISIBLE, "invisibletooltip") {
+
+ /**
+ * 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();
+ }
+ };
+
+
+ this.simpleView = new MagicAction("simpleview") {
+
+ /**
+ * 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);
+ */
+ MainFrame.this.mapView.setShowAccessPoints(false);
+ MainFrame.this.outlineView.collapseAPs(true);
+ MainFrame.this.mapView.setShowClients(true);
+ MainFrame.this.mapView.setShowEdges(false);
+ MainFrame.this.mapView.setShowEdgesBetweenLocations(false);
+ MainFrame.this.mapView.setShowLocations(false);
+ MainFrame.this.outlineView.collapseRPs(true);
+ MainFrame.this.mapView.setShowEdgesForSelectedNode(false);
+
+ MainFrame.this.simpleView.setSelected(true);
+ MainFrame.this.normalView.setSelected(false);
+ MainFrame.this.expertView.setSelected(false);
+ MainFrame.this.userDefinedView.setSelected(false);
+ }
+ };
+
+ this.normalView = new MagicAction("normalview") {
+
+ /**
+ * 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){
+
+ MainFrame.this.mapView.setShowAccessPoints(true);
+ MainFrame.this.outlineView.collapseAPs(false);
+ MainFrame.this.mapView.setShowClients(true);
+ MainFrame.this.mapView.setShowEdges(true);
+ MainFrame.this.mapView.setShowEdgesBetweenLocations(false);
+ MainFrame.this.mapView.setShowLocations(true);
+ MainFrame.this.outlineView.collapseRPs(false);
+ MainFrame.this.mapView.setShowEdgesForSelectedNode(true);
+
+ MainFrame.this.simpleView.setSelected(false);
+ MainFrame.this.normalView.setSelected(true);
+ MainFrame.this.expertView.setSelected(false);
+ MainFrame.this.userDefinedView.setSelected(false);
+ }
+ };
+
+ this.expertView = new MagicAction("expertview") {
+
+ /**
+ * 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){
+ MainFrame.this.mapView.setShowAccessPoints(true);
+ MainFrame.this.outlineView.collapseAPs(false);
+ MainFrame.this.mapView.setShowClients(true);
+ MainFrame.this.mapView.setShowEdges(true);
+ MainFrame.this.mapView.setShowEdgesBetweenLocations(true);
+ MainFrame.this.mapView.setShowLocations(true);
+ MainFrame.this.outlineView.collapseRPs(false);
+ MainFrame.this.mapView.setShowEdgesForSelectedNode(false);
+
+ MainFrame.this.simpleView.setSelected(false);
+ MainFrame.this.normalView.setSelected(false);
+ MainFrame.this.expertView.setSelected(true);
+ MainFrame.this.userDefinedView.setSelected(false);
+ }
+ };
+
+ this.userDefinedView = new MagicAction("userdefinedview") {
+
+ /**
+ * 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){
+ MainFrame.this.userDefinedView.setSelected(!MainFrame.this.userDefinedView.isSelected());
+ ViewOptionsDialog.showDialog(MainFrame.this);
+ }
+ };
+
+ this.dataInvocationRateAction = new MagicAction[MainFrame.numberOfdataInvocationRateAction];
+
+ for (int i = 0; i < MainFrame.numberOfdataInvocationRateAction; i++) {
+ final int thisAction = i;
+ this.dataInvocationRateAction[thisAction] = new MagicAction("dataInvocationRate" + (thisAction + 1)) {
+
+ /**
+ * 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 < MainFrame.numberOfdataInvocationRateAction; j++)
+ MainFrame.this.dataInvocationRateAction[j].setSelected(false);
+ MainFrame.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);
+ this.simpleView.setEnabled(false);
+ this.normalView.setEnabled(false);
+ this.expertView.setEnabled(false);
+ this.userDefinedView.setEnabled(false);
+ }
+
+}
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java 2007-02-24 14:40:57 UTC (rev 571)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java 2007-02-25 15:50:28 UTC (rev 572)
@@ -5,96 +5,32 @@
package net.sf.magicmap.client.gui;
-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.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.AccessPointNodeIcon;
import net.sf.magicmap.client.gui.utils.ClientNodeIcon;
-import net.sf.magicmap.client.gui.utils.GUIBuilder;
-import net.sf.magicmap.client.gui.utils.GUIConstants;
-import net.sf.magicmap.client.gui.utils.GUIUtils;
import net.sf.magicmap.client.gui.utils.GeoPosNodeIcon;
import net.sf.magicmap.client.gui.utils.LocationNodeIcon;
-import net.sf.magicmap.client.gui.utils.MagicAction;
import net.sf.magicmap.client.gui.utils.MapNodeIcon;
import net.sf.magicmap.client.gui.utils.NodeIcons;
-import net.sf.magicmap.client.gui.views.ConsoleView;
-import net.sf.magicmap.client.gui.views.MapView;
-import net.sf.magicmap.client.gui.views.MeasurementView;
-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 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
* @author thuebner
* @author Florian Lederer
*/
-@SuppressWarnings({"JavadocReference"})
-public class MainGUI extends JFrame
- implements
- ServerConnectCallback,
- ServerDisconnectCallback,
- CreateNewMapCallback,
- MapNamesCallback,
- LoadMapDialogListener {
+public class MainGUI {
/**
- * serial version id
- */
- private static final long serialVersionUID = -3842976532877305041L;
-
- /**
* singleton instance of the main GUI
*/
- private static MainGUI mainGUI = null;
+ private static MainGUI mainGUI = null;
/**
* Getter for the singleton instance of the main GUI
@@ -104,36 +40,12 @@
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 Map<String, JComponent> jComponentMap = new HashMap<String, JComponent>();
private INodeSelectionModel nodeSelectionModel;
private NodeIcons nodeIcons;
+ private MainFrame mainFrame;
- private static final int numberOfdataInvocationRateAction = 10;
- private MagicAction[] dataInvocationRateAction;
-
/**
* Erzeugt Hauptfenster der Anwendung.
* Private constructor, only used by getInstance() to fulfill singleton pattern
@@ -150,773 +62,35 @@
nodeIcons.registerNodeIcon(new LocationNodeIcon());
nodeIcons.registerNodeIcon(new GeoPosNodeIcon());
nodeIcons.registerNodeIcon(new MapNodeIcon());
-
- // Aktionen erstellen
- buildActions();
-
- // 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());
-
- //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));
-
- // 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");
-
- // 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));
-
- // 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("consoleView", consoleView);
- viewMap.put("mapView", mapView);
- viewMap.put("bottomRightTabPanel", bottomRightTabPanel);
- viewMap.put("mapPanel", mapPanel);
-
}
/**
- * Action builder for the action of the GUI
- *
+ * @return the mainFrame
*/
- public void buildActions(){
-
- this.connectAction = new MagicAction("connect", GUIConstants.ICON_CONNECT, "connecttooltip") {
-
- /**
- * 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) {
-
- 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") {
-
- /**
- * 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);
- }
- };
-
- this.disconnectAction = new MagicAction("disconnect", GUIConstants.ICON_DISCONNECT, "disconnecttooltip") {
-
- /**
- * 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);
- }
- };
-
- this.newMapAction = new MagicAction("newmap", GUIConstants.ICON_NEWMAP, "newmaptooltip") {
-
- /**
- * 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);
- }
- };
-
- this.loadMapAction = new MagicAction("loadmap", GUIConstants.ICON_LOADMAP, "loadmaptooltip") {
-
- /**
- * 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);
- }
- };
-
- this.exitAction = new MagicAction("exit", GUIConstants.ICON_EXIT, "exit") {
-
- /**
- * 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);
- }
- };
-
- this.onlineHelp = new MagicAction("onlinehelp", GUIConstants.ICON_HELP, "onlinehelptooltip") {
-
- /**
- * 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
- }
- }
- };
-
- this.aboutAction = new MagicAction("about") {
-
- /**
- * 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);
- }
- };
-
- this.invisibleAction = new MagicAction("invisible", GUIConstants.ICON_INVISIBLE, "invisibletooltip") {
-
- /**
- * 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();
- }
- };
-
- // 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") {
-
- /**
- * 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);
-
- 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") {
-
- /**
- * 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){
-
- MainGUI.this.mapView.setShowAccessPoints(true);
- MainGUI.this.outlineView.collapseAPs(false);
- MainGUI.this.mapView.setShowClients(true);
...
[truncated message content] |
|
From: <fle...@us...> - 2007-02-24 14:40:59
|
Revision: 571
http://svn.sourceforge.net/magicmap/?rev=571&view=rev
Author: flederohr
Date: 2007-02-24 06:40:57 -0800 (Sat, 24 Feb 2007)
Log Message:
-----------
fixed bug: fail to load image for GeoPosDialog
Removed Paths:
-------------
trunk/magicmapclient/res/NodeIcons/geopos_big.png
Deleted: trunk/magicmapclient/res/NodeIcons/geopos_big.png
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fle...@us...> - 2007-02-24 14:40:03
|
Revision: 570
http://svn.sourceforge.net/magicmap/?rev=570&view=rev
Author: flederohr
Date: 2007-02-24 06:39:58 -0800 (Sat, 24 Feb 2007)
Log Message:
-----------
fixed bug: fail to load image for GeoPosDialog
Added Paths:
-----------
trunk/magicmapclient/res/toolBarButtonGraphics/custom/geopos_big.png
Added: trunk/magicmapclient/res/toolBarButtonGraphics/custom/geopos_big.png
===================================================================
(Binary files differ)
Property changes on: trunk/magicmapclient/res/toolBarButtonGraphics/custom/geopos_big.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jan...@us...> - 2007-02-24 08:54:25
|
Revision: 569
http://svn.sourceforge.net/magicmap/?rev=569&view=rev
Author: jan_fride
Date: 2007-02-24 00:54:20 -0800 (Sat, 24 Feb 2007)
Log Message:
-----------
moved viewMap into constructor.
Modified Paths:
--------------
trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java 2007-02-24 02:57:32 UTC (rev 568)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java 2007-02-24 08:54:20 UTC (rev 569)
@@ -142,7 +142,7 @@
// NodeSelectionModel
nodeSelectionModel = new NodeSelectionModel();
-
+
// NodeIcons
nodeIcons = NodeIcons.getInstance();
nodeIcons.registerNodeIcon(new ClientNodeIcon());
@@ -215,6 +215,13 @@
AttributeType.TOP, -5));
this.layout.addConstraint("mainpane", AttributeType.TOP, new AttributeConstraint("toolbar",
AttributeType.BOTTOM, GUIConstants.DIVIDER_SIZE));
+
+ viewMap.put("outlineView", outlineView);
+ viewMap.put("consoleView", consoleView);
+ viewMap.put("mapView", mapView);
+ viewMap.put("bottomRightTabPanel", bottomRightTabPanel);
+ viewMap.put("mapPanel", mapPanel);
+
}
/**
@@ -703,12 +710,6 @@
nodeSelectionModel.addNodeModelSelectionListener(mapView);
nodeSelectionModel.addNodeModelSelectionListener(measurementView);
nodeSelectionModel.addNodeModelSelectionListener(measurementView.getMeasurementTable().getModel());
-
- viewMap.put("outlineView", outlineView);
- viewMap.put("consoleView", consoleView);
- viewMap.put("mapView", mapView);
- viewMap.put("bottomRightTabPanel", bottomRightTabPanel);
- viewMap.put("mapPanel", mapPanel);
}
/**
@@ -915,7 +916,7 @@
return nodeSelectionModel;
}
-
+
public NodeIcons getNodeIcons(){
return nodeIcons;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fle...@us...> - 2007-02-24 02:57:34
|
Revision: 568
http://svn.sourceforge.net/magicmap/?rev=568&view=rev
Author: flederohr
Date: 2007-02-23 18:57:32 -0800 (Fri, 23 Feb 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/AccessPointNodeIcon.java
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/AccessPointNodeIcon.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/AccessPointNodeIcon.java 2007-02-24 02:27:55 UTC (rev 567)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/AccessPointNodeIcon.java 2007-02-24 02:57:32 UTC (rev 568)
@@ -8,8 +8,6 @@
import javax.swing.Icon;
import javax.swing.ImageIcon;
-import net.sf.magicmap.client.gui.MainGUI;
-import net.sf.magicmap.client.gui.views.MapView;
import net.sf.magicmap.client.model.node.AccessPointNode;
import net.sf.magicmap.client.model.node.INodeModel;
import net.sf.magicmap.client.model.node.Node;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fle...@us...> - 2007-02-24 02:27:56
|
Revision: 567
http://svn.sourceforge.net/magicmap/?rev=567&view=rev
Author: flederohr
Date: 2007-02-23 18:27:55 -0800 (Fri, 23 Feb 2007)
Log Message:
-----------
changed Handling of NodeIcons
Added Paths:
-----------
trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/NodeIcons.java
Added: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/NodeIcons.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/NodeIcons.java (rev 0)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/NodeIcons.java 2007-02-24 02:27:55 UTC (rev 567)
@@ -0,0 +1,68 @@
+
+package net.sf.magicmap.client.gui.utils;
+
+import java.awt.Color;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.swing.Icon;
+
+import net.sf.magicmap.client.model.node.Node;
+
+import org.apache.log4j.Logger;
+
+/**
+ * @author Florian Lederer
+ */
+public class NodeIcons {
+
+ private static NodeIcons ni = null;
+
+ private static Logger log = Logger.getLogger(NodeIcons.class);
+
+ private static final INodeIcon DEFAULT_ICON = new INodeIcon() {
+
+ Icon defaultIcon = GUIBuilder.getToolIcon("default.png",
+ "NodeIcons");
+
+ public Color getBgColor(Node node){
+ return Color.BLACK;
+ }
+
+ public Color getFgColor(Node node){
+ return Color.BLACK;
+ }
+
+ public Icon getIcon(Node node){
+ return defaultIcon;
+ }
+
+ public Class getNodeClass(){
+ return null;
+ }
+
+ public int getNodeType(){
+ return -1;
+ }
+ };
+
+ private final Map<Class, INodeIcon> iconMap = new HashMap<Class, INodeIcon>();
+
+ private NodeIcons() {}
+
+ public static NodeIcons getInstance(){
+ if (NodeIcons.ni == null) NodeIcons.ni = new NodeIcons();
+ return NodeIcons.ni;
+ }
+
+ public INodeIcon getNodeIcon(Node node){
+ if (node == null) return null;
+ if (iconMap.containsKey(node.getClass())) return iconMap.get(node.getClass());
+ return DEFAULT_ICON;
+ }
+
+ public void registerNodeIcon(INodeIcon icon){
+ iconMap.put(icon.getNodeClass(), icon);
+ }
+
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fle...@us...> - 2007-02-24 02:26:55
|
Revision: 566
http://svn.sourceforge.net/magicmap/?rev=566&view=rev
Author: flederohr
Date: 2007-02-23 18:26:53 -0800 (Fri, 23 Feb 2007)
Log Message:
-----------
Removed Paths:
-------------
trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/NodeIcons.java
Deleted: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/NodeIcons.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/NodeIcons.java 2007-02-24 02:14:24 UTC (rev 565)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/NodeIcons.java 2007-02-24 02:26:53 UTC (rev 566)
@@ -1,63 +0,0 @@
-
-package net.sf.magicmap.client.gui.utils;
-
-import java.awt.Color;
-import java.util.HashMap;
-import java.util.Map;
-import javax.swing.Icon;
-import net.sf.magicmap.client.model.node.Node;
-import org.apache.log4j.Logger;
-
-/**
- * @author Florian Lederer
- */
-public class NodeIcons {
-
- private static NodeIcons ni = null;
-
- private static Logger log = Logger.getLogger(NodeIcons.class);
-
- private static final INodeIcon DEFAULT_ICON = new INodeIcon() {
-
- Icon defaultIcon = GUIBuilder.getToolIcon("default.png",
- "NodeIcons");
-
- public Color getBgColor(Node node){
- return Color.BLACK;
- }
-
- public Color getFgColor(Node node){
- return Color.BLACK;
- }
-
- public Icon getIcon(Node node){
- return defaultIcon;
- }
-
- public Class getNodeClass(){
- return null;
- }
-
- public int getNodeType(){
- return -1;
- }
- };
-
- private final Map<Class, INodeIcon> iconMap = new HashMap<Class, INodeIcon>();
-
- private NodeIcons() {}
-
- public static NodeIcons getInstance(){
- if (NodeIcons.ni == null) NodeIcons.ni = new NodeIcons();
- return NodeIcons.ni;
- }
-
- public INodeIcon getNodeIcon(Node node){
- return iconMap.get(node.getClass());
- }
-
- public void registerNodeIcon(INodeIcon icon){
- iconMap.put(icon.getNodeClass(), icon);
- }
-
-}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fle...@us...> - 2007-02-24 02:14:27
|
Revision: 565
http://svn.sourceforge.net/magicmap/?rev=565&view=rev
Author: flederohr
Date: 2007-02-23 18:14:24 -0800 (Fri, 23 Feb 2007)
Log Message:
-----------
changed Handling of NodeIcons
Added Paths:
-----------
trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/NodeIcons.java
Added: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/NodeIcons.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/NodeIcons.java (rev 0)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/NodeIcons.java 2007-02-24 02:14:24 UTC (rev 565)
@@ -0,0 +1,63 @@
+
+package net.sf.magicmap.client.gui.utils;
+
+import java.awt.Color;
+import java.util.HashMap;
+import java.util.Map;
+import javax.swing.Icon;
+import net.sf.magicmap.client.model.node.Node;
+import org.apache.log4j.Logger;
+
+/**
+ * @author Florian Lederer
+ */
+public class NodeIcons {
+
+ private static NodeIcons ni = null;
+
+ private static Logger log = Logger.getLogger(NodeIcons.class);
+
+ private static final INodeIcon DEFAULT_ICON = new INodeIcon() {
+
+ Icon defaultIcon = GUIBuilder.getToolIcon("default.png",
+ "NodeIcons");
+
+ public Color getBgColor(Node node){
+ return Color.BLACK;
+ }
+
+ public Color getFgColor(Node node){
+ return Color.BLACK;
+ }
+
+ public Icon getIcon(Node node){
+ return defaultIcon;
+ }
+
+ public Class getNodeClass(){
+ return null;
+ }
+
+ public int getNodeType(){
+ return -1;
+ }
+ };
+
+ private final Map<Class, INodeIcon> iconMap = new HashMap<Class, INodeIcon>();
+
+ private NodeIcons() {}
+
+ public static NodeIcons getInstance(){
+ if (NodeIcons.ni == null) NodeIcons.ni = new NodeIcons();
+ return NodeIcons.ni;
+ }
+
+ public INodeIcon getNodeIcon(Node node){
+ return iconMap.get(node.getClass());
+ }
+
+ public void registerNodeIcon(INodeIcon icon){
+ iconMap.put(icon.getNodeClass(), icon);
+ }
+
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fle...@us...> - 2007-02-24 02:03:32
|
Revision: 564
http://svn.sourceforge.net/magicmap/?rev=564&view=rev
Author: flederohr
Date: 2007-02-23 18:03:29 -0800 (Fri, 23 Feb 2007)
Log Message:
-----------
changed Handling of NodeIcons
Modified Paths:
--------------
trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java
trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java
trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineTree.java
Added Paths:
-----------
trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/AccessPointNodeIcon.java
trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/ClientNodeIcon.java
trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/GeoPosNodeIcon.java
trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/INodeIcon.java
trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/LocationNodeIcon.java
trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/MapNodeIcon.java
Removed Paths:
-------------
trunk/magicmapclient/res/icons.properties
trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/NodeIcons.java
Deleted: trunk/magicmapclient/res/icons.properties
===================================================================
--- trunk/magicmapclient/res/icons.properties 2007-02-24 01:53:49 UTC (rev 563)
+++ trunk/magicmapclient/res/icons.properties 2007-02-24 02:03:29 UTC (rev 564)
@@ -1,39 +0,0 @@
-####################################################################
-# #
-# This file stores the combination between magicmap nodetypes and #
-# theirs visualisation. By adding a new node class to the magicmap #
-# nodemodell it would displayed with a default symbol in the GUI. #
-# If you wish, that it should use it's own symbol, you have to #
-# make an entry to this resource file: #
-# #
-# <name of your node class> = <path to your icon image> #
-# #
-# Symbolnames for fixed nodes are created by the class name #
-# followed by the word 'Anchor': #
-# #
-# <name of your node class>Anchor = <path to your icon image> #
-# #
-# The images must be placed in the resource folder: #
-# #
-# 'toolBarButtonGraphics' #
-# #
-####################################################################
-
-
-Node = custom/default.png
-AccessPointNode = custom/accesspoint.png
-ClientNode = custom/client.png
-GeoPosNode = custom/geopos.png
-InfoObjectNode = custom/info.png
-LocationNode = custom/location.png
-MapNode = custom/image.png
-
-NodeAnchor = custom/default.png
-AccessPointNodeAnchor = custom/accesspoint_anchor.png
-AccessPointNodeHidden = custom/accesspoint_hidden.png
-AccessPointNodeHiddenAnchor = custom/accesspoint_hidden_anchor.png
-ClientNodeAnchor = custom/client_anchor.png
-LocationNodeAnchor = custom/location_anchor.png
-LocationNodeRescan = custom/location_rescan.png
-GeoPosNodeAnchor = custom/geopos.png
-InfoObjectNodeAnchor = custom/info.png
\ No newline at end of file
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java 2007-02-24 01:53:49 UTC (rev 563)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java 2007-02-24 02:03:29 UTC (rev 564)
@@ -35,10 +35,16 @@
import net.sf.magicmap.client.gui.dialogs.NewMapDialog;
import net.sf.magicmap.client.gui.dialogs.SetProxyDialog;
import net.sf.magicmap.client.gui.dialogs.ViewOptionsDialog;
+import net.sf.magicmap.client.gui.utils.AccessPointNodeIcon;
+import net.sf.magicmap.client.gui.utils.ClientNodeIcon;
import net.sf.magicmap.client.gui.utils.GUIBuilder;
import net.sf.magicmap.client.gui.utils.GUIConstants;
import net.sf.magicmap.client.gui.utils.GUIUtils;
+import net.sf.magicmap.client.gui.utils.GeoPosNodeIcon;
+import net.sf.magicmap.client.gui.utils.LocationNodeIcon;
import net.sf.magicmap.client.gui.utils.MagicAction;
+import net.sf.magicmap.client.gui.utils.MapNodeIcon;
+import net.sf.magicmap.client.gui.utils.NodeIcons;
import net.sf.magicmap.client.gui.views.ConsoleView;
import net.sf.magicmap.client.gui.views.MapView;
import net.sf.magicmap.client.gui.views.MeasurementView;
@@ -69,6 +75,7 @@
/**
* The main GUI window
* @author thuebner
+ * @author Florian Lederer
*/
@SuppressWarnings({"JavadocReference"})
public class MainGUI extends JFrame
@@ -122,6 +129,7 @@
private MagicAction expertView;
private MagicAction userDefinedView;
private INodeSelectionModel nodeSelectionModel;
+ private NodeIcons nodeIcons;
private static final int numberOfdataInvocationRateAction = 10;
private MagicAction[] dataInvocationRateAction;
@@ -134,7 +142,15 @@
// NodeSelectionModel
nodeSelectionModel = new NodeSelectionModel();
-
+
+ // NodeIcons
+ nodeIcons = NodeIcons.getInstance();
+ nodeIcons.registerNodeIcon(new ClientNodeIcon());
+ nodeIcons.registerNodeIcon(new AccessPointNodeIcon());
+ nodeIcons.registerNodeIcon(new LocationNodeIcon());
+ nodeIcons.registerNodeIcon(new GeoPosNodeIcon());
+ nodeIcons.registerNodeIcon(new MapNodeIcon());
+
// Aktionen erstellen
buildActions();
@@ -574,7 +590,7 @@
*/
public JComponent buildMainPane(){
buildViews();
-
+
UIFSplitPane pane2;
this.bottomRightTabPanel = new ViewTabPanel();
@@ -687,7 +703,7 @@
nodeSelectionModel.addNodeModelSelectionListener(mapView);
nodeSelectionModel.addNodeModelSelectionListener(measurementView);
nodeSelectionModel.addNodeModelSelectionListener(measurementView.getMeasurementTable().getModel());
-
+
viewMap.put("outlineView", outlineView);
viewMap.put("consoleView", consoleView);
viewMap.put("mapView", mapView);
@@ -898,4 +914,9 @@
public INodeSelectionModel getNodeSelectionModel(){
return nodeSelectionModel;
}
+
+
+ public NodeIcons getNodeIcons(){
+ return nodeIcons;
+ }
}
Added: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/AccessPointNodeIcon.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/AccessPointNodeIcon.java (rev 0)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/AccessPointNodeIcon.java 2007-02-24 02:03:29 UTC (rev 564)
@@ -0,0 +1,100 @@
+
+package net.sf.magicmap.client.gui.utils;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
+
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
+
+import net.sf.magicmap.client.gui.MainGUI;
+import net.sf.magicmap.client.gui.views.MapView;
+import net.sf.magicmap.client.model.node.AccessPointNode;
+import net.sf.magicmap.client.model.node.INodeModel;
+import net.sf.magicmap.client.model.node.Node;
+
+/**
+ * @author Florian Lederer
+ */
+public class AccessPointNodeIcon implements INodeIcon {
+
+ ImageIcon accessPoint;
+ ImageIcon accessPointFixed;
+ ImageIcon accessPointHidden;
+ ImageIcon accessPointHiddenFixed;
+
+ private ImageIcon getAccessPoint(){
+ if (accessPoint == null) accessPoint = GUIBuilder.getToolIcon("accesspoint.png", "NodeIcons");
+ return accessPoint;
+ }
+
+ private ImageIcon getAccessPointFixed(){
+ if (accessPointFixed == null) {
+ final ImageIcon anchor = GUIBuilder.getToolIcon("anchor_white.png", "NodeIcons");
+ accessPointFixed = new ImageIcon(getAccessPoint().getImage()) {
+
+ @Override
+ public synchronized void paintIcon(Component c, Graphics g, int x, int y){
+ super.paintIcon(c, g, x, y);
+ g.drawImage(anchor.getImage(), x, y, x + getIconWidth(), y + getIconHeight(), 0, 0, anchor
+ .getIconWidth(), anchor.getIconHeight(), null);
+ }
+ };
+ }
+ return accessPointFixed;
+ }
+
+ private ImageIcon getAccessPointHidden(){
+ if (accessPointHidden == null)
+ accessPointHidden = GUIBuilder.getToolIcon("accesspoint_hidden.png", "NodeIcons");
+ return accessPointHidden;
+ }
+
+ private ImageIcon getAccessPointHiddenFixed(){
+ if (accessPointHiddenFixed == null) {
+ final ImageIcon anchor = GUIBuilder.getToolIcon("anchor_black.png", "NodeIcons");
+ accessPointHiddenFixed = new ImageIcon(getAccessPointHidden().getImage()) {
+
+ @Override
+ public synchronized void paintIcon(Component c, Graphics g, int x, int y){
+ super.paintIcon(c, g, x, y);
+ g.drawImage(anchor.getImage(), x, y, x + getIconWidth(), y + getIconHeight(), 0, 0, anchor
+ .getIconWidth(), anchor.getIconHeight(), null);
+ }
+ };
+ }
+ return accessPointHiddenFixed;
+ }
+
+ public Color getBgColor(Node node){
+ return Color.BLACK;
+ }
+
+ public Color getFgColor(Node node){
+ return Color.BLACK;
+ }
+
+ public Icon getIcon(Node node){
+ AccessPointNode ap = (AccessPointNode) node;
+ if (ap.isHidden()) {
+ if (ap.isFix())
+ return getAccessPointHiddenFixed();
+ else
+ return getAccessPointHidden();
+ } else {
+ if (ap.isFix())
+ return getAccessPointFixed();
+ else
+ return getAccessPoint();
+ }
+ }
+
+ public Class getNodeClass(){
+ return AccessPointNode.class;
+ }
+
+ public int getNodeType(){
+ return INodeModel.NODETYPE_ACCESSPOINT;
+ }
+}
Added: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/ClientNodeIcon.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/ClientNodeIcon.java (rev 0)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/ClientNodeIcon.java 2007-02-24 02:03:29 UTC (rev 564)
@@ -0,0 +1,68 @@
+
+package net.sf.magicmap.client.gui.utils;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
+
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
+
+import net.sf.magicmap.client.gui.MainGUI;
+import net.sf.magicmap.client.gui.views.MapView;
+import net.sf.magicmap.client.model.node.ClientNode;
+import net.sf.magicmap.client.model.node.INodeModel;
+import net.sf.magicmap.client.model.node.Node;
+
+/**
+ * @author Florian Lederer
+ */
+public class ClientNodeIcon implements INodeIcon {
+
+ private ImageIcon client;
+ private ImageIcon clientFixed;
+
+ private ImageIcon getClient(){
+ if (client == null) client = GUIBuilder.getToolIcon("Client.png", "NodeIcons");
+ return client;
+ }
+
+ private ImageIcon getClientFixed(){
+ if (clientFixed == null) {
+ final ImageIcon anchor = GUIBuilder.getToolIcon("anchor_black.png", "NodeIcons");
+ clientFixed = new ImageIcon(getClient().getImage()) {
+
+ @Override
+ public synchronized void paintIcon(Component c, Graphics g, int x, int y){
+ super.paintIcon(c, g, x, y);
+ g.drawImage(anchor.getImage(), x, y, x + getIconWidth(), y + getIconHeight(), 0, 0, anchor
+ .getIconWidth(), anchor.getIconHeight(), null);
+ }
+ };
+ }
+ return clientFixed;
+ }
+
+ public Color getBgColor(Node node){
+ return Color.BLACK;
+ }
+
+ public Color getFgColor(Node node){
+ return Color.BLACK;
+ }
+
+ public Icon getIcon(Node node){
+ if (node.isFix()) return getClientFixed();
+ return getClient();
+
+ }
+
+ public Class getNodeClass(){
+ return ClientNode.class;
+ }
+
+ public int getNodeType(){
+ return INodeModel.NODETYPE_CLIENT;
+ }
+
+}
Added: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/GeoPosNodeIcon.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/GeoPosNodeIcon.java (rev 0)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/GeoPosNodeIcon.java 2007-02-24 02:03:29 UTC (rev 564)
@@ -0,0 +1,51 @@
+package net.sf.magicmap.client.gui.utils;
+
+import java.awt.Color;
+
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
+
+import net.sf.magicmap.client.model.node.GeoPosNode;
+import net.sf.magicmap.client.model.node.INodeModel;
+import net.sf.magicmap.client.model.node.Node;
+
+/**
+ * @author Florian Lederer
+ */
+public class GeoPosNodeIcon implements INodeIcon {
+
+ private ImageIcon geoPos;
+ private ImageIcon geoPosBig;
+
+ private ImageIcon getGeoPos(){
+ if (geoPos == null) geoPos = GUIBuilder.getToolIcon("geopos.png", "NodeIcons");
+ return geoPos;
+ }
+
+ private ImageIcon getGeoPosBig(){
+ if (geoPosBig == null) geoPosBig = GUIBuilder.getToolIcon("geopos_big.png", "NodeIcons");
+ return geoPosBig;
+ }
+
+ public Color getBgColor(Node node){
+ return Color.BLACK;
+ }
+
+ public Color getFgColor(Node node){
+ return Color.BLACK;
+ }
+
+ public Icon getIcon(Node node){
+ return getGeoPos();
+
+ }
+
+ public Class getNodeClass(){
+ return GeoPosNode.class;
+ }
+
+ public int getNodeType(){
+ return INodeModel.NODETYPE_GEOPOS;
+ }
+
+}
Added: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/INodeIcon.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/INodeIcon.java (rev 0)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/INodeIcon.java 2007-02-24 02:03:29 UTC (rev 564)
@@ -0,0 +1,23 @@
+package net.sf.magicmap.client.gui.utils;
+
+import java.awt.Color;
+
+import javax.swing.Icon;
+
+import net.sf.magicmap.client.model.node.Node;
+
+
+/**
+ *
+ * @author Jan Friderici
+ * @author Florian Lederer
+ *
+ * @param <T> the nodetype this is icon is for.
+ */
+public interface INodeIcon {
+ public int getNodeType();
+ public Class getNodeClass();
+ public Icon getIcon(Node node);
+ public Color getFgColor(Node node);
+ public Color getBgColor(Node node);
+}
Added: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/LocationNodeIcon.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/LocationNodeIcon.java (rev 0)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/LocationNodeIcon.java 2007-02-24 02:03:29 UTC (rev 564)
@@ -0,0 +1,78 @@
+
+package net.sf.magicmap.client.gui.utils;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
+
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
+
+import net.sf.magicmap.client.gui.MainGUI;
+import net.sf.magicmap.client.gui.views.MapView;
+import net.sf.magicmap.client.model.node.INodeModel;
+import net.sf.magicmap.client.model.node.LocationNode;
+import net.sf.magicmap.client.model.node.Node;
+
+/**
+ * @author Florian Lederer
+ */
+public class LocationNodeIcon implements INodeIcon {
+
+ ImageIcon location;
+ ImageIcon locationFixed;
+ ImageIcon locationRescan;
+
+ private ImageIcon getLocation(){
+ if (location == null) location = GUIBuilder.getToolIcon("location.png", "NodeIcons");
+ return location;
+ }
+
+ private ImageIcon getLocationFixed(){
+ if (locationFixed == null) {
+ final ImageIcon anchor = GUIBuilder.getToolIcon("anchor_white.png", "NodeIcons");
+ locationFixed = new ImageIcon(getLocation().getImage()) {
+
+ @Override
+ public synchronized void paintIcon(Component c, Graphics g, int x, int y){
+ super.paintIcon(c, g, x, y);
+ g.drawImage(anchor.getImage(), x, y, x + getIconWidth(), y + getIconHeight(), 0, 0, anchor
+ .getIconWidth(), anchor.getIconHeight(), null);
+ }
+ };
+ }
+ return locationFixed;
+ }
+
+ private ImageIcon getLocationRescan(){
+ if (locationRescan == null) locationRescan = GUIBuilder.getToolIcon("location_rescan.png", "NodeIcons");
+ return locationRescan;
+ }
+
+ public Color getBgColor(Node node){
+ return Color.BLACK;
+ }
+
+ public Color getFgColor(Node node){
+ return Color.BLACK;
+ }
+
+ public Icon getIcon(Node node){
+ if (node.isUpdate()) {
+ return getLocationRescan();
+ } else {
+ if (node.isFix())
+ return getLocationFixed();
+ else
+ return getLocation();
+ }
+ }
+
+ public Class getNodeClass(){
+ return LocationNode.class;
+ }
+
+ public int getNodeType(){
+ return INodeModel.NODETYPE_LOCATION;
+ }
+}
Added: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/MapNodeIcon.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/MapNodeIcon.java (rev 0)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/MapNodeIcon.java 2007-02-24 02:03:29 UTC (rev 564)
@@ -0,0 +1,45 @@
+
+package net.sf.magicmap.client.gui.utils;
+
+import java.awt.Color;
+
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
+
+import net.sf.magicmap.client.model.node.INodeModel;
+import net.sf.magicmap.client.model.node.MapNode;
+import net.sf.magicmap.client.model.node.Node;
+
+/**
+ * @author Florian Lederer
+ */
+public class MapNodeIcon implements INodeIcon {
+
+ private ImageIcon map;
+
+ private ImageIcon getMap(){
+ if (map == null) map = GUIBuilder.getToolIcon("map.png", "NodeIcons");
+ return map;
+ }
+
+ public Color getBgColor(Node node){
+ return Color.BLACK;
+ }
+
+ public Color getFgColor(Node node){
+ return Color.BLACK;
+ }
+
+ public Icon getIcon(Node node){
+ return getMap();
+
+ }
+
+ public Class getNodeClass(){
+ return MapNode.class;
+ }
+
+ public int getNodeType(){
+ return INodeModel.NODETYPE_MAP;
+ }
+}
Deleted: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/NodeIcons.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/NodeIcons.java 2007-02-24 01:53:49 UTC (rev 563)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/NodeIcons.java 2007-02-24 02:03:29 UTC (rev 564)
@@ -1,101 +0,0 @@
-
-package net.sf.magicmap.client.gui.utils;
-
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import javax.swing.Icon;
-
-import net.sf.magicmap.client.model.node.AccessPointNode;
-import net.sf.magicmap.client.model.node.Node;
-
-import org.apache.log4j.Logger;
-
-public class NodeIcons {
-
- private static NodeIcons ni = null;
-
- private static final String RESOURCE = "icons";
-
- private static ResourceBundle iconBundle;
-
- private static Map<String, Icon> icons;
-
- private static Logger log = Logger.getLogger(NodeIcons.class);
-
- // TODO better use a default Icon object
- private static final String DEFAULT_ICON = "Node";
-
- private static final String ANCHOR = "Anchor";
-
- private static final String RESCAN = "Rescan";
-
- private static final String HIDDEN = "Hidden";
-
- private final Map<Class, NodeIcon> iconMap = new HashMap<Class, NodeIcon>();
-
- private NodeIcons() {
- init();
- }
-
- public static Icon getIconForNode(Node node){
- String name = node.getClass().getSimpleName();
- if (node instanceof AccessPointNode && ((AccessPointNode) node).isHidden()) {
- if (node.isFix()) return NodeIcons.getIconIntern(name + NodeIcons.HIDDEN + NodeIcons.ANCHOR);
- return NodeIcons.getIconIntern(name + NodeIcons.HIDDEN);
- }
- if (node.isUpdate()) return NodeIcons.getIconIntern(name + NodeIcons.RESCAN);
- if (node.isFix()) return NodeIcons.getIconIntern(name + NodeIcons.ANCHOR);
- return NodeIcons.getIconIntern(name);
- }
-
- private static Icon getIconIntern(String name){
- Icon i = NodeIcons.icons.get(name);
- if (i != null)
- return i;
- else {
- //NodeIcons.log.warn("No icon found for: " + name);
- return NodeIcons.icons.get(NodeIcons.DEFAULT_ICON);
- }
- }
-
- private void init(){
-
- NodeIcons.icons = Collections.synchronizedMap(new HashMap<String, Icon>());
-
- try {
- NodeIcons.iconBundle = ResourceBundle.getBundle(NodeIcons.RESOURCE, GUIUtils.getLocale());
- NodeIcons.log.info("Bundle loaded!");
- } catch (MissingResourceException e) {
- NodeIcons.log.error("Missing Bundle: " + NodeIcons.RESOURCE);
- return;
- }
- Enumeration en = NodeIcons.iconBundle.getKeys();
- while (en.hasMoreElements()) {
- String key = en.nextElement().toString();
- NodeIcons.log.info(key + " " + NodeIcons.iconBundle.getObject(key).toString());
- Icon i = GUIBuilder.getToolIcon(NodeIcons.iconBundle.getObject(key).toString());
- if (i == null)
- NodeIcons.log.error("Icon for " + key + " not created!");
- else
- NodeIcons.icons.put(key, i);
- }
- }
-
- public static NodeIcons getInstance(){
- if (NodeIcons.ni == null) NodeIcons.ni = new NodeIcons();
- return NodeIcons.ni;
- }
-
- public NodeIcon getNodeIcon(Node node){
- return iconMap.get(node.getClass());
- }
- public void registerNodeIcon(NodeIcon icon){
- iconMap.put(icon.getNodeClass(), icon);
- }
-
-}
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java 2007-02-24 01:53:49 UTC (rev 563)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MapView.java 2007-02-24 02:03:29 UTC (rev 564)
@@ -26,7 +26,7 @@
import net.sf.magicmap.client.gui.utils.GUIBuilder;
import net.sf.magicmap.client.gui.utils.GUIConstants;
import net.sf.magicmap.client.gui.utils.GUIUtils;
-import net.sf.magicmap.client.gui.utils.NodeIcon;
+import net.sf.magicmap.client.gui.utils.INodeIcon;
import net.sf.magicmap.client.gui.utils.NodeIcons;
import net.sf.magicmap.client.meta.MapInfo;
import net.sf.magicmap.client.model.location.INodePlacer;
@@ -105,8 +105,6 @@
private static Logger log = Logger.getLogger(NodeIcons.class);
- private static NodeIcons ni;
-
// @TODO TEST LAYOUT!
JungNodePlacer layoutModel;
@@ -119,7 +117,6 @@
this.setFrameIcon(GUIBuilder.getToolIcon(GUIConstants.ICON_MAP));
- ni = NodeIcons.getInstance();
initializeGraph();
}
@@ -137,101 +134,6 @@
graphdraw.getVisualizationViewer().suspend();
}
- public Icon getIconForNode(Node node){
- if (node == null) return null;
- switch (node.getType()) {
- case INodeModel.NODETYPE_CLIENT :
- if (!showClients) {
- return null;
- }
- break;
- case INodeModel.NODETYPE_ACCESSPOINT :
- if (!showAccessPoints) {
- return null;
- }
- break;
- case INodeModel.NODETYPE_LOCATION :
- if (!showLocations) {
- return null;
- }
- //break;
- // TODO: InfonodeIcon in NodeIcons behandeln
- // case INodeModel.NODETYPE_INFO :
- // if (((InfoObjectNode) node).getDepiction() != null) {
- // ImageIcon icon;
- // try {
- // icon = new ImageIcon(new URL(((InfoObjectNode) node).getDepiction()), "<Depiction>");
- // if (icon != null && icon.getIconHeight() > 0) {
- // return icon;
- // }
- // } catch (MalformedURLException e) {
- // // TODO Auto-generated catch block
- // e.printStackTrace();
- // }
- // }
- break;
- }
- log.debug("Nodename: " + node.getClass().getSimpleName());
- final NodeIcon nodeIcon = NodeIcons.getInstance().getNodeIcon(node);
- if (nodeIcon != null) return nodeIcon.getIcon(node);
- return ni.getIconForNode(node);
- }
-
- public Color getFgColorForNode(Node node){
- if (node == null) return null;
- switch (node.getType()) {
- case INodeModel.NODETYPE_CLIENT :
- if (!showClients) {
- return null;
- }
- return Color.BLACK;
- case INodeModel.NODETYPE_ACCESSPOINT :
- if (!showAccessPoints) {
- return null;
- }
- return Color.BLACK;
- case INodeModel.NODETYPE_LOCATION :
- if (!showLocations) {
- return null;
- }
- return Color.BLACK;
- default :
- return Color.BLACK;
- }
- }
-
- public Color getBgColorForNode(Node node){
- if (node == null) return null;
- switch (node.getType()) {
- case INodeModel.NODETYPE_CLIENT :
- if (!showClients) {
- return null;
- }
- if (node.isFix())
- return Color.BLACK;
- else
- return Color.BLACK;
- case INodeModel.NODETYPE_ACCESSPOINT :
- if (!showAccessPoints) {
- return null;
- }
- if (node.isFix())
- return Color.BLACK;
- else
- return Color.BLACK;
- case INodeModel.NODETYPE_LOCATION :
- if (!showLocations) {
- return null;
- }
- if (node.isFix())
- return Color.BLACK;
- else
- return Color.BLACK;
- default :
- return Color.BLACK;
- }
- }
-
public void resumeGraph(){
graphdraw.getVisualizationViewer().unsuspend();
}
@@ -295,17 +197,50 @@
public Color getForeColor(Vertex v){
Node node = findNode(v);
- return getFgColorForNode(node);
+ switch (node.getType()) {
+ case INodeModel.NODETYPE_CLIENT :
+ if (!showClients) return null;
+ break;
+ case INodeModel.NODETYPE_ACCESSPOINT :
+ if (!showAccessPoints) return null;
+ break;
+ case INodeModel.NODETYPE_LOCATION :
+ if (!showLocations) return null;
+ break;
+ }
+ return MainGUI.getInstance().getNodeIcons().getNodeIcon(node).getFgColor(node);
}
public Color getBackColor(Vertex v){
Node node = findNode(v);
- return getBgColorForNode(node);
+ switch (node.getType()) {
+ case INodeModel.NODETYPE_CLIENT :
+ if (!showClients) return null;
+ break;
+ case INodeModel.NODETYPE_ACCESSPOINT :
+ if (!showAccessPoints) return null;
+ break;
+ case INodeModel.NODETYPE_LOCATION :
+ if (!showLocations) return null;
+ break;
+ }
+ return MainGUI.getInstance().getNodeIcons().getNodeIcon(node).getBgColor(node);
}
public Icon getIcon(Vertex v){
Node node = findNode(v);
- return getIconForNode(node);
+ switch (node.getType()) {
+ case INodeModel.NODETYPE_CLIENT :
+ if (!showClients) return null;
+ break;
+ case INodeModel.NODETYPE_ACCESSPOINT :
+ if (!showAccessPoints) return null;
+ break;
+ case INodeModel.NODETYPE_LOCATION :
+ if (!showLocations) return null;
+ break;
+ }
+ return MainGUI.getInstance().getNodeIcons().getNodeIcon(node).getIcon(node);
}
});
@@ -571,7 +506,7 @@
* @see edu.uci.ics.jung.graph.event.VertexListener#vertexSelected(edu.uci.ics.jung.graph.Vertex)
*/
public void vertexSelected(Vertex v){
- INodeSelectionModel nodeSelectionModel = MainGUI.getInstance().getNodeSelectionModel();
+ INodeSelectionModel nodeSelectionModel = MainGUI.getInstance().getNodeSelectionModel();
if (v == null) {
nodeSelectionModel.selectNode(Node.EMPTY_NODE);
} else {
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineTree.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineTree.java 2007-02-24 01:53:49 UTC (rev 563)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/OutlineTree.java 2007-02-24 02:03:29 UTC (rev 564)
@@ -23,6 +23,7 @@
* @author Jan Friderici
* @author thuebner
* @author Johannes Zapotoczky (joh...@za...)
+ * @author Florian Lederer
* @see OutlineModel
*/
public class OutlineTree extends JTree {
@@ -87,7 +88,7 @@
} else {
c = (JLabel) super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
c.setText(node.getDisplayName());
- Icon icon = ((MapView) MainGUI.getInstance().getViewComponent("mapView")).getIconForNode(node);
+ Icon icon = MainGUI.getInstance().getNodeIcons().getNodeIcon(node).getIcon(node);
if (icon == null) icon = this.getDefaultLeafIcon();
c.setIcon(icon);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fle...@us...> - 2007-02-24 01:53:50
|
Revision: 563
http://svn.sourceforge.net/magicmap/?rev=563&view=rev
Author: flederohr
Date: 2007-02-23 17:53:49 -0800 (Fri, 23 Feb 2007)
Log Message:
-----------
changed Handling of NodeIcons
Removed Paths:
-------------
trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/NodeIcon.java
Deleted: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/NodeIcon.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/NodeIcon.java 2007-02-24 01:43:33 UTC (rev 562)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/NodeIcon.java 2007-02-24 01:53:49 UTC (rev 563)
@@ -1,18 +0,0 @@
-package net.sf.magicmap.client.gui.utils;
-
-import javax.swing.Icon;
-
-import net.sf.magicmap.client.model.node.Node;
-
-
-/**
- *
- * @author Jan Friderici
- *
- * @param <T> the nodetype this is icon is for.
- */
-public interface NodeIcon {
- public int getNodeType();
- public Class getNodeClass();
- public Icon getIcon(Node node);
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fle...@us...> - 2007-02-24 01:44:19
|
Revision: 562
http://svn.sourceforge.net/magicmap/?rev=562&view=rev
Author: flederohr
Date: 2007-02-23 17:43:33 -0800 (Fri, 23 Feb 2007)
Log Message:
-----------
changed Handling of NodeIcons
Added Paths:
-----------
trunk/magicmapclient/res/NodeIcons/accesspoint.png
trunk/magicmapclient/res/NodeIcons/accesspoint_hidden.png
trunk/magicmapclient/res/NodeIcons/anchor_black.png
trunk/magicmapclient/res/NodeIcons/anchor_white.png
trunk/magicmapclient/res/NodeIcons/client.png
trunk/magicmapclient/res/NodeIcons/default.png
trunk/magicmapclient/res/NodeIcons/geopos.png
trunk/magicmapclient/res/NodeIcons/geopos_big.png
trunk/magicmapclient/res/NodeIcons/location.png
trunk/magicmapclient/res/NodeIcons/location_rescan.png
trunk/magicmapclient/res/NodeIcons/map.png
Added: trunk/magicmapclient/res/NodeIcons/accesspoint.png
===================================================================
(Binary files differ)
Property changes on: trunk/magicmapclient/res/NodeIcons/accesspoint.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/magicmapclient/res/NodeIcons/accesspoint_hidden.png
===================================================================
(Binary files differ)
Property changes on: trunk/magicmapclient/res/NodeIcons/accesspoint_hidden.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/magicmapclient/res/NodeIcons/anchor_black.png
===================================================================
(Binary files differ)
Property changes on: trunk/magicmapclient/res/NodeIcons/anchor_black.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/magicmapclient/res/NodeIcons/anchor_white.png
===================================================================
(Binary files differ)
Property changes on: trunk/magicmapclient/res/NodeIcons/anchor_white.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/magicmapclient/res/NodeIcons/client.png
===================================================================
(Binary files differ)
Property changes on: trunk/magicmapclient/res/NodeIcons/client.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/magicmapclient/res/NodeIcons/default.png
===================================================================
(Binary files differ)
Property changes on: trunk/magicmapclient/res/NodeIcons/default.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/magicmapclient/res/NodeIcons/geopos.png
===================================================================
(Binary files differ)
Property changes on: trunk/magicmapclient/res/NodeIcons/geopos.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/magicmapclient/res/NodeIcons/geopos_big.png
===================================================================
(Binary files differ)
Property changes on: trunk/magicmapclient/res/NodeIcons/geopos_big.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/magicmapclient/res/NodeIcons/location.png
===================================================================
(Binary files differ)
Property changes on: trunk/magicmapclient/res/NodeIcons/location.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/magicmapclient/res/NodeIcons/location_rescan.png
===================================================================
(Binary files differ)
Property changes on: trunk/magicmapclient/res/NodeIcons/location_rescan.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/magicmapclient/res/NodeIcons/map.png
===================================================================
(Binary files differ)
Property changes on: trunk/magicmapclient/res/NodeIcons/map.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fle...@us...> - 2007-02-24 01:39:40
|
Revision: 561
http://svn.sourceforge.net/magicmap/?rev=561&view=rev
Author: flederohr
Date: 2007-02-23 17:39:39 -0800 (Fri, 23 Feb 2007)
Log Message:
-----------
Added Paths:
-----------
trunk/magicmapclient/res/NodeIcons/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fle...@us...> - 2007-02-24 01:36:12
|
Revision: 560
http://svn.sourceforge.net/magicmap/?rev=560&view=rev
Author: flederohr
Date: 2007-02-23 17:35:59 -0800 (Fri, 23 Feb 2007)
Log Message:
-----------
changed Handling of NodeIcons
Removed Paths:
-------------
trunk/magicmapclient/res/toolBarButtonGraphics/custom/accesspoint.png
trunk/magicmapclient/res/toolBarButtonGraphics/custom/accesspoint_anchor.png
trunk/magicmapclient/res/toolBarButtonGraphics/custom/accesspoint_hidden.png
trunk/magicmapclient/res/toolBarButtonGraphics/custom/accesspoint_hidden_anchor.png
trunk/magicmapclient/res/toolBarButtonGraphics/custom/client.png
trunk/magicmapclient/res/toolBarButtonGraphics/custom/client_anchor.png
trunk/magicmapclient/res/toolBarButtonGraphics/custom/default.png
trunk/magicmapclient/res/toolBarButtonGraphics/custom/geopos.png
trunk/magicmapclient/res/toolBarButtonGraphics/custom/geopos_big.png
trunk/magicmapclient/res/toolBarButtonGraphics/custom/image.png
trunk/magicmapclient/res/toolBarButtonGraphics/custom/info.png
trunk/magicmapclient/res/toolBarButtonGraphics/custom/location.png
trunk/magicmapclient/res/toolBarButtonGraphics/custom/location_anchor.png
trunk/magicmapclient/res/toolBarButtonGraphics/custom/location_rescan.png
trunk/magicmapclient/res/toolBarButtonGraphics/custom/node.png
trunk/magicmapclient/res/toolBarButtonGraphics/custom/rfid_antenna.png
trunk/magicmapclient/res/toolBarButtonGraphics/custom/rfid_tag.png
Deleted: trunk/magicmapclient/res/toolBarButtonGraphics/custom/accesspoint.png
===================================================================
(Binary files differ)
Deleted: trunk/magicmapclient/res/toolBarButtonGraphics/custom/accesspoint_anchor.png
===================================================================
(Binary files differ)
Deleted: trunk/magicmapclient/res/toolBarButtonGraphics/custom/accesspoint_hidden.png
===================================================================
(Binary files differ)
Deleted: trunk/magicmapclient/res/toolBarButtonGraphics/custom/accesspoint_hidden_anchor.png
===================================================================
(Binary files differ)
Deleted: trunk/magicmapclient/res/toolBarButtonGraphics/custom/client.png
===================================================================
(Binary files differ)
Deleted: trunk/magicmapclient/res/toolBarButtonGraphics/custom/client_anchor.png
===================================================================
(Binary files differ)
Deleted: trunk/magicmapclient/res/toolBarButtonGraphics/custom/default.png
===================================================================
(Binary files differ)
Deleted: trunk/magicmapclient/res/toolBarButtonGraphics/custom/geopos.png
===================================================================
(Binary files differ)
Deleted: trunk/magicmapclient/res/toolBarButtonGraphics/custom/geopos_big.png
===================================================================
(Binary files differ)
Deleted: trunk/magicmapclient/res/toolBarButtonGraphics/custom/image.png
===================================================================
(Binary files differ)
Deleted: trunk/magicmapclient/res/toolBarButtonGraphics/custom/info.png
===================================================================
(Binary files differ)
Deleted: trunk/magicmapclient/res/toolBarButtonGraphics/custom/location.png
===================================================================
(Binary files differ)
Deleted: trunk/magicmapclient/res/toolBarButtonGraphics/custom/location_anchor.png
===================================================================
(Binary files differ)
Deleted: trunk/magicmapclient/res/toolBarButtonGraphics/custom/location_rescan.png
===================================================================
(Binary files differ)
Deleted: trunk/magicmapclient/res/toolBarButtonGraphics/custom/node.png
===================================================================
(Binary files differ)
Deleted: trunk/magicmapclient/res/toolBarButtonGraphics/custom/rfid_antenna.png
===================================================================
(Binary files differ)
Deleted: trunk/magicmapclient/res/toolBarButtonGraphics/custom/rfid_tag.png
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fle...@us...> - 2007-02-23 19:41:47
|
Revision: 559
http://svn.sourceforge.net/magicmap/?rev=559&view=rev
Author: flederohr
Date: 2007-02-23 11:41:38 -0800 (Fri, 23 Feb 2007)
Log Message:
-----------
remove empty folder
Removed Paths:
-------------
trunk/magicmapclient/src/net/sf/magicmap/util/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|