Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] SimpleTool onMouseDragged

To Jody,
 
Thank you. I completely missed the flags in the constructor. My tool now works fine (onMouseDragged fires) using the following constructor:
 
public GetPhotosTool(){
    super( MOUSE | MOTION);
}
 
Thanks,
Rueben
 
-----Original Message-----
From: udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx [mailto:udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx]On Behalf Of Jody Garnett
Sent: Tuesday, June 22, 2010 11:51 PM
To: User-friendly Desktop Internet GIS
Subject: Re: [udig-devel] SimpleTool onMouseDragged

Hello again:

When you create your SimpleTool please check out the constructor; there are some static final constants you can use in order to ask the tool "listen" to mouse move events.

Here is the documentation page on that:

--- snip ---
Note when using AbstractTool you can use the constructor to define what sort of events you are interested in, the events come in already expressed in Map coordinates.
class ExampleTool AbstractTool(){
    ExampleTool(){
       super( MOUSE | WHEEL );
    }
    public void mouseReleased( MapMouseEvent e ) {
       ...
    }
    public void mouseWheelMoved( MapMouseWheelEvent e ) {
       ...
    } 
}


On 23/06/2010, at 4:14 AM, Rueben Schulz wrote:

Hello,

I have a modalTool (based on the Tool Plugin Tutorial) and I am trying to
add a rectangle on the map to give the user feedback when they drag the tool
(like the zoom tool does).

However, I am having problems with the SimpleTool::onMouseDragged() or
onMouseMoved(). Both are never being fired, making it hard to update the
feedback rectangle (onMousePressed() and onMouseReleased() work fine).

I am using uDig 1.2-RC2, do you have any suggestions about why this does not
work?

Thank you,
Rueben


_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel


Back to the top