List of Figures

Chapter 1. Welcome to the Griffon revolution

Figure 1.1. Updating variable settings on Windows

Figure 1.2. Your first application is up and running in standalone mode.

Figure 1.3. Your first application running in Web Start mode

Figure 1.4. The GroovyEdit application running in applet mode

Figure 1.5. Finished GroovyEdit application displaying two tabs with its own source code

Figure 1.6. The GroovyEdit application now has a menu.

Figure 1.7. Native menu accelerators (Windows)

Figure 1.8. GroovyEdit displaying two tabs. But where is the content?

Figure 1.9. A diagram of the Model-View-Controller design pattern

Figure 1.10. Bookstore application MVC model

Chapter 2. A closer look at Griffon

Figure 2.1. Directory structure of the GroovyEdit application

Figure 2.2. CompositeBuilder works with all builders based on FactoryBuilderSupport.

Figure 2.3. Merging the MVC runtime config and all other runtime config into the runtime application config

Figure 2.4. Application life cycle

Figure 2.5. Application life cycle: initialize

Figure 2.6. Application life cycle: startup

Figure 2.7. Application life cycle: ready

Figure 2.8. Application life cycle: shutdown

Figure 2.9. Application life cycle: stop

Chapter 3. Models and binding

Figure 3.1. The completed registration application

Figure 3.2. The completed Mortgage Calculator app

Chapter 4. Creating a view

Figure 4.1. Swing containers and components

Figure 4.2. “Hello World” component hierarchy

Figure 4.3. “Hello World” in plain Swing. It can’t get much more straightforward than this.

Figure 4.4. The “Hello Back” Swing application displaying the user’s input after they click the button

Figure 4.5. How Groovy SwingBuilder creates a view

Figure 4.6. Expected result

Figure 4.7. Actual result

Figure 4.8. SwingPad running a small view script. The right side is the outcome of the code in the editor on the left side.

Figure 4.9. A basic legacy Login dialog. This dialog was created using the NetBeans GUI builder visual designer.

Figure 4.10. The user entered griffon and random_password in the input fields of LoginDialog, and then clicked OK.

Figure 4.11. The user canceled LoginDialog by clicking Cancel.

Figure 4.12. The LoginDialog panel edited with Abeille Forms Designer. Notice that the grid can be made explicit to guide you in placing the components.

Chapter 5. Understanding controllers and services

Figure 5.1. Controller receives stimulus from event, service, or UI then updates the model

Figure 5.2. Controllers sharing logic to access a remote web service

Figure 5.3. Sample controller invoking the greet() method on a simple service

Figure 5.4. BeanBuilder processing the resources.groovy file to build the application context

Figure 5.5. Complex service results

Figure 5.6. Core Griffon classes that perform artifact management

Figure 5.7. First iteration of the form. There are three input fields and two actions.

Figure 5.8. A dialog opens when you click the Submit button. It shows all the information entered by the user on the form.

Figure 5.9. The form displaying the new model properties and controller actions

Chapter 6. Understanding MVC groups

Figure 6.1. destroyMVCGroup() sequence

Figure 6.2. A dialog with custom title, icon, and message. The message’s text should change according to the error that occurred.

Chapter 7. Multithreaded applications

