Add maximize() method. Fixes #4181. by GKFX · Pull Request #4488 · processing/processing
boolean fullScreen; boolean maximize; // True if sketch should be created maximized. int display = -1; // use default GraphicsDevice[] displayDevices; // Unlike the others above, needs to be public to support
/** * Returns whether the sketch was/should be created maximized, not whether * it is now. */ final public boolean sketchMaximize() { return maximize; }
// // Could be named 'screen' instead of display since it's the people using // // full screen who will be looking for it. On the other hand, screenX/Y/Z // // makes things confusing, and if 'displayIndex' exists...
/** * ( begin auto-generated from maximize.xml ) * * Create this sketch maximized. * Description to come... * * ( end auto-generated ) * @webref environment * @param renderer the renderer to use, e.g. P2D, P3D, JAVA2D (default) * @see PApplet#settings() * @see PApplet#setup() * @see PApplet#size() */ public void maximize(String renderer) { if (!maximize && insideSettings("maximize")) { this.maximize = true; this.fullScreen = false; this.renderer = renderer; } }
/** * @see PApplet#maximize(String) */ public void maximize() { if (!maximize && insideSettings("maximize")) { this.maximize = true; this.fullScreen = false; } }
private CountDownLatch maximizeSignal = new CountDownLatch(1);
/** * Called by a PSurface to indicate that the window has maximized. */ public void doneMaximizing() { maximizeSignal.countDown(); }
/** * ( begin auto-generated from size.xml ) *
sketch.showSurface();
if (sketch.sketchMaximize()) try { if (!sketch.maximizeSignal.await(2500, TimeUnit.MILLISECONDS)) { System.err.format("maximize() failed for %s.%n", sketch.renderer); } } catch (InterruptedException e) {} sketch.startSurface(); /* if (sketch.getGraphics().displayable()) {