All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gnu.app.displayhack.eraser.Circle Maven / Gradle / Ivy

Go to download

Escher is a collection of libraries for X Window System written purely in Java.

The newest version!
package gnu.app.displayhack.eraser;


/**
 * Erase by a circle. 
 *
 * 

Modified from circle_wipe of erase.c in xscreensaver by Johannes * Keukelaar . */ public class Circle extends Eraser { public Circle () { super ("circle-wipe"); } public void erase (gnu.app.displayhack.DisplayHack hack) { gnu.x11.Window window = hack.window; /* Minimum radius = L/sqrt(2) ~= 0.707*L, * where L = max(width, heigth) * sqrt(2) = 1.414213562373095 * * Take radius = L for faster (easier) computation. */ int radius = Math.max (window.width, window.height); int full = 360 * 64; int delta = (full/200) * hack.eraser_delta; int step_count = (int) Math.ceil (1 + full/delta); int start = hack.random.nextInt (full); // clockwise or counter-clockwise if (hack.random.nextBoolean ()) delta = -delta; for (int i=0; i





© 2015 - 2025 Weber Informatics LLC | Privacy Policy