Message-ID: <455326810.1955.1427689659558.JavaMail.firstname.lastname@example.org> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_1954_1089293355.1427689659557" ------=_Part_1954_1089293355.1427689659557 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
The following makes it simple to start a griffon project.
The target will prompt you for the name of your project and create the p= roject structure below:
Make sure you are in the root directory of your project (for argument sa= ke "DemoConsole", a simple script evaluator) by typing
The "create-app" target created a Griffon MVC Triad for you in= the models, views, and controllers directory named after the application. = Hence you already have a model class DemoConsoleModel in the models directo= ry.
The application model for the quick start is simple: the script to be ev=
aluated and the results of the evaluation. Make sure to paste the following=
code into your copy of
The controller for our quick start app is also simple: throw the content= s of the script from the model at a groovy shell. Copy the following code i= nto your controller.
The Griffon framework will inject references to the other portions of th=
e MVC triad if fields named
The executeScript method will be used in the view for the button action.= Hence the ActionEvent parameter, and the default value so it can be called= without an action event.
Finally, the Griffon framework can be configured to inject portions of t=
he builders it uses. By default, the Threading classes are injected into th=
e controller, allowing the use of the
doLater methods from the SwingBuilder.
Also, the threading may look a bit obsessive. But good thread management= is essential to a well functioning Swing application.
The view classes contain the visual components for your application. As =
with the previous artifacts, copy the contents of the following snippet int=
o its corresponding file:
The view script is a fairly straightforward SwingBuilder script. Griffon= will execute these groovy scripts in context of it's UberBuilder (a compos= ite of the SwingBuilder and whatever else is thrown in).
To start your Griffon app run the following target
This will run the application as a Java application. You can also use th=
run-webstart target to run the application from a WebStart/J=
The run-app script implies the execution of the package script. The pack= age script creates file artifacts suitable for a Java application, a WebSta= rt application, and an Applet, with code signed by a self-signed certificat= e. All from the same source tree. By default they go in the 'staging' direc= tory.
Try out the applet by bringing up the applet.html file in a browser. Or = you can try them out directly by running the following commands
This is just the first pass at the framework. The sky's the limit! More = information about the framework, artifacts, conventions and commands can be= found at the Griffon Guide.