Thursday, November 26, 2009

Griffon Painter Demo


I was looking at the Swing Labs site and ran across the page on painters(http://swinglabs.org/docs/frameworks/painters/index.jsp) and thought the code looked pretty straight forward. Then I had the thought, Well Griffon uses SwingX I wonder, . . . the result is the image above.

Griffon code: PainterView.groovy


import java.awt.*
import org.jdesktop.swingx.painter.*

GlossPainter gloss = new GlossPainter(new Color(1.0f, 1.0f, 1.0f, 0.2f),
GlossPainter.GlossPosition.TOP)

PinstripePainter stripes = new PinstripePainter(
paint: new Color(1.0f, 1.0f, 1.0f, 0.17f),
spacing:5.0
)
MattePainter matte = new MattePainter(new Color(51, 51, 51));

application(title:'painter',
//size:[320,480],
pack:true,
//location:[50,50],
locationByPlatform:true,
iconImage: imageIcon('/griffon-icon-48x48.png').image,
iconImages: [imageIcon('/griffon-icon-48x48.png').image,
imageIcon('/griffon-icon-32x32.png').image,
imageIcon('/griffon-icon-16x16.png').image]
) {
jxpanel(id: "header",
backgroundPainter: new CompoundPainter(matte, stripes, gloss)) {
label('Griffon Painter Demo',
icon: imageIcon(resource:'griffon-icon-48x48.png'),
foreground: Color.white)
}
}

Tuesday, November 10, 2009

COJUG: Eclipse Demo Camp Links

Here are the Links for my COJUG: Eclipse Demo Camp Groovy and Grails Plugins discussion

You can use these links to download the Eclipse Groovy V2 plugin and SpringSource Tool Suite.

http://groovy.codehaus.org/Eclipse+Plugin+V2+FAQ#EclipsePluginV2FAQ
http://blog.springsource.com/2009/07/30/a-groovier-eclipse-experience/
http://docs.codehaus.org/pages/viewpage.action?pageId=133464433
http://grails.org/STS+Integration
http://www.springsource.com/products/springsource-tool-suite-download