Author: kono
Date: 2011-05-09 16:34:54 -0700 (Mon, 09 May 2011)
New Revision: 24985
Removed:
core3/viewmodel-impl/trunk/impl/src/main/java/org/cytoscape/view/model/internal/NullCyNetworkView.java
Modified:
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/loadnetwork/AbstractLoadNetworkTask.java
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/CyNetworkView.java
core3/viewmodel-impl/trunk/impl/src/main/java/org/cytoscape/view/model/internal/NetworkViewFactoryImpl.java
core3/viewmodel-impl/trunk/impl/src/main/java/org/cytoscape/view/model/internal/NetworkViewImpl.java
Log:
isEmptyView method removed.
Modified:
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/loadnetwork/AbstractLoadNetworkTask.java
===================================================================
---
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/loadnetwork/AbstractLoadNetworkTask.java
2011-05-09 23:34:32 UTC (rev 24984)
+++
core3/core-task-impl/trunk/src/main/java/org/cytoscape/task/internal/loadnetwork/AbstractLoadNetworkTask.java
2011-05-09 23:34:54 UTC (rev 24985)
@@ -81,7 +81,7 @@
throw new IllegalArgumentException("Could not read
file: Network View Reader is null.");
taskMonitor.setStatusMessage("Reading in Network Data...");
- taskMonitor.setProgress(-1.0);
+ taskMonitor.setProgress(0.0);
taskMonitor.setStatusMessage("Creating Cytoscape Network...");
insertTasksAfterCurrentTask(viewReader, new
GenerateNetworkViewsTask(name, viewReader, networkManager,
@@ -123,21 +123,22 @@
public void run(final TaskMonitor taskMonitor) throws Exception {
- taskMonitor.setProgress(-1.0);
+ taskMonitor.setProgress(0.0);
final CyNetwork[] networks = viewReader.getCyNetworks();
for (CyNetwork network : networks) {
+
network.getCyRow().set(CyTableEntry.NAME,
namingUtil.getSuggestedNetworkTitle(name));
networkManager.addNetwork(network);
final int numGraphObjects = network.getNodeCount() +
network.getEdgeCount();
- if (numGraphObjects < viewThreshold) {
-
networkViewManager.addNetworkView(viewReader.buildCyNetworkView(network));
- // TODO: is this necessary?
- // view.fitContent();
- }
+// if (numGraphObjects < viewThreshold) {
+//
networkViewManager.addNetworkView(viewReader.buildCyNetworkView(network));
+// //view.fitContent();
+// }
+
informUserOfGraphStats(network, numGraphObjects,
taskMonitor);
}
taskMonitor.setProgress(1.0);
Modified:
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/CyNetworkView.java
===================================================================
---
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/CyNetworkView.java
2011-05-09 23:34:32 UTC (rev 24984)
+++
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/CyNetworkView.java
2011-05-09 23:34:54 UTC (rev 24985)
@@ -94,17 +94,6 @@
/**
- * Returns true if this is an empty view object.
- * Usually, the empty view is used when network model is too big to
visualize.
- * {@link CyNetworkViewFactory} checks viewThreshold property value to
create regular
- * view model implementation or empty view model.
- *
- * @return true if this is an empty view model.
- */
- Boolean isEmptyView();
-
-
- /**
* Utility method to fit content to the presentation container (usually
a Swing Window).
* This fires event to the presentation layer for updating presentation.
*/
Modified:
core3/viewmodel-impl/trunk/impl/src/main/java/org/cytoscape/view/model/internal/NetworkViewFactoryImpl.java
===================================================================
---
core3/viewmodel-impl/trunk/impl/src/main/java/org/cytoscape/view/model/internal/NetworkViewFactoryImpl.java
2011-05-09 23:34:32 UTC (rev 24984)
+++
core3/viewmodel-impl/trunk/impl/src/main/java/org/cytoscape/view/model/internal/NetworkViewFactoryImpl.java
2011-05-09 23:34:54 UTC (rev 24985)
@@ -11,13 +11,6 @@
public class NetworkViewFactoryImpl implements CyNetworkViewFactory {
- private final String VIEW_THRESHOLD = "viewThreshold";
-
- /**
- * By default, this value will be used as the View Threshold.
- */
- private static final int DEF_VIEW_THRESHOLD = 3000;
-
private final CyEventHelper eventHelper;
private final CyServiceRegistrar registrar;
private final Properties props;
@@ -58,27 +51,9 @@
return view;
}
- final int viewThreshold = getViewThreshold();
- final int objectCount = network.getEdgeCount() +
network.getNodeCount();
- if (viewThreshold < objectCount)
- view = new NullCyNetworkView(network);
- else {
- view = new NetworkViewImpl(network, eventHelper);
- registrar.registerAllServices(view, new Properties());
- }
+ view = new NetworkViewImpl(network, eventHelper);
+ registrar.registerAllServices(view, new Properties());
return view;
}
-
- private int getViewThreshold() {
- final String vts = props.getProperty(VIEW_THRESHOLD);
- int threshold;
- try {
- threshold = Integer.parseInt(vts);
- } catch (Exception e) {
- threshold = DEF_VIEW_THRESHOLD;
- }
-
- return threshold;
- }
}
Modified:
core3/viewmodel-impl/trunk/impl/src/main/java/org/cytoscape/view/model/internal/NetworkViewImpl.java
===================================================================
---
core3/viewmodel-impl/trunk/impl/src/main/java/org/cytoscape/view/model/internal/NetworkViewImpl.java
2011-05-09 23:34:32 UTC (rev 24984)
+++
core3/viewmodel-impl/trunk/impl/src/main/java/org/cytoscape/view/model/internal/NetworkViewImpl.java
2011-05-09 23:34:54 UTC (rev 24985)
@@ -193,10 +193,4 @@
cyEventHelper.getMicroListener(NetworkViewChangeMicroListener.class,
this).networkVisualPropertySet(this, vp, value);
}
-
- @Override
- public Boolean isEmptyView() {
- return false;
- }
-
}
Deleted:
core3/viewmodel-impl/trunk/impl/src/main/java/org/cytoscape/view/model/internal/NullCyNetworkView.java
===================================================================
---
core3/viewmodel-impl/trunk/impl/src/main/java/org/cytoscape/view/model/internal/NullCyNetworkView.java
2011-05-09 23:34:32 UTC (rev 24984)
+++
core3/viewmodel-impl/trunk/impl/src/main/java/org/cytoscape/view/model/internal/NullCyNetworkView.java
2011-05-09 23:34:54 UTC (rev 24985)
@@ -1,112 +0,0 @@
-package org.cytoscape.view.model.internal;
-
-import java.util.Collection;
-
-import org.cytoscape.model.CyEdge;
-import org.cytoscape.model.CyNetwork;
-import org.cytoscape.model.CyNode;
-import org.cytoscape.model.CyTableEntry;
-import org.cytoscape.model.SUIDFactory;
-import org.cytoscape.view.model.CyNetworkView;
-import org.cytoscape.view.model.View;
-import org.cytoscape.view.model.VisualProperty;
-
-/**
- * Null object for CyNetworkView.
- *
- * Network readers may return this null object.
- *
- */
-public final class NullCyNetworkView implements CyNetworkView {
-
- private final long suid;
- private final CyNetwork model;
-
- public NullCyNetworkView(final CyNetwork model) {
- this.model = model;
- this.suid = SUIDFactory.getNextSUID();
- }
-
- @Override
- public CyNetwork getModel() {
- return model;
- }
-
- @Override
- public long getSUID() {
- return suid;
- }
-
- // All of the methods below are dummy.
-
- @Override
- public <T, V extends T> void setVisualProperty(VisualProperty<? extends T>
vp, V value) {
- throw new UnsupportedOperationException("This is a null object and does
not support this method.");
- }
-
- @Override
- public <T> T getVisualProperty(VisualProperty<T> vp) {
- throw new UnsupportedOperationException("This is a null object and does
not support this method.");
- }
-
- @Override
- public <T, V extends T> void setLockedValue(VisualProperty<? extends T>
vp, V value) {
- throw new UnsupportedOperationException("This is a null object and does
not support this method.");
- }
-
- @Override
- public boolean isValueLocked(VisualProperty<?> vp) {
- throw new UnsupportedOperationException("This is a null object and does
not support this method.");
- }
-
- @Override
- public void clearValueLock(VisualProperty<?> vp) {
- throw new UnsupportedOperationException("This is a null object and does
not support this method.");
- }
-
- @Override
- public View<CyNode> getNodeView(CyNode node) {
- throw new UnsupportedOperationException("This is a null object and does
not support this method.");
- }
-
- @Override
- public Collection<View<CyNode>> getNodeViews() {
- throw new UnsupportedOperationException("This is a null object and does
not support this method.");
- }
-
- @Override
- public View<CyEdge> getEdgeView(CyEdge edge) {
- throw new UnsupportedOperationException("This is a null object and does
not support this method.");
- }
-
- @Override
- public Collection<View<CyEdge>> getEdgeViews() {
- throw new UnsupportedOperationException("This is a null object and does
not support this method.");
- }
-
- @Override
- public Collection<View<? extends CyTableEntry>> getAllViews() {
- throw new UnsupportedOperationException("This is a null object and does
not support this method.");
- }
-
- @Override
- public void fitContent() {
- throw new UnsupportedOperationException("This is a null object and does
not support this method.");
- }
-
- @Override
- public void fitSelected() {
- throw new UnsupportedOperationException("This is a null object and does
not support this method.");
- }
-
- @Override
- public void updateView() {
- throw new UnsupportedOperationException("This is a null object and does
not support this method.");
- }
-
- @Override
- public Boolean isEmptyView() {
- return true;
- }
-
-}
--
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.