| Drag & Drop [message #118498] | 
Thu, 19 February 2004 17:57   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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 #119056 is a reply to message #118771] | 
Mon, 23 February 2004 11:44    | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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 12:53   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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 
> > > 
> > > 
> > 
> > 
> 
>
 |  
 |  
  | 
Powered by 
FUDForum. Page generated in 0.10378 seconds