[gephi-dev] how to implement a selection tool?
Yi Du(杜一)
duyi001 at gmail.com
Thu Jan 13 02:55:20 CET 2011
@Mathieu If I do as what Rectangle do, I should add a flag to mark current
selection type as lasso. There is isRectangleSelection() because VizConfig
have such flag (A new selectionArea is created here). Do you mean I shoud
add such kind of parameter to VizConfig to represent current selection type?
Do you think it's necessary to modify the code and let it support kinds of
selection type? Initially I think customSelection is do such thing. But I
only found it used in ShortestPath tool (the selection type changed to
customselection when selectNode() used). Unfortunately, it is a tool, and
not designed for selection handlers as you said.
@Eduardo We can work together, can't we? I have time to do it this two
months, I can spend about 2hours per day.
2011/1/13 Mathieu Bastian <mathieu.bastian at gmail.com>
> I think you have to go the 2nd solution, as the ToolAPI is not
> designed for new selection handlers.
>
> Unfortunately, I can already tell that it will be quite a pain to dig and
> modify VisualizationModule, as selection has effect on many different
> classes. You should mostly copy what Rectangle do, as it is the same
> type of selection. The cylinder is a bit different (and its the
> default option), as it's only on mouse over.
>
> Modify the org.gephi.visualization.component.SelectionToolbar to add a
> new button under rectangle.
>
> Mathieu
>
> On Wed, Jan 12, 2011 at 1:52 AM, Yi Du(杜一) <duyi001 at gmail.com> wrote:
> > 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
> >
> > _______________________________________________
> > gephi-dev mailing list
> > gephi-dev at lists.gephi.org
> > http://gephi.org/mailman/listinfo/gephi-dev
> >
> >
>
--
杜一 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/20110113/5daf4e67/attachment.html>
More information about the gephi-dev
mailing list