I want to add tooltips for nodes and edges based on properties.
The edge tool tip works fine, the node tool tips don't work at all
(although there is a ca. 4px black dot drawn).
Neither show up in the VizMapper window, but I don't really care
about that. I asssume I need to add the calculator to the thingy for
that.
I tried several node attributes including ID, canonicalName, etc.
with no results.
Any ideas? Am I missing something? Is this a bug?
--- snippet follows ---
VisualMappingManager vmm =
Cytoscape.getVisualMappingManager();
...
String eTTName = "Edge Name TT";
PassThroughMapping edgeTTMapping = new PassThroughMapping
("", "interaction");
Calculator ettc = vmm.getCalculatorCatalog().getCalculator
(VisualPropertyType.EDGE_TOOLTIP, eTTName);
if (ettc == null) {
System.out.println("Edge Tooltip Calculator rehacking");
ettc = new BasicCalculator(eTTName, edgeTTMapping,
VisualPropertyType.EDGE_TOOLTIP);
}
String nTTName = "Node GO TT";
PassThroughMapping nodeTTMapping = new PassThroughMapping
("", "canonicalName"); // this must match attribute set in XGMML file
Calculator nttc = vmm.getCalculatorCatalog().getCalculator
(VisualPropertyType.NODE_TOOLTIP, nTTName);
if (nttc == null) {
System.out.println("Node Tooltip Calculator rehacking");
nttc = new BasicCalculator(nTTName, nodeTTMapping,
VisualPropertyType.NODE_TOOLTIP);
}
eac.setCalculator(ettc);
eac.setCalculator(nttc);
vmm.applyAppearances();
view.redrawGraph(true, true);
--
Ben Hitz
Senior Scientific Programmer ** Saccharomyces Genome Database ** GO
Consortium
Stanford University ** hi...@genome.stanford.edu
I'm not sure, but maybe it's a simple typo? In the following lines:
eac.setCalculator(ettc);
eac.setCalculator(nttc);
Looks like you are trying to set both to EdgeAppearenceCalculator. Probably
eac.setCalculator(ettc);
nac.setCalculator(nttc);
is correct if nac is set correctly somewhere in your code.
Thanks.
Kei
2007/9/7, Benjamin Hitz <hi...@genome.stanford.edu>:
--
Keiichiro Ono ko...@ucsd.edu
Cytoscape Core Developer Team: http://www.cytoscape.org/
UCSD Bioengineering Ideker Lab: http://chianti.ucsd.edu/idekerlab/