diff --git a/app/PdeBase.java b/app/PdeBase.java index fa3448feb..8aa5c6fc2 100644 --- a/app/PdeBase.java +++ b/app/PdeBase.java @@ -4,9 +4,8 @@ PdeBase - base class for the main processing application Part of the Processing project - http://Proce55ing.net - Copyright (c) 2001-03 - Ben Fry, Massachusetts Institute of Technology and - Casey Reas, Interaction Design Institute Ivrea + Except where noted, code is written by Ben Fry and + Copyright (c) 2001-03 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/app/PdeCompiler.java b/app/PdeCompiler.java index c23b8d533..6d8c1eaf3 100644 --- a/app/PdeCompiler.java +++ b/app/PdeCompiler.java @@ -4,9 +4,8 @@ PdeCompiler - default compiler class that connects to jikes Part of the Processing project - http://Proce55ing.net - Copyright (c) 2001-03 - Ben Fry, Massachusetts Institute of Technology and - Casey Reas, Interaction Design Institute Ivrea + Except where noted, code is written by Ben Fry and + Copyright (c) 2001-03 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/app/PdeCompilerJavac.java b/app/PdeCompilerJavac.java index 4fa824e11..d60e6820d 100755 --- a/app/PdeCompilerJavac.java +++ b/app/PdeCompilerJavac.java @@ -4,9 +4,8 @@ PdeCompilerJavac - compiler interface to kjc.. someday this will go away Part of the Processing project - http://Proce55ing.net - Copyright (c) 2001-03 - Ben Fry, Massachusetts Institute of Technology and - Casey Reas, Interaction Design Institute Ivrea + Except where noted, code is written by Ben Fry and + Copyright (c) 2001-03 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/app/PdeCompilerKjc.java b/app/PdeCompilerKjc.java index 51ced9177..6e13978e8 100644 --- a/app/PdeCompilerKjc.java +++ b/app/PdeCompilerKjc.java @@ -4,9 +4,8 @@ PdeCompilerKjc - compiler interface to kjc.. someday this will go away Part of the Processing project - http://Proce55ing.net - Copyright (c) 2001-03 - Ben Fry, Massachusetts Institute of Technology and - Casey Reas, Interaction Design Institute Ivrea + Except where noted, code is written by Ben Fry and + Copyright (c) 2001-03 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/app/PdeEditor.java b/app/PdeEditor.java index 6c88498b5..f33b7100c 100644 --- a/app/PdeEditor.java +++ b/app/PdeEditor.java @@ -4,9 +4,8 @@ PdeEditor - main editor panel for the processing ide Part of the Processing project - http://Proce55ing.net - Copyright (c) 2001-03 - Ben Fry, Massachusetts Institute of Technology and - Casey Reas, Interaction Design Institute Ivrea + Except where noted, code is written by Ben Fry and + Copyright (c) 2001-03 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -342,7 +341,6 @@ public class PdeEditor extends JFrame } } }); - // can this happen here? //restorePreferences(); } @@ -406,7 +404,7 @@ public class PdeEditor extends JFrame String sketchDir = PdePreferences.get("last.sketch.path"); if (sketchName != null) { - if (new File(sketchDir + File.separator + sketchName).exists()) { + if (new File(sketchDir + File.separator + sketchName + ".pde").exists()) { skOpen(sketchDir, sketchName); } else { @@ -1499,7 +1497,7 @@ public class PdeEditor extends JFrame public void checkModified2() { switch (checking) { - case SK_NEW: skNew2(); break; + case SK_NEW: skNew2(false); break; case SK_OPEN: skOpen2(openingPath, openingName); break; case DO_QUIT: doQuit2(); break; } @@ -1521,53 +1519,56 @@ public class PdeEditor extends JFrame */ protected void skNew2(boolean startup) { try { - File sketchDir = null; - String sketchName = null; + File newbieDir = null; + String newbieName = null; if (PdePreferences.getBoolean("sketchbook.prompt") && !startup) { + // prompt for the filename and location for the new sketch + FileDialog fd = new FileDialog(new Frame(), "Create new sketch named", FileDialog.SAVE); fd.setDirectory(PdePreferences.get("sketchbook.path")); fd.show(); - String sketchParentDir = fd.getDirectory(); - sketchName = fd.getFile(); - if (sketchName == null) return; + String newbieParentDir = fd.getDirectory(); + newbieName = fd.getFile(); + if (newbieName == null) return; - sketchDir = new File(sketchParentDir, sketchName); + newbieDir = new File(newbieParentDir, newbieName); } else { - String sketchParentDir = PdePreferences.get("sketchbook.path"); + // use a generic name like sketch_031008a, the date plus a char + String newbieParentDir = PdePreferences.get("sketchbook.path"); int index = 0; SimpleDateFormat formatter = new SimpleDateFormat("yyMMdd"); String purty = formatter.format(new Date()); do { - sketchName = "sketch_" + purty + ((char) ('a' + index)); - sketchDir = new File(sketchParentDir, sketchName); + newbieName = "sketch_" + purty + ((char) ('a' + index)); + newbieDir = new File(newbieParentDir, newbieName); index++; - } while (sketchDir.exists()); + } while (newbieDir.exists()); } // mkdir for new project name - sketchDir.mkdirs(); + newbieDir.mkdirs(); //new File(sketchDir, "data").mkdirs(); // make empty pde file - File sketchFile = new File(sketchDir, sketchName + ".pde"); - new FileOutputStream(sketchFile); + File newbieFile = new File(newbieDir, newbieName + ".pde"); + new FileOutputStream(newbieFile); #ifdef MACOS - // thank you apple, for changing this + // thank you apple, for changing this @#$)(* //com.apple.eio.setFileTypeAndCreator(String filename, int, int); // jdk13 on osx, or jdk11 // though apparently still available for 1.4 if ((PdeBase.platform == PdeBase.MACOS9) || (PdeBase.platform == PdeBase.MACOSX)) { - MRJFileUtils.setFileTypeAndCreator(sketchFile, + MRJFileUtils.setFileTypeAndCreator(newbieFile, MRJOSType.kTypeTEXT, new MRJOSType("Pde1")); } @@ -1577,12 +1578,10 @@ public class PdeEditor extends JFrame // actually, don't, that way can avoid too much extra mess // rebuild the menu here - //base.rebuildSketchbookMenu(); sketchbook.rebuildMenu(); // now open it up - //skOpen(sketchFile, sketchDir); - handleOpen(sketchName, sketchFile, sketchDir); + handleOpen(newbieName, newbieFile, newbieDir); } catch (IOException e) { // NEED TO DO SOME ERROR REPORTING HERE *** @@ -1604,10 +1603,6 @@ public class PdeEditor extends JFrame /* - public void doOpen() { - checkModified(DO_OPEN); - } - protected void doOpen2() { // at least set the default dir here to the sketchbook folder diff --git a/app/PdeEditorButtons.java b/app/PdeEditorButtons.java index 7a87e3293..63fd6ce0a 100644 --- a/app/PdeEditorButtons.java +++ b/app/PdeEditorButtons.java @@ -4,9 +4,8 @@ PdeEditorButtons - run/stop/etc buttons for the ide Part of the Processing project - http://Proce55ing.net - Copyright (c) 2001-03 - Ben Fry, Massachusetts Institute of Technology and - Casey Reas, Interaction Design Institute Ivrea + Except where noted, code is written by Ben Fry and + Copyright (c) 2001-03 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/app/PdeEditorConsole.java b/app/PdeEditorConsole.java index b5a0ca8ae..26ede1435 100644 --- a/app/PdeEditorConsole.java +++ b/app/PdeEditorConsole.java @@ -4,9 +4,8 @@ PdeEditorConsole - message console that sits below the program area Part of the Processing project - http://Proce55ing.net - Copyright (c) 2001-03 - Ben Fry, Massachusetts Institute of Technology and - Casey Reas, Interaction Design Institute Ivrea + Except where noted, code is written by Ben Fry and + Copyright (c) 2001-03 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/app/PdeEditorFind.java b/app/PdeEditorFind.java index 04c5dec9b..426377358 100644 --- a/app/PdeEditorFind.java +++ b/app/PdeEditorFind.java @@ -1,16 +1,32 @@ +/* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */ + +/* + PdeEditorFind - find/replace window for processing + Part of the Processing project - http://Proce55ing.net + + Except where noted, code is written by Ben Fry and + Copyright (c) 2001-03 Massachusetts Institute of Technology + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + import java.awt.*; import java.awt.event.*; import javax.swing.*; -/* - Find: [ ] - Replace with: [ ] - - [ ] Ignore Case - - [Replace All] [Replace] [Replace & Find] [Previous] [Next] -*/ public class PdeEditorFind extends JFrame implements ActionListener { static final int BIG = 13; static final int SMALL = 6; @@ -22,9 +38,6 @@ public class PdeEditorFind extends JFrame implements ActionListener { JButton replaceButton; JButton replaceAllButton; - //JButton replaceFindButton; - //JButton previousButton; - //JButton nextButton; JButton findButton; boolean found; diff --git a/app/PdeEditorHeader.java b/app/PdeEditorHeader.java index 10e928372..bb5b68e40 100644 --- a/app/PdeEditorHeader.java +++ b/app/PdeEditorHeader.java @@ -4,9 +4,8 @@ PdeEditorHeader - panel that containing the sketch title Part of the Processing project - http://Proce55ing.net - Copyright (c) 2001-03 - Ben Fry, Massachusetts Institute of Technology and - Casey Reas, Interaction Design Institute Ivrea + Except where noted, code is written by Ben Fry and + Copyright (c) 2001-03 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/app/PdeEditorStatus.java b/app/PdeEditorStatus.java index b15ef11df..4fc3be3e1 100644 --- a/app/PdeEditorStatus.java +++ b/app/PdeEditorStatus.java @@ -4,9 +4,8 @@ PdeEditorStatus - panel containing status messages Part of the Processing project - http://Proce55ing.net - Copyright (c) 2001-03 - Ben Fry, Massachusetts Institute of Technology and - Casey Reas, Interaction Design Institute Ivrea + Except where noted, code is written by Ben Fry and + Copyright (c) 2001-03 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/app/PdeException.java b/app/PdeException.java index f8e4ee19b..0d24b8056 100644 --- a/app/PdeException.java +++ b/app/PdeException.java @@ -4,9 +4,8 @@ PdeException - an exception with a line number attached Part of the Processing project - http://Proce55ing.net - Copyright (c) 2001-03 - Ben Fry, Massachusetts Institute of Technology and - Casey Reas, Interaction Design Institute Ivrea + Except where noted, code is written by Ben Fry and + Copyright (c) 2001-03 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/app/PdeFontBuilder.java b/app/PdeFontBuilder.java index 3d7aaf24b..01a5d3bf1 100644 --- a/app/PdeFontBuilder.java +++ b/app/PdeFontBuilder.java @@ -4,6 +4,7 @@ PdeFontBuilder - gui interface to font creation heaven/hell Part of the Processing project - http://Proce55ing.net + Except where noted, code is written by Ben Fry and Copyright (c) 2001-03 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify diff --git a/app/PdeHistory.java b/app/PdeHistory.java index 6be50ec7a..772ca17e8 100644 --- a/app/PdeHistory.java +++ b/app/PdeHistory.java @@ -4,9 +4,8 @@ PdeHistory - handler for storing history information about a project Part of the Processing project - http://Proce55ing.net - Copyright (c) 2001-03 - Ben Fry, Massachusetts Institute of Technology and - Casey Reas, Interaction Design Institute Ivrea + Except where noted, code is written by Ben Fry and + Copyright (c) 2001-03 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -44,27 +43,17 @@ public class PdeHistory { static final String HISTORY_SEPARATOR = "#################################################"; - //boolean recordingHistory; - //JMenu historyMenu; JMenu menu; + // true if the sketch is read-only, + // meaning that no history will be recorded + boolean readOnlySketch; + File historyFile; - //OutputStream historyStream; - //PrintWriter historyWriter; - //String lastRecorded; String lastRecorded; ActionListener menuListener; - /* - ActionListener historyMenuListener = - new ActionListener() { - public void actionPerformed(ActionEvent e) { - editor.retrieveHistory(e.getActionCommand()); - } - }; - */ - public PdeHistory(PdeEditor editor) { this.editor = editor; @@ -82,7 +71,10 @@ public class PdeHistory { /** * Set the path for the current sketch */ - public void setPath(String path) { + public void setPath(String path, boolean readOnlySketch) { + this.readOnlySketch = true; + + if (readOnlySketch) return; historyFile = new File(path, "history.gz"); } @@ -103,6 +95,8 @@ public class PdeHistory { * mode is RUN, SAVE, AUTOSAVE, or BEAUTIFY */ public void record(String program, int mode) { + if (readOnlySketch) return; + if (!PdePreferences.getBoolean("history.recording")) return; if ((lastRecorded != null) && diff --git a/app/PdeKeywords.java b/app/PdeKeywords.java index c4868dd8c..0bf7e8fcb 100644 --- a/app/PdeKeywords.java +++ b/app/PdeKeywords.java @@ -4,9 +4,8 @@ PdeKeywords - handles text coloring and links to html reference Part of the Processing project - http://Proce55ing.net - Copyright (c) 2001-03 - Ben Fry, Massachusetts Institute of Technology and - Casey Reas, Interaction Design Institute Ivrea + Except where noted, code is written by Ben Fry and + Copyright (c) 2001-03 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/app/PdeMessageConsumer.java b/app/PdeMessageConsumer.java index 23330b513..5ed25ad46 100644 --- a/app/PdeMessageConsumer.java +++ b/app/PdeMessageConsumer.java @@ -4,9 +4,8 @@ PdeMessageConsumer - interface for dealing with parser/compiler output Part of the Processing project - http://Proce55ing.net - Copyright (c) 2001-03 - Ben Fry, Massachusetts Institute of Technology and - Casey Reas, Interaction Design Institute Ivrea + Except where noted, code is written by Ben Fry and + Copyright (c) 2001-03 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/app/PdeMessageSiphon.java b/app/PdeMessageSiphon.java index 9565787ea..3177ae6fd 100644 --- a/app/PdeMessageSiphon.java +++ b/app/PdeMessageSiphon.java @@ -4,9 +4,8 @@ PdeMessageSiphon - slurps up messages from compiler Part of the Processing project - http://Proce55ing.net - Copyright (c) 2001-03 - Ben Fry, Massachusetts Institute of Technology and - Casey Reas, Interaction Design Institute Ivrea + Except where noted, code is written by Ben Fry and + Copyright (c) 2001-03 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/app/PdeMessageStream.java b/app/PdeMessageStream.java index 451d35922..a38947224 100644 --- a/app/PdeMessageStream.java +++ b/app/PdeMessageStream.java @@ -4,9 +4,8 @@ PdeMessageStream - outputstream to handle stdout/stderr messages Part of the Processing project - http://Proce55ing.net - Copyright (c) 2001-03 - Ben Fry, Massachusetts Institute of Technology and - Casey Reas, Interaction Design Institute Ivrea + Except where noted, code is written by Ben Fry and + Copyright (c) 2001-03 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/app/PdePreferences.java b/app/PdePreferences.java index aade6f570..f99652190 100644 --- a/app/PdePreferences.java +++ b/app/PdePreferences.java @@ -4,9 +4,8 @@ PdePreferences - controls user preferences and environment settings Part of the Processing project - http://Proce55ing.net - Copyright (c) 2001-03 - Ben Fry, Massachusetts Institute of Technology and - Casey Reas, Interaction Design Institute Ivrea + Except where noted, code is written by Ben Fry and + Copyright (c) 2001-03 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/app/PdePreprocessor.java b/app/PdePreprocessor.java index 8c9a650ff..8b38a8fc5 100644 --- a/app/PdePreprocessor.java +++ b/app/PdePreprocessor.java @@ -4,9 +4,8 @@ PdePreprocessor - default ANTLR-generated parser Part of the Processing project - http://Proce55ing.net - Copyright (c) 2001-03 - Ben Fry, Massachusetts Institute of Technology and - Casey Reas, Interaction Design Institute Ivrea + Except where noted, code is written by Ben Fry and + Copyright (c) 2001-03 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/app/PdePreprocessorOro.java b/app/PdePreprocessorOro.java index 2b6abfc4e..21d9852d7 100644 --- a/app/PdePreprocessorOro.java +++ b/app/PdePreprocessorOro.java @@ -4,9 +4,8 @@ PdePreprocessorOro - current oro-based preprocessor (soon to be gone) Part of the Processing project - http://Proce55ing.net - Copyright (c) 2001-03 - Ben Fry, Massachusetts Institute of Technology and - Casey Reas, Interaction Design Institute Ivrea + Except where noted, code is written by Ben Fry and + Copyright (c) 2001-03 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/app/PdeRuntime.java b/app/PdeRuntime.java index 96da5b0bf..f9c74a1b8 100644 --- a/app/PdeRuntime.java +++ b/app/PdeRuntime.java @@ -4,9 +4,8 @@ PdeRuntime - runs compiled java applet Part of the Processing project - http://Proce55ing.net - Copyright (c) 2001-03 - Ben Fry, Massachusetts Institute of Technology and - Casey Reas, Interaction Design Institute Ivrea + Except where noted, code is written by Ben Fry and + Copyright (c) 2001-03 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/app/PdeUpdater.java b/app/PdeUpdater.java index 676ef4b2f..f4ee5026e 100644 --- a/app/PdeUpdater.java +++ b/app/PdeUpdater.java @@ -4,9 +4,8 @@ PdeUpdater - self-updater code.. when was the last this worked? Part of the Processing project - http://Proce55ing.net - Copyright (c) 2001-03 - Ben Fry, Massachusetts Institute of Technology and - Casey Reas, Interaction Design Institute Ivrea + Except where noted, code is written by Ben Fry and + Copyright (c) 2001-03 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/build/macosx/dist.sh b/build/macosx/dist.sh index d1a695da3..ddd025380 100755 --- a/build/macosx/dist.sh +++ b/build/macosx/dist.sh @@ -47,7 +47,8 @@ rm -rf processing/sketchbook/default/CVS rm -f processing/sketchbook/default/.cvsignore # new style examples thing ala reas -cd processing/sketchbook +#cd processing/sketchbook +cd processing/lib unzip -q examples.zip rm examples.zip cd ../.. diff --git a/build/macosx/make.sh b/build/macosx/make.sh index dbcc613fe..9f34b5bd5 100755 --- a/build/macosx/make.sh +++ b/build/macosx/make.sh @@ -31,7 +31,8 @@ else cp -r ../shared work echo Extracting examples... - cd work/sketchbook + #cd work/sketchbook + cd work/lib unzip -q examples.zip rm examples.zip cd ../.. diff --git a/todo.txt b/todo.txt index cfc2407ce..489b2c79a 100644 --- a/todo.txt +++ b/todo.txt @@ -12,6 +12,7 @@ X auto-create code and data folder via 'add files to sketch..' _ sketch.properties should go into user.home _ otherwise moving sketch folder will kill it +_ last-used sketch not being saved X may need to start putting properties somewhere besides lib X home directory (or preferences folder under macos9)