Author: pwang
Date: 2009-07-24 16:16:38 -0700 (Fri, 24 Jul 2009)
New Revision: 17564

Modified:
   
csplugins/trunk/soc/chinmoy/phylotree/src/org/cytoscape/phylotree/ui/PhyloFileDialog.java
Log:
Add support for phyloXML format

Modified: 
csplugins/trunk/soc/chinmoy/phylotree/src/org/cytoscape/phylotree/ui/PhyloFileDialog.java
===================================================================
--- 
csplugins/trunk/soc/chinmoy/phylotree/src/org/cytoscape/phylotree/ui/PhyloFileDialog.java
   2009-07-24 22:40:17 UTC (rev 17563)
+++ 
csplugins/trunk/soc/chinmoy/phylotree/src/org/cytoscape/phylotree/ui/PhyloFileDialog.java
   2009-07-24 23:16:38 UTC (rev 17564)
@@ -10,7 +10,7 @@
 
        PhyloTreeImportAction parent;
        File selectedFile = null;
-       String format = "Phylip"; // this is the only supported format for now
+       String format = "phylip"; // default
           /** Creates new form PhyloFileDialog */
     public PhyloFileDialog(PhyloTreeImportAction pParent) {
         super(Cytoscape.getDesktop(), true);
@@ -18,7 +18,7 @@
         initComponents();
         
         buttonGroup1.add(rbtPhylip);
-        buttonGroup1.add(rbtOther);
+        buttonGroup1.add(rbtPhyloXML);
         
         this.setTitle("Select Phylogenetic Tree File");
         this.setSize(400,200);
@@ -42,7 +42,7 @@
         jPanel1 = new javax.swing.JPanel();
         lbFormat = new javax.swing.JLabel();
         rbtPhylip = new javax.swing.JRadioButton();
-        rbtOther = new javax.swing.JRadioButton();
+        rbtPhyloXML = new javax.swing.JRadioButton();
         pnlButtons = new javax.swing.JPanel();
         btnOK = new javax.swing.JButton();
         btnCancel = new javax.swing.JButton();
@@ -85,20 +85,18 @@
         rbtPhylip.setSelected(true);
         rbtPhylip.setText("Phylip");
         rbtPhylip.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 
0, 0));
-        rbtPhylip.setEnabled(false);
         rbtPhylip.setMargin(new java.awt.Insets(0, 0, 0, 0));
         gridBagConstraints = new java.awt.GridBagConstraints();
         gridBagConstraints.gridy = 1;
         gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 20);
         jPanel1.add(rbtPhylip, gridBagConstraints);
 
-        rbtOther.setText("Other");
-        rbtOther.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 
0, 0));
-        rbtOther.setEnabled(false);
-        rbtOther.setMargin(new java.awt.Insets(0, 0, 0, 0));
+        rbtPhyloXML.setText("phyloXML");
+        rbtPhyloXML.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 
0, 0, 0));
+        rbtPhyloXML.setMargin(new java.awt.Insets(0, 0, 0, 0));
         gridBagConstraints = new java.awt.GridBagConstraints();
         gridBagConstraints.gridy = 1;
-        jPanel1.add(rbtOther, gridBagConstraints);
+        jPanel1.add(rbtPhyloXML, gridBagConstraints);
 
         gridBagConstraints = new java.awt.GridBagConstraints();
         gridBagConstraints.gridy = 1;
@@ -135,6 +133,8 @@
         pack();
     }// </editor-fold>                        
 
+    
+    
     private void btnFileActionPerformed(java.awt.event.ActionEvent evt) {      
                                  
        JFileChooser chooser = new JFileChooser(System.getProperty("user.dir"));
                chooser.setAcceptAllFileFilterUsed(false);
@@ -152,9 +152,18 @@
     }                                         
 
     private void btnOKActionPerformed(java.awt.event.ActionEvent evt) {        
                              
+       if (rbtPhyloXML.isSelected()){
+               this.format = "phyloxml";
+       }
+       else if (rbtPhylip.isSelected()){
+               this.format = "phylip";
+       }
+       
        this.dispose();
+       
                parent.ImportTreeFromFile(this.selectedFile, this.format);      
     }                                     
+
     // Variables declaration - do not modify                     
     private javax.swing.JButton btnCancel;
     private javax.swing.JButton btnFile;
@@ -164,8 +173,8 @@
     private javax.swing.JPanel jPanel1;
     private javax.swing.JLabel lbFormat;
     private javax.swing.JPanel pnlButtons;
-    private javax.swing.JRadioButton rbtOther;
     private javax.swing.JRadioButton rbtPhylip;
+    private javax.swing.JRadioButton rbtPhyloXML;
     private javax.swing.JTextField tfFileName;
     // End of variables declaration                   
     


--~--~---------~--~----~------------~-------~--~----~
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