public void mouseClicked(MouseEvent e) {
if (e.getButton()==MouseEvent.BUTTON1) {
final Point2D pnt = new Point2D.Double(e.getX(), e.getY());
if (info.booleanValue()==true){
try {
transform.inverseTransform(pnt,pnt);
} catch (NoninvertibleTransformException ex) {
ex.printStackTrace();
}
.......
transform is an AffineTransform that has to be defined in order to use the streaming renderer (I guess), like this:
final AffineTransform transform = new AffineTransform (){
{final double scaleFactor = (Math.min((getWidth ()/ box.getWidth ()), (getHeight ()/box.getHeight ())) * getZoomFactor ());
System.out.println(scaleFactor);
// Translate to the center of the JPanel.
translate (getBounds().getWidth()/2, getBounds().getHeight()/2);
// Scale with negative y factor to correct the orientation.
scale (scaleFactor, -scaleFactor);
// Translate to the center of the feature collection.
translate(-centro.getX(), -centro.getY());}
};
I hope that helps,
Mauricio Mantilla
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ Geotools-gt2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
