From: <jan...@us...> - 2007-02-10 16:42:30
|
Revision: 529 http://svn.sourceforge.net/magicmap/?rev=529&view=rev Author: jan_fride Date: 2007-02-10 08:42:26 -0800 (Sat, 10 Feb 2007) Log Message: ----------- Menu is dynamic Modified Paths: -------------- trunk/magicmapclient/magicmapclient.iml 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/views/View.java trunk/magicmapclient/src/net/sf/magicmap/client/plugin/PluginLoader.java trunk/magicmapserver/magicmapserver.iml Added Paths: ----------- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/ 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/NodeMenuItem.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 Modified: trunk/magicmapclient/magicmapclient.iml =================================================================== --- trunk/magicmapclient/magicmapclient.iml 2007-02-10 14:27:24 UTC (rev 528) +++ trunk/magicmapclient/magicmapclient.iml 2007-02-10 16:42:26 UTC (rev 529) @@ -1,300 +1,302 @@ -<?xml version="1.0" encoding="UTF-8"?> -<module version="4" relativePaths="true" type="JAVA_MODULE"> - <component name="ModuleRootManager" /> - <component name="NewModuleRootManager" inherit-compiler-output="false"> - <output url="file://$MODULE_DIR$/build" /> - <exclude-output /> - <output-test url="file://$MODULE_DIR$/build-test" /> - <content url="file://$MODULE_DIR$"> - <sourceFolder url="file://$MODULE_DIR$/inf" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/perl" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/res" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src-gen" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" /> - <excludeFolder url="file://$MODULE_DIR$/.settings" /> - <excludeFolder url="file://$MODULE_DIR$/lib" /> - <excludeFolder url="file://$MODULE_DIR$/lib-dev" /> - </content> - <orderEntry type="inheritedJdk" /> - <orderEntry type="sourceFolder" forTests="false" /> - <orderEntry type="library" name="Groovy from GroovyJ 0.1.8 (Demetra)" level="application" /> - <orderEntry type="library" name="magicmap-server" level="application" /> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/nekohtml.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/jaxrpc.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/concurrent.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/commons-collections-3.1.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/jaxen-1.1-beta-9.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/forms-1.0.5.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/xml-apis.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/activation.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/jung-1.5.2.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/xmlParserAPIs.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/mail.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/derby.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/foxtrot.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/commons-httpclient-3.0-rc3.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/dom4j-1.6.1.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/commons-discovery.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/RelativeLayout.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/saaj.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/log4j-1.2.8.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/commons-logging.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/xercesImpl.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/looks-1.2.2.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/axis.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/ostermillerutils_1_05_00.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/jpox-20041204.032009.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/commons-codec-1.3.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/colt.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib/wsdl4j.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib-dev/axis-ant.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntry type="module-library"> - <library> - <CLASSES> - <root url="jar://$MODULE_DIR$/lib-dev/junit.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES /> - </library> - </orderEntry> - <orderEntryProperties /> - </component> - <component name="VcsManagerConfiguration"> - <option name="ACTIVE_VCS_NAME" value="svn" /> - <option name="USE_PROJECT_VCS" value="false" /> - </component> -</module> - +<?xml version="1.0" encoding="UTF-8"?> +<module version="4" relativePaths="false" type="JAVA_MODULE"> + <component name="ModuleRootManager" /> + <component name="NewModuleRootManager" inherit-compiler-output="false"> + <output url="file://$MODULE_DIR$/build" /> + <exclude-output /> + <output-test url="file://$MODULE_DIR$/build-test" /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/res" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src-gen" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" /> + <excludeFolder url="file://$MODULE_DIR$/build" /> + <excludeFolder url="file://$MODULE_DIR$/build-test" /> + <excludeFolder url="file://$MODULE_DIR$/target" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://X:/maven/junit/junit/3.8.1/junit-3.8.1.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/dom4j-1.6.1.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/forms-1.0.5.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/commons-collections-3.1.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/foxtrot.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/jaxrpc.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/ostermillerutils_1_05_00.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/commons-codec-1.3.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/concurrent.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/colt.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/nekohtml.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/commons-logging.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/jung-1.5.2.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/saaj.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/xmlParserAPIs.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/derby.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/RelativeLayout.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/xercesImpl.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/xml-apis.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/mail.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/jaxen-1.1-beta-9.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/commons-httpclient-3.0-rc3.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/jpox-20041204.032009.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/looks-1.2.2.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/log4j-1.2.8.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/axis.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/activation.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/wsdl4j.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/commons-discovery.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib-dev/junit.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib-dev/axis-ant.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module" module-name="magicmapserver" /> + <orderEntryProperties /> + </component> +</module> + Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java 2007-02-10 14:27:24 UTC (rev 528) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java 2007-02-10 16:42:26 UTC (rev 529) @@ -17,10 +17,7 @@ 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.gui.views.*; import net.sf.magicmap.client.interfaces.*; import net.sf.magicmap.client.meta.MapInfo; import net.sf.magicmap.client.meta.ServerConnectionInfo; @@ -37,6 +34,10 @@ import java.io.PrintWriter; import java.io.StringWriter; import java.rmi.RemoteException; +import java.util.Map; +import java.util.HashMap; +import java.util.Collection; +import java.util.Set; /** * The main GUI window @@ -69,7 +70,7 @@ 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; @@ -167,6 +168,12 @@ AttributeType.TOP, -5)); this.layout.addConstraint("mainpane", AttributeType.TOP, new AttributeConstraint("toolbar", AttributeType.BOTTOM, GUIConstants.DIVIDER_SIZE)); + + viewMap.put("outlineView", outlineView); + viewMap.put("mapPanel", mapPanel); + viewMap.put("mapView", mapView); + viewMap.put("consoleView", consoleView); + } /** @@ -835,5 +842,10 @@ this.statusBar.setInvisible(Controller.getInstance().isInvisible()); Controller.getInstance().connect(MainGUI.this); } - + public JComponent getViewComponent(String name){ + return viewMap.get(name); + } + public Set<String> getViewComponents(){ + return viewMap.keySet(); + } } Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/MapPanel.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/MapPanel.java 2007-02-10 14:27:24 UTC (rev 528) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/MapPanel.java 2007-02-10 16:42:26 UTC (rev 529) @@ -327,23 +327,9 @@ this.renameAction.setEnabled(false); this.propertiesAction.setEnabled(false); menu.addSeparator(); - if (node instanceof InfoObjectNode) { - final InfoObjectNode info = (InfoObjectNode) node; - menu.add(new AbstractAction("Expandieren") { - public void actionPerformed(ActionEvent arg0){ - try { - info.setExpanded(!info.isExpanded()); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - }); - - } - return menu; + // aditilnal + return mapView.getMenuContainer().buildMenu(node, menu); } /* Added: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuAndPredicate.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuAndPredicate.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuAndPredicate.java 2007-02-10 16:42:26 UTC (rev 529) @@ -0,0 +1,23 @@ +package net.sf.magicmap.client.gui.utils.menu; + +import net.sf.magicmap.client.model.node.Node; + +/** + * Class ${class} + * + * @author jan + * @date 10.02.2007 + */ +public class NodeMenuAndPredicate implements NodeMenuPredicate{ + private final NodeMenuPredicate first; + private final NodeMenuPredicate second; + + public NodeMenuAndPredicate (NodeMenuPredicate first, NodeMenuPredicate second){ + + this.first = first; + this.second = second; + } + public boolean show(Node node) { + return first.show(node) && second.show(node); + } +} Added: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuContainer.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuContainer.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuContainer.java 2007-02-10 16:42:26 UTC (rev 529) @@ -0,0 +1,44 @@ +package net.sf.magicmap.client.gui.utils.menu; + +import net.sf.magicmap.client.model.node.Node; + +import javax.swing.*; +import java.util.List; +import java.util.LinkedList; +import java.util.Set; +import java.util.HashSet; + +/** + * Class ${class} + * + * @author jan + * @date 10.02.2007 + */ +public class NodeMenuContainer { + + 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; + } + + public void addNodeMenuItem(Object owner, JMenuItem item){ + this.addNodeMenuItem(owner, item, NodeMenuPredicate.TRUE); + } + public void addNodeMenuItem(Object owner, JMenuItem item, NodeMenuPredicate predicate){ + items.add(new NodeMenuItem(item, predicate)); + } + public JPopupMenu buildMenu(Node node, JPopupMenu menu){ + for (NodeMenuItem item: items){ + if (item.showPredicate.show(node)){ + menu.add(item.item); + } + } + return menu; + } + + public void addSeperator() { + seperators.add(items.get(items.size()-1)); + } +} Added: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuItem.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuItem.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuItem.java 2007-02-10 16:42:26 UTC (rev 529) @@ -0,0 +1,19 @@ +package net.sf.magicmap.client.gui.utils.menu; + +import javax.swing.*; + +/** + * Class ${class} + * + * @author jan + * @date 10.02.2007 + */ +public class NodeMenuItem { + public final JMenuItem item; + public final NodeMenuPredicate showPredicate; + + public NodeMenuItem(JMenuItem item, NodeMenuPredicate predicate){ + this.item = item; + this. showPredicate = predicate; + } +} Added: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuNotPredicate.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuNotPredicate.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuNotPredicate.java 2007-02-10 16:42:26 UTC (rev 529) @@ -0,0 +1,21 @@ +package net.sf.magicmap.client.gui.utils.menu; + +import net.sf.magicmap.client.model.node.Node; + +/** + * Class ${class} + * + * @author jan + * @date 10.02.2007 + */ +public class NodeMenuNotPredicate implements NodeMenuPredicate{ + private final NodeMenuPredicate other; + + public NodeMenuNotPredicate(NodeMenuPredicate other){ + + this.other = other; + } + public boolean show(Node node) { + return !other.show(node); + } +} Added: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuPredicate.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuPredicate.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuPredicate.java 2007-02-10 16:42:26 UTC (rev 529) @@ -0,0 +1,26 @@ +package net.sf.magicmap.client.gui.utils.menu; + +import net.sf.magicmap.client.model.node.Node; + +/** + * Class ${class} + * + * @author jan + * @date 10.02.2007 + */ +public interface NodeMenuPredicate { + + public boolean show(Node node); + + static final NodeMenuPredicate TRUE = new NodeMenuPredicate() { + public boolean show(Node node) { + return true; + } + }; + + static final NodeMenuPredicate FALSE = new NodeMenuPredicate() { + public boolean show(Node node) { + return false; + } + }; +} Added: trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuTypePredicate.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuTypePredicate.java (rev 0) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/utils/menu/NodeMenuTypePredicate.java 2007-02-10 16:42:26 UTC (rev 529) @@ -0,0 +1,21 @@ +package net.sf.magicmap.client.gui.utils.menu; + +import net.sf.magicmap.client.model.node.Node; + +/** + * Class ${class} + * + * @author jan + * @date 10.02.2007 + */ +public class NodeMenuTypePredicate implements NodeMenuPredicate{ + private final int type; + + public NodeMenuTypePredicate(int type){ + + this.type = type; + } + public boolean show(Node node) { + return node != null && node.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-10 14:27:24 UTC (rev 528) +++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/View.java 2007-02-10 16:42:26 UTC (rev 529) @@ -7,6 +7,7 @@ import javax.swing.JComponent; import com.jgoodies.uif_lite.panel.SimpleInternalFrame; +import net.sf.magicmap.client.gui.utils.menu.NodeMenuContainer; /** * Beliebiger View im PACW Client. Ein View greift auf ein Modell @@ -19,9 +20,10 @@ public abstract class View extends SimpleInternalFrame { private JComponent view; + private final NodeMenuContainer menuCOntainer = new NodeMenuContainer(this); + + //private ViewHeader header; - //private ViewHeader header; - public View() { super("Bla"); this.setTitle(getName()); @@ -53,4 +55,7 @@ return new ViewHeader(getName()); } + public NodeMenuContainer getMenuContainer(){ + return menuCOntainer; + } } \ No newline at end of file Modified: trunk/magicmapclient/src/net/sf/magicmap/client/plugin/PluginLoader.java =================================================================== --- trunk/magicmapclient/src/net/sf/magicmap/client/plugin/PluginLoader.java 2007-02-10 14:27:24 UTC (rev 528) +++ trunk/magicmapclient/src/net/sf/magicmap/client/plugin/PluginLoader.java 2007-02-10 16:42:26 UTC (rev 529) @@ -68,6 +68,7 @@ } } } catch (Exception e) { + log.warn("Invalid plugin directory: " + url.toString()); brokenUrlList.add(url); } } Modified: trunk/magicmapserver/magicmapserver.iml =================================================================== --- trunk/magicmapserver/magicmapserver.iml 2007-02-10 14:27:24 UTC (rev 528) +++ trunk/magicmapserver/magicmapserver.iml 2007-02-10 16:42:26 UTC (rev 529) @@ -1,24 +1,307 @@ -<?xml version="1.0" encoding="UTF-8"?> -<module version="4" relativePaths="true" type="JAVA_MODULE"> - <component name="ModuleRootManager" /> - <component name="NewModuleRootManager" inherit-compiler-output="false"> - <output url="file://$MODULE_DIR$/web/WEB-INF/classes" /> - <exclude-output /> - <output-test url="file://$MODULE_DIR$/build-test" /> - <content url="file://$MODULE_DIR$"> - <sourceFolder url="file://$MODULE_DIR$/dblayer/src" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> - </content> - <orderEntry type="inheritedJdk" /> - <orderEntry type="sourceFolder" forTests="false" /> - <orderEntry type="library" exported="" name="server-lib" level="project" /> - <orderEntry type="library" exported="" name="lib-dev" level="project" /> - <orderEntry type="library" name="Groovy from GroovyJ 0.1.8 (Demetra)" level="application" /> - <orderEntryProperties /> - </component> - <component name="VcsManagerConfiguration"> - <option name="ACTIVE_VCS_NAME" value="svn" /> - <option name="USE_PROJECT_VCS" value="false" /> - </component> -</module> - +<?xml version="1.0" encoding="UTF-8"?> +<module version="4" relativePaths="false" type="JAVA_MODULE"> + <component name="ModuleRootManager" /> + <component name="NewModuleRootManager" inherit-compiler-output="false"> + <output url="file://$MODULE_DIR$/target/classes" /> + <exclude-output /> + <output-test url="file://$MODULE_DIR$/target/test-classes" /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/dblayer/src" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> + <excludeFolder url="file://$MODULE_DIR$/target" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://X:/maven/junit/junit/3.8.1/junit-3.8.1.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib.dev/jasper-runtime.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib.dev/jsp-api.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib.dev/servlet-api.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/dom4j-1.6.1.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/forms-1.0.5.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/commons-collections-3.1.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/foxtrot.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/jaxrpc.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/ostermillerutils_1_05_00.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/commons-codec-1.3.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/concurrent.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/colt.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/nekohtml.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/commons-logging.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/jung-1.5.2.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/saaj.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/xmlParserAPIs.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/derby.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/RelativeLayout.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/xercesImpl.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/xml-apis.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/mail.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/jaxen-1.1-beta-9.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/commons-httpclient-3.0-rc3.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/jpox-20041204.032009.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/looks-1.2.2.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/log4j-1.2.8.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/axis.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/activation.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/wsdl4j.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://E:/_Projekte/_Diplomarbeit/_magicmap/magicmap/magicmapclient/lib/commons-discovery.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntryProperties /> + </component> +</module> + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |