Created
July 3, 2009 00:56
-
-
Save aalmiray/139855 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.Color | |
import groovy.swing.SwingBuilder | |
import griffon.builder.gfx.GfxBuilder | |
import griffon.builder.gfx.swing.GfxPanel | |
def gfx = new GfxBuilder() | |
def node = gfx.group { | |
antialias true | |
ellipse(cx: 150, cy: 150, rx: 100, ry: 50, f: Color.WHITE) | |
ellipse(cx: 150, cy: 150, rx: 100, ry: 50, o: 0.5f) { | |
radialGradient(fx:50, fy: 50, /*r: 50,*/ fit: true) { | |
stop(offset: 0.0f, c: Color.WHITE) | |
stop(offset: 0.5f, c: Color.YELLOW) | |
stop(offset: 1.0f, c: Color.RED) | |
transforms { | |
rotate(a: 15, x: 150, y: 150) | |
} | |
} | |
} | |
} | |
new SwingBuilder().edt { | |
frame(title: "Bouncing Ball", size: [300,300], visible: true) { | |
panel(new GfxPanel(), node:node) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment