/** * ( begin auto-generated from endRecord.xml ) * * Stops the recording process started by <b>beginRecord()</b> and closes * the file. * * ( end auto-generated ) * @webref output:files * @see PApplet#beginRecord(String, String) */ public void endRecord() { if (recorder != null) { recorder.endDraw(); recorder.dispose(); recorder = null; } }
/** * Called to dispose of resources and shut down the sketch. * Destroys the thread, dispose the renderer, and notify listeners. * <p/> * Not to be called or overriden by users. If called multiple times, * will only notify listeners once. Register a dispose listener instead. */ final public void dispose() { // moved here from stop() finished = true; // let the sketch know it is shut down time activity = null; // don't run stop and disposers twice // call to shut down renderer, in case it needs it (pdf does) if (g != null) g.dispose(); //surfaceView.destroyDrawingCache(); //surfaceView.surfaceDestroyed(surfaceView.getHolder()); //surfaceView = null; // window = null; handleMethods("dispose"); if (thread == null) return; thread = null; }
public void endRaw() { // ignore if (raw != null) { // for 3D, need to flush any geometry that's been stored for sorting // (particularly if the ENABLE_DEPTH_SORT hint is set) flush(); // just like beginDraw, this will have to be called because // endDraw() will be happening outside of draw() raw.endDraw(); raw.dispose(); raw = null; } }
public void endRaw() { // ignore if (raw != null) { // for 3D, need to flush any geometry that's been stored for sorting // (particularly if the ENABLE_DEPTH_SORT hint is set) flush(); // just like beginDraw, this will have to be called because // endDraw() will be happening outside of draw() raw.endDraw(); raw.dispose(); raw = null; } }
/** * Called to dispose of resources and shut down the sketch. * Destroys the thread, dispose the renderer,and notify listeners. * <p> * Not to be called or overriden by users. If called multiple times, * will only notify listeners once. Register a dispose listener instead. */ public void dispose() { // moved here from stop() finished = true; // let the sketch know it is shut down time // don't run the disposers twice if (surface.stopThread()) { // shut down renderer if (g != null) { g.dispose(); } // run dispose() methods registered by libraries handleMethods("dispose"); } if (platform == MACOSX) { try { final String td = "processing.core.ThinkDifferent"; final Class<?> thinkDifferent = getClass().getClassLoader().loadClass(td); thinkDifferent.getMethod("cleanup").invoke(null); } catch (Exception e) { e.printStackTrace(); } } }
void dispose() { if (viewTask != null && !viewTask.isDone()) { viewTask.cancel(true); } if (indepTask != null && !indepTask.isDone()) { indepTask.cancel(true); } if (pcanvas != null) { mira.g.removeCache(pcanvas); pcanvas.dispose(); pcanvas = null; } if (canvas != null) { mira.g.removeCache(canvas); canvas.dispose(); canvas = null; } mira.session.removePair(var, rowVar); }
PGraphics pdf = new PGraphicsPDF(); pdf.setPrimary(false); pdf.setPath(filename); pdf.setSize(sizeX, sizeY); // pdf.setParent(new PApplet()); This is intentionally NOT called. pdf.beginDraw(); // draw everything pdf.dispose(); pdf.endDraw();
@Override public void dispose() { // PGraphics if (asyncPixelReader != null) { asyncPixelReader.dispose(); asyncPixelReader = null; } if (!primaryGraphics) { deleteSurfaceTextures(); FrameBuffer ofb = offscreenFramebuffer; FrameBuffer mfb = multisampleFramebuffer; if (ofb != null) { ofb.dispose(); } if (mfb != null) { mfb.dispose(); } } pgl.dispose(); super.dispose(); }
@Override public void dispose() { // PGraphics if (asyncPixelReader != null) { asyncPixelReader.dispose(); asyncPixelReader = null; } if (!primaryGraphics) { deleteSurfaceTextures(); FrameBuffer ofb = offscreenFramebuffer; FrameBuffer mfb = multisampleFramebuffer; if (ofb != null) { ofb.dispose(); } if (mfb != null) { mfb.dispose(); } } pgl.dispose(); super.dispose(); }
public void draw(PGraphics pg, boolean pdf) { pg.beginDraw(); pg.background(WHITE); if (canDraw()) { if (vary.categorical()) { drawEikosogram(pg); } else { drawBoxplot(pg); } } else { drawCross(pg); } if (pdf) pg.dispose(); pg.endDraw(); }
public void draw(PGraphics pg, boolean pdf) { pg.beginDraw(); pg.background(WHITE); if (canDraw()) { float binw = (float)pg.width / binCount; pg.noStroke(); for (int bx = 0; bx < binCount; bx++) { float p = density[bx]; float h = PApplet.map(p, 0, maxProb, 0, 0.5f); // float p = density[bx]; pg.fill(hColor); pg.rect(binw * bx, pg.height * (1 - h), binw, pg.height * h); } } else { drawCross(pg); } if (pdf) pg.dispose(); pg.endDraw(); }
public void draw(PGraphics pg, boolean pdf) { pg.beginDraw(); pg.background(WHITE); if (canDraw()) { pg.noStroke(); float rad = 0; int a; int count = PApplet.min(500, points.size()); rad = PApplet.map(count, 0, 500, 0.05f, 0.01f); a = (int) PApplet.map(count, 0, 500, 70, 10); pg.fill(pg.red(COLOR), pg.green(COLOR), pg.blue(COLOR), a); for (Value2D pt : points) { float px = pg.width * (float) pt.x; float py = pg.height * (float) (1 - pt.y); float pw = pg.width * rad; float ph = pg.height * rad; if (50000 < points.size()) pg.rect(px - pw / 2, py - ph / 2, pw, ph); else pg.ellipse(px, py, pw, ph); } } else { drawCross(pg); } if (pdf) pg.dispose(); pg.endDraw(); }
public void draw(PGraphics pg, boolean pdf) { pg.beginDraw(); pg.background(WHITE); if (canDraw()) { float binw = (float)pg.width / binCountX; float binh = (float)pg.height / binCountY; pg.noStroke(); for (int bx = 0; bx < binCountX; bx++) { for (int by = 0; by < binCountY; by++) { float p = PApplet.map(density[bx][by], 0, maxProb, 0, 1); pg.fill(mixColors(WHITE, COLOR, p)); pg.rect(binw * bx, pg.height - binh * by, binw, -binh); } } } else { drawCross(pg); } if (pdf) pg.dispose(); pg.endDraw(); }