Author: clopes
Date: 2013-01-21 13:37:27 -0800 (Mon, 21 Jan 2013)
New Revision: 31065
Modified:
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/model/converters/XGMMLConverter.as
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/util/GraphUtils.as
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/GraphMediator.as
Log:
Fixed bug #2782 (Child nodes are drawn under edges)
Modified:
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/model/converters/XGMMLConverter.as
===================================================================
---
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/model/converters/XGMMLConverter.as
2013-01-18 22:56:30 UTC (rev 31064)
+++
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/model/converters/XGMMLConverter.as
2013-01-21 21:37:27 UTC (rev 31065)
@@ -626,7 +626,7 @@
if (k.indexOf('cy:') === 0)
v = g.@CY::[k.replace('cy:', '')];
else
- v = g.@[k]
+ v = g.@[k];
if (v[0] != null) {
v = v[0].toString();
Modified:
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/util/GraphUtils.as
===================================================================
--- cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/util/GraphUtils.as
2013-01-18 22:56:30 UTC (rev 31064)
+++ cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/util/GraphUtils.as
2013-01-21 21:37:27 UTC (rev 31065)
@@ -63,21 +63,6 @@
// ========[ PUBLIC METHODS
]===============================================================
/**
- * Brings the given display object to the front of the stage. This
- * function does not taken compound nodes into account. Use
bringToFront
- * function for full compatibility with compound graphs.
- *
- * @param d DisplayObject to bring to front
- */
- public static function toFront(d:DisplayObject):void {
- if (d != null) {
- var p:DisplayObjectContainer = d.parent;
- if (p != null)
- p.setChildIndex(d, p.numChildren-1);
- }
- }
-
- /**
* Brings the given display object to the front of the stage. If the
* given display object is a CompoundNodeSprite, also brings all
* its children and edges inside the compound node to the front.
@@ -86,26 +71,25 @@
*/
public static function bringToFront(d:DisplayObject):void {
if (d != null) {
+ toFront(d);
+
if (d is CompoundNodeSprite) {
var cns:CompoundNodeSprite = d as CompoundNodeSprite;
+ var ns:NodeSprite;
// bring the compound node sprite as well as all its
// children and the edges inside the compound to the front.
- GraphUtils.toFront(cns);
-
if (cns.isInitialized() && !cns.allChildrenInvisible()) {
- for each (var ns:NodeSprite in cns.getNodes()) {
- GraphUtils.toFront(ns);
-
- if (ns is CompoundNodeSprite) {
- GraphUtils.bringToFront(ns as
CompoundNodeSprite);
- }
-
+ for each (ns in cns.getNodes()) {
ns.visitEdges(toFront);
}
+ for each (ns in cns.getNodes()) {
+ if (ns is CompoundNodeSprite)
+ bringToFront(ns);
+ else
+ toFront(ns);
+ }
}
- } else {
- GraphUtils.toFront(d);
}
}
}
@@ -448,5 +432,22 @@
return sorted;
}
+
+ // ========[ PRIVATE METHODS
]==============================================================
+
+ /**
+ * Brings the given display object to the front of the stage. This
+ * function does not taken compound nodes into account. Use
bringToFront
+ * function for full compatibility with compound graphs.
+ *
+ * @param d DisplayObject to bring to front
+ */
+ private static function toFront(d:DisplayObject):void {
+ if (d != null) {
+ var p:DisplayObjectContainer = d.parent;
+ if (p != null)
+ p.setChildIndex(d, p.numChildren-1);
+ }
+ }
}
}
\ No newline at end of file
Modified:
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/GraphMediator.as
===================================================================
--- cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/GraphMediator.as
2013-01-18 22:56:30 UTC (rev 31064)
+++ cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/GraphMediator.as
2013-01-21 21:37:27 UTC (rev 31065)
@@ -400,7 +400,7 @@
if (ds is CompoundNodeSprite) {
parent = ds as CompoundNodeSprite;
- while (parent != null) {trace("update parent >>> " +
parent.data.id);
+ while (parent != null) {
// update the bounds of the compound node
if (parent.nodesCount > 0) {
this.vis.updateCompoundBounds(parent);
--
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.