Author: pwang
Date: 2009-12-03 14:54:32 -0800 (Thu, 03 Dec 2009)
New Revision: 18648

Modified:
   cytoscape/trunk/src/cytoscape/dialogs/SetNestedNetworkDialog.java
Log:
Add new constructor and new method

Modified: cytoscape/trunk/src/cytoscape/dialogs/SetNestedNetworkDialog.java
===================================================================
--- cytoscape/trunk/src/cytoscape/dialogs/SetNestedNetworkDialog.java   
2009-12-03 22:31:28 UTC (rev 18647)
+++ cytoscape/trunk/src/cytoscape/dialogs/SetNestedNetworkDialog.java   
2009-12-03 22:54:32 UTC (rev 18648)
@@ -59,8 +59,17 @@
        NodeView nodeView;
        
        public SetNestedNetworkDialog(JFrame parent, boolean modal, NodeView 
nodeView) {
-        super(parent, "Set Nested Network for " + 
nodeView.getNode().getIdentifier(), modal);
-        this.nodeView = nodeView;
+               super(parent, "Set Nested Network for " + 
nodeView.getNode().getIdentifier(), modal);
+               init(nodeView);
+       }
+       
+       public SetNestedNetworkDialog(JFrame parent, boolean modal) {
+               super(parent, "Set Nested Network for new node", modal);
+               init(null);
+       }
+       
+       private void init(NodeView nodeView){
+               this.nodeView = nodeView;
         
         initComponents();
         this.lstNetwork.addListSelectionListener(this);
@@ -79,9 +88,10 @@
         
         this.lstNetwork.setListData(networkArray);
         
-               setSize(new java.awt.Dimension(500, 300));
+               setSize(new java.awt.Dimension(500, 300));                      
        
        }
-
+       
+       
     /** This method is called from within the constructor to
      * initialize the form.
      * WARNING: Do NOT modify this code. The content of this method is
@@ -159,10 +169,17 @@
     private javax.swing.JPanel pnlButtons;
     // End of variables declaration                   
        
+    private CyNetwork selectedNetwork = null;
     
+    public CyNetwork getSelectedNetwork(){
+       return selectedNetwork;
+    }
+    
     private void btnOKActionPerformed(java.awt.event.ActionEvent evt) {        
                              
-       CyNetwork selectedNetwork = (CyNetwork) 
this.lstNetwork.getSelectedValue();
-       this.nodeView.getNode().setNestedNetwork(selectedNetwork);
+       selectedNetwork = (CyNetwork) this.lstNetwork.getSelectedValue();
+       if (this.nodeView != null) {
+               this.nodeView.getNode().setNestedNetwork(selectedNetwork);      
        
+       }
        this.dispose();
     }                                     
 

--

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