What happened to GraphicsBuilder? - No Fluff Just Stuff

What happened to GraphicsBuilder?

Posted by: Andres Almiray on November 16, 2007

It's not dead, that is for sure! I've been occupied with personal matters (relocating always takes precious hacking time away) and helping the new generation of builder support (FactoryBuilderSupport) to make it into Groovy 1.1 final (we're so close!). But last night I went back to GraphicsBuilder, I had one thing on my mind: support mouse and key events.

The good news are it wasn't that difficult to route all events through the GraphicsPanel to any GraphicsInputListener registered (GIL accepts all events from MouseListener, MouseMotionListener, MouseWheelListener and KeyListener), and everything went well with simple tests. But as the code got fancier, let's say transformations were applied, it became clear that the shapes were drawn correctly but their coordinates were off if you asked the original GraphicsOperation that created the shape itself. Another thing I noticed is that Area operations may return a Shape if they have 'asShape' property set to true, but that don't prevent children operations to draw their own shapes (can anyone say bug?). Now I have to rethink how operations store their values before and after execution so that the correct coordinates may be obtained at any time.

To ease up the testing process of actually seeing the result I also added a small application that lets you execute code on the fly and display the graphics, think of it as a simpler version of GraphicsBuilderDemo (no fancy icons, no JXTitleLabel, no docs) which is aptly named GraphicsPad (guess you saw that one coming too).

Once I have figured out how to handle input events and fixed area operations I'll commit the changes to SVN, but don't expect those features to be bundled with the Groovy 1.1 windows installer as it may go out before I commit.

Keep on Groovying!
Andres Almiray

About Andres Almiray

Andres is a Java/Groovy developer and a Java Champion with more than 20 years of experience in software design and development. He has been involved in web and desktop application development since the early days of Java. Andres is a true believer in open source and has participated on popular projects like Groovy, Griffon, and DbUnit, as well as starting his own projects (Json-lib, EZMorph, GraphicsBuilder, JideBuilder). Founding member of the Griffon framework and Hackergarten community event. https://ch.linkedin.com/in/aalmiray

Why Attend the NFJS Tour?

  • » Cutting-Edge Technologies
  • » Agile Practices
  • » Peer Exchange

Current Topics:

  • Languages on the JVM: Scala, Groovy, Clojure
  • Enterprise Java
  • Core Java, Java 8
  • Agility
  • Testing: Geb, Spock, Easyb
  • REST
  • NoSQL: MongoDB, Cassandra
  • Hadoop
  • Spring 4
  • Cloud
  • Automation Tools: Gradle, Git, Jenkins, Sonar
  • HTML5, CSS3, AngularJS, jQuery, Usability
  • Mobile Apps - iPhone and Android
  • More...
Learn More »