Griffon 是Swing開(kāi)發(fā)者的一個(gè)Groovy框架。Griffon期望提供一個(gè)穩(wěn)定代碼結(jié)構(gòu)給Swing應(yīng)用,就像Grails給web開(kāi)發(fā)帶來(lái)的優(yōu)勢(shì)一樣。同時(shí),Griffon也可能提供一個(gè)替代應(yīng)用框架,替代Spring RCP,Eclipse RCP和NetBeans平臺(tái)。
示例代碼:
DemoConsoleView.groovy
application(title:'DemoConsole', pack:true, locationByPlatform:true) { panel(border:emptyBorder(6)) { borderLayout() scrollPane(constraints:CENTER) { textArea(text:bind(target:model, targetProperty:'scriptSource'), enabled: bind {model.enabled}, columns:40, rows:10) } hbox(constraints:SOUTH) { button("Execute", actionPerformed:controller.&executeScript, enabled: bind {model.enabled}) hstrut(5) label("Result:") hstrut(5) label(text:bind {model.scriptResult}) } } }