Search in sources :

Example 1 with PApplet

use of processing.core.PApplet in project geomerative by rikrd.

the class HelloSplittingShapesTest method setUp.

public void setUp() {
    PApplet applet = new PApplet();
    RG.init(applet);
    RSVG svgLoader = new RSVG();
    // need to be in the geomerative directory for this to work
    poly = svgLoader.toGroup("./tutorial/Tutorial_13_HelloSplittingShapes/data/bot1.svg").toPolygon();
}
Also used : PApplet(processing.core.PApplet)

Example 2 with PApplet

use of processing.core.PApplet in project hid-serial by rayshobby.

the class G4P method setCursor.

public static void setCursor(int cursorOff, GWindow window) {
    PApplet app = window.papplet;
    setCursor(cursorOff, app);
}
Also used : PApplet(processing.core.PApplet)

Example 3 with PApplet

use of processing.core.PApplet in project hid-serial by rayshobby.

the class GWindowCloser method post.

public void post() {
    // System.out.println("Window to dispose " + toDisposeOf.size());
    if (!toDisposeOf.isEmpty()) {
        for (GWindow gwindow : toDisposeOf) {
            PApplet wapp = gwindow.papplet;
            GWindowInfo winfo = G4P.windows.get(wapp);
            if (winfo != null) {
                winfo.dispose();
                G4P.windows.remove(wapp);
                gwindow.dispose();
            }
        }
        toDisposeOf.clear();
    }
}
Also used : PApplet(processing.core.PApplet)

Example 4 with PApplet

use of processing.core.PApplet in project hid-serial by rayshobby.

the class G4P method addWindow.

/**
	 * Register a GWindow object.
	 * 
	 * @param window
	 */
static void addWindow(GWindow window) {
    PApplet app = window.papplet;
    GWindowInfo winfo = windows.get(app);
    if (winfo == null) {
        winfo = new GWindowInfo(app);
        windows.put(app, winfo);
    }
    // Create and start windows closer object
    if (windowCloser == null) {
        windowCloser = new GWindowCloser();
        sketchApplet.registerMethod("post", windowCloser);
    }
}
Also used : PApplet(processing.core.PApplet)

Example 5 with PApplet

use of processing.core.PApplet in project hid-serial by rayshobby.

the class G4P method removeControl.

/**
	 * Remove a control from the window. This is used in preparation 
	 * for disposing of a control.
	 * @param control
	 * @return true if control was remove else false
	 */
static boolean removeControl(GAbstractControl control) {
    PApplet app = control.getPApplet();
    GWindowInfo winfo = windows.get(app);
    if (winfo != null) {
        winfo.removeControl(control);
        return true;
    }
    return false;
}
Also used : PApplet(processing.core.PApplet)

Aggregations

PApplet (processing.core.PApplet)6