[gephi-dev] how to implement a selection tool?
Eduardo Ramos Ibañez
eduramiba at gmail.com
Thu Jan 13 21:53:02 CET 2011
Yes, we can work together, 2 minds better than one :)
I am now implementing other few features and soon will have much less time
because of exams until February though
2011/1/13 Yi Du(§ù¤@) <duyi001 at gmail.com>
> @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.
>> 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
>> > 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
>> > 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
>> > the window in the Tool API. If I do this way, should I implement the
>> > and drag event listener myself? Besides, I should
>> > modified DesktopToolController and add a MouseDragHandler, because all
>> > event handlers are here.
>> > *Second, In fact the tool is a kind of selection. I found the
>> > Cylinder and Rectangle are similar as the lasso. But I don't know how
>> > add a new selection tool here. In the
>> > there are only three kinds of selections(custom, rectangle, cylinder).
>> > 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...
More information about the gephi-dev