Author: clopes
Date: 2011-10-14 13:39:28 -0700 (Fri, 14 Oct 2011)
New Revision: 27193
Modified:
cytoscapeweb/branches/compound/html-template/js/cytoscapeweb.js
cytoscapeweb/branches/compound/src/org/cytoscapeweb/controller/ApplyLayoutCommand.as
cytoscapeweb/branches/compound/src/org/cytoscapeweb/model/ConfigProxy.as
cytoscapeweb/branches/compound/src/org/cytoscapeweb/view/components/GraphVis.as
Log:
Updated API doc.
Better error for invalid layout names.
Modified: cytoscapeweb/branches/compound/html-template/js/cytoscapeweb.js
===================================================================
--- cytoscapeweb/branches/compound/html-template/js/cytoscapeweb.js
2011-10-14 20:35:08 UTC (rev 27192)
+++ cytoscapeweb/branches/compound/html-template/js/cytoscapeweb.js
2011-10-14 20:39:28 UTC (rev 27193)
@@ -619,7 +619,7 @@
},
/**
- * <p>Get all nodes that belong to another node.</p>
+ * <p>Get all nodes that belong to a compound node.</p>
* @param {Object} parent The parent node object or the parent ID
(String).
* @return {Array} List of {@link org.cytoscapeweb.Node} objects.
* @see org.cytoscapeweb.Visualization#edges
@@ -2681,7 +2681,8 @@
*/
/**
* <p>An object that defines visual styles for nodes.</p>
- * <p>The possible node properties are:</p>
+ * <p>The possible node properties are as follows. Each property can be
prefixed by "compound"
+ * and the first letter of the term is correspondingly capitalized (e.g.
"color" becomes "compoundColor") for compound nodes.</p>
* <ul class="options"><li><code>shape</code> {{@link
org.cytoscapeweb.NodeShape}}: Node shape name. The default value is
"ELLIPSE".</li>
* <li><code>size</code> {Number}: Node size, in pixels.
* It has the same effect of setting
the same value (or mapper) to both <code>width</code> and <code>height</code>.
Modified:
cytoscapeweb/branches/compound/src/org/cytoscapeweb/controller/ApplyLayoutCommand.as
===================================================================
---
cytoscapeweb/branches/compound/src/org/cytoscapeweb/controller/ApplyLayoutCommand.as
2011-10-14 20:35:08 UTC (rev 27192)
+++
cytoscapeweb/branches/compound/src/org/cytoscapeweb/controller/ApplyLayoutCommand.as
2011-10-14 20:39:28 UTC (rev 27193)
@@ -28,8 +28,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package org.cytoscapeweb.controller {
- import mx.utils.StringUtil;
-
+ import org.cytoscapeweb.model.methods.error;
import org.puremvc.as3.interfaces.INotification;
@@ -39,11 +38,15 @@
var layout:Object = notification.getBody();
if (layout != null) {
- // Fisrt, we have to set the new current layout:
- configProxy.currentLayout = layout;
-
- // Then, ask the mediator to apply it:
- graphMediator.applyLayout(configProxy.currentLayout);
+ try {
+ // Fisrt, we have to set the new current layout:
+ configProxy.currentLayout = layout;
+
+ // Then, ask the mediator to apply it:
+ graphMediator.applyLayout(configProxy.currentLayout);
+ } catch (err:Error) {
+ error(err);
+ }
}
}
}
Modified:
cytoscapeweb/branches/compound/src/org/cytoscapeweb/model/ConfigProxy.as
===================================================================
--- cytoscapeweb/branches/compound/src/org/cytoscapeweb/model/ConfigProxy.as
2011-10-14 20:35:08 UTC (rev 27192)
+++ cytoscapeweb/branches/compound/src/org/cytoscapeweb/model/ConfigProxy.as
2011-10-14 20:39:28 UTC (rev 27193)
@@ -40,6 +40,7 @@
import org.cytoscapeweb.model.data.VisualPropertyVO;
import org.cytoscapeweb.model.data.VisualStyleBypassVO;
import org.cytoscapeweb.model.data.VisualStyleVO;
+ import org.cytoscapeweb.model.error.CWError;
import org.cytoscapeweb.util.GraphUtils;
import org.cytoscapeweb.util.Layouts;
import org.puremvc.as3.patterns.proxy.Proxy;
@@ -184,6 +185,7 @@
case Layouts.RADIAL.toLowerCase(): name =
Layouts.RADIAL; break;
case Layouts.TREE.toLowerCase(): name =
Layouts.TREE; break;
case Layouts.COSE.toLowerCase():
name = Layouts.COSE; break;
+ default:
throw new CWError("Invalid layout: " + name);
}
options = Layouts.mergeOptions(name, options);
Modified:
cytoscapeweb/branches/compound/src/org/cytoscapeweb/view/components/GraphVis.as
===================================================================
---
cytoscapeweb/branches/compound/src/org/cytoscapeweb/view/components/GraphVis.as
2011-10-14 20:35:08 UTC (rev 27192)
+++
cytoscapeweb/branches/compound/src/org/cytoscapeweb/view/components/GraphVis.as
2011-10-14 20:39:28 UTC (rev 27193)
@@ -55,6 +55,7 @@
import org.cytoscapeweb.model.data.ConfigVO;
import org.cytoscapeweb.model.data.VisualStyleVO;
+ import org.cytoscapeweb.model.error.CWError;
import org.cytoscapeweb.util.CompoundNodes;
import org.cytoscapeweb.util.Edges;
import org.cytoscapeweb.util.GraphUtils;
@@ -643,6 +644,8 @@
layout = cose;
}
+ if (layout == null) throw new CWError("Invalid layout: " + name);
+
layout.layoutBounds = layoutBounds;
layout.layoutRoot = layoutRoot;
--
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.