Author: kono
Date: 2011-12-13 14:13:53 -0800 (Tue, 13 Dec 2011)
New Revision: 27782
Modified:
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/creation/CreateNetworkViewTask.java
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/creation/CreateNetworkViewTaskFactory.java
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/layout/ApplyPreferredLayoutTask.java
Log:
TaskMonitor messages had been modified.
Modified:
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/creation/CreateNetworkViewTask.java
===================================================================
---
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/creation/CreateNetworkViewTask.java
2011-12-13 21:53:34 UTC (rev 27781)
+++
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/creation/CreateNetworkViewTask.java
2011-12-13 22:13:53 UTC (rev 27782)
@@ -73,6 +73,7 @@
public void run(TaskMonitor taskMonitor) throws Exception {
taskMonitor.setProgress(0.01d);
+ taskMonitor.setTitle("Creating Network View");
taskMonitor.setStatusMessage("Creating network view...");
final long start = System.currentTimeMillis();
@@ -81,8 +82,9 @@
// By calling this task, actual view will be created
even if it's a
// large network.
final CyNetworkView view =
viewFactory.createNetworkView(network, false);
- taskMonitor.setProgress(0.7d);
+
networkViewManager.addNetworkView(view);
+ taskMonitor.setProgress(0.9d);
// Apply layout only when it is necessary.
if (layouts != null)
@@ -94,9 +96,7 @@
}
if (undoSupport != null)
- undoSupport.postEdit(
- new CreateNetworkViewEdit(eventHelper, network,
viewFactory,
- networkViewManager));
+ undoSupport.postEdit(new
CreateNetworkViewEdit(eventHelper, network, viewFactory, networkViewManager));
taskMonitor.setProgress(1.0d);
taskMonitor.setStatusMessage("Network view successfully create
for: "
Modified:
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/creation/CreateNetworkViewTaskFactory.java
===================================================================
---
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/creation/CreateNetworkViewTaskFactory.java
2011-12-13 21:53:34 UTC (rev 27781)
+++
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/creation/CreateNetworkViewTaskFactory.java
2011-12-13 22:13:53 UTC (rev 27782)
@@ -60,8 +60,12 @@
}
public TaskIterator createTaskIterator() {
- return new TaskIterator(2, new
CreateNetworkViewTask(undoSupport, network, viewFactory,
-
networkViewManager, layouts,
-
eventHelper));
+ // Create visualization + layout (optional)
+ if (layouts == null)
+ return new TaskIterator(1, new
CreateNetworkViewTask(undoSupport, network, viewFactory, networkViewManager,
+ layouts, eventHelper));
+ else
+ return new TaskIterator(2, new
CreateNetworkViewTask(undoSupport, network, viewFactory, networkViewManager,
+ layouts, eventHelper));
}
}
Modified:
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/layout/ApplyPreferredLayoutTask.java
===================================================================
---
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/layout/ApplyPreferredLayoutTask.java
2011-12-13 21:53:34 UTC (rev 27781)
+++
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/layout/ApplyPreferredLayoutTask.java
2011-12-13 22:13:53 UTC (rev 27782)
@@ -69,16 +69,18 @@
this.layouts = layouts;
}
+
+ @Override
public void run(TaskMonitor tm) {
- tm.setProgress(0.0);
+ tm.setProgress(0.0d);
+ tm.setStatusMessage("Applying Default Layout...");
if (undoSupport != null)
- undoSupport.postEdit(new LayoutEdit(eventHelper,
-
view));
+ undoSupport.postEdit(new LayoutEdit(eventHelper, view));
tm.setProgress(0.1);
String pref = CyLayoutAlgorithmManager.DEFAULT_LAYOUT_NAME;
- if(props != null)
+ if (props != null)
pref = props.getProperty("preferredLayoutAlgorithm",
DEF_LAYOUT);
- tm.setProgress(0.2);
+ tm.setProgress(0.2d);
final CyLayoutAlgorithm layout = layouts.getLayout(pref);
if (layout != null) {
--
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.