Author: paperwing
Date: 2012-02-02 14:59:46 -0800 (Thu, 02 Feb 2012)
New Revision: 28187
Modified:
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/rendering/RenderNodesProcedure.java
Log:
fixed node dimension casting error while attempting to interpret an integer as
a double by using the more general Number class when retrieving node dimension
visual properties
Modified:
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/rendering/RenderNodesProcedure.java
===================================================================
---
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/rendering/RenderNodesProcedure.java
2012-02-02 22:20:09 UTC (rev 28186)
+++
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/rendering/RenderNodesProcedure.java
2012-02-02 22:59:46 UTC (rev 28187)
@@ -66,7 +66,7 @@
int hoverNodeIndex =
graphicsData.getSelectionData().getHoverNodeIndex();
float x, y, z;
- float width, height, depth;
+ Number width, height, depth;
int index;
ShapeType shapeType;
@@ -79,12 +79,9 @@
z =
nodeView.getVisualProperty(RichVisualLexicon.NODE_Z_LOCATION)
.floatValue() / distanceScale;
- width =
nodeView.getVisualProperty(MinimalVisualLexicon.NODE_WIDTH)
- .floatValue() / distanceScale;
- height =
nodeView.getVisualProperty(MinimalVisualLexicon.NODE_HEIGHT)
- .floatValue() / distanceScale;
- depth =
nodeView.getVisualProperty(RichVisualLexicon.NODE_DEPTH)
- .floatValue() / distanceScale;
+ width =
nodeView.getVisualProperty(MinimalVisualLexicon.NODE_WIDTH);
+ height =
nodeView.getVisualProperty(MinimalVisualLexicon.NODE_HEIGHT);
+ depth =
nodeView.getVisualProperty(RichVisualLexicon.NODE_DEPTH);
index = nodeView.getModel().getIndex();
@@ -99,10 +96,16 @@
chooseColor(gl, nodeView, graphicsData);
//gl.glCallList(nodeListIndex);
- gl.glScalef(NODE_SIZE_RADIUS * width,
- NODE_SIZE_RADIUS * height,
- NODE_SIZE_RADIUS * depth);
+ gl.glScalef(NODE_SIZE_RADIUS,
+ NODE_SIZE_RADIUS,
+ NODE_SIZE_RADIUS);
+ if (width != null && height != null && depth !=
null) {
+ gl.glScalef(width.floatValue() /
distanceScale,
+ height.floatValue() /
distanceScale,
+ depth.floatValue() /
distanceScale);
+ }
+
shapeType =
cytoscapeShapeMap.get(nodeView.getVisualProperty(RichVisualLexicon.NODE_SHAPE));
if (shapeType != 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.