Figure 7.1. A threading-aware FileViewer application displaying a file using the first technique (Test #1) for reading a file’s contents. The other file-loading techniques (Test #2, #3, and Test #4) depend on the threading options employed.

Chapter 8. Listening to notifications

Figure 8.1. Application after clicking the Ping! button five times

Figure 8.2. When you click the Ping button, the Ping controller fires a Ping event. The event is processed by the Pong controller, which fires a Pong event processed by the Ping controller.

Figure 8.3. Playing ping-pong with events

Figure 8.4. A diagram of several players in the Marco Application triggering “Marco” events at any given time

Figure 8.5. Marco Polo event flow

Figure 8.6. Marco application at startup

Figure 8.7. Marco application after a Marco event

Chapter 9. Testing your application

Figure 9.1. Running Dictionary application

Figure 9.2. HTML report of all the tests you ran on the dictionary application. There’s only a single test class with three test methods reported. All succeeded.

Figure 9.3. HTML report generated for the FEST integration test. All tests succeeded.

Figure 9.4. HTML report of DictionaryServiceSpec. Pay close attention to the name of the third method. Notice that the variable placeholders have been replaced with values from the data table.

Figure 9.5. Test report of a FEST+Spock specification after it runs successfully

Figure 9.6. CodeNarc report for the Dictionary application. Everything appears to be in order.

Figure 9.7. Files in violation as found by CodeNarc. The controller fails three rules, whereas the view fails just one.

Figure 9.8. GMetrics report on the Dictionary application. The class and method line numbers look OK, but the cyclomatic complexity is high.

Figure 9.9. Code-coverage report with Cobertura

Chapter 10. Ship it!

Figure 10.1. Standard directory structure of an application’s configuration files

Figure 10.2. Directory outline of a jar distribution

Figure 10.3. Directory outline of a zip distribution

Figure 10.4. The outcome of running deb, izpack, mac, rpm, and zip packaging targets on GroovyEdit

Figure 10.5. An IzPack installer for the GroovyEdit application. The default installer template runs eight steps.

Chapter 11. Working with plugins

Figure 11.1. A list of available plugins, with their names, versions, and short descriptions

Figure 11.2. Information on the Spring plugin. Notice that this plugin works with every UI toolkit and on every platform.

Figure 11.3. Installing the Clojure plugin. Notice that this plugin provides new scripts.

Figure 11.4. The directory structure of a plugin. Notice the resemblance to an application’s structure. The plugin descriptor is highlighted.

Figure 11.5. An addon named foo has been added to a plugin, also named Foo. The addon descriptor is highlighted.

Figure 11.6. Intercepting a call to an application

Figure 11.7. Contents of the Tracer plugin. You can see the plugin and addon descriptor files created by the Griffon commands. The addon descriptor is selected.

Figure 11.8. The calculator application. The first screen shows the application as it looks when it’s launched. The second screen shows the application after inputs have been entered and the Result button has been clicked.

Chapter 12. Enhanced looks

Figure 12.1. Factory methods used during node building. The setChild() method is called on the parent factory if it exists.

Figure 12.2. Builder and factory engaged in the node build cycle. Delegates are called on each phase that matches their name.

Figure 12.3. A simple application composed of SwingX components. The header’s visuals were updated by a set of painters.

Figure 12.4. An application built with JIDE components. The checkBoxListis at the left. Four JideButtons, each with a different style applied, are at the right. The fifth and last button is a JideSplitButton, a combination of button and menu.

Figure 12.5. A CSS-styled Griffon application. Each section has a border applied, labels use italics, and buttons have bolded text. Button 1.2 and Label 2.2 share red as their foreground color.

Figure 12.6. A simple drawing made with geometric objects. There are three rectangles, one triangle, and one circle, with different colors and strokes applied.

Figure 12.7. A sphere drawn with nothing more than two circles and four gradients

Chapter 13. Griffon in front, Grails in the back

Figure 13.1. Bookstore webpage

Figure 13.2. The Bookstore application showing a list of two authors that were created by clicking on the New Author link and filling in the generated form

Figure 13.3. A tabbed view of all instances of Author domain classes after querying the Grails backend. The Books tab does the same for Book domain classes.

Figure 13.4. The Search tab for the Bookclient application. Users can search the bookstore backend by querying Authors or Books.

Figure 13.5. Griffon Bookstore client calling Grails Bookstore

Chapter 14. Productivity tools

Figure 14.1. The Classpath Variables preferences dialog box, showing the configured variables after adding values for USER_HOME and GRIFFON_HOME

Figure 14.2. The Import dialog box showing the recommended option for importing a Griffon project into Eclipse

Figure 14.3. The last step for importing a Griffon project into an Eclipse workspace

Figure 14.4. Eclipse, showing the structure of a Griffon application in the project explorer, as well as the class structure of the DemoController

Figure 14.5. An Ant view of the application’s targets, as shown by Eclipse’s Ant support

Figure 14.6. Both Griffon NetBeans modules are selected for installation.

Figure 14.7. NetBeans’ New Project wizard page with a project template selected, which is required for setting up a Griffon application

Figure 14.8. The second step of the New Griffon Application wizard

Figure 14.9. Configuring Griffon Home

Figure 14.10. Project view with artifacts properly identified

Figure 14.11. The Run Griffon Command dialog box, containing a list of suggestions based on what was typed in the Filter text field

Figure 14.12. IDEA’s New Project wizard showing several options. The Griffon one is the last in the list.

Figure 14.13. Configuring the demo application

Figure 14.14. Selecting a Griffon SDK to be used with the demo application

Figure 14.15. A Griffon project, as shown in IDEA’s Griffon view

Figure 14.16. The dialog box for running any Griffon command. It takes the name of the command and any optional arguments as input.

Figure 14.17. The PATH configuration, showing the full path of a Griffon installation being added at the beginning of the variable’s value

Figure 14.18. The view of the demo application. Notice that TextMate provides a detailed list of all files in a sidebar.

Figure 14.19. A list of default commands provided by the bundle. This list might be updated in future versions of the bundle.

Figure 14.20. The output of invoking the Run App command from within the bundle. Notice that the output is the same as you’d get when invoking the command by regular means.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.254.44