Skip to content

Instantly share code, notes, and snippets.

Avatar

Andres Almiray aalmiray

View GitHub Profile
View ApplicationBuilder.groovy
/*
* Copyright 2008 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
View gist:79304
if (isMacOSX) {
javaOps << "-Xdock:name=$griffonAppName"
javaOps << "-Xdock:icon=${jardir.absolutePath}/griffon-icon-48x48.png"
}
View gist:99606
import groovy.swing.SwingBuilder
def loremIpsum = """Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Suspendisse consectetur neque eget purus. Praesent aliquam,
mi eget vestibulum facilisis, leo ipsum mattis lacus, at
luctus lacus urna eget quam. Proin massa augue, consequat sed,
convallis et, faucibus id, ligula. Vivamus sagittis velit id
quam. Nam quis quam quis nisi convallis auctor. Etiam sodales
ligula ornare libero. Ut at eros vel diam ultrices sollicitudin.
Ut quis augue sed ante cursus luctus. Nullam sed urna. Etiam
View gist:114664
import java.awt.Color
import groovy.swing.SwingBuilder
import griffon.builder.trident.TridentBuilder
def trident = new TridentBuilder()
def swing = new SwingBuilder()
swing.edt {
frame( title: "Trident+Groovy", size: [400,200],
locationRelativeTo: null, visible: true ) {
flowLayout()
View gist:115266
button("Sample", id: "button",
mouseEntered: controller.play,
mouseExited: controller.playReverse) {
timeline(button, id: "timeline", duration: 2500) {
interpolatedProperty("foreground", from: Color.BLUE, to: Color.RED)
}
}
View gist:115315
package snake
import java.awt.Color
import java.awt.Dimension
import java.awt.Graphics
import javax.swing.JPanel
import org.pushingpixels.trident.Timeline
import org.pushingpixels.trident.Timeline.RepeatBehavior
View gist:115941
import java.awt.Color
import java.awt.Font
import matrix.Letter
import org.pushingpixels.trident.Timeline
import org.pushingpixels.trident.Timeline.RepeatBehavior
// warning!! reading font file on EDT
InputStream is = MatrixView.classLoader.getResourceAsStream("katakana.ttf")
Font kf = Font.createFont(Font.TRUETYPE_FONT, is)
View gist:117278
/*
* Copyright 2008 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
View gist:121006
import groovy.beans.Bindable
import groovy.swing.SwingBuilder
class Foo {
@Bindable Bar bar
}
class Bar {
@Bindable String baz
}
View Griffon + Flexdock
import java.awt.Color
application(title:'dock', size:[600,400],
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]) {
tabbedPane {
panel(title: "Simple") {
You can’t perform that action at this time.