| Summary: | Graph#setSelection() doesn't work for GraphContainer objects | ||
|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Stefan Tucker <stefan.tucker> |
| Component: | GEF-Legacy Zest | Assignee: | Ian Bull <irbull> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 3.4 | ||
| Target Milestone: | 3.5.0 (Galileo) M4 | ||
| Hardware: | PC | ||
| OS: | Windows Server 2003 | ||
| Whiteboard: | |||
Thanks, Fixed. |
Build ID: I20080523-0100 Steps To Reproduce: 1. Create a GraphContainer object and add it to a Graph. 2. Call Graph#setSelection(new GraphNode[] { container }); 3. Note that setSelection() highlights only objects that return GraphItem.NODE from getItemType(). More information: Graph.java: public void setSelection(GraphItem[] nodes) { clearSelection(); if (nodes != null) { for (int i = 0; i < nodes.length; i++) { if (nodes[i] != null && nodes[i].getItemType() == GraphItem.NODE) { selectedItems.add(nodes[i]); ((GraphNode) nodes[i]).highlight(); } } } } Should probably be: public void setSelection(GraphItem[] nodes) { clearSelection(); if (nodes != null) { for (int i = 0; i < nodes.length; i++) { if ((nodes[i] != null) && (nodes[i] instanceof GraphNode)) { selectedItems.add(nodes[i]); ((GraphNode) nodes[i]).highlight(); } } } }