[gephi-dev] how to implement a selection tool?
Yi Du(杜一)
duyi001 at gmail.com
Wed Jan 12 10:52:26 CET 2011
Hi all,
I have some questions on implementing a tool. The tool is a kind of
selection tool, which can let user to draw a certain shape and select nodes
in the shape. I call it lasso tool.
The question is: how can I implement such feature?
I think there might be two ways to implement it.
*The first is using the Tool API, and implement the lasso as a tool plugin
just as the other tool plugins. If I do this way, I should focus on the
process method of ToolEventListener. But now I didn't find any
ToolEventListener supporting the mouse press and drag on the background of
the window in the Tool API. If I do this way, should I implement the press
and drag event listener myself? Besides, I should
modified DesktopToolController and add a MouseDragHandler, because all the
event handlers are here.
*Second, In fact the tool is a kind of selection. I found the implemented
Cylinder and Rectangle are similar as the lasso. But I don't know how to
add a new selection tool here. In the CompatibilityEngine->initSelection(),
there are only three kinds of selections(custom, rectangle, cylinder). Seems
I shouldn't implement such tool as Cylinder and Rectangle do.
Sincerely.
--
杜一 Yi Du (Yestin)
IEL, Chinese Academy of Sciences, Institute of Software.
TEL: +86-15810134970
email>alk: duyi001 at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gephi.org/pipermail/gephi-dev/attachments/20110112/115cfe46/attachment.html>
More information about the gephi-dev
mailing list