Author: mes
Date: 2011-03-02 16:43:32 -0800 (Wed, 02 Mar 2011)
New Revision: 24300
Added:
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/quickstart/
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/quickstart/LoadNetworkTask.java
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/quickstart/LoadTableTask.java
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/quickstart/QuickStartState.java
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/quickstart/QuickStartTask.java
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/quickstart/QuickStartTaskFactory.java
Modified:
core3/core-task-impl/trunk/src/main/resources/META-INF/spring/bundle-context-osgi.xml
core3/core-task-impl/trunk/src/main/resources/META-INF/spring/bundle-context.xml
Log:
added the beginnings of a quickstart plugin
Added:
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/quickstart/LoadNetworkTask.java
===================================================================
---
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/quickstart/LoadNetworkTask.java
(rev 0)
+++
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/quickstart/LoadNetworkTask.java
2011-03-03 00:43:32 UTC (rev 24300)
@@ -0,0 +1,49 @@
+/*
+ Copyright (c) 2006, The Cytoscape Consortium (www.cytoscape.org)
+
+ The Cytoscape Consortium is:
+ - Institute for Systems Biology
+ - University of California San Diego
+ - Memorial Sloan-Kettering Cancer Center
+ - Institut Pasteur
+ - Agilent Technologies
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License, or
+ any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and
+ documentation provided hereunder is on an "as is" basis, and the
+ Institute for Systems Biology and the Whitehead Institute
+ have no obligations to provide maintenance, support,
+ updates, enhancements or modifications. In no event shall the
+ Institute for Systems Biology and the Whitehead Institute
+ be liable to any party for direct, indirect, special,
+ incidental or consequential damages, including lost profits, arising
+ out of the use of this software and its documentation, even if the
+ Institute for Systems Biology and the Whitehead Institute
+ have been advised of the possibility of such damage. See
+ the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+*/
+
+package org.cytoscape.task.internal.quickstart;
+
+import org.cytoscape.work.AbstractTask;
+import org.cytoscape.work.TaskMonitor;
+
+public class LoadNetworkTask extends AbstractTask {
+
+ public LoadNetworkTask(QuickStartState state) {
+ }
+
+ public void run(TaskMonitor e) {
+ System.out.println("loading network");
+ }
+}
Added:
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/quickstart/LoadTableTask.java
===================================================================
---
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/quickstart/LoadTableTask.java
(rev 0)
+++
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/quickstart/LoadTableTask.java
2011-03-03 00:43:32 UTC (rev 24300)
@@ -0,0 +1,49 @@
+/*
+ Copyright (c) 2006, The Cytoscape Consortium (www.cytoscape.org)
+
+ The Cytoscape Consortium is:
+ - Institute for Systems Biology
+ - University of California San Diego
+ - Memorial Sloan-Kettering Cancer Center
+ - Institut Pasteur
+ - Agilent Technologies
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License, or
+ any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and
+ documentation provided hereunder is on an "as is" basis, and the
+ Institute for Systems Biology and the Whitehead Institute
+ have no obligations to provide maintenance, support,
+ updates, enhancements or modifications. In no event shall the
+ Institute for Systems Biology and the Whitehead Institute
+ be liable to any party for direct, indirect, special,
+ incidental or consequential damages, including lost profits, arising
+ out of the use of this software and its documentation, even if the
+ Institute for Systems Biology and the Whitehead Institute
+ have been advised of the possibility of such damage. See
+ the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+*/
+
+package org.cytoscape.task.internal.quickstart;
+
+import org.cytoscape.work.AbstractTask;
+import org.cytoscape.work.TaskMonitor;
+
+public class LoadTableTask extends AbstractTask {
+
+ public LoadTableTask(QuickStartState state) {
+ }
+
+ public void run(TaskMonitor e) {
+ System.out.println("loading table");
+ }
+}
Added:
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/quickstart/QuickStartState.java
===================================================================
---
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/quickstart/QuickStartState.java
(rev 0)
+++
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/quickstart/QuickStartState.java
2011-03-03 00:43:32 UTC (rev 24300)
@@ -0,0 +1,58 @@
+/*
+ Copyright (c) 2006, The Cytoscape Consortium (www.cytoscape.org)
+
+ The Cytoscape Consortium is:
+ - Institute for Systems Biology
+ - University of California San Diego
+ - Memorial Sloan-Kettering Cancer Center
+ - Institut Pasteur
+ - Agilent Technologies
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License, or
+ any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and
+ documentation provided hereunder is on an "as is" basis, and the
+ Institute for Systems Biology and the Whitehead Institute
+ have no obligations to provide maintenance, support,
+ updates, enhancements or modifications. In no event shall the
+ Institute for Systems Biology and the Whitehead Institute
+ be liable to any party for direct, indirect, special,
+ incidental or consequential damages, including lost profits, arising
+ out of the use of this software and its documentation, even if the
+ Institute for Systems Biology and the Whitehead Institute
+ have been advised of the possibility of such damage. See
+ the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+*/
+
+package org.cytoscape.task.internal.quickstart;
+
+import java.util.Set;
+import java.util.EnumSet;
+import java.util.Collections;
+
+class QuickStartState {
+
+ enum Job {
+ LOAD_NETWORK,
+ LOAD_TABLE,
+ }
+
+ private Set<Job> completedSoFar =
Collections.synchronizedSet(EnumSet.noneOf(Job.class));
+
+ synchronized void finished(Job j) {
+ completedSoFar.add(j);
+ }
+
+ synchronized boolean isFinished() {
+ return (completedSoFar.size() == Job.values().length);
+ }
+}
Added:
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/quickstart/QuickStartTask.java
===================================================================
---
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/quickstart/QuickStartTask.java
(rev 0)
+++
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/quickstart/QuickStartTask.java
2011-03-03 00:43:32 UTC (rev 24300)
@@ -0,0 +1,66 @@
+/*
+ Copyright (c) 2006, The Cytoscape Consortium (www.cytoscape.org)
+
+ The Cytoscape Consortium is:
+ - Institute for Systems Biology
+ - University of California San Diego
+ - Memorial Sloan-Kettering Cancer Center
+ - Institut Pasteur
+ - Agilent Technologies
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License, or
+ any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and
+ documentation provided hereunder is on an "as is" basis, and the
+ Institute for Systems Biology and the Whitehead Institute
+ have no obligations to provide maintenance, support,
+ updates, enhancements or modifications. In no event shall the
+ Institute for Systems Biology and the Whitehead Institute
+ be liable to any party for direct, indirect, special,
+ incidental or consequential damages, including lost profits, arising
+ out of the use of this software and its documentation, even if the
+ Institute for Systems Biology and the Whitehead Institute
+ have been advised of the possibility of such damage. See
+ the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+*/
+
+package org.cytoscape.task.internal.quickstart;
+
+import org.cytoscape.work.Task;
+import org.cytoscape.work.AbstractTask;
+import org.cytoscape.work.TaskMonitor;
+import org.cytoscape.work.Tunable;
+import org.cytoscape.work.util.ListSingleSelection;
+
+public class QuickStartTask extends AbstractTask {
+ private static String optionA = "Load a Network";
+ private static String optionB = "Load an Attribute Table";
+
+// @Tunable(description="What would you like to do today?\nCytoscape
requires at the minimum a network to do anything. A network and attributes
makes life much better. If you don't have a network, that's OK, we'll help you
find one.")
+ @Tunable(description="What would you like to do today?")
+ public ListSingleSelection<String> selection = new
ListSingleSelection<String>(optionA,optionB);
+
+ private final QuickStartState state;
+
+ public QuickStartTask(QuickStartState state) {
+ super();
+ this.state = state;
+ }
+
+ public void run(TaskMonitor e) {
+ String selected = selection.getSelectedValue();
+ if ( selected == optionA )
+ insertTasksAfterCurrentTask( new LoadNetworkTask(state)
);
+ else if ( selected == optionB )
+ insertTasksAfterCurrentTask( new LoadTableTask(state) );
+ }
+}
Added:
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/quickstart/QuickStartTaskFactory.java
===================================================================
---
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/quickstart/QuickStartTaskFactory.java
(rev 0)
+++
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/quickstart/QuickStartTaskFactory.java
2011-03-03 00:43:32 UTC (rev 24300)
@@ -0,0 +1,40 @@
+/*
+ Copyright (c) 2006, 2010, The Cytoscape Consortium (www.cytoscape.org)
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License, or
+ any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and
+ documentation provided hereunder is on an "as is" basis, and the
+ Institute for Systems Biology and the Whitehead Institute
+ have no obligations to provide maintenance, support,
+ updates, enhancements or modifications. In no event shall the
+ Institute for Systems Biology and the Whitehead Institute
+ be liable to any party for direct, indirect, special,
+ incidental or consequential damages, including lost profits, arising
+ out of the use of this software and its documentation, even if the
+ Institute for Systems Biology and the Whitehead Institute
+ have been advised of the possibility of such damage. See
+ the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+*/
+package org.cytoscape.task.internal.quickstart;
+
+
+import org.cytoscape.work.TaskIterator;
+import org.cytoscape.work.TaskFactory;
+
+
+public class QuickStartTaskFactory implements TaskFactory {
+
+ public TaskIterator getTaskIterator() {
+ return new TaskIterator(new QuickStartTask(new
QuickStartState()));
+ }
+}
Modified:
core3/core-task-impl/trunk/src/main/resources/META-INF/spring/bundle-context-osgi.xml
===================================================================
---
core3/core-task-impl/trunk/src/main/resources/META-INF/spring/bundle-context-osgi.xml
2011-03-03 00:27:24 UTC (rev 24299)
+++
core3/core-task-impl/trunk/src/main/resources/META-INF/spring/bundle-context-osgi.xml
2011-03-03 00:43:32 UTC (rev 24300)
@@ -603,4 +603,12 @@
<osgi:service id="deleteTableTaskFactoryService"
ref="deleteTableTaskFactory"
interface="org.cytoscape.task.TableTaskFactory">
</osgi:service>
+
+ <osgi:service id="quickStartTaskFactoryService"
ref="quickStartTaskFactory"
+ interface="org.cytoscape.work.TaskFactory">
+ <osgi:service-properties>
+ <entry key="title" value="QuickStart" />
+ <entry key="scope" value="startup" />
+ </osgi:service-properties>
+ </osgi:service>
</beans>
Modified:
core3/core-task-impl/trunk/src/main/resources/META-INF/spring/bundle-context.xml
===================================================================
---
core3/core-task-impl/trunk/src/main/resources/META-INF/spring/bundle-context.xml
2011-03-03 00:27:24 UTC (rev 24299)
+++
core3/core-task-impl/trunk/src/main/resources/META-INF/spring/bundle-context.xml
2011-03-03 00:43:32 UTC (rev 24300)
@@ -312,4 +312,8 @@
class="org.cytoscape.task.internal.table.DeleteTableTaskFactory">
<constructor-arg ref="cyTableManagerServiceRef" />
</bean>
+
+ <bean id="quickStartTaskFactory"
+
class="org.cytoscape.task.internal.quickstart.QuickStartTaskFactory">
+ </bean>
</beans>
--
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.