Author: kono
Date: 2012-07-11 14:07:27 -0700 (Wed, 11 Jul 2012)
New Revision: 29841

Added:
   
core3/impl/trunk/network-analyzer-impl/src/main/resources/networkAnalyzer16.png
   
core3/impl/trunk/network-analyzer-impl/src/main/resources/networkAnalyzer24.png
   core3/impl/trunk/network-analyzer-impl/src/test/
   core3/impl/trunk/network-analyzer-impl/src/test/java/
   core3/impl/trunk/network-analyzer-impl/test/
Modified:
   
core3/impl/trunk/network-analyzer-impl/src/main/java/de/mpg/mpi_inf/bioinf/netanalyzer/AnalyzeNetworkAction.java
   
core3/impl/trunk/network-analyzer-impl/src/main/java/de/mpg/mpi_inf/bioinf/netanalyzer/CyActivator.java
   
core3/impl/trunk/network-analyzer-impl/src/main/java/de/mpg/mpi_inf/bioinf/netanalyzer/NetAnalyzerAction.java
Log:
Icon added for NetworkAnalyzer.

Modified: 
core3/impl/trunk/network-analyzer-impl/src/main/java/de/mpg/mpi_inf/bioinf/netanalyzer/AnalyzeNetworkAction.java
===================================================================
--- 
core3/impl/trunk/network-analyzer-impl/src/main/java/de/mpg/mpi_inf/bioinf/netanalyzer/AnalyzeNetworkAction.java
    2012-07-11 19:45:47 UTC (rev 29840)
+++ 
core3/impl/trunk/network-analyzer-impl/src/main/java/de/mpg/mpi_inf/bioinf/netanalyzer/AnalyzeNetworkAction.java
    2012-07-11 21:07:27 UTC (rev 29841)
@@ -19,14 +19,18 @@
 
 
 import java.awt.event.ActionEvent;
+import java.util.Map;
 import java.util.Set;
 
+import javax.swing.ImageIcon;
+
 import org.cytoscape.application.CyApplicationManager;
 import org.cytoscape.application.swing.CySwingApplication;
 import org.cytoscape.model.CyNetwork;
 import org.cytoscape.model.CyNode;
 import org.cytoscape.view.model.CyNetworkViewManager;
 import org.cytoscape.view.vizmap.VisualMappingManager;
