Skip to content

Instantly share code, notes, and snippets.

@aalmiray
Created July 9, 2009 23:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aalmiray/144098 to your computer and use it in GitHub Desktop.
Save aalmiray/144098 to your computer and use it in GitHub Desktop.
import groovy.swing.SwingBuilder
import griffon.builder.gfx.*
import griffon.builder.gfx.swing.GfxPanel
import java.awt.Color
def gfx = new GfxBuilder()
def node = gfx.group() {
antialias true
background(color('black'))
(0..41).each{ i ->
def color = i % 5 == 0 ? color('cyan') : color('gray')
line(x1: 0, y1: i*10, x2: 410, y2: i*10, bc: color)
line(y1: 0, x1: i*10, y2: 410, x2: i*10, bc: color)
}
image(file: "/tmp/griffon.png", x: 50, y: 50)
}
def swing = new SwingBuilder()
swing.edt {
frame(title: "Sphere", size: [410,430], visible: true) {
panel(new GfxPanel(), id: "canvas", node: node)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment