Skip to content

Instantly share code, notes, and snippets.

@orekyuu
orekyuu / src_sample_Controller.java
Created November 1, 2014 13:31
アニメーションで画面遷移する奴
package sample;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import sample.controllable.ControllablePane;
import sample.controllable.animator.FadeAnimator;
import java.net.URL;
import java.util.ResourceBundle;
@orekyuu
orekyuu / src_sample_Controller.java
Created December 5, 2014 16:38
JavaFXAdventCalendar24日目で作ったやつ
package sample;
import javafx.animation.AnimationTimer;
import javafx.fxml.Initializable;
import javafx.geometry.Point2D;
import javafx.scene.canvas.Canvas;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
@orekyuu
orekyuu / Main.java
Created December 31, 2014 15:54
書き初め
/**
* 2015年書き初め
* 噂のセミコロンレスJavaにチャレンジ
*/
public class Main {
public static void main(String[] args) {
if (java.util.stream.IntStream.range(0, 2016)
.mapToObj(i -> (i % 3 == 0 && i % 5 == 0) ? "FizzBuzz" : ((i % 3 == 0) ? "Fizz" : (i % 5 == 0 ? "Buzz" : String.valueOf(i))))
.peek(System.out::println).allMatch(i -> true)){}
@orekyuu
orekyuu / UpdateNamePlugin.java
Created January 10, 2015 07:10
UpdateNamePlugin
package net.orekyuu.updatename;
import net.orekyuu.javatter.api.models.UserModel;
import net.orekyuu.javatter.api.plugin.OnLoad;
import net.orekyuu.javatter.api.twitter.ClientUser;
import net.orekyuu.javatter.api.twitter.ClientUserRegister;
import twitter4j.Status;
import twitter4j.TwitterException;
import java.util.regex.Matcher;
@orekyuu
orekyuu / src_Hoge.java
Created January 29, 2015 15:48
2回目の出力でfalseになる理由が知りたい
public class Hoge {
private int id;
public Hoge(int i) {
id = i;
}
public boolean equals(Hoge obj) {
return obj.id == id;
apply plugin: 'java'
apply plugin: 'idea'
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
sourceCompatibility = 1.8
version = '1.0'
repositories {
mavenCentral()
@orekyuu
orekyuu / src_sample_Controller.java
Created March 28, 2015 16:41
カスタムListCellでマルチスレッドを扱うサンプル
package sample;
import javafx.concurrent.Service;
import javafx.concurrent.Task;
import javafx.fxml.Initializable;
import javafx.scene.control.ListCell;
import javafx.scene.control.ListView;
import javafx.scene.control.ProgressBar;
import java.net.URL;
public interface EventListener {
void onMessage(String message);
}
@orekyuu
orekyuu / AboutController.java
Created May 30, 2015 11:02
ラムダと匿名クラスで挙動変わる
package net.orekyuu.javatter.core.controller;
import javafx.fxml.Initializable;
import javafx.scene.control.Hyperlink;
import javafx.scene.text.Text;
import net.orekyuu.javatter.api.twitter.model.Tweet;
import net.orekyuu.javatter.api.twitter.userstream.events.OnStatus;
import net.orekyuu.javatter.core.service.TwitterUserServiceImpl;
import net.orekyuu.javatter.core.twitter.TwitterUserImpl;
@orekyuu
orekyuu / Main.java
Created May 30, 2015 12:02
匿名クラスとラムダと時々弱参照
import java.lang.ref.WeakReference;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Main main = new Main();
main.run();
}
private void run() {