Author: ruschein
Date: 2011-02-16 08:59:50 -0800 (Wed, 16 Feb 2011)
New Revision: 24147
Added:
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/AbstractTableCellTask.java
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/AbstractTableColumnTask.java
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/AbstractTableTask.java
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/MapNetworkAttrTask.java
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/TableCellTaskFactory.java
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/TableColumnTaskFactory.java
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/TableTaskFactory.java
Removed:
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/AbstractTableCellTask.java
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/AbstractTableColumnTask.java
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/AbstractTableTask.java
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/MapNetworkAttrTask.java
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/TableCellTaskFactory.java
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/TableColumnTaskFactory.java
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/TableTaskFactory.java
Modified:
core3/core-task-api/trunk/osgi.bnd
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/table/AbstractTableCellTaskFactory.java
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/table/AbstractTableColumnTaskFactory.java
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/table/CopyValueToEntireColumnTask.java
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/table/CopyValueToEntireColumnTaskFactory.java
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/table/DeleteTableTask.java
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/table/DeleteTableTaskFactory.java
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/table/RenameColumnTask.java
Log:
Moved table-related tasks from .../task/table to .../task in core-task-api.
Modified: core3/core-task-api/trunk/osgi.bnd
===================================================================
--- core3/core-task-api/trunk/osgi.bnd 2011-02-16 00:31:51 UTC (rev 24146)
+++ core3/core-task-api/trunk/osgi.bnd 2011-02-16 16:59:50 UTC (rev 24147)
@@ -3,5 +3,5 @@
#-----------------------------------------------------------------
-Export-Package: ${bundle.namespace}, ${bundle.namespace}.*
+Export-Package: ${bundle.namespace}, ${bundle.namespace}.*,
${bundle.namespace}.table.*
Copied:
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/AbstractTableCellTask.java
(from rev 24146,
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/AbstractTableCellTask.java)
===================================================================
---
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/AbstractTableCellTask.java
(rev 0)
+++
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/AbstractTableCellTask.java
2011-02-16 16:59:50 UTC (rev 24147)
@@ -0,0 +1,52 @@
+/*
+ Copyright (c) 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;
+
+
+import org.cytoscape.model.CyColumn;
+import org.cytoscape.work.AbstractTask;
+
+
+/** A base class for Tasks that need to operate on a single CyTable cell. */
+public abstract class AbstractTableCellTask extends AbstractTask {
+ protected final CyColumn column;
+ protected final Object primaryKeyValue;
+
+ /** Initialises a Task that needs to operate on a CyTable cell entry.
+ * @param column a non-null CyColumn
+ * @param primaryKeyValue a non-null primary key value
+ */
+ public AbstractTableCellTask(final CyColumn column, final Object
primaryKeyValue) {
+ if (column == null)
+ throw new NullPointerException("\"column\" parameter
must *never* be null!");
+ this.column = column;
+ if (primaryKeyValue == null)
+ throw new NullPointerException("\"primaryKeyValue\"
parameter must *never* be null!");
+ this.primaryKeyValue = primaryKeyValue;
+ }
+}
\ No newline at end of file
Copied:
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/AbstractTableColumnTask.java
(from rev 24146,
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/AbstractTableColumnTask.java)
===================================================================
---
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/AbstractTableColumnTask.java
(rev 0)
+++
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/AbstractTableColumnTask.java
2011-02-16 16:59:50 UTC (rev 24147)
@@ -0,0 +1,47 @@
+/*
+ Copyright (c) 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;
+
+
+import org.cytoscape.model.CyColumn;
+import org.cytoscape.work.AbstractTask;
+
+
+/** A base class for Tasks that need to operate on an entire CyTable column. */
+public abstract class AbstractTableColumnTask extends AbstractTask {
+ protected final CyColumn column;
+
+ /** Initialises a Task that needs to operate on a CyTable column.
+ * @param column a non-null CyColumn
+ */
+ public AbstractTableColumnTask(final CyColumn column) {
+ if (column == null)
+ throw new NullPointerException("\"column\" parameter
must *never* be null!");
+ this.column = column;
+ }
+}
\ No newline at end of file
Copied:
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/AbstractTableTask.java
(from rev 24146,
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/AbstractTableTask.java)
===================================================================
---
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/AbstractTableTask.java
(rev 0)
+++
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/AbstractTableTask.java
2011-02-16 16:59:50 UTC (rev 24147)
@@ -0,0 +1,47 @@
+/*
+ Copyright (c) 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;
+
+
+import org.cytoscape.model.CyTable;
+import org.cytoscape.work.AbstractTask;
+
+
+/** A base class for Tasks that need to operate on an entire CyTable. */
+public abstract class AbstractTableTask extends AbstractTask {
+ protected final CyTable table;
+
+ /** Initializes a Task that needs to operate on a CyTable.
+ * @param table a non-null CyTable
+ */
+ public AbstractTableTask(CyTable table) {
+ if (table == null)
+ throw new NullPointerException("\"table\" parameter
must *never* be null!");
+ this.table = table;
+ }
+}
\ No newline at end of file
Copied:
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/MapNetworkAttrTask.java
(from rev 24146,
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/MapNetworkAttrTask.java)
===================================================================
---
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/MapNetworkAttrTask.java
(rev 0)
+++
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/MapNetworkAttrTask.java
2011-02-16 16:59:50 UTC (rev 24147)
@@ -0,0 +1,75 @@
+package org.cytoscape.task;
+
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import org.cytoscape.model.CyEdge;
+import org.cytoscape.model.CyNode;
+import org.cytoscape.model.CyNetwork;
+import org.cytoscape.model.CyNetworkManager;
+import org.cytoscape.model.CyTable;
+import org.cytoscape.model.CyTableEntry;
+import org.cytoscape.session.CyApplicationManager;
+import org.cytoscape.work.AbstractTask;
+import org.cytoscape.work.TaskMonitor;
+import org.cytoscape.work.Tunable;
+
+
+public final class MapNetworkAttrTask extends AbstractTask {
+ @Tunable(description="Map to current network only")
+ public boolean currentNetworkOnly = true;
+
+ private final Class<? extends CyTableEntry> type; // Must be node or
edge!
+ private final CyTable newGlobalTable;
+ private final CyNetworkManager networkManager;
+ final private CyApplicationManager applicationManager;
+
+ public MapNetworkAttrTask(final Class<? extends CyTableEntry> type,
final CyTable newGlobalTable,
+ final CyNetworkManager networkManager,
+ final CyApplicationManager applicationManager)
+ {
+ this.type = type;
+ this.newGlobalTable = newGlobalTable;
+ this.networkManager = networkManager;
+ this.applicationManager = applicationManager;
+
+ if (type != CyNode.class && type != CyEdge.class)
+ throw new IllegalArgumentException("\"type\" must be
CyNode.class or CyEdge.class!");
+ }
+
+ public void run(final TaskMonitor taskMonitor) throws Exception {
+ taskMonitor.setTitle("Mapping virtual columns");
+
+ final List<CyTable> targetTables = new ArrayList<CyTable>();
+ if (currentNetworkOnly) {
+ final CyNetwork currentNetwork =
applicationManager.getCurrentNetwork();
+ targetTables.add(type == CyNode.class ?
currentNetwork.getDefaultNodeTable()
+ :
currentNetwork.getDefaultEdgeTable());
+ } else {
+ final Set<CyNetwork> networks =
networkManager.getNetworkSet();
+ for (final CyNetwork network : networks)
+ targetTables.add(type == CyNode.class ?
network.getDefaultNodeTable()
+ :
network.getDefaultEdgeTable());
+ }
+
+ mapAll(targetTables);
+ }
+
+ private void mapAll(final List<CyTable> targetTables) {
+ if (targetTables.isEmpty())
+ return;
+
+ if (newGlobalTable.getPrimaryKey().getType() != String.class)
+ throw new IllegalStateException("The new table's
primary key is not of type String!");
+ final String sourceTableJoinColumn =
newGlobalTable.getPrimaryKey().getName();
+
+ for (final CyTable targetTable : targetTables) {
+ if (cancelled)
+ return;
+ targetTable.addVirtualColumns(newGlobalTable,
sourceTableJoinColumn,
+ CyTableEntry.NAME, false);
+ }
+ }
+}
\ No newline at end of file
Copied:
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/TableCellTaskFactory.java
(from rev 24146,
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/TableCellTaskFactory.java)
===================================================================
---
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/TableCellTaskFactory.java
(rev 0)
+++
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/TableCellTaskFactory.java
2011-02-16 16:59:50 UTC (rev 24147)
@@ -0,0 +1,46 @@
+/*
+ Copyright (c) 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;
+
+
+import org.cytoscape.work.TaskFactory;
+import org.cytoscape.model.CyColumn;
+
+
+/**
+ * The assumption is that setColumnAndPrimaryKey() will be called before
getTask() and that the Task
+ * in question operates on the specified table entry identified by the column
and primary key value.'
+ */
+public interface TableCellTaskFactory extends TaskFactory {
+ /** Used to provision this factory with a {@param CyColumn} and a
primary key that will be
+ * used to create tasks.
+ * @param column a non-null CyColumn
+ * @param primaryKeyValue a non-null primary key value
+ */
+ public void setColumnAndPrimaryKey(final CyColumn column, final Object
primaryKeyValue);
+}
Copied:
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/TableColumnTaskFactory.java
(from rev 24146,
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/TableColumnTaskFactory.java)
===================================================================
---
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/TableColumnTaskFactory.java
(rev 0)
+++
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/TableColumnTaskFactory.java
2011-02-16 16:59:50 UTC (rev 24147)
@@ -0,0 +1,44 @@
+/*
+ Copyright (c) 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;
+
+
+import org.cytoscape.work.TaskFactory;
+import org.cytoscape.model.CyColumn;
+
+
+/**
+ * The assumption is that setColumn() will be called before getTask() and that
the Task in question
+ * operates on the specified CyColumn.
+ */
+public interface TableColumnTaskFactory extends TaskFactory {
+ /** Used to provision this factory with a {@param CyColumn} that will
be used to create tasks.
+ * @param column a non-null CyColumn
+ */
+ public void setColumn(final CyColumn column);
+}
Copied:
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/TableTaskFactory.java
(from rev 24146,
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/TableTaskFactory.java)
===================================================================
---
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/TableTaskFactory.java
(rev 0)
+++
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/TableTaskFactory.java
2011-02-16 16:59:50 UTC (rev 24147)
@@ -0,0 +1,44 @@
+/*
+ Copyright (c) 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;
+
+
+import org.cytoscape.work.TaskFactory;
+import org.cytoscape.model.CyTable;
+
+
+/**
+ * The assumption is that setTable() will be called before getTask() and that
the Task in question
+ * operates on the specified CyTable.
+ */
+public interface TableTaskFactory extends TaskFactory {
+ /** Used to provision this factory with a {@param Cytable} that will be
used to create tasks.
+ * @param table a non-null CyTable
+ */
+ public void setTable(CyTable table);
+}
Deleted:
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/AbstractTableCellTask.java
===================================================================
---
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/AbstractTableCellTask.java
2011-02-16 00:31:51 UTC (rev 24146)
+++
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/AbstractTableCellTask.java
2011-02-16 16:59:50 UTC (rev 24147)
@@ -1,52 +0,0 @@
-/*
- Copyright (c) 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.table;
-
-
-import org.cytoscape.model.CyColumn;
-import org.cytoscape.work.AbstractTask;
-
-
-/** A base class for Tasks that need to operate on a single CyTable cell. */
-public abstract class AbstractTableCellTask extends AbstractTask {
- protected final CyColumn column;
- protected final Object primaryKeyValue;
-
- /** Initialises a Task that needs to operate on a CyTable cell entry.
- * @param column a non-null CyColumn
- * @param primaryKeyValue a non-null primary key value
- */
- public AbstractTableCellTask(final CyColumn column, final Object
primaryKeyValue) {
- if (column == null)
- throw new NullPointerException("\"column\" parameter
must *never* be null!");
- this.column = column;
- if (primaryKeyValue == null)
- throw new NullPointerException("\"primaryKeyValue\"
parameter must *never* be null!");
- this.primaryKeyValue = primaryKeyValue;
- }
-}
\ No newline at end of file
Deleted:
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/AbstractTableColumnTask.java
===================================================================
---
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/AbstractTableColumnTask.java
2011-02-16 00:31:51 UTC (rev 24146)
+++
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/AbstractTableColumnTask.java
2011-02-16 16:59:50 UTC (rev 24147)
@@ -1,47 +0,0 @@
-/*
- Copyright (c) 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.table;
-
-
-import org.cytoscape.model.CyColumn;
-import org.cytoscape.work.AbstractTask;
-
-
-/** A base class for Tasks that need to operate on an entire CyTable column. */
-public abstract class AbstractTableColumnTask extends AbstractTask {
- protected final CyColumn column;
-
- /** Initialises a Task that needs to operate on a CyTable column.
- * @param column a non-null CyColumn
- */
- public AbstractTableColumnTask(final CyColumn column) {
- if (column == null)
- throw new NullPointerException("\"column\" parameter
must *never* be null!");
- this.column = column;
- }
-}
\ No newline at end of file
Deleted:
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/AbstractTableTask.java
===================================================================
---
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/AbstractTableTask.java
2011-02-16 00:31:51 UTC (rev 24146)
+++
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/AbstractTableTask.java
2011-02-16 16:59:50 UTC (rev 24147)
@@ -1,47 +0,0 @@
-/*
- Copyright (c) 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.table;
-
-
-import org.cytoscape.model.CyTable;
-import org.cytoscape.work.AbstractTask;
-
-
-/** A base class for Tasks that need to operate on an entire CyTable. */
-public abstract class AbstractTableTask extends AbstractTask {
- protected final CyTable table;
-
- /** Initializes a Task that needs to operate on a CyTable.
- * @param table a non-null CyTable
- */
- public AbstractTableTask(CyTable table) {
- if (table == null)
- throw new NullPointerException("\"table\" parameter
must *never* be null!");
- this.table = table;
- }
-}
\ No newline at end of file
Deleted:
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/MapNetworkAttrTask.java
===================================================================
---
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/MapNetworkAttrTask.java
2011-02-16 00:31:51 UTC (rev 24146)
+++
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/MapNetworkAttrTask.java
2011-02-16 16:59:50 UTC (rev 24147)
@@ -1,75 +0,0 @@
-package org.cytoscape.task.table;
-
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import org.cytoscape.model.CyEdge;
-import org.cytoscape.model.CyNode;
-import org.cytoscape.model.CyNetwork;
-import org.cytoscape.model.CyNetworkManager;
-import org.cytoscape.model.CyTable;
-import org.cytoscape.model.CyTableEntry;
-import org.cytoscape.session.CyApplicationManager;
-import org.cytoscape.work.AbstractTask;
-import org.cytoscape.work.TaskMonitor;
-import org.cytoscape.work.Tunable;
-
-
-public final class MapNetworkAttrTask extends AbstractTask {
- @Tunable(description="Map to current network only")
- public boolean currentNetworkOnly = true;
-
- private final Class<? extends CyTableEntry> type; // Must be node or
edge!
- private final CyTable newGlobalTable;
- private final CyNetworkManager networkManager;
- final private CyApplicationManager applicationManager;
-
- public MapNetworkAttrTask(final Class<? extends CyTableEntry> type,
final CyTable newGlobalTable,
- final CyNetworkManager networkManager,
- final CyApplicationManager applicationManager)
- {
- this.type = type;
- this.newGlobalTable = newGlobalTable;
- this.networkManager = networkManager;
- this.applicationManager = applicationManager;
-
- if (type != CyNode.class && type != CyEdge.class)
- throw new IllegalArgumentException("\"type\" must be
CyNode.class or CyEdge.class!");
- }
-
- public void run(final TaskMonitor taskMonitor) throws Exception {
- taskMonitor.setTitle("Mapping virtual columns");
-
- final List<CyTable> targetTables = new ArrayList<CyTable>();
- if (currentNetworkOnly) {
- final CyNetwork currentNetwork =
applicationManager.getCurrentNetwork();
- targetTables.add(type == CyNode.class ?
currentNetwork.getDefaultNodeTable()
- :
currentNetwork.getDefaultEdgeTable());
- } else {
- final Set<CyNetwork> networks =
networkManager.getNetworkSet();
- for (final CyNetwork network : networks)
- targetTables.add(type == CyNode.class ?
network.getDefaultNodeTable()
- :
network.getDefaultEdgeTable());
- }
-
- mapAll(targetTables);
- }
-
- private void mapAll(final List<CyTable> targetTables) {
- if (targetTables.isEmpty())
- return;
-
- if (newGlobalTable.getPrimaryKey().getType() != String.class)
- throw new IllegalStateException("The new table's
primary key is not of type String!");
- final String sourceTableJoinColumn =
newGlobalTable.getPrimaryKey().getName();
-
- for (final CyTable targetTable : targetTables) {
- if (cancelled)
- return;
- targetTable.addVirtualColumns(newGlobalTable,
sourceTableJoinColumn,
- CyTableEntry.NAME, false);
- }
- }
-}
\ No newline at end of file
Deleted:
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/TableCellTaskFactory.java
===================================================================
---
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/TableCellTaskFactory.java
2011-02-16 00:31:51 UTC (rev 24146)
+++
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/TableCellTaskFactory.java
2011-02-16 16:59:50 UTC (rev 24147)
@@ -1,46 +0,0 @@
-/*
- Copyright (c) 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.table;
-
-
-import org.cytoscape.work.TaskFactory;
-import org.cytoscape.model.CyColumn;
-
-
-/**
- * The assumption is that setColumnAndPrimaryKey() will be called before
getTask() and that the Task
- * in question operates on the specified table entry identified by the column
and primary key value.'
- */
-public interface TableCellTaskFactory extends TaskFactory {
- /** Used to provision this factory with a {@param CyColumn} and a
primary key that will be
- * used to create tasks.
- * @param column a non-null CyColumn
- * @param primaryKeyValue a non-null primary key value
- */
- public void setColumnAndPrimaryKey(final CyColumn column, final Object
primaryKeyValue);
-}
Deleted:
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/TableColumnTaskFactory.java
===================================================================
---
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/TableColumnTaskFactory.java
2011-02-16 00:31:51 UTC (rev 24146)
+++
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/TableColumnTaskFactory.java
2011-02-16 16:59:50 UTC (rev 24147)
@@ -1,44 +0,0 @@
-/*
- Copyright (c) 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.table;
-
-
-import org.cytoscape.work.TaskFactory;
-import org.cytoscape.model.CyColumn;
-
-
-/**
- * The assumption is that setColumn() will be called before getTask() and that
the Task in question
- * operates on the specified CyColumn.
- */
-public interface TableColumnTaskFactory extends TaskFactory {
- /** Used to provision this factory with a {@param CyColumn} that will
be used to create tasks.
- * @param column a non-null CyColumn
- */
- public void setColumn(final CyColumn column);
-}
Deleted:
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/TableTaskFactory.java
===================================================================
---
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/TableTaskFactory.java
2011-02-16 00:31:51 UTC (rev 24146)
+++
core3/core-task-api/trunk/src/main/java/org/cytoscape/task/table/TableTaskFactory.java
2011-02-16 16:59:50 UTC (rev 24147)
@@ -1,44 +0,0 @@
-/*
- Copyright (c) 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.table;
-
-
-import org.cytoscape.work.TaskFactory;
-import org.cytoscape.model.CyTable;
-
-
-/**
- * The assumption is that setTable() will be called before getTask() and that
the Task in question
- * operates on the specified CyTable.
- */
-public interface TableTaskFactory extends TaskFactory {
- /** Used to provision this factory with a {@param Cytable} that will be
used to create tasks.
- * @param table a non-null CyTable
- */
- public void setTable(CyTable table);
-}
Modified:
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/table/AbstractTableCellTaskFactory.java
===================================================================
---
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/table/AbstractTableCellTaskFactory.java
2011-02-16 00:31:51 UTC (rev 24146)
+++
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/table/AbstractTableCellTaskFactory.java
2011-02-16 16:59:50 UTC (rev 24147)
@@ -30,7 +30,7 @@
import org.cytoscape.work.TaskFactory;
import org.cytoscape.model.CyColumn;
-import org.cytoscape.task.table.TableCellTaskFactory;
+import org.cytoscape.task.TableCellTaskFactory;
/**
Modified:
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/table/AbstractTableColumnTaskFactory.java
===================================================================
---
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/table/AbstractTableColumnTaskFactory.java
2011-02-16 00:31:51 UTC (rev 24146)
+++
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/table/AbstractTableColumnTaskFactory.java
2011-02-16 16:59:50 UTC (rev 24147)
@@ -30,7 +30,7 @@
import org.cytoscape.work.TaskFactory;
import org.cytoscape.model.CyColumn;
-import org.cytoscape.task.table.TableColumnTaskFactory;
+import org.cytoscape.task.TableColumnTaskFactory;
/**
Modified:
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/table/CopyValueToEntireColumnTask.java
===================================================================
---
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/table/CopyValueToEntireColumnTask.java
2011-02-16 00:31:51 UTC (rev 24146)
+++
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/table/CopyValueToEntireColumnTask.java
2011-02-16 16:59:50 UTC (rev 24147)
@@ -33,7 +33,7 @@
import org.cytoscape.model.CyColumn;
import org.cytoscape.model.CyTable;
import org.cytoscape.model.CyRow;
-import org.cytoscape.task.table.AbstractTableCellTask;
+import org.cytoscape.task.AbstractTableCellTask;
import org.cytoscape.work.TaskMonitor;
Modified:
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/table/CopyValueToEntireColumnTaskFactory.java
===================================================================
---
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/table/CopyValueToEntireColumnTaskFactory.java
2011-02-16 00:31:51 UTC (rev 24146)
+++
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/table/CopyValueToEntireColumnTaskFactory.java
2011-02-16 16:59:50 UTC (rev 24147)
@@ -29,7 +29,7 @@
import org.cytoscape.model.CyColumn;
-import org.cytoscape.task.table.AbstractTableCellTask;
+import org.cytoscape.task.AbstractTableCellTask;
import org.cytoscape.work.TaskIterator;
Modified:
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/table/DeleteTableTask.java
===================================================================
---
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/table/DeleteTableTask.java
2011-02-16 00:31:51 UTC (rev 24146)
+++
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/table/DeleteTableTask.java
2011-02-16 16:59:50 UTC (rev 24147)
@@ -27,8 +27,9 @@
*/
package org.cytoscape.task.internal.table;
+
import org.cytoscape.model.CyTable;
-import org.cytoscape.task.table.AbstractTableTask;
+import org.cytoscape.task.AbstractTableTask;
import org.cytoscape.work.TaskMonitor;
import org.cytoscape.model.CyTableManager;
Modified:
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/table/DeleteTableTaskFactory.java
===================================================================
---
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/table/DeleteTableTaskFactory.java
2011-02-16 00:31:51 UTC (rev 24146)
+++
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/table/DeleteTableTaskFactory.java
2011-02-16 16:59:50 UTC (rev 24147)
@@ -28,11 +28,12 @@
package org.cytoscape.task.internal.table;
-import org.cytoscape.task.table.TableTaskFactory;
+import org.cytoscape.task.TableTaskFactory;
import org.cytoscape.work.TaskIterator;
import org.cytoscape.model.CyTable;
import org.cytoscape.model.CyTableManager;
+
public final class DeleteTableTaskFactory implements TableTaskFactory {
protected CyTable table = null;
Modified:
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/table/RenameColumnTask.java
===================================================================
---
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/table/RenameColumnTask.java
2011-02-16 00:31:51 UTC (rev 24146)
+++
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/table/RenameColumnTask.java
2011-02-16 16:59:50 UTC (rev 24147)
@@ -30,7 +30,7 @@
import org.cytoscape.model.CyColumn;
import org.cytoscape.model.CyTable;
-import org.cytoscape.task.table.AbstractTableColumnTask;
+import org.cytoscape.task.AbstractTableColumnTask;
import org.cytoscape.work.TaskMonitor;
import org.cytoscape.work.Tunable;
import org.cytoscape.work.TunableValidator;
--
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.