Skip to content

Instantly share code, notes, and snippets.

@skrb
skrb / InterpolatorDemo.java
Created Dec 9, 2015
Interpolator Demonstration
View InterpolatorDemo.java
import javafx.animation.Animation;
import javafx.animation.Interpolator;
import javafx.animation.TranslateTransition;
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.image.Image;
@skrb
skrb / BezierDrawer.java
Created Dec 30, 2014
Bezier Demo: Enable Touch, Mouse Drag and Slider
View BezierDrawer.java
package net.javainthebox.bezier;
import javafx.application.Application;
import javafx.beans.binding.Bindings;
import javafx.beans.property.DoubleProperty;
import javafx.scene.Group;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.Slider;
@skrb
skrb / RockPaperScissors
Last active Aug 29, 2015
じゃんけん
View RockPaperScissors
import java.util.EnumMap;
import java.util.Map;
import java.util.Random;
import java.util.function.Supplier;
public class RockPaperScissors {
class FormatException extends Exception {
public FormatException(String message) {
super(message);
@skrb
skrb / IrofDrawingSong.java
Created Dec 24, 2014
Irod Drawing Song by JavaFX
View IrofDrawingSong.java
package irofdrawingsong;
import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
import javafx.animation.Timeline;
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Group;
import javafx.scene.Scene;
View CircleDemo.java
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.stage.Stage;
public class CircleDemo extends Application {
@Override
@skrb
skrb / Sum.java
Created Sep 5, 2014
StreamとパラレルStreamの比較
View Sum.java
import java.util.function.IntConsumer;
import java.util.stream.IntStream;
public class Sum {
private static final int SIZE = 1_000_000;
public Sum() {
evaluate("sum000", i -> sum000());
View AsyncTextAreaUpdater.java
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import javafx.application.Application;
import javafx.beans.property.StringProperty;
import javafx.concurrent.Service;
import javafx.concurrent.Task;
@skrb
skrb / SwitchOnOff.java
Created Jun 28, 2014
SwitchOnOff.java
View SwitchOnOff.java
/*
* Java Embedded Raspberry Pi GPIO app
* スイッチポチポチ♪
* 用意するもの
* ジャンパーケーブル(オス×メス:2本、オス×オス:1本)
* タクトスイッチ(モーメンタリ)
* 抵抗 10kΩ(茶・黒・橙・金)
*/
import java.io.File;
import java.io.FileWriter;
View BlinkLED.java
/*
* Java Embedded Raspberry Pi GPIO app
* エルチカ♪
* * 用意するもの
* ジャンパーケーブル(オス×メス:2本)
* LED(RED 3.3v)
* 抵抗 470Ω(黄・紫・茶・金)
*/
import java.io.File;
import java.io.FileWriter;
@skrb
skrb / Album.java
Created Jun 24, 2014
Table Sample
View Album.java
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleObjectProperty;
public class Album {
private ObjectProperty<String> title = new SimpleObjectProperty<>();
private ObjectProperty<String> artist = new SimpleObjectProperty<>();