Oh boy, can you believe that I thought up the title for this entry before even starting the work required to be able to write it? What kind of sick and twisted form of narcissism is that? That’s ok, java2d extracted a heavy toll for my sins.

I literally sat down with the previous article about google rounded corners and set out to initially duplicate those features. Check.

rounded corners

That was pretty easy. Not totally straightforward but how wrong can you go with?:

Arc2D.Float shape = new Arc2D.Float(x,y, width, height, startAngle, extents, type);g2.fill(shape);

So there is that, and it’s of course available to all Tapestry users by dropping in the tapestry-contrib.jar on their classpath. It even uses the same parameter names / url style as googles services. ;) (i hope they aren’t mad at me about that)

After sending what I hoped was a very pitiful email the java2d kung fu master himself pointed me down the right path for drop shadow rendering – speaking of course about Romain Guy.

Now things are getting a lot more interesting / useful. I’ve played and played and imagine I could spend months on this particular aspect as nothing every feels quite right (except for Romain’s excellent drop shadow effects) , but here it is anyways..

Hello, I’m a little shadow.

There are of course more possibilities, if for some reason you needed them.

rounded corners
rounded corners

 

 

 

That’s about it for now. Still lots of work left to do but things are working out well so far. You can see a new and improved demo of them in use in the TimeTracker demo application.


  1. Gravatar IconRomain Guy

    Nice! I’m glad you released this. This is way easier than fiddling with Photoshop & co. ;-)

  2. Gravatar Iconjkuhnert

    Hehe.. Yes – it certainly is. Google had a good idea, thanks for making it a lot easier.

Leave a Comment