Author: kono
Date: 2010-02-16 15:44:38 -0800 (Tue, 16 Feb 2010)
New Revision: 19340
Modified:
csplugins/trunk/ucsd/mes/MCODE3/src/csplugins/mcode/internal/MCODEParameterSet.java
csplugins/trunk/ucsd/mes/MCODE3/src/csplugins/mcode/internal/action/MCODEScoreAndFindAction.java
csplugins/trunk/ucsd/mes/MCODE3/src/csplugins/mcode/internal/ui/MCODEMainPanel.java
Log:
NetworkSelectorPanel is embedded to specify target network for analysis.
Modified:
csplugins/trunk/ucsd/mes/MCODE3/src/csplugins/mcode/internal/MCODEParameterSet.java
===================================================================
---
csplugins/trunk/ucsd/mes/MCODE3/src/csplugins/mcode/internal/MCODEParameterSet.java
2010-02-16 23:02:12 UTC (rev 19339)
+++
csplugins/trunk/ucsd/mes/MCODE3/src/csplugins/mcode/internal/MCODEParameterSet.java
2010-02-16 23:44:38 UTC (rev 19340)
@@ -1,5 +1,7 @@
package csplugins.mcode.internal;
+import cytoscape.CyNetwork;
+
/**
* * Copyright (c) 2004 Memorial Sloan-Kettering Cancer Center
* *
@@ -63,6 +65,7 @@
// result viewing parameters (only used for dialog box of results)
private int defaultRowHeight;
+
/**
* Constructor for the parameter set object. Default parameters are:
scope =
Modified:
csplugins/trunk/ucsd/mes/MCODE3/src/csplugins/mcode/internal/action/MCODEScoreAndFindAction.java
===================================================================
---
csplugins/trunk/ucsd/mes/MCODE3/src/csplugins/mcode/internal/action/MCODEScoreAndFindAction.java
2010-02-16 23:02:12 UTC (rev 19339)
+++
csplugins/trunk/ucsd/mes/MCODE3/src/csplugins/mcode/internal/action/MCODEScoreAndFindAction.java
2010-02-16 23:44:38 UTC (rev 19340)
@@ -2,28 +2,22 @@
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
-import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
-import javax.swing.Icon;
-import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
-import javax.swing.SwingConstants;
-import csplugins.mcode.MCODEPlugin;
import csplugins.mcode.internal.MCODEAlgorithm;
import csplugins.mcode.internal.MCODECurrentParameters;
import csplugins.mcode.internal.MCODEParameterSet;
-import csplugins.mcode.internal.MCODEVisualStyle;
import cytoscape.CyNetwork;
import cytoscape.CyNode;
import cytoscape.Cytoscape;
import cytoscape.task.ui.JTaskConfig;
import cytoscape.task.util.TaskManager;
-import cytoscape.view.CytoscapeDesktop;
-import cytoscape.visual.VisualMappingManager;
+import cytoscape.util.swing.NetworkSelectorPanel;
+import cytoscape.view.NetworkPanel;
/**
* * Copyright (c) 2004 Memorial Sloan-Kettering Cancer Center
@@ -80,11 +74,13 @@
int resultCounter = 0;
- MCODEParameterSet currentParamsCopy;
+ private MCODEParameterSet currentParamsCopy;
+ private NetworkSelectorPanel networkPanel;
- public MCODEScoreAndFindAction(MCODEParameterSet currentParamsCopy) {
+ public MCODEScoreAndFindAction(MCODEParameterSet currentParamsCopy,
NetworkSelectorPanel networkPanel) {
this.currentParamsCopy = currentParamsCopy;
networkManager = new HashMap<String, MCODEAlgorithm>();
+ this.networkPanel = networkPanel;
}
/**
@@ -99,7 +95,7 @@
String callerID = "MCODEScoreAndFindAction.actionPerformed";
String interruptedMessage = "";
// get the network object, this contains the graph
- final CyNetwork network = Cytoscape.getCurrentNetwork();
+ final CyNetwork network = networkPanel.getSelectedNetwork();
if (network == null) {
System.err.println("In " + callerID + ":");
System.err.println("Can't get current network.");
Modified:
csplugins/trunk/ucsd/mes/MCODE3/src/csplugins/mcode/internal/ui/MCODEMainPanel.java
===================================================================
---
csplugins/trunk/ucsd/mes/MCODE3/src/csplugins/mcode/internal/ui/MCODEMainPanel.java
2010-02-16 23:02:12 UTC (rev 19339)
+++
csplugins/trunk/ucsd/mes/MCODE3/src/csplugins/mcode/internal/ui/MCODEMainPanel.java
2010-02-16 23:44:38 UTC (rev 19340)
@@ -1,6 +1,7 @@
package csplugins.mcode.internal.ui;
import java.awt.BorderLayout;
+import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
@@ -30,6 +31,7 @@
import csplugins.mcode.internal.action.MCODEHelpAction;
import csplugins.mcode.internal.action.MCODEScoreAndFindAction;
import cytoscape.Cytoscape;
+import cytoscape.util.swing.NetworkSelectorPanel;
import cytoscape.view.cytopanels.CytoPanel;
/**
@@ -70,7 +72,10 @@
* The parameter change cytpanel which the user can use to select scope and
change the scoring and finding parameters
*/
public class MCODEMainPanel extends JPanel {
- //Parameters for MCODE
+
+ private static final long serialVersionUID = -1193166321778330446L;
+
+ //Parameters for MCODE
MCODEParameterSet currentParamsCopy; // stores current parameters -
populates panel fields
DecimalFormat decFormat; // used in the formatted text fields
@@ -99,13 +104,20 @@
JCheckBox fluffCheckBox;
JFormattedTextField fluffNodeDensityCutOffFormattedTextField;
JFormattedTextField maxDepthFormattedTextField;
-
+
+ private final NetworkSelectorPanel networkPanel;
/**
* The actual parameter change panel that builds the UI
*
*/
public MCODEMainPanel() {
- setLayout(new BorderLayout());
+ // Overall panel settings
+ this.setMinimumSize(new Dimension(310, 420));
+ this.setPreferredSize(new Dimension(310, 420));
+ this.setLayout(new BorderLayout());
+
+ networkPanel = new NetworkSelectorPanel();
+ networkPanel.setBorder(BorderFactory.createTitledBorder("Target
Network"));
//get the current parameters
currentParamsCopy = MCODECurrentParameters.getParamsCopy(null);
@@ -115,9 +127,9 @@
decFormat.setParseIntegerOnly(true);
//create the three main panels: scope, advanced options, and bottom
- JPanel scopePanel = createScopePanel();
- MCODECollapsiblePanel advancedOptionsPanel =
createAdvancedOptionsPanel();
- JPanel bottomPanel = createBottomPanel();
+ final JPanel scopePanel = createScopePanel();
+ final MCODECollapsiblePanel advancedOptionsPanel =
createAdvancedOptionsPanel();
+ final JPanel bottomPanel = createBottomPanel();
//Since the advanced options panel is being added to the center of
this border layout
//it will stretch it's height to fit the main panel. To prevent this
we create an
@@ -145,12 +157,16 @@
* @return panel containing the scope option buttons
*/
private JPanel createScopePanel() {
- JPanel panel = new JPanel();
- panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
+
+
+ final JPanel panel = new JPanel();
+ panel.setLayout(new GridLayout(0,1));
panel.setBorder(BorderFactory.createTitledBorder("Find Cluster(s)"));
+
+ panel.add(networkPanel);
- JRadioButton scopeNetwork = new JRadioButton("in Whole Network",
currentParamsCopy.getScope().equals(MCODEParameterSet.NETWORK));
- JRadioButton scopeSelection = new JRadioButton("from Selection",
currentParamsCopy.getScope().equals(MCODEParameterSet.SELECTION));
+ final JRadioButton scopeNetwork = new JRadioButton("in Whole Network",
currentParamsCopy.getScope().equals(MCODEParameterSet.NETWORK));
+ final JRadioButton scopeSelection = new JRadioButton("from Selection",
currentParamsCopy.getScope().equals(MCODEParameterSet.SELECTION));
scopeNetwork.setActionCommand(MCODEParameterSet.NETWORK);
scopeSelection.setActionCommand(MCODEParameterSet.SELECTION);
@@ -516,7 +532,7 @@
aboutButton.addActionListener(new MCODEAboutAction());
JButton searchButton = new JButton("Search");
- searchButton.addActionListener(new
MCODEScoreAndFindAction(currentParamsCopy));
+ searchButton.addActionListener(new
MCODEScoreAndFindAction(currentParamsCopy, networkPanel));
JButton closeButton = new JButton("Close");
closeButton.addActionListener(new MCODEMainPanel.CloseAction(this));
--
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.