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 groovy.swing.SwingBuilder | |
import griffon.builder.trident.* | |
import griffon.builder.gfx.* | |
import griffon.builder.gfx.swing.* | |
import java.awt.Color | |
import java.beans.PropertyChangeEvent | |
class SquareNode extends CustomGfxNode { | |
@GfxAttribute Color foreground = Colors.get("yellow") | |
@GfxAttribute Color background = Colors.get("black") |
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 groovy.swing.SwingBuilder | |
import com.bric.plaf.* | |
import org.kordamp.jsilhouette.geom.* | |
def shapes =[ | |
new Arrow(10f, 10f, 100f, 60f), | |
new Balloon(10f, 10f, 100f, 100f, 20f, 20f, 10f, | |
Balloon.TAB_AT_BOTTOM, 0.5f, Balloon.ANGLE_AT_END), | |
new Cross(50f, 50f, 40f, 30f, 0f, 0.25f), | |
new Lauburu(50f, 50f, 40f, 0f) |
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
private def showWordCloud { | |
def counts = statusTableModel.filteredStatuses.inject([:]) { counts, status -> | |
status.split(/\s/).each{ counts.put(it, counts.get(it,0)+1) } | |
counts | |
} | |
log.info(counts) | |
} |
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
// JUNG2 http://jung.sourceforge.net | |
// JSilhouette http://code.google.com/p/jsilhouette | |
// Groovy http://groovy.codehaus.org | |
import edu.uci.ics.jung.graph.* | |
import edu.uci.ics.jung.visualization.* | |
import edu.uci.ics.jung.visualization.decorators.* | |
import edu.uci.ics.jung.visualization.renderers.* | |
import edu.uci.ics.jung.visualization.util.* | |
import edu.uci.ics.jung.algorithms.layout.* |
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
// JUNG2 http://jung.sourceforge.net | |
// JSilhouette http://code.google.com/p/jsilhouette | |
// Groovy http://groovy.codehaus.org | |
// improved over http://gist.github.com/192396 | |
import edu.uci.ics.jung.graph.* | |
import edu.uci.ics.jung.visualization.* | |
import edu.uci.ics.jung.visualization.decorators.* | |
import edu.uci.ics.jung.visualization.renderers.* | |
import edu.uci.ics.jung.algorithms.layout.* |
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 javax.swing.SwingConstants | |
import org.kordamp.jsilhouette.geom.* | |
import com.jhlabs.image.* | |
def lipsum = '''Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor | |
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis | |
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. | |
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu | |
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in | |
culpa qui officia deserunt mollit anim id est laborum. |
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
application(title: 'MapView', | |
size:[320,320], | |
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]) { | |
jxmapKit(addressLocationShown: true, dataProviderCreditShown: false, | |
miniMapVisible: false, zoomButtonsVisible: true, zoom: 5) { | |
waypoint(latitude: 10, longitude: 10) // random |
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
application(text: "SWT Demo", location:[100,100], size:[300,150]) { | |
gridLayout() | |
cTabFolder(style: "BOTTOM") { | |
gridData(style:"fill_both") | |
cTabItem("Item1", style:"none") { | |
text(style:"border, multi, v_scroll, h_scroll", "Content for Item1") | |
} | |
cTabItem("Item2", style:"none") { | |
text(style:"border, multi", "Content for Item2") | |
} |
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 org.apache.pivot.wtk.HorizontalAlignment | |
import org.apache.pivot.wtk.VerticalAlignment | |
import org.apache.pivot.wtk.Orientation | |
import java.awt.Font | |
import java.awt.Color | |
application(title: "Pivot Window", maximized: true) { | |
boxPane(padding: 10, verticalAlignment: VerticalAlignment.CENTER, orientation: Orientation.VERTICAL) { | |
label(text: "Hello Griffon!", font: new Font('Arial', Font.BOLD, 24), color: Color.RED, | |
horizontalAlignment: HorizontalAlignment.CENTER, verticalAlignment: VerticalAlignment.CENTER) |
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
/* | |
* Griffon + Pivot application based on | |
* http://incubator.apache.org/pivot/1.3/tutorials/link_buttons.html | |
*/ | |
import org.apache.pivot.wtk.Orientation | |
application(title: "Pivot Window", maximized: true) { | |
cardPane(id: 'aCardPane', styles: "{selectionChangeEffect:'horizontal_slide'}") { | |
boxPane(orientation: Orientation.VERTICAL, styles: '{horizontalAlignment:"center", verticalAlignment:"center"}') { | |
imageView(image: 'IMG_0735_2.jpg') |