()
| 1945 | |
| 1946 | |
| 1947 | static public void locateSketchbookFolder() { |
| 1948 | // If a value is at least set, first check to see if the folder exists. |
| 1949 | // If it doesn't, warn the user that the sketchbook folder is being reset. |
| 1950 | String sketchbookPath = Preferences.getSketchbookPath(); |
| 1951 | if (sketchbookPath != null) { |
| 1952 | sketchbookFolder = new File(sketchbookPath); |
| 1953 | if (!sketchbookFolder.exists()) { |
| 1954 | Messages.showWarning("Sketchbook folder disappeared", |
| 1955 | "The sketchbook folder no longer exists.\n" + |
| 1956 | "Processing will switch to the default sketchbook\n" + |
| 1957 | "location, and create a new sketchbook folder if\n" + |
| 1958 | "necessary. Processing will then stop talking\n" + |
| 1959 | "about itself in the third person.", null); |
| 1960 | sketchbookFolder = null; |
| 1961 | } |
| 1962 | } |
| 1963 | |
| 1964 | // If no path is set, get the default sketchbook folder for this platform |
| 1965 | if (sketchbookFolder == null) { |
| 1966 | sketchbookFolder = getDefaultSketchbookFolder(); |
| 1967 | Preferences.setSketchbookPath(sketchbookFolder.getAbsolutePath()); |
| 1968 | if (!sketchbookFolder.exists()) { |
| 1969 | sketchbookFolder.mkdirs(); |
| 1970 | } |
| 1971 | } |
| 1972 | makeSketchbookSubfolders(); |
| 1973 | } |
| 1974 | |
| 1975 | |
| 1976 | public void setSketchbookFolder(File folder) { |
no test coverage detected