Author: clopes
Date: 2012-07-13 08:44:21 -0700 (Fri, 13 Jul 2012)
New Revision: 29887
Modified:
cytoscapeweb/trunk/cytoscapeweb/src-test/org/cytoscapeweb/util/VisualPropertiesTest.as
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/components/GraphVis.as
Log:
Fixed bug #2733: Visual property "compoundTooltipText" does not work
Modified:
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/components/GraphVis.as
===================================================================
---
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/components/GraphVis.as
2012-07-13 00:11:54 UTC (rev 29886)
+++
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/components/GraphVis.as
2012-07-13 15:44:21 UTC (rev 29887)
@@ -721,15 +721,16 @@
private function formatNodeTooltip(node:NodeSprite,
tooltip:TextSprite):void {
var data:Object = node.data;
+ var compound:Boolean = (node is CompoundNodeSprite) &&
(CompoundNodeSprite(node)).nodesCount > 0;
- var font:String =
_style.getValue(VisualProperties.NODE_TOOLTIP_FONT, data);
- var color:uint =
_style.getValue(VisualProperties.NODE_TOOLTIP_COLOR, data);
- var size:Number =
_style.getValue(VisualProperties.NODE_TOOLTIP_FONT_SIZE, data);
- var template:String =
_style.getValue(VisualProperties.NODE_TOOLTIP_TEXT, data);
+ var font:String = _style.getValue(compound ?
VisualProperties.C_NODE_TOOLTIP_FONT : VisualProperties.NODE_TOOLTIP_FONT,
data);
+ var color:uint = _style.getValue(compound ?
VisualProperties.C_NODE_TOOLTIP_COLOR : VisualProperties.NODE_TOOLTIP_COLOR,
data);
+ var size:Number = _style.getValue(compound ?
VisualProperties.C_NODE_TOOLTIP_FONT_SIZE :
VisualProperties.NODE_TOOLTIP_FONT_SIZE, data);
+ var template:String = _style.getValue(compound ?
VisualProperties.C_NODE_TOOLTIP_TEXT : VisualProperties.NODE_TOOLTIP_TEXT,
data);
tooltip.htmlText = formatTooltipContent(data, template, font,
color, size);
- tooltip.textField.backgroundColor =
_style.getValue(VisualProperties.NODE_TOOLTIP_BACKGROUND_COLOR, data);
- tooltip.textField.borderColor =
_style.getValue(VisualProperties.NODE_TOOLTIP_BORDER_COLOR, data);
+ tooltip.textField.backgroundColor = _style.getValue(compound ?
VisualProperties.C_NODE_TOOLTIP_BACKGROUND_COLOR :
VisualProperties.NODE_TOOLTIP_BACKGROUND_COLOR, data);
+ tooltip.textField.borderColor = _style.getValue(compound ?
VisualProperties.C_NODE_TOOLTIP_BORDER_COLOR :
VisualProperties.NODE_TOOLTIP_BORDER_COLOR, data);
}
private function formatTooltipContent(data:Object, template:String,
font:String, color:uint, size:Number):String {
Modified:
cytoscapeweb/trunk/cytoscapeweb/src-test/org/cytoscapeweb/util/VisualPropertiesTest.as
===================================================================
---
cytoscapeweb/trunk/cytoscapeweb/src-test/org/cytoscapeweb/util/VisualPropertiesTest.as
2012-07-13 00:11:54 UTC (rev 29886)
+++
cytoscapeweb/trunk/cytoscapeweb/src-test/org/cytoscapeweb/util/VisualPropertiesTest.as
2012-07-13 15:44:21 UTC (rev 29887)
@@ -68,6 +68,11 @@
assertEquals(null,
VisualProperties.parseValue(VisualProperties.NODE_TOOLTIP_TEXT, null));
assertEquals(null,
VisualProperties.parseValue(VisualProperties.NODE_TOOLTIP_TEXT, undefined));
+ assertEquals("1.15",
VisualProperties.parseValue(VisualProperties.C_NODE_TOOLTIP_TEXT, 1.15));
+ assertEquals(" ",
VisualProperties.parseValue(VisualProperties.C_NODE_TOOLTIP_TEXT, " "));
+ assertEquals(null,
VisualProperties.parseValue(VisualProperties.C_NODE_TOOLTIP_TEXT, null));
+ assertEquals(null,
VisualProperties.parseValue(VisualProperties.C_NODE_TOOLTIP_TEXT, undefined));
+
assertEquals(NodeShapes.ELLIPSE,
VisualProperties.parseValue(VisualProperties.NODE_SHAPE, 0));
assertEquals(NodeShapes.ELLIPSE,
VisualProperties.parseValue(VisualProperties.NODE_SHAPE, "NotAShape!"));
assertEquals(NodeShapes.ELLIPSE,
VisualProperties.parseValue(VisualProperties.NODE_SHAPE, ""));
--
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.