Author: mes
Date: 2012-06-04 16:44:21 -0700 (Mon, 04 Jun 2012)
New Revision: 29450
Modified:
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DGraphView.java
Log:
Consolidated applyVisualProperty and setVisualProperty to clarify how things
work. Also removed potentially dangerous call to updateView.
Modified:
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DGraphView.java
===================================================================
---
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DGraphView.java
2012-06-04 23:31:56 UTC (rev 29449)
+++
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DGraphView.java
2012-06-04 23:44:21 UTC (rev 29450)
@@ -580,10 +580,6 @@
listener.graphViewChanged(new
GraphViewNodesUnselectedEvent(
this,
makeNodeList(unselectedNodes, this)));
}
-
- // Update the view after listener events are fired
because listeners
- // may change something in the graph.
- updateView();
}
}
@@ -2541,6 +2537,14 @@
protected <T, V extends T> void applyVisualProperty(final
VisualProperty<? extends T> vpOriginal, V value) {
if (value == null)
return;
+
+ //
+ // WARNING!!!!!!!
+ //
+ // No calls to other methods from this method should trigger
calls to updateView().
+ // Allowing this can cause deadlocks! The expectation is that
anyone using
+ // setVisualProperty() should call updateView() themselves.
+ //
final VisualProperty<?> vp = vpOriginal;
@@ -2568,19 +2572,13 @@
setCenter(m_networkCanvas.m_xCenter, y);
} else if (vp == BasicVisualLexicon.NETWORK_SCALE_FACTOR) {
setZoom(((Double) value).doubleValue());
- }
- }
-
- @Override
- public <T, V extends T> void setVisualProperty(final VisualProperty<?
extends T> vp, V value) {
- if (vp == BasicVisualLexicon.NETWORK_WIDTH) {
+ } else if (vp == BasicVisualLexicon.NETWORK_WIDTH) {
m_networkCanvas.setSize(((Double)value).intValue(),
m_networkCanvas.getHeight());
} else if (vp == BasicVisualLexicon.NETWORK_HEIGHT) {
m_networkCanvas.setSize(m_networkCanvas.getWidth(),
((Double)value).intValue());
}
- super.setVisualProperty(vp, value);
}
-
+
@Override
public <T> T getVisualProperty(final VisualProperty<T> vp) {
Object value = 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.