Author: clopes Date: 2012-01-10 14:24:21 -0800 (Tue, 10 Jan 2012) New Revision: 27969
Modified: csplugins/trunk/toronto/clopes/mcode/README.txt csplugins/trunk/toronto/clopes/mcode/build.xml csplugins/trunk/toronto/clopes/mcode/pom.xml csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/AbstractMCODEAction.java csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/CyActivator.java csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/MCODEAboutAction.java csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/MCODEAnalyzeAction.java csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/MCODECloseAction.java csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/MCODEHelpAction.java csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/MCODEOpenAction.java csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/MCODEVisualStyleAction.java csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/package.html csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/task/MCODEAnalyzeTaskFactory.java csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/util/MCODEUtil.java csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/view/MCODEAboutDialog.java csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/view/MCODEResultsPanel.java Log: Fixed compilation errors due to Cy3 API changes, and replaced "plugin" by "app". Modified: csplugins/trunk/toronto/clopes/mcode/README.txt =================================================================== --- csplugins/trunk/toronto/clopes/mcode/README.txt 2012-01-10 21:51:18 UTC (rev 27968) +++ csplugins/trunk/toronto/clopes/mcode/README.txt 2012-01-10 22:24:21 UTC (rev 27969) @@ -35,8 +35,8 @@ INSTALLATION ================================================================================ -This plugin requires Cytoscape version 3.0 or higher (http://cytoscape.org/). -TODO: explain instalation +This app requires Cytoscape version 3.0 or higher (http://cytoscape.org/). +TODO: explain installation ================================================================================ BUILDING WITH APACHE MAVEN Modified: csplugins/trunk/toronto/clopes/mcode/build.xml =================================================================== --- csplugins/trunk/toronto/clopes/mcode/build.xml 2012-01-10 21:51:18 UTC (rev 27968) +++ csplugins/trunk/toronto/clopes/mcode/build.xml 2012-01-10 22:24:21 UTC (rev 27969) @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<project name="MCODE Plugin" basedir="." default="install"> +<project name="MCODE App - Cytoscape 3" basedir="." default="install"> <!-- This file should be created by each user when he/she needs to override particular values. @@ -14,17 +14,17 @@ <property environment="env"/> <property name="build.dir" value="target"/> - <property name="cytoscape.plugin.dir" value="${cytoscape.home}/plugins"/> + <property name="cytoscape.app.dir" value="${cytoscape.home}/deploy"/> <target name="install"> - <copy todir="${cytoscape.plugin.dir}" overwrite="true"> + <copy todir="${cytoscape.app.dir}" overwrite="true"> <fileset dir="${build.dir}" includes="*.jar"/> </copy> </target> <target name="info"> <echo>*******************************************************************</echo> - <echo>* This script installs the Cytoscape plugin *</echo> + <echo>* This script installs the MCODE Cytoscape app *</echo> <echo>*******************************************************************</echo> </target> Modified: csplugins/trunk/toronto/clopes/mcode/pom.xml =================================================================== --- csplugins/trunk/toronto/clopes/mcode/pom.xml 2012-01-10 21:51:18 UTC (rev 27968) +++ csplugins/trunk/toronto/clopes/mcode/pom.xml 2012-01-10 22:24:21 UTC (rev 27969) @@ -12,8 +12,8 @@ <modelVersion>4.0.0</modelVersion> <groupId>org.cytoscape.mcode</groupId> - <artifactId>mcode-plugin</artifactId> - <version>1.4.0-alpha2-SNAPSHOT</version> + <artifactId>mcode-app</artifactId> + <version>1.4.0-alpha3-SNAPSHOT</version> <name>${bundle.symbolicName} [${bundle.namespace}]</name> @@ -80,6 +80,40 @@ </configuration> </plugin> </plugins> + <pluginManagement> + <plugins> + <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.--> + <plugin> + <groupId>org.eclipse.m2e</groupId> + <artifactId>lifecycle-mapping</artifactId> + <version>1.0.0</version> + <configuration> + <lifecycleMappingMetadata> + <pluginExecutions> + <pluginExecution> + <pluginExecutionFilter> + <groupId>org.ops4j</groupId> + <artifactId> + maven-pax-plugin + </artifactId> + <versionRange> + [1.5,) + </versionRange> + <goals> + <goal>compile</goal> + <goal>testCompile</goal> + </goals> + </pluginExecutionFilter> + <action> + <ignore></ignore> + </action> + </pluginExecution> + </pluginExecutions> + </lifecycleMappingMetadata> + </configuration> + </plugin> + </plugins> + </pluginManagement> </build> <!-- Links to the Cytoscape Maven repositories. --> Modified: csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/AbstractMCODEAction.java =================================================================== --- csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/AbstractMCODEAction.java 2012-01-10 21:51:18 UTC (rev 27968) +++ csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/AbstractMCODEAction.java 2012-01-10 22:24:21 UTC (rev 27969) @@ -16,11 +16,13 @@ private static final long serialVersionUID = 844755168181859513L; protected final CySwingApplication swingApplication; + protected final CyApplicationManager applicationManager; public AbstractMCODEAction(final String name, final CyApplicationManager applicationManager, final CySwingApplication swingApplication) { - super(name, applicationManager); + super(name, applicationManager, "network"); + this.applicationManager = applicationManager; this.swingApplication = swingApplication; } @@ -39,7 +41,7 @@ } /** - * @return The main panel of the plugin if it is opened, and null otherwise + * @return The main panel of the app if it is opened, and null otherwise */ protected MCODEMainPanel getMainPanel() { CytoPanel cytoPanel = getControlCytoPanel(); @@ -54,7 +56,7 @@ } /** - * @return The result panels of the plugin if it is opened, or an empty collection otherwise + * @return The result panels of the app if it is opened, or an empty collection otherwise */ protected Collection<MCODEResultsPanel> getResultPanels() { Collection<MCODEResultsPanel> panels = new ArrayList<MCODEResultsPanel>(); @@ -78,7 +80,7 @@ } /** - * @return true if the plugin is opened and false otherwise + * @return true if the app is opened and false otherwise */ protected boolean isOpened() { return getMainPanel() != null; Modified: csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/CyActivator.java =================================================================== --- csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/CyActivator.java 2012-01-10 21:51:18 UTC (rev 27968) +++ csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/CyActivator.java 2012-01-10 22:24:21 UTC (rev 27969) @@ -1,6 +1,5 @@ package org.cytoscape.mcode.internal; -import java.io.InputStream; import java.util.Properties; import org.cytoscape.application.CyApplicationManager; @@ -14,7 +13,7 @@ import org.cytoscape.model.events.NetworkAboutToBeDestroyedListener; import org.cytoscape.model.events.NetworkAddedListener; import org.cytoscape.model.events.NetworkDestroyedListener; -import org.cytoscape.model.subnetwork.CyRootNetworkFactory; +import org.cytoscape.model.subnetwork.CyRootNetworkManager; import org.cytoscape.service.util.AbstractCyActivator; import org.cytoscape.service.util.CyServiceRegistrar; import org.cytoscape.util.swing.FileUtil; @@ -43,7 +42,7 @@ TaskManager taskManager = getService(bc, TaskManager.class); CyNetworkViewFactory networkViewFactory = getService(bc, CyNetworkViewFactory.class); - CyRootNetworkFactory rootNetworkFactory = getService(bc, CyRootNetworkFactory.class); + CyRootNetworkManager rootNetworkMgr = getService(bc, CyRootNetworkManager.class); CySwingApplication swingApplication = getService(bc, CySwingApplication.class); RenderingEngineFactory<CyNetwork> dingRenderingEngineFactory = getService(bc, RenderingEngineFactory.class, "(id=ding)"); @@ -58,7 +57,7 @@ OpenBrowser openBrowser = getService(bc, OpenBrowser.class); CyEventHelper eventHelper = getService(bc, CyEventHelper.class); - MCODEUtil mcodeUtil = new MCODEUtil(dingRenderingEngineFactory, networkViewFactory, rootNetworkFactory, + MCODEUtil mcodeUtil = new MCODEUtil(dingRenderingEngineFactory, networkViewFactory, rootNetworkMgr, applicationManager, networkMgr, networkViewMgr, visualStyleFactory, visualMappingMgr, swingApplication, eventHelper, discreteMappingFactory, continuousMappingFactory, fileUtil); Modified: csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/MCODEAboutAction.java =================================================================== --- csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/MCODEAboutAction.java 2012-01-10 21:51:18 UTC (rev 27968) +++ csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/MCODEAboutAction.java 2012-01-10 22:24:21 UTC (rev 27969) @@ -62,7 +62,7 @@ super(name, applicationManager, swingApplication); this.openBrowser = openBrowser; this.mcodeUtil = mcodeUtil; - setPreferredMenu("Plugins.MCODE"); + setPreferredMenu("Apps.MCODE"); } @Override Modified: csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/MCODEAnalyzeAction.java =================================================================== --- csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/MCODEAnalyzeAction.java 2012-01-10 21:51:18 UTC (rev 27968) +++ csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/MCODEAnalyzeAction.java 2012-01-10 22:24:21 UTC (rev 27969) @@ -6,7 +6,6 @@ import java.util.Properties; import javax.swing.JOptionPane; -import javax.swing.SwingUtilities; import org.cytoscape.application.CyApplicationManager; import org.cytoscape.application.swing.CySwingApplication; @@ -116,7 +115,7 @@ // This should never happen, because the action should be disabled, // but let's keep this extra check anyway if (network == null) { - JOptionPane.showMessageDialog(swingApplication.getJFrame(), "You must have a network to run this plugin."); + JOptionPane.showMessageDialog(swingApplication.getJFrame(), "You must have a network to run this app."); return; } @@ -133,7 +132,7 @@ List<Integer> selectedNodes = new ArrayList<Integer>(); for (CyNode n : nodes) { - if (n.getCyRow().get(CyNetwork.SELECTED, Boolean.class)) { + if (network.getRow(n).get(CyNetwork.SELECTED, Boolean.class)) { selectedNodes.add(n.getIndex()); } } Modified: csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/MCODECloseAction.java =================================================================== --- csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/MCODECloseAction.java 2012-01-10 21:51:18 UTC (rev 27968) +++ csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/MCODECloseAction.java 2012-01-10 22:24:21 UTC (rev 27969) @@ -21,7 +21,7 @@ import org.cytoscape.service.util.CyServiceRegistrar; /** - * Closes the plugin panels. + * Closes the app panels. */ public class MCODECloseAction extends AbstractMCODEAction implements NetworkAboutToBeDestroyedListener { @@ -38,7 +38,7 @@ super(name, applicationManager, swingApplication); this.registrar = registrar; this.mcodeUtil = mcodeUtil; - setPreferredMenu("Plugins.MCODE"); + setPreferredMenu("Apps.MCODE"); } /** @@ -47,12 +47,12 @@ */ @Override public void actionPerformed(final ActionEvent event) { - //First we must make sure that the plugin is opened + //First we must make sure that the app is opened if (isOpened()) { Collection<MCODEResultsPanel> resultPanels = getResultPanels(); if (resultPanels.size() > 0) { - String message = "You are about to close the MCODE plugin.\nDo you wish to continue?"; + String message = "You are about to close the MCODE app.\nDo you wish to continue?"; int result = JOptionPane.showOptionDialog(swingApplication.getJFrame(), new Object[] { message }, "Confirm", Modified: csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/MCODEHelpAction.java =================================================================== --- csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/MCODEHelpAction.java 2012-01-10 21:51:18 UTC (rev 27968) +++ csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/MCODEHelpAction.java 2012-01-10 22:24:21 UTC (rev 27969) @@ -58,7 +58,7 @@ final OpenBrowser openBrowser) { super(name, applicationManager, swingApplication); this.openBrowser = openBrowser; - setPreferredMenu("Plugins.MCODE"); + setPreferredMenu("Apps.MCODE"); } @Override Modified: csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/MCODEOpenAction.java =================================================================== --- csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/MCODEOpenAction.java 2012-01-10 21:51:18 UTC (rev 27968) +++ csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/MCODEOpenAction.java 2012-01-10 22:24:21 UTC (rev 27969) @@ -12,7 +12,7 @@ import org.cytoscape.service.util.CyServiceRegistrar; /** - * Creates a new menu item under Plugins menu section. + * Creates a new menu item under Apps menu section. */ public class MCODEOpenAction extends AbstractMCODEAction { @@ -32,7 +32,7 @@ this.registrar = registrar; this.analyzeAction = analyzeAction; this.mcodeUtil = mcodeUtil; - setPreferredMenu("Plugins.MCODE"); + setPreferredMenu("Apps.MCODE"); } /** @@ -45,7 +45,7 @@ synchronized (this) { MCODEMainPanel mainPanel = null; - // First we must make sure that the plugin is not already open + // First we must make sure that the app is not already open if (!isOpened()) { mainPanel = new MCODEMainPanel(swingApplication, mcodeUtil); mainPanel.addAction(analyzeAction); Modified: csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/MCODEVisualStyleAction.java =================================================================== --- csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/MCODEVisualStyleAction.java 2012-01-10 21:51:18 UTC (rev 27968) +++ csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/MCODEVisualStyleAction.java 2012-01-10 22:24:21 UTC (rev 27969) @@ -101,17 +101,17 @@ resultsPanel.getClusterBrowserTable().setRowSelectionInterval(selectedRow, selectedRow); } - // Get updated plugin style - VisualStyle pluginStyle = mcodeUtil.getPluginStyle(maxScore); - // Register the plugin style but don't make it active by default - mcodeUtil.registerVisualStyle(pluginStyle); + // Get the updated app's style + VisualStyle appStyle = mcodeUtil.getAppStyle(maxScore); + // Register the app's style but don't make it active by default + mcodeUtil.registerVisualStyle(appStyle); - // Update the network view if there is one and it is using the plugin style + // Update the network view if there is one and it is using the app's style CyNetworkView netView = resultsPanel.getNetworkView(); if (netView != null) { - if (visualMappingMgr.getVisualStyle(netView) == pluginStyle) { - pluginStyle.apply(netView); + if (visualMappingMgr.getVisualStyle(netView) == appStyle) { + appStyle.apply(netView); netView.updateView(); } } Modified: csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/package.html =================================================================== --- csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/package.html 2012-01-10 21:51:18 UTC (rev 27968) +++ csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/package.html 2012-01-10 22:24:21 UTC (rev 27969) @@ -2,6 +2,6 @@ <html> <head></head> <body bgcolor="white"> - Cytoscape PlugIn that clusters a network. Can be used to detect complexes in a molecular interaction network. + Cytoscape app that clusters a network. Can be used to detect complexes in a molecular interaction network. </body> </html> Modified: csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/task/MCODEAnalyzeTaskFactory.java =================================================================== --- csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/task/MCODEAnalyzeTaskFactory.java 2012-01-10 21:51:18 UTC (rev 27968) +++ csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/task/MCODEAnalyzeTaskFactory.java 2012-01-10 22:24:21 UTC (rev 27969) @@ -31,7 +31,7 @@ } @Override - public TaskIterator getTaskIterator() { + public TaskIterator createTaskIterator() { return new TaskIterator(new MCODEAnalyzeTask(network, analyze, resultId, alg, mcodeUtil, listener)); } Modified: csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/util/MCODEUtil.java =================================================================== --- csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/util/MCODEUtil.java 2012-01-10 21:51:18 UTC (rev 27968) +++ csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/util/MCODEUtil.java 2012-01-10 22:24:21 UTC (rev 27969) @@ -24,9 +24,9 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Map; +import java.util.Map.Entry; import java.util.Properties; import java.util.Set; -import java.util.Map.Entry; import javax.swing.JOptionPane; import javax.swing.JPanel; @@ -49,7 +49,7 @@ import org.cytoscape.model.CyRow; import org.cytoscape.model.CyTableEntry; import org.cytoscape.model.subnetwork.CyRootNetwork; -import org.cytoscape.model.subnetwork.CyRootNetworkFactory; +import org.cytoscape.model.subnetwork.CyRootNetworkManager; import org.cytoscape.model.subnetwork.CySubNetwork; import org.cytoscape.util.swing.FileChooserFilter; import org.cytoscape.util.swing.FileUtil; @@ -116,7 +116,7 @@ private final RenderingEngineFactory<CyNetwork> renderingEngineFactory; private final CyNetworkViewFactory networkViewFactory; - private final CyRootNetworkFactory rootNetworkFactory; + private final CyRootNetworkManager rootNetworkMgr; private final CyApplicationManager applicationMgr; private final CyNetworkViewManager networkViewMgr; private final CyNetworkManager networkMgr; @@ -132,7 +132,7 @@ private boolean interrupted; private Image placeHolderImage; private VisualStyle clusterStyle; - private VisualStyle pluginStyle; + private VisualStyle appStyle; private MCODECurrentParameters currentParameters; // Keeps track of networks (id is key) and their respective algorithms private Map<Long, MCODEAlgorithm> networkAlgorithms; @@ -143,7 +143,7 @@ public MCODEUtil(final RenderingEngineFactory<CyNetwork> renderingEngineFactory, final CyNetworkViewFactory networkViewFactory, - final CyRootNetworkFactory rootNetworkFactory, + final CyRootNetworkManager rootNetworkMgr, final CyApplicationManager applicationMgr, final CyNetworkManager networkMgr, final CyNetworkViewManager networkViewMgr, @@ -156,7 +156,7 @@ final FileUtil fileUtil) { this.renderingEngineFactory = renderingEngineFactory; this.networkViewFactory = networkViewFactory; - this.rootNetworkFactory = rootNetworkFactory; + this.rootNetworkMgr = rootNetworkMgr; this.applicationMgr = applicationMgr; this.networkMgr = networkMgr; this.networkViewMgr = networkViewMgr; @@ -402,7 +402,7 @@ JWindow window = new JWindow(); window.getContentPane().add(panel, BorderLayout.CENTER); - RenderingEngine<CyNetwork> re = renderingEngineFactory.getInstance(panel, clusterView); + RenderingEngine<CyNetwork> re = renderingEngineFactory.createRenderingEngine(panel, clusterView); vs.apply(clusterView); clusterView.fitContent(); @@ -430,7 +430,7 @@ } public CySubNetwork createSubNetwork(final CyNetwork net, Collection<CyNode> nodes) { - final CyRootNetwork root = rootNetworkFactory.convert(net); + final CyRootNetwork root = rootNetworkMgr.getRootNetwork(net); final Set<CyEdge> edges = new HashSet<CyEdge>(); for (CyNode n : nodes) { @@ -450,7 +450,7 @@ } public CyNetworkView createNetworkView(final CyNetwork net, VisualStyle vs) { - final CyNetworkView view = networkViewFactory.getNetworkView(net, false); + final CyNetworkView view = networkViewFactory.createNetworkView(net, false); if (vs == null) vs = visualMappingMgr.getDefaultVisualStyle(); visualMappingMgr.setVisualStyle(vs, view); @@ -477,7 +477,7 @@ @SuppressWarnings("unchecked") public VisualStyle getClusterStyle() { if (clusterStyle == null) { - clusterStyle = visualStyleFactory.getInstance("MCODE Cluster"); + clusterStyle = visualStyleFactory.createVisualStyle("MCODE Cluster"); clusterStyle.setDefaultValue(MinimalVisualLexicon.NODE_SIZE, 40.0); clusterStyle.setDefaultValue(MinimalVisualLexicon.NODE_WIDTH, 40.0); @@ -506,30 +506,30 @@ return clusterStyle; } - public VisualStyle getPluginStyle(double maxScore) { - if (pluginStyle == null) { - pluginStyle = visualStyleFactory.getInstance("MCODE"); + public VisualStyle getAppStyle(double maxScore) { + if (appStyle == null) { + appStyle = visualStyleFactory.createVisualStyle("MCODE"); // Node Shape: DiscreteMapping<String, NodeShape> nodeShapeDm = (DiscreteMapping<String, NodeShape>) discreteMappingFactory - .createVisualMappingFunction("MCODE_Node_Status", String.class, RichVisualLexicon.NODE_SHAPE); + .createVisualMappingFunction("MCODE_Node_Status", String.class, null, RichVisualLexicon.NODE_SHAPE); nodeShapeDm.putMapValue("Clustered", NodeShapeVisualProperty.ELLIPSE); nodeShapeDm.putMapValue("Seed", NodeShapeVisualProperty.RECTANGLE); nodeShapeDm.putMapValue("Unclustered", NodeShapeVisualProperty.DIAMOND); - pluginStyle.addVisualMappingFunction(nodeShapeDm); + appStyle.addVisualMappingFunction(nodeShapeDm); } // Node Color: - pluginStyle.setDefaultValue(MinimalVisualLexicon.NODE_FILL_COLOR, Color.WHITE); + appStyle.setDefaultValue(MinimalVisualLexicon.NODE_FILL_COLOR, Color.WHITE); // Important: Always recreate this mapping function with the new score. - pluginStyle.removeVisualMappingFunction(MinimalVisualLexicon.NODE_FILL_COLOR); + appStyle.removeVisualMappingFunction(MinimalVisualLexicon.NODE_FILL_COLOR); // The lower the score the darker the color ContinuousMapping<Double, Paint> nodeColorCm = (ContinuousMapping<Double, Paint>) continuousMappingFactory - .createVisualMappingFunction("MCODE_Score", Double.class, MinimalVisualLexicon.NODE_FILL_COLOR); + .createVisualMappingFunction("MCODE_Score", Double.class, null, MinimalVisualLexicon.NODE_FILL_COLOR); final Color MIN_COLOR = Color.BLACK; final Color MAX_COLOR = Color.RED; @@ -542,9 +542,9 @@ // The max value is set by MCODEVisualStyleAction based on the current result set's max score nodeColorCm.addPoint(maxScore, new BoundaryRangeValues<Paint>(MAX_COLOR, MAX_COLOR, MAX_COLOR)); - pluginStyle.addVisualMappingFunction(nodeColorCm); + appStyle.addVisualMappingFunction(nodeColorCm); - return pluginStyle; + return appStyle; } public VisualStyle getNetworkViewStyle(CyNetworkView view) { @@ -565,7 +565,7 @@ for (final CyTableEntry nodeOrEdge : allElements) { boolean select = elements.contains(nodeOrEdge); - nodeOrEdge.getCyRow().set(CyNetwork.SELECTED, select); + network.getRow(nodeOrEdge).set(CyNetwork.SELECTED, select); } eventHelper.flushPayloadEvents(); @@ -662,7 +662,7 @@ StringBuffer sb = new StringBuffer(); for (CyNode node : network.getNodeList()) { - CyRow row = node.getCyRow(); + CyRow row = network.getRow(node); String id = "" + node.getSUID(); if (row.isSet(CyNetwork.NAME)) { @@ -710,7 +710,7 @@ fout = new FileWriter(file); // Write header - fout.write("MCODE Plugin Results" + lineSep); + fout.write("MCODE App Results" + lineSep); fout.write("Date: " + DateFormat.getDateTimeInstance().format(new Date()) + lineSep + lineSep); fout.write("Parameters:" + lineSep + alg.getParams().toString() + lineSep); fout.write("Cluster Score (Density*#Nodes)\tNodes\tEdges\tNode IDs" + lineSep); Modified: csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/view/MCODEAboutDialog.java =================================================================== --- csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/view/MCODEAboutDialog.java 2012-01-10 21:51:18 UTC (rev 27968) +++ csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/view/MCODEAboutDialog.java 2012-01-10 22:24:21 UTC (rev 27969) @@ -96,14 +96,14 @@ String text = "<html><body>" + logoCode + "<P align=center><b>MCODE (Molecular Complex Detection) v" + version + " (" + buildDate + ")</b><BR>" + - "A Cytoscape PlugIn<BR><BR>" + + "A Cytoscape App<BR><BR>" + "Version " + version + " by <a href='http://www.baderlab.org/'>Bader Lab</a>, University of Toronto<BR>" + "Version 1.2 by Vuk Pavlovic (<a href='http://www.baderlab.org/'>Bader Lab</a>, University of Toronto)<BR>" + "Version 1.1 and 1.0 by Gary Bader (while in the <a href='http://cbio.mskcc.org/'>Sander Lab</a>,<BR>" + "Memorial Sloan-Kettering Cancer Center)<BR><BR>" + - "If you use this plugin in your research, please cite:<BR>" + + "If you use this app in your research, please cite:<BR>" + "Bader GD, Hogue CW<BR>" + "<a href='http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&list_uids=12525261&dopt=Abstract'>An automated method for finding molecular complexes<BR>" + "in large protein interaction networks.</a><BR>" + Modified: csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/view/MCODEResultsPanel.java =================================================================== --- csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/view/MCODEResultsPanel.java 2012-01-10 21:51:18 UTC (rev 27968) +++ csplugins/trunk/toronto/clopes/mcode/src/main/java/org/cytoscape/mcode/internal/view/MCODEResultsPanel.java 2012-01-10 22:24:21 UTC (rev 27969) @@ -424,7 +424,7 @@ for (CyNode n : network.getNodeList()) { int rgi = n.getIndex(); - CyRow row = n.getCyRow(); + CyRow row = network.getRow(n); row.set("MCODE_Node_Status", "Unclustered"); for (int c = 0; c < clusters.length; c++) { @@ -483,7 +483,7 @@ @Override protected CyNetworkView doInBackground() throws Exception { CyNetwork newNetwork = mcodeUtil.createSubNetwork(clusterNetwork, clusterNetwork.getNodeList()); - newNetwork.getCyRow().set(CyNetwork.NAME, title); + newNetwork.getRow(newNetwork).set(CyNetwork.NAME, title); VisualStyle vs = mcodeUtil.getNetworkViewStyle(networkView); CyNetworkView newNetworkView = mcodeUtil.createNetworkView(newNetwork, vs); @@ -763,12 +763,14 @@ // If its the generic 'please select' option then we don't do any enumeration if (!attributeName.equals("Please Select")) { + final CyNetwork net = clusters[selectedRow].getNetwork(); + // Otherwise, we want to get the selected attribute's value for each node in the selected cluster - for (CyNode node : clusters[selectedRow].getNetwork().getNodeList()) { + for (CyNode node : net.getNodeList()) { // The attribute value will be stored as a string no matter // what it is but we need an array list because some attributes are maps or lists of any size ArrayList attributeValues = new ArrayList(); - CyRow row = node.getCyRow(); + CyRow row = net.getRow(node); Class<?> type = row.getTable().getColumn(attributeName).getType(); if (Collection.class.isAssignableFrom(type)) { -- 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.
