Hi Valerio,

I've just added a key event handler class to trunk:

http://svn.osgeo.org/geotools/trunk/modules/unsupported/swing/src/main/java/org/geotools/swing/MapPaneKeyHandler.java

You could adapt this to work with JMapPane in the 2.7 branch by
replacing all references to MapPane interface (new in GeoTools 8) with
JMapPane class. Also, if you are using Java 5 you will need to remove
the @Override annotations from interface methods.

To use the class, simple add it as a KeyListener to your map pane. On
trunk, this is done by default in the AbstractMapPane class (super
class for JMapPane and the new JLayeredMapPane):

http://svn.osgeo.org/geotools/trunk/modules/unsupported/swing/src/main/java/org/geotools/swing/AbstractMapPane.java

(look for the "keyHandler" field).

It hasn't been tested yet so any feedback you have about bugs or
improvements would be much appreciated.

Michael

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to