SwingPad 0.1 - No Fluff Just Stuff

SwingPad 0.1

Posted by: Andres Almiray on December 11, 2008

From the makers of Griffon and GfxPad comes: SwingPad! an exploratory tool for Groovy's Swing based builders (SwingBuilder, SwingXBuilder and JideBuilder). But first a bit of background behind the application. Here I was minding my own business at work when I received an e-mail from a good friend of mine with a rather peculiar subject "is there a swingbuilder console?" and that got me thinking, sure we have groovyConsole (made with SwingBuilder by the way) distributed with Groovy core but it is too general (hey it runs any Groovy code :-D), and of course there is GfxPad but it only works for GraphicsBuilder, so perhaps a dedicated console for Swing builders wouldn't be a bad idea after all.

Here is a screenshot of the current version



Want to know a little secret? noticed the camera icon at the far right of the toolbar? SwingPad will take a snapshot of itself if you click it, that is how this screenshot was taken, no additional software required :-D. This tool is in no way a replacement for a visual designer but can help you prototype Swing UIs, and of course views for your next Griffon application. Speaking of Griffon and the often referred phrase "eating your own dog food" SwingPad is made with 100% Griffon magic, no extra ingredients, no secret sauce. (Griffon, accept no substitutes!). It also looks (and behaves) a lot like GfxPad and the original groovyConsole because it actually reuses a lot of code from those two apps, as a matter of fact SwingPad's main bulk was developed in under 4 hours! talk about being productive. These are the stats for the current version by the way
    +----------------------+-------+-------+
    | Name                 | Files |  LOC  |
    +----------------------+-------+-------+
    | Controllers          |     2 |   324 |
    | Models               |     2 |    28 |
    | Views                |     9 |   637 |
    | Lifecycle            |     5 |    14 |
    | Groovy Source        |     1 |   114 |
    | Integration Tests    |     2 |     8 |
    | Scripts              |     1 |     9 |
    +----------------------+-------+-------+
    | Totals               |    22 |  1134 |
    +----------------------+-------+-------+
Now compare them to GfxPad 0.1-BETA
    +----------------------+-------+-------+
    | Name                 | Files |  LOC  |
    +----------------------+-------+-------+
    | Controllers          |     1 |   390 |
    | Models               |     1 |    31 |
    | Views                |     8 |   762 |
    | Lifecycle            |     5 |    20 |
    | Groovy Source        |     1 |   114 |
    | Integration Tests    |     1 |     4 |
    | Scripts              |     1 |     5 |
    +----------------------+-------+-------+
    | Totals               |    18 |  1326 |
    +----------------------+-------+-------+

SwingPad has a second MVC group in order to handle your Swing input, other than that the code is pretty much the same as it currently stands, James even managed to give a preview of it yesterday at the Griffon BOF (Devoxx). SwingPad relies on the the latest Griffon 0.1 -BETA, whose release was also announced by Danno yesterday.There are still some rough edges here and there (specially when packing components if an invalid script has been typed), which will be covered in version 0.2, along with other amazing features that must be kept secret for now ;-)

Keep on Groovying!

PD: thank you Eitan for a marvelous idea! :-D

UPDATE: the Windows run script had a bug on it, it has been fixed already [download]
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 »