Skip to content

Instantly share code, notes, and snippets.

View aalmiray's full-sized avatar
💭
🧰 building cool stuff

Andres Almiray aalmiray

💭
🧰 building cool stuff
View GitHub Profile
/*
* 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
if (isMacOSX) {
javaOps << "-Xdock:name=$griffonAppName"
javaOps << "-Xdock:icon=${jardir.absolutePath}/griffon-icon-48x48.png"
}
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
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()
button("Sample", id: "button",
mouseEntered: controller.play,
mouseExited: controller.playReverse) {
timeline(button, id: "timeline", duration: 2500) {
interpolatedProperty("foreground", from: Color.BLUE, to: Color.RED)
}
}
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
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)
/*
* 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
import groovy.beans.Bindable
import groovy.swing.SwingBuilder
class Foo {
@Bindable Bar bar
}
class Bar {
@Bindable String baz
}
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") {