PSurface surface = game.getSurface(); SmoothCanvas smoothCanvas = (SmoothCanvas)surface.getNative(); JFrame frame = (JFrame) smoothCanvas.getFrame();
@Override public void setResizable(boolean resizable) { deprecationWarning("setResizable"); surface.setResizable(resizable); }
@Override public void setSize(int w, int h) { deprecationWarning("setSize"); surface.setSize(w, h); }
ps.setSize(200, 200); SmoothCanvas smoothCanvas = (SmoothCanvas)ps.getNative(); ps.startThread();
surface.initFrame(this); //, backgroundColor, displayNum, fullScreen, spanDisplays); surface.setTitle(getClass().getSimpleName()); surface.initOffscreen(this); // for PDF/PSurfaceNone and friends
@Override public void setTitle(String title) { deprecationWarning("setTitle"); surface.setTitle(title); }
/** See warning in showSurface() */ protected void startSurface() { surface.startThread(); }
/** * ( begin auto-generated from noCursor.xml ) * * Hides the cursor from view. Will not work when running the program in a * web browser or when running in full screen (Present) mode. * * ( end auto-generated ) * <h3>Advanced</h3> * Hide the cursor by creating a transparent image * and using it as a custom cursor. * @webref environment * @see PApplet#cursor() * @usage Application */ public void noCursor() { surface.hideCursor(); }
if (surface.isStopped()) {
@Override public void run() { loadingError = false; try { dataset = new DataSet(project); initInterface(); loaded = true; animAlpha.setTarget(0); surface.setTitle(project.dataTitle); } catch (Exception ex) { loadingError = true; errorMessage = ex.getMessage(); } } }
@Override public Object getNative() { return sketch.getSurface().getNative(); }
@Override public void setup() { surface.setResizable(true); colorMode(HSB, 1.0f); PFont font = createDefaultFont(12); textFont(font); this.evoBoard = new Board(this, seed); resetZoom(); peripherals.onMouse(MouseButton.NONE, MouseAction.WHEEL, this::zoom); peripherals.onMouse(MouseButton.LEFT, MouseAction.PRESS, this::mouseDown); peripherals.onMouse(MouseButton.LEFT, MouseAction.RELEASE, this::mouseUp); }
/** * Update the applet size to the current frameSize. The current frameSize * depends on which type of rendering is used. */ public void setFrameSize() { this.applet.getSurface().setSize((int) frameSize.x, (int) frameSize.y); }
public void setup() { Log.init(false); // loadPreferences(); tasker = new Tasker(); intf = new Interface(this, "style.css"); intf.setBackground(color(247)); initPanel(); // uploader = new UploadHandler(this); surface.setTitle(APP_NAME + " is loading..."); loadSession(); loadProject(inputFile); }
/** * Force a fullscreen size (for projectors). This call removes the window * decoration: menu bars, and makets it fullscreen. * * @param w width in pixels. * @param h hegiht in pixels. * @param px location in pixels (from left). * @param py location in pixels (from top). */ public void forceProjectorSize(int w, int h, int px, int py) { frameSize.set(w, h); // this.shouldSetWindowSize = true; // registerPost(); GLWindow window = (GLWindow) applet.getSurface().getNative(); window.setUndecorated(true); window.setSize(w, h); window.setPosition(px, py); }
protected void drawLoadAnimation() { animAlpha.update(); int alpha = animAlpha.getFloor(); if (alpha == 0) { animating = false; MiraApp.this.surface.setResizable(true); } float x = 0.5f * width; float y = 0.5f * height; float r = 75; fill(color(247), alpha); rect(0, 0, width, height); noStroke(); pushMatrix(); translate(0.5f * width, 0.5f * height); rotate(animTime); float da = PConstants.TWO_PI / 8; for (int i = 0; i < 8; i++) { fill(106, 179, 219, PApplet.map(i, 0, 9, 0, alpha)); arc(0, 0, r, r, i * da, (i + 1) * da); } popMatrix(); fill(250, alpha); ellipse(x, y, r - 5, r - 5); animTime += 0.1f; }
/** * Set the frame to default location given by the screenConfiguration. */ public void defaultFrameLocation() { ScreenConfiguration screenConfiguration = getDefaultScreenConfiguration(this.applet); this.applet.frame.setLocation(screenConfiguration.getProjectionScreenOffsetX(), screenConfiguration.getProjectionScreenOffsetY()); GLWindow window = (GLWindow) applet.getSurface().getNative(); window.setPosition(screenConfiguration.getProjectionScreenOffsetX(), screenConfiguration.getProjectionScreenOffsetY()); }