Skip to content

Instantly share code, notes, and snippets.

View shemnon's full-sized avatar

Danno Ferrin shemnon

View GitHub Profile
@shemnon
shemnon / gist:4652761
Created January 28, 2013 03:20
RT-26719
import javafx.application.Application;
import javafx.scene.Node;
import javafx.scene.SceneBuilder;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.ScrollPaneBuilder;
import javafx.scene.control.SplitPane;
import javafx.scene.control.SplitPaneBuilder;
import javafx.scene.layout.Region;
import javafx.scene.layout.VBox;
import javafx.scene.text.Text;
@shemnon
shemnon / build.gradle
Created January 16, 2013 18:14
BinTray configuration in Gradle
/* SNIP */
uploadArchives {
repositories {
mavenDeployer {
repository(
url:"https://api.bintray.com/maven/shemnon/javafx-gradle/plugin/",
id: 'bintray-shemnon-javafx-gradle-plugin'
) {
try {
@shemnon
shemnon / build-from-snapshot.gradle
Created November 8, 2012 04:58
Installing the JavaFX Gradle Plugin
apply from: 'https://repository-javafx-gradle-plugin.forge.cloudbees.com/snapshot/javafx.plugin'
@shemnon
shemnon / gist:3711882
Created September 13, 2012 04:37
Annotated Styleable CSS Musing
// Approach A - Just annotate the property method
StyleableDoubleProperty size = new StyleableDoubleProperty(this, "size", 1.0);
StyleableDoubleProperty weight = new StyleableDoubleProperty(this, "weight", 200);
@Styleable("-x-weight", initial="200pt")
public DoubleProperty weightProperty() {return weight;}
@Styleable("-x-size")
public StyleableDoubleProperty sizeProperty() {return size;}
@shemnon
shemnon / StyleableProperty1.java
Created September 13, 2012 03:49
JavaFX CSS Styling Plumbing
public final void setBackScale(double value) {
backScaleProperty().set(value);
}
public final double getBackScale() {
return backScale == null ? 0.7 : backScale.get();
}
public final DoubleProperty backScaleProperty() {
if (backScale == null) {
backScale = new StyleableDoubleProperty(0.7) {
@shemnon
shemnon / FXMLDemoInline.fxml
Created September 4, 2012 14:07
GroovyFX 3.0 FXML integration
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<AnchorPane xmlns:fx="http://javafx.com/fxml"
id="AnchorPane"
prefHeight="150.0" prefWidth="320.0" >
@shemnon
shemnon / gist:3621291
Created September 4, 2012 13:45
Griffon Native JavaFX Packaging
griffon package jfx-native
@shemnon
shemnon / gist:3621275
Created September 4, 2012 13:43
Creating a JavaFX Griffon App
griffon create-app MyJavaFXApp -archetype=javafx
@shemnon
shemnon / PermissionVsForgiveness.java
Created February 20, 2012 20:36
Permission (guard blocks) vs. Forgiveness (catching NPEs)
import java.util.Arrays;
import java.util.Random;
import java.util.concurrent.Callable;
public class PermissionVsForgiveness {
int[] a1, a2, a3, a4;
Callable<Integer> permission = new Callable<Integer>() {
@shemnon
shemnon / gist:912639
Created April 10, 2011 19:30
Subtstance Image Wrapper Icon Deadlock
Thread-2477@12271, prio=6, in group 'main', status: 'MONITOR'
blocks Thread-2476@12270
blocks AWT-EventQueue-0@10510
waiting for Thread-2476@12270 to release lock on {1}
at org.pushingpixels.flamingo.api.common.icon.ImageWrapperIcon.setPreferredSize(ImageWrapperIcon.java:203)
at org.pushingpixels.flamingo.api.common.icon.ImageWrapperResizableIcon.setPreferredSize(ImageWrapperResizableIcon.java:43)
at org.pushingpixels.flamingo.api.common.icon.ImageWrapperResizableIcon.setDimension(ImageWrapperResizableIcon.java:126)
at org.pushingpixels.flamingo.api.common.icon.LayeredIcon.setDimension(LayeredIcon.java:64)
at org.pushingpixels.flamingo.internal.ui.common.BasicCommandButtonUI.syncIconDimension(BasicCommandButtonUI.java:1228)
at org.pushingpixels.flamingo.internal.ui.common.BasicCommandButtonUI$2$1.completed(BasicCommandButtonUI.java:282)