| 24 | |
| 25 | |
| 26 | public interface PSurface { |
| 27 | /** |
| 28 | * Minimum dimensions for the window holding an applet. This varies between |
| 29 | * platforms, Mac OS X 10.3 (confirmed with 10.7 and Java 6) can do any |
| 30 | * height but requires at least 128 pixels width. Windows XP has another |
| 31 | * set of limitations. And for all I know, Linux probably allows window |
| 32 | * sizes to be negative numbers. |
| 33 | */ |
| 34 | static public final int MIN_WINDOW_WIDTH = 128; |
| 35 | static public final int MIN_WINDOW_HEIGHT = 128; |
| 36 | |
| 37 | // renderer that doesn't draw to the screen |
| 38 | public void initOffscreen(PApplet sketch); |
| 39 | |
| 40 | // considering removal in favor of separate Component classes for appropriate renderers |
| 41 | // (i.e. for Java2D or a generic Image surface, but not PDF, debatable for GL or FX) |
| 42 | //public Component initComponent(PApplet sketch); |
| 43 | |
| 44 | //public Frame initFrame(PApplet sketch, Color backgroundColor, |
| 45 | // public void initFrame(PApplet sketch, int backgroundColor, |
| 46 | // int deviceIndex, boolean fullScreen, boolean spanDisplays); |
| 47 | public void initFrame(PApplet sketch); |
| 48 | |
| 49 | /** |
| 50 | * Get the native window object associated with this drawing surface. |
| 51 | * For Java2D, this will be an AWT Frame object. For OpenGL, the window. |
| 52 | * The data returned here is subject to the whims of the renderer, |
| 53 | * and using this method means you're willing to deal with underlying |
| 54 | * implementation changes and that you won't throw a fit like a toddler |
| 55 | * if your code breaks sometime in the future. |
| 56 | */ |
| 57 | public Object getNative(); |
| 58 | |
| 59 | // |
| 60 | |
| 61 | // Just call these on an AWT Frame object stored in PApplet. |
| 62 | // Silly, but prevents a lot of rewrite and extra methods for little benefit. |
| 63 | // However, maybe prevents us from having to document the 'frame' variable? |
| 64 | |
| 65 | /** Set the window (and dock, or whatever necessary) title. */ |
| 66 | public void setTitle(String title); |
| 67 | |
| 68 | /** Show or hide the window. */ |
| 69 | public void setVisible(boolean visible); |
| 70 | |
| 71 | /** Set true if we want to resize things (default is not resizable) */ |
| 72 | public void setResizable(boolean resizable); |
| 73 | |
| 74 | /** Dumb name, but inherited from Frame and no better ideas. */ |
| 75 | public void setAlwaysOnTop(boolean always); |
| 76 | |
| 77 | public void setIcon(PImage icon); |
| 78 | |
| 79 | // |
| 80 | |
| 81 | // public void placeWindow(int[] location); |
| 82 | |
| 83 | public void placeWindow(int[] location, int[] editorLocation); |
no outgoing calls
no test coverage detected