(String index)
| 603 | } |
| 604 | |
| 605 | private int[] retrieveSketchLocation(String index) { |
| 606 | if (PreferencesData.get("last.screen.height") == null) |
| 607 | return defaultEditorLocation(); |
| 608 | |
| 609 | // if screen size has changed, the window coordinates no longer |
| 610 | // make sense, so don't use them unless they're identical |
| 611 | Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); |
| 612 | int screenW = PreferencesData.getInteger("last.screen.width"); |
| 613 | int screenH = PreferencesData.getInteger("last.screen.height"); |
| 614 | |
| 615 | if ((screen.width != screenW) || (screen.height != screenH)) |
| 616 | return defaultEditorLocation(); |
| 617 | |
| 618 | String locationStr = PreferencesData |
| 619 | .get("last.sketch" + index + ".location"); |
| 620 | if (locationStr == null) |
| 621 | return defaultEditorLocation(); |
| 622 | |
| 623 | int location[] = PApplet.parseInt(PApplet.split(locationStr, ',')); |
| 624 | if (location[0] > screen.width || location[1] > screen.height) |
| 625 | return defaultEditorLocation(); |
| 626 | |
| 627 | return location; |
| 628 | } |
| 629 | |
| 630 | protected void storeRecentSketches(SketchController sketch) { |
| 631 | if (sketch.isUntitled()) { |
no test coverage detected