()
| 10980 | |
| 10981 | |
| 10982 | protected PSurface initSurface() { |
| 10983 | g = createPrimaryGraphics(); |
| 10984 | surface = g.createSurface(); |
| 10985 | |
| 10986 | // Create fake Frame object to warn user about the changes |
| 10987 | if (g.displayable()) { |
| 10988 | frame = new Frame() { |
| 10989 | @Override |
| 10990 | public void setResizable(boolean resizable) { |
| 10991 | deprecationWarning("setResizable"); |
| 10992 | surface.setResizable(resizable); |
| 10993 | } |
| 10994 | |
| 10995 | @Override |
| 10996 | public void setVisible(boolean visible) { |
| 10997 | deprecationWarning("setVisible"); |
| 10998 | surface.setVisible(visible); |
| 10999 | } |
| 11000 | |
| 11001 | @Override |
| 11002 | public void setTitle(String title) { |
| 11003 | deprecationWarning("setTitle"); |
| 11004 | surface.setTitle(title); |
| 11005 | } |
| 11006 | |
| 11007 | @Override |
| 11008 | public void setUndecorated(boolean ignored) { |
| 11009 | throw new RuntimeException("'frame' has been removed from Processing 3, " + |
| 11010 | "use fullScreen() to get an undecorated full screen frame"); |
| 11011 | } |
| 11012 | |
| 11013 | // Can't override this one because it's called by Window's constructor |
| 11014 | /* |
| 11015 | @Override |
| 11016 | public void setLocation(int x, int y) { |
| 11017 | deprecationWarning("setLocation"); |
| 11018 | surface.setLocation(x, y); |
| 11019 | } |
| 11020 | */ |
| 11021 | |
| 11022 | @Override |
| 11023 | public void setSize(int w, int h) { |
| 11024 | deprecationWarning("setSize"); |
| 11025 | surface.setSize(w, h); |
| 11026 | } |
| 11027 | |
| 11028 | private void deprecationWarning(String method) { |
| 11029 | PGraphics.showWarning("Use surface." + method + "() instead of " + |
| 11030 | "frame." + method + " in Processing 3"); |
| 11031 | //new Exception(method).printStackTrace(System.out); |
| 11032 | } |
| 11033 | }; |
| 11034 | |
| 11035 | surface.initFrame(this); //, backgroundColor, displayNum, fullScreen, spanDisplays); |
| 11036 | surface.setTitle(getClass().getSimpleName()); |
| 11037 | |
| 11038 | } else { |
| 11039 | surface.initOffscreen(this); // for PDF/PSurfaceNone and friends |
no test coverage detected