Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Drag & Drop
Drag & Drop [message #118498] Thu, 19 February 2004 22:57 Go to next message
Eclipse UserFriend
Originally posted by: sandip.us.ibm.com

I am trying to customize dnd operations on the graphical viewer for the GEF
logic example
so that an item from the pallette can be only dropped into certain but not
all region of the
GraphicalViewer. To do this, I override the following methods in the
LogicTemplateTransferDropTargetListener class (the idea is I will check for
validity of a
drop inside these methods):

public void

dragEnter(DropTargetEvent event)

{

System.err.println("dragEnter called");

super.dragEnter(event);


}

protected void handleDragOver()

{

System.err.println("handleDragOver called");

super.handleDragOver();

}

protected void

handleHover()

{

System.err.println("handleHover called");

super.handleHover();

}

However, none of these methods are called when I select an item from the
pallet and move the cursor

over the GraphicalViewer area. Am I missing something here?

Thanks.

- Sandip
Re: Drag & Drop [message #118771 is a reply to message #118498] Fri, 20 February 2004 23:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sandip.us.ibm.com

OK, here's what's happening: when I select a pallette item and hold down the
left mouse button, then the callbacks are getting called when I move the
mouse over the graphical editor. However, if simply select a pallette item
and then move the mouse *without* holding its left button down over the
graphical editor the callbacks are *not* getting called. However, the cursor
is changing to DND OK shape in both the cases.

- Sandip

"Sandip Lahiri" <sandip@us.ibm.com> wrote in message
news:c13eud$4in$1@eclipse.org...
> I am trying to customize dnd operations on the graphical viewer for the
GEF
> logic example
> so that an item from the pallette can be only dropped into certain but not
> all region of the
> GraphicalViewer. To do this, I override the following methods in the
> LogicTemplateTransferDropTargetListener class (the idea is I will check
for
> validity of a
> drop inside these methods):
>
> public void
>
> dragEnter(DropTargetEvent event)
>
> {
>
> System.err.println("dragEnter called");
>
> super.dragEnter(event);
>
>
> }
>
> protected void handleDragOver()
>
> {
>
> System.err.println("handleDragOver called");
>
> super.handleDragOver();
>
> }
>
> protected void
>
> handleHover()
>
> {
>
> System.err.println("handleHover called");
>
> super.handleHover();
>
> }
>
> However, none of these methods are called when I select an item from the
> pallet and move the cursor
>
> over the GraphicalViewer area. Am I missing something here?
>
> Thanks.
>
> - Sandip
>
>
Re: Drag & Drop [message #119056 is a reply to message #118771] Mon, 23 February 2004 16:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

DND is only used if you hold down the mouse. Hence the name. What you are
seeing is the creation tool's cursor, which looks similar. It allows
creation, but the mechanism/callbacks are standard mouse events, not DND.

"Sandip Lahiri" <sandip@us.ibm.com> wrote in message
news:c165ka$7td$1@eclipse.org...
> OK, here's what's happening: when I select a pallette item and hold down
the
> left mouse button, then the callbacks are getting called when I move the
> mouse over the graphical editor. However, if simply select a pallette item
> and then move the mouse *without* holding its left button down over the
> graphical editor the callbacks are *not* getting called. However, the
cursor
> is changing to DND OK shape in both the cases.
>
> - Sandip
>
> "Sandip Lahiri" <sandip@us.ibm.com> wrote in message
> news:c13eud$4in$1@eclipse.org...
> > I am trying to customize dnd operations on the graphical viewer for the
> GEF
> > logic example
> > so that an item from the pallette can be only dropped into certain but
not
> > all region of the
> > GraphicalViewer. To do this, I override the following methods in the
> > LogicTemplateTransferDropTargetListener class (the idea is I will check
> for
> > validity of a
> > drop inside these methods):
> >
> > public void
> >
> > dragEnter(DropTargetEvent event)
> >
> > {
> >
> > System.err.println("dragEnter called");
> >
> > super.dragEnter(event);
> >
> >
> > }
> >
> > protected void handleDragOver()
> >
> > {
> >
> > System.err.println("handleDragOver called");
> >
> > super.handleDragOver();
> >
> > }
> >
> > protected void
> >
> > handleHover()
> >
> > {
> >
> > System.err.println("handleHover called");
> >
> > super.handleHover();
> >
> > }
> >
> > However, none of these methods are called when I select an item from the
> > pallet and move the cursor
> >
> > over the GraphicalViewer area. Am I missing something here?
> >
> > Thanks.
> >
> > - Sandip
> >
> >
>
>
Re: Drag & Drop [message #119095 is a reply to message #119056] Mon, 23 February 2004 17:53 Go to previous message
Eclipse UserFriend
Originally posted by: sandip.us.ibm.com

Randy, mucho thanks!!!

- Sandip

"Randy Hudson" <none@us.ibm.com> wrote in message
news:c1daf2$dk4$1@eclipse.org...
> DND is only used if you hold down the mouse. Hence the name. What you
are
> seeing is the creation tool's cursor, which looks similar. It allows
> creation, but the mechanism/callbacks are standard mouse events, not DND.
>
> "Sandip Lahiri" <sandip@us.ibm.com> wrote in message
> news:c165ka$7td$1@eclipse.org...
> > OK, here's what's happening: when I select a pallette item and hold down
> the
> > left mouse button, then the callbacks are getting called when I move the
> > mouse over the graphical editor. However, if simply select a pallette
item
> > and then move the mouse *without* holding its left button down over the
> > graphical editor the callbacks are *not* getting called. However, the
> cursor
> > is changing to DND OK shape in both the cases.
> >
> > - Sandip
> >
> > "Sandip Lahiri" <sandip@us.ibm.com> wrote in message
> > news:c13eud$4in$1@eclipse.org...
> > > I am trying to customize dnd operations on the graphical viewer for
the
> > GEF
> > > logic example
> > > so that an item from the pallette can be only dropped into certain but
> not
> > > all region of the
> > > GraphicalViewer. To do this, I override the following methods in the
> > > LogicTemplateTransferDropTargetListener class (the idea is I will
check
> > for
> > > validity of a
> > > drop inside these methods):
> > >
> > > public void
> > >
> > > dragEnter(DropTargetEvent event)
> > >
> > > {
> > >
> > > System.err.println("dragEnter called");
> > >
> > > super.dragEnter(event);
> > >
> > >
> > > }
> > >
> > > protected void handleDragOver()
> > >
> > > {
> > >
> > > System.err.println("handleDragOver called");
> > >
> > > super.handleDragOver();
> > >
> > > }
> > >
> > > protected void
> > >
> > > handleHover()
> > >
> > > {
> > >
> > > System.err.println("handleHover called");
> > >
> > > super.handleHover();
> > >
> > > }
> > >
> > > However, none of these methods are called when I select an item from
the
> > > pallet and move the cursor
> > >
> > > over the GraphicalViewer area. Am I missing something here?
> > >
> > > Thanks.
> > >
> > > - Sandip
> > >
> > >
> >
> >
>
>
Previous Topic:Read-Only Editor
Next Topic:Enabling Undo of GEF commands from a view
Goto Forum:
  


Current Time: Sat Jul 27 16:28:51 GMT 2024

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

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

Back to the top