Java 2D Implementation of my tomatojs project