Skip to content

Instantly share code, notes, and snippets.

View miho's full-sized avatar

Michael Hoffer miho

View GitHub Profile
@miho
miho / UnmodifiableMapSample.java
Created July 16, 2012 11:52
Unmodifiable Map Sample
/**
*
* @author Michael Hoffer <[email protected]>
*/
public class UnmodifiableMapSample {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
@miho
miho / CodeEditor.java
Created July 21, 2012 13:19 — forked from jewelsea/CodeEditor.java
CodeMirror based code editor for JavaFX
import javafx.scene.layout.StackPane;
import javafx.scene.web.WebView;
/**
* A syntax highlighting code editor for JavaFX created by wrapping a
* CodeMirror code editor in a WebView.
*
* See http://codemirror.net for more information on using the codemirror editor.
*/
public class CodeEditor extends StackPane {
@miho
miho / CenteredNodeInScrollPaneExample.java
Created July 21, 2012 13:40 — forked from jewelsea/CenteredNodeInScrollPaneExample.java
Example of scrollpane viewports, transforms and layout bounds in JavaFX
import javafx.application.Application;
import javafx.application.Platform;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Bounds;
import javafx.geometry.Pos;
import javafx.scene.Node;
import javafx.scene.Scene;
@miho
miho / aGameCenter_Codea.h
Created July 22, 2012 20:29 — forked from juaxix/aGameCenter_Codea.h
Objective C - connection with Game Center and highscores board
//
// aGameCenter_Codea.h
//
// Created by Juan Belón on 28/05/12
// Games -> http://www.xixgames.com
// LGPL - @juaxix - Codea connection!
//
#import <Foundation/Foundation.h>
#import <GameKit/GameKit.h>
@miho
miho / ModalConfirmExample.java
Created September 22, 2012 17:57 — forked from jewelsea/ModalConfirmExample.java
JavaFX Modal Confirm Dialog Box Example
import javafx.application.Application;
import javafx.beans.value.*;
import javafx.concurrent.Worker;
import javafx.event.*;
import javafx.scene.*;
import javafx.scene.control.*;
import javafx.scene.effect.BoxBlur;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.*;
import javafx.scene.paint.Color;
@miho
miho / FXZoomTest01.java
Created October 2, 2012 10:08
FXZoomTest01 (testing what happens if size of scaled nodes changes)
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fxzoomtest01;
import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
import javafx.animation.ScaleTransition;
import javafx.animation.Timeline;
@miho
miho / DraggableNode01.java
Created October 2, 2012 17:03
Draggable Node 01 (make JavaFX nodes draggable)
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.Pane;
import javafx.scene.layout.StackPane;
import javafx.scene.paint.Color;
@miho
miho / DraggableNode02.java
Created October 3, 2012 20:00
Draggable Node 02 (make JavaFX nodes draggable)
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Cursor;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.input.MouseEvent;
import javafx.scene.input.ScrollEvent;
import javafx.scene.layout.Pane;
@miho
miho / ExampleCustomPGNode.java
Created October 28, 2012 20:40
Example custom render node for JavaFX 2.2
package org.dejay.javafx.example;
import javafx.animation.Transition;
import javafx.application.Application;
import javafx.collections.ObservableList;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.Region;
import javafx.scene.text.Font;
//
// aGameCenter_Codea.h
//
// Created by Juan Belón on 28/05/12
// Games -> http://www.xixgames.com
// LGPL - @juaxix - Codea connection!
//
#import <Foundation/Foundation.h>
#import <GameKit/GameKit.h>