+import org.cytoscape.work.ServiceProperties;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import de.mpg.mpi_inf.bioinf.netanalyzer.data.Messages;
@@ -54,8 +58,9 @@
         * Initializes a new instance of <code>AnalyzeNetworkAction</code>.
         */
        public AnalyzeNetworkAction(CyApplicationManager 
appMgr,CySwingApplication swingApp, final CyNetworkViewManager viewManager, 
final VisualStyleBuilder vsBuilder,
-                       final VisualMappingManager vmm) {
-               super(Messages.AC_ANALYZE,appMgr,swingApp);
+                       final VisualMappingManager vmm, final Map<String, 
String> configProps,
+                       final CyNetworkViewManager networkViewManager) {
+               super(Messages.AC_ANALYZE,appMgr,swingApp, configProps, 
networkViewManager);
                this.viewManager = viewManager;
                this.vmm = vmm;
                this.vsBuilder = vsBuilder;

Modified: 
core3/impl/trunk/network-analyzer-impl/src/main/java/de/mpg/mpi_inf/bioinf/netanalyzer/CyActivator.java
===================================================================
--- 
core3/impl/trunk/network-analyzer-impl/src/main/java/de/mpg/mpi_inf/bioinf/netanalyzer/CyActivator.java
     2012-07-11 19:45:47 UTC (rev 29840)
+++ 
core3/impl/trunk/network-analyzer-impl/src/main/java/de/mpg/mpi_inf/bioinf/netanalyzer/CyActivator.java
     2012-07-11 21:07:27 UTC (rev 29841)
@@ -1,30 +1,25 @@
 package de.mpg.mpi_inf.bioinf.netanalyzer;
 
+import static org.cytoscape.work.ServiceProperties.ENABLE_FOR;
+import static org.cytoscape.work.ServiceProperties.ID;
+import static org.cytoscape.work.ServiceProperties.IN_TOOL_BAR;
+import static org.cytoscape.work.ServiceProperties.LARGE_ICON_URL;
+import static org.cytoscape.work.ServiceProperties.MENU_GRAVITY;
+import static org.cytoscape.work.ServiceProperties.PREFERRED_MENU;
+import static org.cytoscape.work.ServiceProperties.SMALL_ICON_URL;
+import static org.cytoscape.work.ServiceProperties.TITLE;
+import static org.cytoscape.work.ServiceProperties.TOOLTIP;
+import static org.cytoscape.work.ServiceProperties.TOOL_BAR_GRAVITY;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import org.cytoscape.application.CyApplicationManager;
+import org.cytoscape.application.swing.CyAction;
 import org.cytoscape.application.swing.CySwingApplication;
-import org.cytoscape.application.CyApplicationManager;
 import org.cytoscape.io.read.CyNetworkReaderManager;
 import org.cytoscape.model.CyNetworkManager;
-
-import de.mpg.mpi_inf.bioinf.netanalyzer.CompareAction;
-import de.mpg.mpi_inf.bioinf.netanalyzer.PlotParameterAction;
-import de.mpg.mpi_inf.bioinf.netanalyzer.MapParameterAction;
-import de.mpg.mpi_inf.bioinf.netanalyzer.RemoveSelfLoopsAction;
-import de.mpg.mpi_inf.bioinf.netanalyzer.ConnComponentAction;
-import de.mpg.mpi_inf.bioinf.netanalyzer.BatchAnalysisAction;
-import de.mpg.mpi_inf.bioinf.netanalyzer.RemDupEdgesAction;
-import de.mpg.mpi_inf.bioinf.netanalyzer.SettingsAction;
-import de.mpg.mpi_inf.bioinf.netanalyzer.AnalyzeSubsetAction;
-import de.mpg.mpi_inf.bioinf.netanalyzer.Plugin;
-import de.mpg.mpi_inf.bioinf.netanalyzer.AboutAction;
-import de.mpg.mpi_inf.bioinf.netanalyzer.LoadNetstatsAction;
-import de.mpg.mpi_inf.bioinf.netanalyzer.AnalyzeNetworkAction;
-import de.mpg.mpi_inf.bioinf.netanalyzer.ui.VisualStyleBuilder;
-
-import org.cytoscape.application.swing.CyAction;
-
-
-import org.osgi.framework.BundleContext;
-
 import org.cytoscape.service.util.AbstractCyActivator;
 import org.cytoscape.task.create.NewNetworkSelectedNodesAndEdgesTaskFatory;
 import org.cytoscape.view.model.CyNetworkViewManager;
@@ -32,8 +27,9 @@
 import org.cytoscape.view.vizmap.VisualMappingManager;
 import org.cytoscape.view.vizmap.VisualStyleFactory;
 import org.cytoscape.work.swing.DialogTaskManager;
+import org.osgi.framework.BundleContext;
 
-import java.util.Properties;
+import de.mpg.mpi_inf.bioinf.netanalyzer.ui.VisualStyleBuilder;
 
 
 
@@ -67,7 +63,19 @@
                
                // Builder object for custom Visual Style
                VisualStyleBuilder vsBuilder = new 
VisualStyleBuilder(vsFactoryServiceRef, passthroughMappingFactoryRef, 
continupousMappingFactoryRef);
-               AnalyzeNetworkAction analyzeNetworkAction = new 
AnalyzeNetworkAction(cyApplicationManagerServiceRef,cySwingApplicationServiceRef,
 viewManagerServiceRef, vsBuilder, vmmServiceRef);
+               
+               Map<String,String> analyzerActionProps = new HashMap<String, 
String>();
+               analyzerActionProps.put(ID,"analyzeNetworkAction");
+               analyzerActionProps.put(PREFERRED_MENU,"Tools.Network 
Analyzer.Network Analysis");
+               analyzerActionProps.put(TITLE,"Analyze Network");
+               analyzerActionProps.put(MENU_GRAVITY,"9.0");
+               analyzerActionProps.put(TOOL_BAR_GRAVITY,"9.8");
+               
analyzerActionProps.put(LARGE_ICON_URL,getClass().getResource("/networkAnalyzer24.png").toString());
+               
analyzerActionProps.put(SMALL_ICON_URL,getClass().getResource("/networkAnalyzer16.png").toString());
+               analyzerActionProps.put(IN_TOOL_BAR,"true");
+               analyzerActionProps.put(TOOLTIP,"Analyze Network");
+               analyzerActionProps.put(ENABLE_FOR, "network");
+               AnalyzeNetworkAction analyzeNetworkAction = new 
AnalyzeNetworkAction(cyApplicationManagerServiceRef,cySwingApplicationServiceRef,
 viewManagerServiceRef, vsBuilder, vmmServiceRef, analyzerActionProps, 
viewManagerServiceRef);
 
                LoadNetstatsAction loadNetstatsAction = new 
LoadNetstatsAction(cyApplicationManagerServiceRef,cySwingApplicationServiceRef, 
viewManagerServiceRef, vsBuilder, vmmServiceRef);
                MapParameterAction mapParameterAction = new 
MapParameterAction(cyApplicationManagerServiceRef,cySwingApplicationServiceRef, 
viewManagerServiceRef, vsBuilder, vmmServiceRef, analyzeNetworkAction);

Modified: 
core3/impl/trunk/network-analyzer-impl/src/main/java/de/mpg/mpi_inf/bioinf/netanalyzer/NetAnalyzerAction.java
===================================================================
--- 
core3/impl/trunk/network-analyzer-impl/src/main/java/de/mpg/mpi_inf/bioinf/netanalyzer/NetAnalyzerAction.java
       2012-07-11 19:45:47 UTC (rev 29840)
+++ 
core3/impl/trunk/network-analyzer-impl/src/main/java/de/mpg/mpi_inf/bioinf/netanalyzer/NetAnalyzerAction.java
       2012-07-11 21:07:27 UTC (rev 29841)
@@ -17,8 +17,10 @@
 
 package de.mpg.mpi_inf.bioinf.netanalyzer;
 
+import java.util.Map;
 
 import org.cytoscape.model.CyNetwork;
+import org.cytoscape.view.model.CyNetworkViewManager;
 import org.cytoscape.application.CyApplicationManager;
 import org.cytoscape.application.swing.AbstractCyAction;
 import org.cytoscape.application.swing.CySwingApplication;
@@ -35,7 +37,7 @@
 
        protected final CySwingApplication swingApp;
        protected final CyApplicationManager applicationManager;
-       
+
        /**
         * Target network for the action.
         */
@@ -54,32 +56,41 @@
                network = null;
        }
 
+       protected NetAnalyzerAction(final String aName, final 
CyApplicationManager appMgr,
+                       final CySwingApplication swingApp, final Map<String, 
String> configProps,
+                       final CyNetworkViewManager networkViewManager) {
+               super(configProps, appMgr, networkViewManager);
+               this.swingApp = swingApp;
+               this.applicationManager = appMgr;
+               network = null;
+       }
+
        /**
         * Finds the network of interest to the user.
         * <p>
-        * In case a network has been identified, the value of the field {@link 
#network} is updated, otherwise
-        * the value of <code>network</code> is set to the empty network or 
<code>null</code>. There are
-        * three possible reasons for the inability to choose a network - (1) 
no network is loaded; (2) there are
-        * two or more networks loaded and none selected; and (3) there is more 
than one network selected. For
-        * each of the two cases above, the method displays an appropriate 
message dialog before exiting and
-        * returning <code>false</code>.
+        * In case a network has been identified, the value of the field
+        * {@link #network} is updated, otherwise the value of 
<code>network</code>
+        * is set to the empty network or <code>null</code>. There are three
+        * possible reasons for the inability to choose a network - (1) no 
network
+        * is loaded; (2) there are two or more networks loaded and none 
selected;
+        * and (3) there is more than one network selected. For each of the two
+        * cases above, the method displays an appropriate message dialog before
+        * exiting and returning <code>false</code>.
         * </p>
         * 
-        * @return <code>true</code> if a network targeting analysis has been 
identified, <code>false</code>
-        *         otherwise.
+        * @return <code>true</code> if a network targeting analysis has been
+        *         identified, <code>false</code> otherwise.
         */
        @SuppressWarnings("fallthrough")
        protected boolean selectNetwork() {
                network = applicationManager.getCurrentNetwork();
-               if ( network == null ) {
-                       
Utils.showErrorBox(swingApp.getJFrame(),Messages.DT_WRONGDATA, 
Messages.SM_LOADNET);
+               if (network == null) {
+                       Utils.showErrorBox(swingApp.getJFrame(), 
Messages.DT_WRONGDATA, Messages.SM_LOADNET);
                        return false;
                }
                return true;
        }
 
-
-
        /**
         * Unique ID for this version of this class. It is used in 
serialization.
         */

Added: 
core3/impl/trunk/network-analyzer-impl/src/main/resources/networkAnalyzer16.png
===================================================================
(Binary files differ)


Property changes on: 
core3/impl/trunk/network-analyzer-impl/src/main/resources/networkAnalyzer16.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: 
core3/impl/trunk/network-analyzer-impl/src/main/resources/networkAnalyzer24.png
===================================================================
(Binary files differ)


Property changes on: 
core3/impl/trunk/network-analyzer-impl/src/main/resources/networkAnalyzer24.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to