Sorry again Micheal! ;)
I just realized that I was using a JMapFrame instead of JFrame as in
FlyingSaucer example...when I changed this, everything works fine!
Thank you again
cheers
francesca
Il giorno mer, 04/05/2011 alle 22.12 +1000, Michael Bedward ha scritto:
> Hi Francesa,
>
> I'm copying this to the user list and I've edited the subject. I hope that's
> OK.
>
> Please see my reply below your message...
>
> > Hi Micheal,
> >
> > I have again a question for you. I'm following the example you suggested
> > me (FlyingSaucer) and I have the following problem: in the method
> > paintSprite, I get a NullPointerException when I call getBaseImage()
> >
> > private void paintSprite(Graphics2D gr2D) {
> > Rectangle bounds = getSpriteScreenPos();
> > spriteBackground = getBaseImage().getData(bounds);
> > gr2D.drawImage(SPRITE_IMAGE, bounds.x, bounds.y, null);
> > }
> >
> > have you any idea on why this happens?
> > Thank you again for your help
> > francesca
>
> Is it possible that you are calling the getBaseImage method before
> your map layers have been displayed ? In the current code (version
> 2.7.x and 8.x) the base image is only created by the map pane when it
> needs to draw some features.
>
> Michael
--
Francesca Martelli, Computer Science Ph.D.
Algorithms and Computational Mathematics Group, IIT - CNR, Pisa
Phone: +39 050 315 3191 (office), +39 050 315 2333 (fax)
http://www.iit.cnr.it/francesca.martelli/
email: [email protected]
------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network
management toolset available today. Delivers lowest initial
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users