Bug 399765 - Make getGraphItem(IFigure figure) public
Summary: Make getGraphItem(IFigure figure) public
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy Zest (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-01 17:56 EST by Shai Bentin CLA
Modified: 2013-03-14 10:26 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shai Bentin CLA 2013-02-01 17:56:38 EST
In order to support some hover functionality over the nodes and connections I need to know the GraphItem under the mouse. It seems that exposing the 'GraphItem getGraphItem(IFigure figure)' as public will allow me to do so efficiently.
Comment 1 Fabian Steeg CLA 2013-02-23 19:39:37 EST
I assume what you need is more than a popup when hovering over nodes or connections? These could be set with GraphNode#setTooltip and GraphConnection#setTooltip.

Or would something using 'ZestStyles.NODES_HIDE_TEXT | ZestStyles.NODES_FISHEYE' be useful for you (see http://git.eclipse.org/c/gef/org.eclipse.gef4.git/tree/org.eclipse.gef4.zest.examples/src/org/eclipse/gef4/zest/examples/swt/GraphSnippet6.java)?

If these don't work for you, could you provide a little snippet of what exactly you would like to do? I'm just trying to see if there is a different solution to your issue, since any public API we release cannot be changed or removed easily later, so we try to expose as little as possible.
Comment 2 Georgian Grec CLA 2013-03-14 10:26:46 EDT
Hello guys.

So I'm having almost the same problem with grabbing a graph item.

My method, called getItem, receives a DropTargetEvent, and does the following:

1. Gets and IFigure with graph.getFigureAt(event.x, event.y)
2. Uses reflection to get a GraphItem using graph.getGraphItem(IFigure)

All in all, what I want to do is get a GraphItem knowing its position on the graph. Can anyone suggest me a more 'clean' alternative to what I've done?