|
From: <jan...@us...> - 2007-02-12 18:18:04
|
Revision: 531
http://svn.sourceforge.net/magicmap/?rev=531&view=rev
Author: jan_fride
Date: 2007-02-12 10:17:29 -0800 (Mon, 12 Feb 2007)
Log Message:
-----------
removed Infoobjects (temporaery) and changed menu....
Modified Paths:
--------------
trunk/magicmapclient/src/edu/uci/ics/jung/visualization/SpringLayout.java
trunk/magicmapclient/src/edu/uci/ics/jung/visualization/VisualizationViewer.java
trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java
trunk/magicmapclient/src/net/sf/magicmap/client/controller/IController.java
trunk/magicmapclient/src/net/sf/magicmap/client/gui/MapPanel.java
trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuAndPredicate.java
trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuContainer.java
trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuNotPredicate.java
trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuPredicate.java
trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuTypePredicate.java
trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/View.java
trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java
trunk/magicmapclient/src/net/sf/magicmap/client/model/node/INode.java
trunk/magicmapclient/src/net/sf/magicmap/client/model/node/InfoObject.java
trunk/magicmapclient/src/net/sf/magicmap/client/model/node/InfoObjectNode.java
Removed Paths:
-------------
trunk/magicmapclient/src/net/sf/magicmap/client/algorithms/InfoNodeMetric.java
trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/InfoObjectDialog.java
trunk/magicmapclient/src/net/sf/magicmap/client/gui/forms/CreateInfoObjectForm.java
trunk/magicmapclient/src/net/sf/magicmap/client/model/info/
trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/handler/InfoNodeHandler.java
Modified: trunk/magicmapclient/src/edu/uci/ics/jung/visualization/SpringLayout.java
===================================================================
--- trunk/magicmapclient/src/edu/uci/ics/jung/visualization/SpringLayout.java 2007-02-11 14:07:44 UTC (rev 530)
+++ trunk/magicmapclient/src/edu/uci/ics/jung/visualization/SpringLayout.java 2007-02-12 18:17:29 UTC (rev 531)
@@ -58,7 +58,7 @@
* length function.
*/
public SpringLayout(Graph g) {
- this(g, UNITLENGTHFUNCTION);
+ this(g, UNITLENGTHFUNCTION, NoRepulsionFunction);
}
/**
@@ -70,14 +70,7 @@
* the length function
*/
public SpringLayout(Graph g, LengthFunction f) {
- super(g);
- this.lengthFunction = f;
- this.leaveFunction = new CanLeaveMapFunction() {
-
- public boolean canLeave(Vertex v){
- return false;
- }
- };
+ this(g,f,NoRepulsionFunction);
}
/**
@@ -94,7 +87,8 @@
super(g);
this.lengthFunction = f;
this.repulsionFunction = r;
- this.leaveFunction = new CanLeaveMapFunction() {
+ this.forceFunction = DefaultForceFunction;
+ this.leaveFunction = new CanLeaveMapFunction() {
public boolean canLeave(Vertex v){
return false;
@@ -369,7 +363,11 @@
public double getRepulsion(Vertex v1, Vertex v2);
}
-
+ public static RepulsionFunction NoRepulsionFunction = new RepulsionFunction(){
+ public double getRepulsion(Vertex v1, Vertex v2) {
+ return 0;
+ }
+ };
/**
* Extension for PACW: Make the Repulsion configurable.
*
@@ -394,6 +392,11 @@
public double getForce(Vertex v1, Vertex v2);
}
+ public static final ForceFunction DefaultForceFunction = new ForceFunction(){
+ public double getForce(Vertex v1, Vertex v2) {
+ return 1;
+ }
+ };
/**
* Extension for PACW: Make the Repulsion configurable.
*
Modified: trunk/magicmapclient/src/edu/uci/ics/jung/visualization/VisualizationViewer.java
===================================================================
--- trunk/magicmapclient/src/edu/uci/ics/jung/visualization/VisualizationViewer.java 2007-02-11 14:07:44 UTC (rev 530)
+++ trunk/magicmapclient/src/edu/uci/ics/jung/visualization/VisualizationViewer.java 2007-02-12 18:17:29 UTC (rev 531)
@@ -98,7 +98,7 @@
/**
* UNTESTED.
- * @param v
+ * @param r
*/
public void setRenderer(Renderer r){
this.renderer = r;
Deleted: trunk/magicmapclient/src/net/sf/magicmap/client/algorithms/InfoNodeMetric.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/algorithms/InfoNodeMetric.java 2007-02-11 14:07:44 UTC (rev 530)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/algorithms/InfoNodeMetric.java 2007-02-12 18:17:29 UTC (rev 531)
@@ -1,36 +0,0 @@
-
-package net.sf.magicmap.client.algorithms;
-
-import java.util.Set;
-
-import net.sf.magicmap.client.model.node.InfoObjectNode;
-import net.sf.magicmap.client.model.node.InfoObjectTag;
-import net.sf.magicmap.client.model.node.Node;
-
-public class InfoNodeMetric implements NodeModelMetric {
-
- public InfoNodeMetric() {
-
- }
-
- public double metric(Node node1, Node node2){
- if (node1 == node2) throw new IllegalArgumentException("Keine Verbindung zwischen dem selben Knoten!");
- if (node1 instanceof InfoObjectNode && node2 instanceof InfoObjectNode) {
- InfoObjectNode iNode1 = (InfoObjectNode) node1;
- InfoObjectNode iNode2 = (InfoObjectNode) node2;
- Set<InfoObjectTag> tagset = iNode2.getTags();
- int commonTags = 0;
- double tagCount = (iNode1.getTags().size() + 1) / 2;
- for (InfoObjectTag tag : iNode1)
- if (tagset.contains(tag))
- commonTags++;
- else {
-
- }
- if (commonTags == 0) return 220.0;
- return 120.0 * (tagCount / commonTags);
- }
- return Double.POSITIVE_INFINITY;
- }
-
-}
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java 2007-02-11 14:07:44 UTC (rev 530)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java 2007-02-12 18:17:29 UTC (rev 531)
@@ -15,7 +15,6 @@
import net.sf.magicmap.client.measurement.interfaces.AbstractScanner;
import net.sf.magicmap.client.measurement.interfaces.AbstractScannerHandler;
import net.sf.magicmap.client.meta.MapInfo;
-import net.sf.magicmap.client.model.info.InfoObjectProviderRegistry;
import net.sf.magicmap.client.model.measurement.IMeasurementModel;
import net.sf.magicmap.client.model.measurement.MeasurementModel;
import net.sf.magicmap.client.model.node.*;
@@ -75,7 +74,6 @@
private Collection<InfoObject> infoObjects;
private ScannerAllocator scannerAllocator;
- private final InfoObjectProviderRegistry infoServiceRegistry;
private final PluginManager pluginManager;
/**
@@ -105,7 +103,6 @@
// pseudo server items
this.infoObjects = new ArrayList<InfoObject>();
// initializeScanner();
- this.infoServiceRegistry = new InfoObjectProviderRegistry(this.nodeModel);
try {
this.pluginManager = new PluginManager(new Settings(), this);
} catch (MalformedURLException e) {
@@ -554,7 +551,4 @@
this.scannerAllocator.addScanResultHandler(handler);
}
- public InfoObjectProviderRegistry getInfoProviderRegistry(){
- return this.infoServiceRegistry;
- }
}
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/controller/IController.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/controller/IController.java 2007-02-11 14:07:44 UTC (rev 530)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/controller/IController.java 2007-02-12 18:17:29 UTC (rev 531)
@@ -20,7 +20,6 @@
import net.sf.magicmap.client.measurement.interfaces.AbstractScanner;
import net.sf.magicmap.client.measurement.interfaces.AbstractScannerHandler;
import net.sf.magicmap.client.meta.MapInfo;
-import net.sf.magicmap.client.model.info.InfoObjectProviderRegistry;
import net.sf.magicmap.client.model.measurement.IMeasurementModel;
import net.sf.magicmap.client.model.node.AccessPointSeerNode;
import net.sf.magicmap.client.model.node.ClientNode;
@@ -250,6 +249,4 @@
void handleScanResult(AbstractScanResult scanResult, AbstractScanner scanner);
void addScannerHandler(AbstractScannerHandler handler);
-
- InfoObjectProviderRegistry getInfoProviderRegistry();
}
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/MapPanel.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/MapPanel.java 2007-02-11 14:07:44 UTC (rev 530)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/MapPanel.java 2007-02-12 18:17:29 UTC (rev 531)
@@ -7,7 +7,6 @@
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
-import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
@@ -19,7 +18,6 @@
import net.sf.magicmap.client.controller.Controller;
import net.sf.magicmap.client.gui.dialogs.GeoPosDialog;
-import net.sf.magicmap.client.gui.dialogs.InfoObjectDialog;
import net.sf.magicmap.client.gui.utils.GUIBuilder;
import net.sf.magicmap.client.gui.utils.GUIConstants;
import net.sf.magicmap.client.gui.utils.GUIUtils;
@@ -28,8 +26,6 @@
import net.sf.magicmap.client.model.node.AccessPointNode;
import net.sf.magicmap.client.model.node.ClientNode;
import net.sf.magicmap.client.model.node.GeoPos;
-import net.sf.magicmap.client.model.node.InfoObject;
-import net.sf.magicmap.client.model.node.InfoObjectNode;
import net.sf.magicmap.client.model.node.Node;
import net.sf.magicmap.client.model.node.NodeModelConstants;
import net.sf.magicmap.client.utils.Settings;
@@ -103,7 +99,6 @@
this.setLayout(new BorderLayout());
this.setPreferredSize(new Dimension(-1, 450));
this.mapView = null;
- this.mapMenu = buildMapMenu();
}
/**
@@ -135,18 +130,6 @@
}
};
- this.createInfoObjectAction = new AbstractAction(GUIUtils.i18n("createinfoobject")) {
-
- /**
- * serial version id
- */
- private static final long serialVersionUID = 1L;
-
- public void actionPerformed(ActionEvent e){
- createInfoObject();
- }
- };
-
this.measureLocationAction = new AbstractAction(GUIUtils.i18n("measurelocation")) {
/**
@@ -264,15 +247,6 @@
}
- /**
- * @deprecated
- * @return
- */
- @Deprecated
- private JMenu buildTestMenu(){
- JMenu menu = new JMenu(GUIUtils.i18n("test"));
- return menu;
- }
/**
*
@@ -287,7 +261,7 @@
menu.add(GUIBuilder.createMenuItem(this.createInfoObjectAction));
menu.addSeparator();
menu.add(GUIBuilder.createMenuItem(this.fetchLocationsAction));
- return menu;
+ return mapView.getMenuContainer().buildMenu(null, menu);
}
/**
@@ -359,7 +333,7 @@
this.selectedNode = null;
int ox = this.mapView.getMapOffsetX();
int oy = this.mapView.getMapOffsetY();
- this.mapMenu.show(this, x + ox, y + oy);
+ this.buildMapMenu().show(this, x + ox, y + oy);
}
/**
@@ -420,22 +394,11 @@
Controller.getInstance().getCurrentMap().name, true, this);
}
+
/**
* Create an info object for the current selected location
*
*/
- void createInfoObject(){
- // TODO \xDCber den Dialog auch die H\xF6he einlesen
- InfoObject infoObject = InfoObjectDialog.showDialog(MainGUI.getInstance());
- if (infoObject != null)
- Controller.getInstance().createInfoObject(getLastX(), getLastY(), Settings.DEFAULT_HEIGHT, infoObject,
- Controller.getInstance().getCurrentMap().name, true, this);
- }
-
- /**
- * Create an info object for the current selected location
- *
- */
protected void measureLocation(){
if (this.selectedNode != null) {
String r = this.selectedNode.getName();
Deleted: trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/InfoObjectDialog.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/InfoObjectDialog.java 2007-02-11 14:07:44 UTC (rev 530)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/InfoObjectDialog.java 2007-02-12 18:17:29 UTC (rev 531)
@@ -1,129 +0,0 @@
-/**
- *
- */
-
-package net.sf.magicmap.client.gui.dialogs;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import javax.swing.JButton;
-import javax.swing.JComponent;
-import javax.swing.JDialog;
-import javax.swing.JFrame;
-
-import net.sf.magicmap.client.controller.Controller;
-import net.sf.magicmap.client.gui.utils.GUIConstants;
-import net.sf.magicmap.client.gui.utils.GUIUtils;
-import net.sf.magicmap.client.gui.utils.RelativePanelBuilder;
-import net.sf.magicmap.client.model.info.InfoObjectProvider;
-import net.sf.magicmap.client.model.info.InfoObjectProviderRegistry;
-import net.sf.magicmap.client.model.node.InfoObject;
-
-import com.brunchboy.util.swing.relativelayout.RelativeLayout;
-
-/**
- * Shows a dialog to create a new InfoObject.
- *
- * @author Johannes Zapotoczky (joh...@za...), Jan friderici (ja...@fr...)
- *
- */
-public class InfoObjectDialog extends JDialog implements ActionListener {
-
- /**
- * serial version id
- */
- private static final long serialVersionUID = 2254415271972084477L;
-
- /**
- * the currently set geopos
- */
- private InfoObject infoObject;
-
- /**
- *
- */
- private InfoObjectProvider currentProvider;
-
- private InfoObjectProviderRegistry reg;
-
- /**
- *
- * @param owner
- * @return
- */
- public static InfoObject showDialog(JFrame owner){
-
- InfoObjectDialog dialog = new InfoObjectDialog(owner);
- GUIUtils.locateOnScreen(dialog);
- dialog.setModal(true);
- dialog.pack();
- dialog.setVisible(true);
-
- return dialog.getValues();
- }
-
- /**
- * @return the new InfoObject.
- */
- private InfoObject getValues(){
- return this.infoObject;
- }
-
- /**
- *
- * @param owner
- */
- public InfoObjectDialog(JFrame owner) {
- super(owner, GUIUtils.i18n("infoobject"));
- //this.setSize(250, 195);
- this.setResizable(false);
- this.reg = Controller.getInstance().getInfoProviderRegistry();
-
- RelativeLayout layout = new RelativeLayout();
- RelativePanelBuilder builder = new RelativePanelBuilder(layout);
-
- JButton okButton = builder.createButton(GUIUtils.i18n("set"), "OK", this);
- JButton cancelButton = builder.createButton(GUIUtils.i18n("cancel"), "CANCEL", this);
-
- // ok/cancel area
- builder.addOKCancelButtonBar(okButton, cancelButton, "okcancel");
- builder.setLeftLeftDistance("okcancel", null, 10);
- builder.setRightRightDistance("okcancel", null, -10);
- builder.setBottomBottomDistance("okcancel", null, -10);
-
- // Kopf
- builder.addDialogHeader("<html><b>" + GUIUtils.i18n("setinfoobject") + "</b><br>"
- + GUIUtils.i18n("setinfoobjecthint") + "</html>", GUIConstants.ICON_INFO, "header");
- builder.setTop("header", 0);
- builder.setLeft("header", 0);
- builder.setRightRightDistance("header", null, 0);
-
- setContentPane(builder.getPanel());
- getRootPane().setDefaultButton(okButton);
-
- JComponent contents = this.reg.visualProxy("", null); //
- builder.add(contents, "contents");
- builder.setRightRightDistance("contents", null, -20);
- builder.setTopBottomDistance("contents", "header", 20);
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- */
- public void actionPerformed(ActionEvent e){
- if ("OK".equals(e.getActionCommand())) {
- try {
- this.infoObject = this.reg.createNode();
- } catch (Exception e1) {
- this.infoObject = null;
- e1.printStackTrace();
- }
- this.setVisible(false);
- } else if ("CANCEL".equals(e.getActionCommand())) {
- this.infoObject = null;
- this.setVisible(false);
- }
-
- }
-}
Deleted: trunk/magicmapclient/src/net/sf/magicmap/client/gui/forms/CreateInfoObjectForm.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/forms/CreateInfoObjectForm.java 2007-02-11 14:07:44 UTC (rev 530)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/forms/CreateInfoObjectForm.java 2007-02-12 18:17:29 UTC (rev 531)
@@ -1,43 +0,0 @@
-
-package net.sf.magicmap.client.gui.forms;
-
-import java.awt.CardLayout;
-
-import javax.swing.JComponent;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-
-import net.sf.magicmap.client.model.info.InfoObjectProviderRegistry;
-
-import com.jgoodies.forms.layout.CellConstraints;
-
-/**
- *
- */
-public class CreateInfoObjectForm extends FormLayoutForm {
-
- private CardLayout cards;
- private JPanel panel;
-
- /**
- *
- */
- public CreateInfoObjectForm() {
- super("p,3dlu,p:grow", "p, 6dlu,p:grow");
- CellConstraints cc = new CellConstraints();
- this.addLabel("", new JLabel("Typ"), cc.xy(1, 1));
-
- }
-
- @Override
- public JComponent attatch(UserInterface ui){
- if (ui instanceof InfoObjectProviderRegistry) {
- InfoObjectProviderRegistry infoObjectProviderRegistry = (InfoObjectProviderRegistry) ui;
- CellConstraints cc = new CellConstraints();
- this.addAttribute("list", "", cc.xy(3, 1));
- return super.attatch(ui);
- } else
- throw new IllegalArgumentException("UserInterface not suported: " + ui);
-
- }
-}
\ No newline at end of file
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuAndPredicate.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuAndPredicate.java 2007-02-11 14:07:44 UTC (rev 530)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuAndPredicate.java 2007-02-12 18:17:29 UTC (rev 531)
@@ -1,7 +1,5 @@
package net.sf.magicmap.client.gui.utils.menu;
-import net.sf.magicmap.client.model.node.Node;
-
/**
* Class ${class}
*
@@ -17,7 +15,7 @@
this.first = first;
this.second = second;
}
- public boolean show(Node node) {
- return first.show(node) && second.show(node);
+ public boolean show(Object context) {
+ return first.show(context) && second.show(context);
}
}
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuContainer.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuContainer.java 2007-02-11 14:07:44 UTC (rev 530)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuContainer.java 2007-02-12 18:17:29 UTC (rev 531)
@@ -19,6 +19,7 @@
private final JComponent component;
private final List<NodeMenuItem> items = new LinkedList<NodeMenuItem>();
private final Set<NodeMenuItem> seperators = new HashSet<NodeMenuItem>();
+
public NodeMenuContainer(JComponent component){
this.component = component;
}
@@ -29,9 +30,9 @@
public void addNodeMenuItem(Object owner, JMenuItem item, NodeMenuPredicate predicate){
items.add(new NodeMenuItem(item, predicate));
}
- public JPopupMenu buildMenu(Node node, JPopupMenu menu){
+ public JPopupMenu buildMenu(Object context, JPopupMenu menu){
for (NodeMenuItem item: items){
- if (item.showPredicate.show(node)){
+ if (item.showPredicate.show(context)){
menu.add(item.item);
}
}
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuNotPredicate.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuNotPredicate.java 2007-02-11 14:07:44 UTC (rev 530)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuNotPredicate.java 2007-02-12 18:17:29 UTC (rev 531)
@@ -1,7 +1,5 @@
package net.sf.magicmap.client.gui.utils.menu;
-import net.sf.magicmap.client.model.node.Node;
-
/**
* Class ${class}
*
@@ -15,7 +13,7 @@
this.other = other;
}
- public boolean show(Node node) {
- return !other.show(node);
+ public boolean show(Object context) {
+ return !other.show(context);
}
}
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuPredicate.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuPredicate.java 2007-02-11 14:07:44 UTC (rev 530)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuPredicate.java 2007-02-12 18:17:29 UTC (rev 531)
@@ -1,7 +1,5 @@
package net.sf.magicmap.client.gui.utils.menu;
-import net.sf.magicmap.client.model.node.Node;
-
/**
* Class ${class}
*
@@ -10,16 +8,16 @@
*/
public interface NodeMenuPredicate {
- public boolean show(Node node);
+ public boolean show(Object context);
static final NodeMenuPredicate TRUE = new NodeMenuPredicate() {
- public boolean show(Node node) {
+ public boolean show(Object context) {
return true;
}
};
static final NodeMenuPredicate FALSE = new NodeMenuPredicate() {
- public boolean show(Node node) {
+ public boolean show(Object context) {
return false;
}
};
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuTypePredicate.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuTypePredicate.java 2007-02-11 14:07:44 UTC (rev 530)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuTypePredicate.java 2007-02-12 18:17:29 UTC (rev 531)
@@ -15,7 +15,7 @@
this.type = type;
}
- public boolean show(Node node) {
- return node != null && node.getType() == type;
+ public boolean show(Object context) {
+ return context != null && (context instanceof Node) && ((Node)context).getType() == type;
}
}
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/View.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/View.java 2007-02-11 14:07:44 UTC (rev 530)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/View.java 2007-02-12 18:17:29 UTC (rev 531)
@@ -20,7 +20,7 @@
public abstract class View extends SimpleInternalFrame {
private JComponent view;
- private final NodeMenuContainer menuCOntainer = new NodeMenuContainer(this);
+ private final NodeMenuContainer nodeMenuContainer = new NodeMenuContainer(this);
//private ViewHeader header;
@@ -56,6 +56,6 @@
}
public NodeMenuContainer getMenuContainer(){
- return menuCOntainer;
+ return nodeMenuContainer;
}
}
\ No newline at end of file
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java 2007-02-11 14:07:44 UTC (rev 530)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/JungNodePlacer.java 2007-02-12 18:17:29 UTC (rev 531)
@@ -133,7 +133,6 @@
addNodeUpdateHandler(new PositionUpdateHandler(this.nodeVertexMapping, this.layout));
addNodeUpdateHandler(new SeeAccessPointHandler(this.clientLocationMap, this.locationLocationMap));
addNodeUpdateHandler(new NotSeeAccessPointHandler(this.clientLocationMap, this.locationLocationMap));
- addNodeUpdateHandler(new InfoNodeHandler());
addNodeUpdateHandler(new AccessPointHiddenStateHandler());
}
Deleted: trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/handler/InfoNodeHandler.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/handler/InfoNodeHandler.java 2007-02-11 14:07:44 UTC (rev 530)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/model/location/jung/handler/InfoNodeHandler.java 2007-02-12 18:17:29 UTC (rev 531)
@@ -1,82 +0,0 @@
-
-package net.sf.magicmap.client.model.location.jung.handler;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import net.sf.magicmap.client.model.location.INodePlacer;
-import net.sf.magicmap.client.model.location.NodeUpdateHandler;
-import net.sf.magicmap.client.model.node.InfoObjectNode;
-import net.sf.magicmap.client.model.node.InfoObjectTag;
-import net.sf.magicmap.client.model.node.Node;
-import net.sf.magicmap.client.model.node.NodeModelConstants;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * K\xFCmmert sich um Infoobjekte:
- * <li> Das anlegen von Kanten
- * <li> Das l\xF6schen von Kanten.
- * @author Jan Friderici
- */
-public class InfoNodeHandler implements NodeUpdateHandler {
-
- Log log = LogFactory.getLog(InfoNodeHandler.class);
-
- private final Map<String, InfoObjectNode> infoNodes = new HashMap<String, InfoObjectNode>();
-
- public InfoNodeHandler() {
- this.log.info("Created!");
- }
-
- /**
- *
- * @param node of type InfoObjectNode
- * @param eventtype NODETYPE_INFO or UPDATE_INFO_OBJECT_TAGS
- * @return true if the node is of type InfoNode.
- */
- public boolean canHandleEvent(Node node, int eventtype){
- return (node instanceof InfoObjectNode);
- }
-
- public int getType(){
- return NodeModelConstants.NODETYPE_INFO;
- }
-
- /**
- *
- * @param node
- * @param type
- * @param data
- * @param nodePlacer
- */
- public void handleNodeUpdated(Node node, int type, Object data, INodePlacer nodePlacer){
- if (!(node instanceof InfoObjectNode)) return;
-
- InfoObjectNode infoObjectNode = (InfoObjectNode) node;
- for (InfoObjectTag tag : infoObjectNode)
- getRelatedNode(infoObjectNode, nodePlacer);
- this.infoNodes.put(infoObjectNode.getInfoUrl(), infoObjectNode);
-
- }
-
- /**
- *
- * @param node
- * @param nodePlacer
- */
- private void getRelatedNode(InfoObjectNode node, INodePlacer nodePlacer){
-
- for (InfoObjectTag tag : node)
- for (InfoObjectNode infoNode : this.infoNodes.values()) {
- this.log.info("Tag:" + tag.value);
- if (infoNode.getTags().contains(tag)) {
- nodePlacer.addEdge(node, infoNode);
- break;
- } else if (tag.type.startsWith("link") && this.infoNodes.containsKey(tag.value))
- nodePlacer.addEdge(node, infoNode);
- }
- }
-
-}
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/node/INode.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/model/node/INode.java 2007-02-11 14:07:44 UTC (rev 530)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/model/node/INode.java 2007-02-12 18:17:29 UTC (rev 531)
@@ -1,6 +1,5 @@
package net.sf.magicmap.client.model.node;
-import java.util.ArrayList;
import java.util.List;
/**
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/node/InfoObject.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/model/node/InfoObject.java 2007-02-11 14:07:44 UTC (rev 530)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/model/node/InfoObject.java 2007-02-12 18:17:29 UTC (rev 531)
@@ -10,30 +10,17 @@
* @author Johannes Zapotoczky (joh...@za...)
*
*/
-public interface InfoObject extends Iterable<InfoObjectTag> {
+public interface InfoObject {
- public String getInfoUrl();
+ String getInfoUrl();
- public String getServiceUrl();
+ String getServiceUrl();
- public String getInfoType();
+ String getInfoType();
- public String getDepiction();
+ String getDepiction();
- public String getDescription();
+ String getDescription();
- public String getInfoTitle();
-
- /**
- *
- * @return
- */
- public Set<InfoObjectTag> getTags();
-
- /**
- *
- * @param tag
- */
- public void addTag(InfoObjectTag tag);
-
+ String getInfoTitle();
}
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/model/node/InfoObjectNode.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/model/node/InfoObjectNode.java 2007-02-11 14:07:44 UTC (rev 530)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/model/node/InfoObjectNode.java 2007-02-12 18:17:29 UTC (rev 531)
@@ -10,8 +10,6 @@
import java.util.Set;
import java.util.TreeSet;
-import net.sf.magicmap.client.controller.Controller;
-
/**
* Wir nehmen ersteinmal NUR flickr dinger....
* @author Johannes Zapotoczky (joh...@za...), Jan Friderici
@@ -61,7 +59,6 @@
setDisplayName(this.infoTitle);
setPhysical(false);
// Will call the update method in our model!
- setTags(info.getTags());
}
/* (non-Javadoc)
@@ -113,7 +110,7 @@
protected void explode() throws IOException{
try {
- Controller.getInstance().getInfoProviderRegistry().expandNode(this);
+ //Controller.getInstance().getInfoProviderRegistry().expandNode(this);
} catch (Exception e) {
e.printStackTrace();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|