[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.gef] Re: GEF Logic Example Drag and Drop

"Pankaj Sanghi" <pankajsanghi@xxxxxxxxxxx> wrote in message
news:co2bdk$esm$1@xxxxxxxxxxxxxxxxxx
> hi all,
>
> This is with reference to drag and drop functionality implemented in Logic
> Example.
>
> I understand that whenever a component(for instance OR gate) is dropped
> from the palette on the canvas, then
> LogicTemplateTransferDropTargetListener gets activated. In the getFactory
> method of this class, a template is passed and a CretionFactory class
> object is returned by it.
>
> Can you please tell me the flow being followed for the call of this
> getFactory() method.

Doesn't setting a breakpoint in that method serve that purpose?  The
template, in this case, is derived from the TemplateTransfer singleton.
TemplateTransferDragSourceListener sets the template on that singleton in
its dragStart() method.

>
> In my case, I have a palette with three components say X, Y, Z. As i drag
> and drop any of these components, every time, an object of only X is
> created and fifure corresponding to X component appears on the canvas. i
> understand this is because the coresponding template name is coming same
> as that of X for all the components.........but i am not able to track why
> the same template object is being passed to getFactory method for all the
> three components despite the fact that I have defined different template
> constants for all of the in my TemplateConstants class.
>
> Can you pl help me solve the issue??
>
> thanks and regards
>
> Pankaj Sanghi
>