Menu

#1 new method to get node from mouse event

open
nobody
None
5
2006-04-28
2006-04-28
No

My application adds a mouse listener to the TMView. If
the listener is to do anything useful, it must know the
node on which the mouse event occurred. You have the
code to determine this, but it is not public. I
therefore added the following method to TMView:

<code>
public TMNode nodeContaining(int x, int y) {
TMNodeModel nodeModel = root.nodeContaining(x, y);
return nodeModel == null ? null : nodeModel.getNode();
}
</code>

Unless I am missing something, I think this method is
essential for processing any kind of mouse events on
the treemap.

Nigel Westbury

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.