Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » GEF Logc Example Drag n drop
GEF Logc Example Drag n drop [message #151783] Thu, 23 September 2004 05:32 Go to next message
Eclipse UserFriend
Originally posted by: p_sanghi_79.yahoo.com

hi all,

can anybody please tell me the flow being followed in logic example when a
component is dropped from the palette on the canvas.

According to my understanding, in the initializeGraphicalViewer of
LogicEditor, LogicTemplateTransferDopTragetListener has been added. This
class initialises LogicElementEditFactory. In this class, getNewObjects
method decides which component should be created on the canvas. But if i
give console printing statements in this method, i find that this method
is never called while drag and drop. Pl help me know where i am wrong in
my understanding.

My requirement is to stop a component from getting dropped on the canvas
if one such component already exists there. For instance, if one or gate
is present on the canvas, i want user should not be able to drop any more
OR Gate.

Pl help me with this.

thanks and regards

Pankaj Sanghi
Re: GEF Logc Example Drag n drop [message #151858 is a reply to message #151783] Thu, 23 September 2004 18:53 Go to previous messageGo to next message
mithun is currently offline mithunFriend
Messages: 4
Registered: July 2009
Junior Member
Hello ,
I think that you should check into collection of models maintained by
LogicDiagram. This is where each new model is added as it is dropped from
palette. So you can iterate over it to see wheather Or-gate is already
present there or not.
CreationCommand Class and It's excute() method will help you.

and about flow followed when component is dropped from palette ,is as what
i know , request for shape create command is created as you click on
palette,
and this request has factory able to create new instances of this
component.
once executed it creates new component instance and it is added to
logicdiagram collection.

-- mithun

pankaj sanghi wrote:

> hi all,

> can anybody please tell me the flow being followed in logic example when a
> component is dropped from the palette on the canvas.

> According to my understanding, in the initializeGraphicalViewer of
> LogicEditor, LogicTemplateTransferDopTragetListener has been added. This
> class initialises LogicElementEditFactory. In this class, getNewObjects
> method decides which component should be created on the canvas. But if i
> give console printing statements in this method, i find that this method
> is never called while drag and drop. Pl help me know where i am wrong in
> my understanding.

> My requirement is to stop a component from getting dropped on the canvas
> if one such component already exists there. For instance, if one or gate
> is present on the canvas, i want user should not be able to drop any more
> OR Gate.

> Pl help me with this.

> thanks and regards

> Pankaj Sanghi
Re: GEF Logc Example Drag n drop [message #151969 is a reply to message #151783] Fri, 24 September 2004 18:07 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

If you are using real drag-and-drop, the data is not available until the
mouse button is released. However, if you use fake drag and drop such as
the SimpleObjectTransfer, you could obtain the object being dragged. To be
generic, we did not assume this so we don't query for a command during
DragOver callbacks. For 3.1, we will allow a configuration on
AbstractTransferDropTargetListener to instruct it to constrantly obtain
commands and therefore indicate the NOT sign by way of null or unexecutable
command.

"pankaj sanghi" <p_sanghi_79@yahoo.com> wrote in message
news:citn54$c9e$1@eclipse.org...
> hi all,
>
> can anybody please tell me the flow being followed in logic example when a
> component is dropped from the palette on the canvas.
>
> According to my understanding, in the initializeGraphicalViewer of
> LogicEditor, LogicTemplateTransferDopTragetListener has been added. This
> class initialises LogicElementEditFactory. In this class, getNewObjects
> method decides which component should be created on the canvas. But if i
> give console printing statements in this method, i find that this method
> is never called while drag and drop. Pl help me know where i am wrong in
> my understanding.
>
> My requirement is to stop a component from getting dropped on the canvas
> if one such component already exists there. For instance, if one or gate
> is present on the canvas, i want user should not be able to drop any more
> OR Gate.
>
> Pl help me with this.
>
> thanks and regards
>
> Pankaj Sanghi
>
Previous Topic:Copy/paste
Next Topic:Image that is displayed when dragging from the palette
Goto Forum:
  


Current Time: Thu Apr 25 21:16:06 GMT 2024

Powered by FUDForum. Page generated in 0.02338 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top