Author: mmichaud
Date: 2009-07-28 10:23:29 -0700 (Tue, 28 Jul 2009)
New Revision: 17594
Removed:
core3/work-headless-impl/trunk/src/main/java/org/cytoscape/work/internal/tunables/CLTaskFactory.java
Modified:
core3/work-headless-impl/trunk/src/main/java/org/cytoscape/work/internal/tunables/CLHandlerFactory.java
core3/work-headless-impl/trunk/src/main/java/org/cytoscape/work/internal/tunables/CLTunableInterceptor.java
core3/work-headless-impl/trunk/src/main/java/org/cytoscape/work/internal/tunables/FileCLHandler.java
Log:
add inputstream and url handlers
Modified:
core3/work-headless-impl/trunk/src/main/java/org/cytoscape/work/internal/tunables/CLHandlerFactory.java
===================================================================
---
core3/work-headless-impl/trunk/src/main/java/org/cytoscape/work/internal/tunables/CLHandlerFactory.java
2009-07-28 15:31:35 UTC (rev 17593)
+++
core3/work-headless-impl/trunk/src/main/java/org/cytoscape/work/internal/tunables/CLHandlerFactory.java
2009-07-28 17:23:29 UTC (rev 17594)
@@ -1,8 +1,10 @@
package org.cytoscape.work.internal.tunables;
import java.io.File;
+import java.io.InputStream;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
+import java.net.URL;
import org.cytoscape.work.HandlerFactory;
import org.cytoscape.work.Tunable;
@@ -49,17 +51,21 @@
else if( type == BoundedDouble.class)
return new
BoundedCLHandler<BoundedDouble>(gmethod,smethod,o,tg,ts);
- else if(type == FlexiblyBoundedInteger.class)
+ else if( type == FlexiblyBoundedInteger.class)
return new
FlexiblyBoundedCLHandler<FlexiblyBoundedInteger>(gmethod,smethod,o,tg,ts);
- else if(type == FlexiblyBoundedDouble.class)
+ else if( type == FlexiblyBoundedDouble.class)
return new
FlexiblyBoundedCLHandler<FlexiblyBoundedDouble>(gmethod,smethod,o,tg,ts);
- else if(type == ListSingleSelection.class)
+ else if( type == ListSingleSelection.class)
return new
ListSingleSelectionCLHandler<Object>(gmethod,smethod,o,tg,ts);
- else if(type == ListMultipleSelection.class)
+ else if( type == ListMultipleSelection.class)
return new
ListMultipleSelectionCLHandler<Object>(gmethod,smethod,o,tg,ts);
- else if(type == File.class)
+ else if( type == File.class)
return new FileCLHandler(gmethod,smethod,o,tg,ts);
+ else if( type == URL.class)
+ return new URLCLHandler(gmethod,smethod,o,tg,ts);
+ else if( type == InputStream.class)
+ return new
InputStreamCLHandler(gmethod,smethod,o,tg,ts);
else
return null;
}
@@ -108,6 +114,10 @@
else if ( type == File.class)
return new FileCLHandler(f,o,t);
+ else if ( type == URL.class)
+ return new URLCLHandler(f,o,t);
+ else if( type == InputStream.class)
+ return new InputStreamCLHandler(f,o,t);
else
return null;
}
Deleted:
core3/work-headless-impl/trunk/src/main/java/org/cytoscape/work/internal/tunables/CLTaskFactory.java
===================================================================
---
core3/work-headless-impl/trunk/src/main/java/org/cytoscape/work/internal/tunables/CLTaskFactory.java
2009-07-28 15:31:35 UTC (rev 17593)
+++
core3/work-headless-impl/trunk/src/main/java/org/cytoscape/work/internal/tunables/CLTaskFactory.java
2009-07-28 17:23:29 UTC (rev 17594)
@@ -1,12 +0,0 @@
-package org.cytoscape.work.internal.tunables;
-
-import java.util.Map;
-
-import org.cytoscape.work.TaskFactory;
-
-
-public interface CLTaskFactory{
-
- void addTaskFactory(TaskFactory factory, Map props);
- void removeTaskFactory(TaskFactory factory, Map props);
-}
Modified:
core3/work-headless-impl/trunk/src/main/java/org/cytoscape/work/internal/tunables/CLTunableInterceptor.java
===================================================================
---
core3/work-headless-impl/trunk/src/main/java/org/cytoscape/work/internal/tunables/CLTunableInterceptor.java
2009-07-28 15:31:35 UTC (rev 17593)
+++
core3/work-headless-impl/trunk/src/main/java/org/cytoscape/work/internal/tunables/CLTunableInterceptor.java
2009-07-28 17:23:29 UTC (rev 17594)
@@ -47,7 +47,11 @@
//add an "Help" option
options.addOption("H", "fullHelp", false, "Display all the
available Commands for this Task");
+ if(lh.size()==0)args = new String[0];
+ //for(String st : args)System.out.println(st);
+
+
//Try to parse the command line
CommandLineParser parser = new PosixParser();
CommandLine line = null;
Modified:
core3/work-headless-impl/trunk/src/main/java/org/cytoscape/work/internal/tunables/FileCLHandler.java
===================================================================
---
core3/work-headless-impl/trunk/src/main/java/org/cytoscape/work/internal/tunables/FileCLHandler.java
2009-07-28 15:31:35 UTC (rev 17593)
+++
core3/work-headless-impl/trunk/src/main/java/org/cytoscape/work/internal/tunables/FileCLHandler.java
2009-07-28 17:23:29 UTC (rev 17594)
@@ -35,19 +35,19 @@
for(String st : line.getArgs())System.out.println(st);
try {
- if ( line.hasOption( fc ) ) {
-
if(line.getOptionValue(fc).equals("--cmd")){displayCmds(fc);System.exit(1);}
- if ( f != null ){
- file = new File(line.getOptionValue(fc));
- f.set(o,file);
+ if ( line.hasOption( fc ) ) {
+
if(line.getOptionValue(fc).equals("--cmd")){displayCmds(fc);System.exit(1);}
+ if ( f != null ){
+ file = new
File(line.getOptionValue(fc));
+ f.set(o,file);
+ }
+ else if ( smethod != null ){
+ file = new
File(line.getOptionValue(fc));
+ smethod.invoke(o,file);
+ }
+ else
+ throw new Exception("no Field or Method
to set!");
}
- else if ( smethod != null ){
- file = new File(line.getOptionValue(fc));
- smethod.invoke(o,file);
- }
- else
- throw new Exception("no Field or Method to
set!");
- }
} catch(Exception e) {e.printStackTrace();}
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---