Author: scooter
Date: 2009-03-15 14:54:36 -0700 (Sun, 15 Mar 2009)
New Revision: 16276

Modified:
   csplugins/trunk/ucsf/scooter/batchTool/src/batchTool/BatchTool.java
   
csplugins/trunk/ucsf/scooter/batchTool/src/batchTool/commands/ImportCommand.java
Log:
Added Set command



Modified: csplugins/trunk/ucsf/scooter/batchTool/src/batchTool/BatchTool.java
===================================================================
--- csplugins/trunk/ucsf/scooter/batchTool/src/batchTool/BatchTool.java 
2009-03-15 19:00:01 UTC (rev 16275)
+++ csplugins/trunk/ucsf/scooter/batchTool/src/batchTool/BatchTool.java 
2009-03-15 21:54:36 UTC (rev 16276)
@@ -70,6 +70,7 @@
                        addCommand(new LayoutCommand());
                        addCommand(new OpenCommand());
                        addCommand(new SaveCommand());
+                       addCommand(new SetCommand());
                        initialized = true;
                }
 

Modified: 
csplugins/trunk/ucsf/scooter/batchTool/src/batchTool/commands/ImportCommand.java
===================================================================
--- 
csplugins/trunk/ucsf/scooter/batchTool/src/batchTool/commands/ImportCommand.java
    2009-03-15 19:00:01 UTC (rev 16275)
+++ 
csplugins/trunk/ucsf/scooter/batchTool/src/batchTool/commands/ImportCommand.java
    2009-03-15 21:54:36 UTC (rev 16276)
@@ -46,7 +46,7 @@
 
 import batchTool.commands.ParseException;
 
-enum ImportType {NETWORK, EDGE_ATTRIBUTES, NODE_ATTRIBUTES};
+enum ImportType {NETWORK, EDGE_ATTRIBUTES, NODE_ATTRIBUTES, VIZMAP};
 
 /**
  * The open command opens a Cytoscape session file
@@ -87,6 +87,9 @@
                } else if (commpare("node", type, 1) && commpare("attributes", 
args.get(2), 1)) {
                        importType = ImportType.NODE_ATTRIBUTES;
                        fileName = args.get(3);
+               } else if (commpare("vizmap", type, 1)) {
+                       importType = ImportType.VIZMAP;
+                       fileName = args.get(2);
                } else {
                        fileName = args.get(1);
                }
@@ -123,8 +126,8 @@
                        Cytoscape.firePropertyChange(Cytoscape.NETWORK_LOADED, 
null, ret_val);
                } else if (importType == ImportType.EDGE_ATTRIBUTES) {
                        try {
-                               Cytoscape.loadAttributes(new String[] { 
file.getAbsolutePath() },
-                                                       new String[] { });
+                               Cytoscape.loadAttributes(new String[] { },
+                                                       new String[] { 
file.getAbsolutePath() });
                        } catch (Exception e) {
                                throw new ParseException("Failed to read edge 
attributes from: "+
                                                         fileName+": 
"+e.getMessage());
@@ -132,13 +135,16 @@
                        
Cytoscape.firePropertyChange(Cytoscape.ATTRIBUTES_CHANGED, null, null);
                } else if (importType == ImportType.NODE_ATTRIBUTES) {
                        try {
-                               Cytoscape.loadAttributes(new String[] { },
-                                                       new String[] { 
file.getAbsolutePath() });
+                               Cytoscape.loadAttributes(new String[] { 
file.getAbsolutePath() },
+                                                       new String[] { });
                        } catch (Exception e) {
                                throw new ParseException("Failed to read node 
attributes from: "+
                                                         fileName+": 
"+e.getMessage());
                        }
                        
Cytoscape.firePropertyChange(Cytoscape.ATTRIBUTES_CHANGED, null, null);
+               } else if (importType == ImportType.VIZMAP) {
+                       // Firing this event apparently also loads the file
+                       Cytoscape.firePropertyChange(Cytoscape.VIZMAP_LOADED, 
null, file.getAbsolutePath());
                }
 
                return -1;


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