trying to clean up copyright info

This commit is contained in:
benfry
2005-04-17 15:48:05 +00:00
parent 008523ae3f
commit d8b3f157a2
36 changed files with 279 additions and 383 deletions

View File

@@ -1,10 +1,9 @@
/* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
Base - base class for the main processing application
Part of the Processing project - http://processing.org
Except where noted, code is written by Ben Fry and
Copyright (c) 2004-05 Ben Fry and Casey Reas
Copyright (c) 2001-04 Massachusetts Institute of Technology
This program is free software; you can redistribute it and/or modify
@@ -44,6 +43,8 @@ import processing.core.*;
/**
* The base class for the main processing application
* <P>
* Primary role of this class is for platform identification and
* general interaction with the system (launching URLs, loading
* files and images, etc) that comes from that.
@@ -386,7 +387,7 @@ public class Base {
} else {
// on linux (or elsewhere?) prompt the user for the location
JFileChooser fc = new JFileChooser();
fc.setDialogTitle("Select the folder where " +
fc.setDialogTitle("Select the folder where " +
"Processing sketches should be stored...");
//fc.setSelectedFile(new File(sketchbookLocationField.getText()));
fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);

View File

@@ -4,9 +4,8 @@
Compiler - default compiler class that connects to jikes
Part of the Processing project - http://processing.org
Copyright (c) 2001-03
Ben Fry, Massachusetts Institute of Technology and
Casey Reas, Interaction Design Institute Ivrea
Copyright (c) 2004-05 Ben Fry and Casey Reas
Copyright (c) 2001-04 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

View File

@@ -4,7 +4,7 @@
Editor - main editor panel for the processing development environment
Part of the Processing project - http://processing.org
Except where noted, code is written by Ben Fry and
Copyright (c) 2004-05 Ben Fry and Casey Reas
Copyright (c) 2001-04 Massachusetts Institute of Technology
This program is free software; you can redistribute it and/or modify

View File

@@ -1,13 +1,10 @@
/* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
EditorButtons - run/stop/etc buttons for the ide
Part of the Processing project - http://processing.org
Copyright (c) 2004 Ben Fry and the Processing project.
The original rendition of this code was written by Ben Fry and
Copyright (c) 2001-03 Massachusetts Institute of Technology
Copyright (c) 2004-05 Ben Fry and Casey Reas
Copyright (c) 2001-04 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
@@ -34,11 +31,13 @@ import javax.swing.*;
import javax.swing.event.*;
/**
* run/stop/etc buttons for the ide
*/
public class EditorButtons extends JComponent implements MouseInputListener {
static final String title[] = {
"Run", "Stop", "New", "Open", "Save", "Export"
//"run", "stop", "new", "open", "save", "export"
};
static final int BUTTON_COUNT = title.length;

View File

@@ -1,11 +1,10 @@
/* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
EditorConsole - message console that sits below the program area
Part of the Processing project - http://Proce55ing.net
Part of the Processing project - http://processing.org
Except where noted, code is written by Ben Fry and
Copyright (c) 2001-03 Massachusetts Institute of Technology
Copyright (c) 2004-05 Ben Fry and Casey Reas
Copyright (c) 2001-04 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
@@ -31,11 +30,13 @@ import javax.swing.*;
import javax.swing.text.*;
// debugging this class is tricky.. if it's throwing
// exceptions, don't take over System.err, and debug
// while watching just System.out
// or just write directly to systemOut or systemErr
/**
* Message console that sits below the editing area.
* <P>
* Debugging this class is tricky... If it's throwing exceptions,
* don't take over System.err, and debug while watching just System.out
* or just write println() or whatever directly to systemOut or systemErr.
*/
public class EditorConsole extends JScrollPane {
Editor editor;

View File

@@ -1,10 +1,9 @@
/* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
EditorHeader - sketch tabs at the top of the screen
Part of the Processing project - http://processing.org
Except where noted, code is written by Ben Fry and
Copyright (c) 2004-05 Ben Fry and Casey Reas
Copyright (c) 2001-04 Massachusetts Institute of Technology
This program is free software; you can redistribute it and/or modify
@@ -32,6 +31,9 @@ import javax.swing.*;
import javax.swing.event.*;
/**
* Sketch tabs at the top of the editor window.
*/
public class EditorHeader extends JComponent {
static Color backgroundColor;
static Color textColor[] = new Color[2];

View File

@@ -1,7 +1,6 @@
/* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
EditorLineStatus - li'l status bar fella that shows the line number
Part of the Processing project - http://processing.org
Copyright (c) 2005 Ben Fry and Casey Reas
@@ -32,6 +31,9 @@ import javax.swing.*;
import javax.swing.event.*;
/**
* Li'l status bar fella that shows the line number.
*/
public class EditorLineStatus extends JComponent {
JEditTextArea textarea;
int start = -1, stop;

View File

@@ -1,10 +1,9 @@
/* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
EditorListener - filter key events for tab expansion/indent/etc
Part of the Processing project - http://processing.org
Except where noted, code is written by Ben Fry and
Copyright (c) 2004-05 Ben Fry and Casey Reas
Copyright (c) 2001-04 Massachusetts Institute of Technology
This program is free software; you can redistribute it and/or modify
@@ -34,6 +33,9 @@ import javax.swing.text.*;
import javax.swing.event.*;
/**
* Filters key events for tab expansion/indent/etc.
*/
public class EditorListener {
Editor editor;
JEditTextArea textarea;

View File

@@ -1,11 +1,10 @@
/* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
EditorStatus - panel containing status messages
Part of the Processing project - http://processing.org
Except where noted, code is written by Ben Fry and
Copyright (c) 2001-03 Massachusetts Institute of Technology
Copyright (c) 2004-05 Ben Fry and Casey Reas
Copyright (c) 2001-04 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
@@ -28,9 +27,10 @@ import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import sun.awt.AppContext; // from java.awt.Dialog, for blocking
/**
* Panel just below the editing area that contains status messages.
*/
public class EditorStatus extends JPanel implements ActionListener {
static Color bgcolor[];
static Color fgcolor[];

View File

@@ -1,10 +1,9 @@
/* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
FindReplace - find/replace window for processing
Part of the Processing project - http://processing.org
Except where noted, code is written by Ben Fry and is
Copyright (c) 2004-05 Ben Fry and Casey Reas
Copyright (c) 2001-04 Massachusetts Institute of Technology
This program is free software; you can redistribute it and/or modify
@@ -29,6 +28,9 @@ import java.awt.event.*;
import javax.swing.*;
/**
* Find & Replace window for the processing editor.
*/
public class FindReplace extends JFrame
implements ActionListener, KeyListener {

View File

@@ -1,11 +1,10 @@
/* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
MessageConsumer - interface for dealing with parser/compiler output
Part of the Processing project - http://Proce55ing.net
Part of the Processing project - http://processing.org
Except where noted, code is written by Ben Fry and
Copyright (c) 2001-03 Massachusetts Institute of Technology
Copyright (c) 2004-05 Ben Fry and Casey Reas
Copyright (c) 2001-04 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
@@ -24,14 +23,18 @@
package processing.app;
// Different instances of MessageStream need to do different things with
// messages. In particular, a stream instance used for parsing output from
// the compiler compiler has to interpret its messages differently than one
// parsing output from the runtime.
//
// Classes which consume messages and do something with them should implement
// this interface.
//
/**
* Interface for dealing with parser/compiler output
* <P>
* Different instances of MessageStream need to do different things with
* messages. In particular, a stream instance used for parsing output from
* the compiler compiler has to interpret its messages differently than one
* parsing output from the runtime.
* <P>
* Classes which consume messages and do something with them
* should implement this interface.
*/
public interface MessageConsumer {
public void message(String s);

View File

@@ -1,11 +1,10 @@
/* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
MessageSiphon - slurps up messages from compiler
Part of the Processing project - http://processing.org
Earlier portions of this code are Copyright (c) 2001-04 MIT
Other parts are Copyright (c) 2004 Ben Fry and Casey Reas
Copyright (c) 2004-05 Ben Fry and Casey Reas
Copyright (c) 2001-04 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
@@ -27,6 +26,9 @@ package processing.app;
import java.io.*;
/**
* Slurps up messages from compiler.
*/
class MessageSiphon implements Runnable {
BufferedReader streamReader;
Thread thread;

View File

@@ -1,11 +1,10 @@
/* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
MessageStream - outputstream to handle stdout/stderr messages
Part of the Processing project - http://Proce55ing.net
Part of the Processing project - http://processing.org
Except where noted, code is written by Ben Fry and
Copyright (c) 2001-03 Massachusetts Institute of Technology
Copyright (c) 2004-05 Ben Fry and Casey Reas
Copyright (c) 2001-04 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
@@ -28,26 +27,20 @@ import java.io.*;
/**
* this is used by Editor, System.err is set to
* new PrintStream(new MessageStream())
*
* it's also used by Compiler
* OutputStream to handle stdout/stderr messages.
* <P>
* This is used by Editor, System.err is set to
* new PrintStream(new MessageStream()).
* It's also used by Compiler.
*/
class MessageStream extends OutputStream {
//Editor editor;
MessageConsumer messageConsumer;
public MessageStream(/*Editor editor,*/
MessageConsumer messageConsumer) {
//this.editor = editor;
public MessageStream(MessageConsumer messageConsumer) {
this.messageConsumer = messageConsumer;
}
//public void setMessageConsumer(MessageConsumer messageConsumer) {
//this.messageConsumer = messageConsumer;
//}
public void close() { }
public void flush() { }

View File

@@ -1,10 +1,9 @@
/* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
Preferences - controls user preferences and environment settings
Part of the Processing project - http://Processing.org
Part of the Processing project - http://processing.org
Except where noted, code is written by Ben Fry and is
Copyright (c) 2004-05 Ben Fry and Casey Reas
Copyright (c) 2001-04 Massachusetts Institute of Technology
This program is free software; you can redistribute it and/or modify
@@ -44,7 +43,7 @@ import processing.core.PApplet;
/**
* Preferences storage class.
* Storage class for user preferences and environment settings.
* <P>
* This class no longer uses the Properties class, since
* properties files are iso8859-1, which is highly likely to

View File

@@ -1,7 +1,6 @@
/* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
PresentMode - helper class for full-screen presentation mode
Part of the Processing project - http://processing.org
Copyright (c) 2005- Ben Fry and Casey Reas
@@ -29,6 +28,9 @@ import java.util.Vector;
import javax.swing.*;
/**
* Helper class for full-screen presentation mode.
*/
public class PresentMode {
static GraphicsDevice devices[];
@@ -123,4 +125,4 @@ public class PresentMode {
device.setFullScreenWindow(null);
}
*/
}
}

View File

@@ -1,7 +1,6 @@
/* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
Runner - runs a compiled java applet
Part of the Processing project - http://processing.org
Copyright (c) 2004-05 Ben Fry and Casey Reas
@@ -34,6 +33,10 @@ import java.lang.reflect.*;
import com.oroinc.text.regex.*;
/**
* Runs a compiled java applet, whether as an external application
* or internally as an applet object in a window.
*/
public class Runner implements MessageConsumer {
PApplet applet;

View File

@@ -1,22 +1,21 @@
/* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/**
* Based on Simple1.2ClassLoader.java - simple Java 1.2 class loader
* Copyright (c) 1999 Ken McCrary, All Rights Reserved.
*
* Permission to use, copy, modify, and distribute this software
* and its documentation for NON-COMMERCIAL purposes and without
* fee is hereby granted provided that this copyright notice
* appears in all copies.
*
* KEN MCCRARY MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
* SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. KEN MCCRARY
* SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT
* OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
*/
/*
Based on Simple1.2ClassLoader.java - simple Java 1.2 class loader
Copyright (c) 1999 Ken McCrary, All Rights Reserved.
Permission to use, copy, modify, and distribute this software
and its documentation for NON-COMMERCIAL purposes and without
fee is hereby granted provided that this copyright notice
appears in all copies.
KEN MCCRARY MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. KEN MCCRARY
SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT
OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
*/
package processing.app;
import java.io.*;
@@ -24,71 +23,31 @@ import java.net.*;
import java.util.*;
import java.util.jar.*;
/**
* Simple class loader to illustrate custom Class
* loading with new delegation model in Java 1.2.
*
* Simple class loader adapted for Processing.
* <P>
* Based on code from Ken McCrary.
*/
public class RunnerClassLoader extends ClassLoader {
String buildFolderPath;
/*
RunnerClassLoader(ClassLoader parent) {
super(parent);
init();
}
*/
RunnerClassLoader() {
//super(); // uses system class loader
//init();
//}
//private void init() {
buildFolderPath = Base.getBuildFolder().getAbsolutePath();
/*
FileInputStream fi = null;
// Check for a manifest in the store directory
try
{
fi = new FileInputStream("store\\MANIFEST.MF");
manifest = new Manifest(fi);
}
catch (Exception e)
{
// No manifest
}
finally
{
if ( null != fi )
{
try
{
fi.close();
}
catch (Exception e){}
}
}
*/
}
/**
* This is the method where the task of class loading
* is delegated to our custom loader.
* This is the method where the task of class loading
* is delegated to our custom loader.
*
* @param name the name of the class
* @return the resulting <code>Class</code> object
* @exception ClassNotFoundException if the class could not be found
*/
protected Class findClass(String name) throws ClassNotFoundException
{
protected Class findClass(String name) throws ClassNotFoundException {
FileInputStream fi = null;
try {
//System.out.println("PCL finding class: " + name);
String path =
buildFolderPath + File.separator + name.replace('.', '/');
//System.out.println("(from " + path + ")");
@@ -99,7 +58,7 @@ public class RunnerClassLoader extends ClassLoader {
return defineClass(name, classBytes, 0, classBytes.length);
} catch (Exception e) {
// We could not find the class, so indicate the problem with an exception
// could not find the class, so indicate the problem with an exception
throw new ClassNotFoundException(name);
} finally {
@@ -113,11 +72,11 @@ public class RunnerClassLoader extends ClassLoader {
/**
* Identify where to load a resource from, resources for
* this simple ClassLoader are in a directory name "store"
* Identify where to load a resource from, resources for
* this simple ClassLoader are in a directory name "store"
*
* @param name the resource name
* @return URL for resource or null if not found
* @param name the resource name
* @return URL for resource or null if not found
*/
protected URL findResource(String name) {
String path =
@@ -136,12 +95,12 @@ public class RunnerClassLoader extends ClassLoader {
/**
* Used for identifying resources from multiple URLS
* Since our simple Classloader only has one repository
* the returned Enumeration contains 0 to 1 items
* Used for identifying resources from multiple URLS
* Since our simple Classloader only has one repository
* the returned Enumeration contains 0 to 1 items
*
* @param name the resource name
* @return Enumeration of one URL
* @param name the resource name
* @return Enumeration of one URL
*/
protected Enumeration findResources(final String name) throws IOException {
// Since we only have a single repository we will only have one
@@ -166,62 +125,4 @@ public class RunnerClassLoader extends ClassLoader {
}
};
}
/**
* Minimal package definition
*
*/
/*
private void definePackage(String className)
{
// Extract the package name from the class name,
String pkgName = className;
int index = className.lastIndexOf('.');
if (-1 != index)
{
pkgName = className.substring(0, index);
}
// Pre-conditions - need a manifest and the package
// is not previously defined
if ( null == manifest ||
getPackage(pkgName) != null)
{
return;
}
String specTitle,
specVersion,
specVendor,
implTitle,
implVersion,
implVendor;
// Look up the versioning information
// This should really look for a named attribute
Attributes attr = manifest.getMainAttributes();
if ( null != attr)
{
specTitle = attr.getValue(Name.SPECIFICATION_TITLE);
specVersion = attr.getValue(Name.SPECIFICATION_VERSION);
specVendor = attr.getValue(Name.SPECIFICATION_VENDOR);
implTitle = attr.getValue(Name.IMPLEMENTATION_TITLE);
implVersion = attr.getValue(Name.IMPLEMENTATION_VERSION);
implVendor = attr.getValue(Name.IMPLEMENTATION_VENDOR);
definePackage(pkgName,
specTitle,
specVersion,
specVendor,
implTitle,
implVersion,
implVendor,
null); // no sealing for simplicity
}
}
private Manifest manifest;
*/
}

View File

@@ -1,10 +1,9 @@
/* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
RunnerException - an exception with a line number attached
Part of the Processing project - http://processing.org
Except where noted, code is written by Ben Fry and is
Copyright (c) 2004-05 Ben Fry and Casey Reas
Copyright (c) 2001-04 Massachusetts Institute of Technology
This program is free software; you can redistribute it and/or modify
@@ -24,6 +23,10 @@
package processing.app;
/**
* An exception with a line number attached that occurs
* during either compile time or run time.
*/
public class RunnerException extends Exception {
public int file = -1;
public int line = -1;
@@ -58,7 +61,7 @@ public class RunnerException extends Exception {
/**
* Nix the java.lang crap out of an exception message
* because it scares the children.
*
* <P>
* This function must be static to be used with super()
* in each of the constructors above.
*/

View File

@@ -1,10 +1,9 @@
/* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
Sketch - stores information about files in the current sketch
Part of the Processing project - http://processing.org
Except where noted, code is written by Ben Fry
Copyright (c) 2004-05 Ben Fry and Casey Reas
Copyright (c) 2001-04 Massachusetts Institute of Technology
This program is free software; you can redistribute it and/or modify
@@ -37,6 +36,9 @@ import javax.swing.JOptionPane;
import com.oroinc.text.regex.*;
/**
* Stores information about files in the current sketch
*/
public class Sketch {
//static String TEMP_BUILD_PATH = "lib" + File.separator + "build";
static File tempBuildFolder;

View File

@@ -4,7 +4,7 @@
SketchCode - data class for a single file inside a sketch
Part of the Processing project - http://processing.org
Except where noted, code is written by Ben Fry and is
Copyright (c) 2004-05 Ben Fry and Casey Reas
Copyright (c) 2001-04 Massachusetts Institute of Technology
This program is free software; you can redistribute it and/or modify

View File

@@ -4,8 +4,8 @@
SketchHistory - handler for storing history information about a project
Part of the Processing project - http://processing.org
Except where noted, code is written by Ben Fry
Copyright (c) 2001-03 Massachusetts Institute of Technology
Copyright (c) 2004-05 Ben Fry and Casey Reas
Copyright (c) 2001-04 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
@@ -17,8 +17,8 @@
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,
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
*/
@@ -43,12 +43,12 @@ public class SketchHistory {
static final int AUTOSAVE = 7;
static final int BEAUTIFY = 8;
static final String HISTORY_SEPARATOR =
static final String HISTORY_SEPARATOR =
"#################################################";
JMenu menu;
// true if the sketch is read-only,
// true if the sketch is read-only,
// meaning that no history will be recorded
boolean readOnlySketch;
@@ -95,7 +95,7 @@ public class SketchHistory {
}
/// Check to see if history should be recorded.
/// Check to see if history should be recorded.
/// mode is RUN, SAVE, AUTOSAVE, or BEAUTIFY
public void record(String program, int mode) {
if (readOnlySketch) return;
@@ -133,13 +133,13 @@ public class SketchHistory {
noPreviousHistory = true; // rebuild menu
}
OutputStream historyStream =
OutputStream historyStream =
new GZIPOutputStream(new FileOutputStream(historyFile));
if (old != null) {
historyStream.write(old.toByteArray());
}
PrintWriter historyWriter =
PrintWriter historyWriter =
new PrintWriter(new OutputStreamWriter(historyStream));
historyWriter.println();
@@ -149,7 +149,7 @@ public class SketchHistory {
// 2002 06 18 11 43 29
// when listing, study for descrepancies.. if all are
// 2002, then don't list the year and soforth.
// for the other end, if all minutes are unique,
// for the other end, if all minutes are unique,
// then don't show seconds
int year = now.get(Calendar.YEAR);
int month = now.get(Calendar.MONTH) + 1;
@@ -162,13 +162,13 @@ public class SketchHistory {
String readableDate = now.getTime().toString();
// increment this so sketchbook won't be mangled
// increment this so sketchbook won't be mangled
// each time this format has to change
String historyVersion = "1";
//Date date = new Date();
//String datestamp = date.toString();
historyWriter.println(historyVersion + " " + modeStr + " - " +
historyWriter.println(historyVersion + " " + modeStr + " - " +
parseDate + " - " + readableDate);
historyWriter.println();
historyWriter.println(program);
@@ -183,7 +183,7 @@ public class SketchHistory {
historyWriter.flush();
historyWriter.close();
if (noPreviousHistory) {
if (noPreviousHistory) {
// to get add the actual menu, to get the 'clear' item in there
//rebuildMenu(historyFile.getPath());
rebuildMenu();
@@ -197,7 +197,7 @@ public class SketchHistory {
public void retrieve(String selection) {
//System.out.println("sel '" + selection + "'");
String readableDate =
String readableDate =
selection.substring(selection.indexOf("-") + 2);
// make history for the current guy
@@ -241,7 +241,7 @@ public class SketchHistory {
editor.setSketchModified(false);
} else {
System.err.println("couldn't find history entry for " +
System.err.println("couldn't find history entry for " +
"'" + readableDate + "'");
}
} catch (IOException e) {
@@ -281,7 +281,7 @@ public class SketchHistory {
public void actionPerformed(ActionEvent e) {
if (!historyFile.delete()) {
//System.err.println("couldn't erase history");
Base.showWarning("History Problem",
Base.showWarning("History Problem",
"Could not erase history", null);
}
rebuildMenu();
@@ -307,7 +307,7 @@ public class SketchHistory {
if (line.equals(HISTORY_SEPARATOR)) {
// next line is the good stuff
line = reader.readLine();
int version =
int version =
Integer.parseInt(line.substring(0, line.indexOf(' ')));
if (version == 1) {
String whysub = line.substring(2); // after "1 "
@@ -332,7 +332,7 @@ public class SketchHistory {
// add the items to the menu in reverse order
//ActionListener historyMenuListener =
//ActionListener historyMenuListener =
// new ActionListener() {
// public void actionPerformed(ActionEvent e) {
// editor.retrieveHistory(e.getActionCommand());
@@ -354,4 +354,4 @@ public class SketchHistory {
}
*/
*/

View File

@@ -1,10 +1,9 @@
/* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
Sketchbook - handles sketchbook mechanics for the sketch menu
Part of the Processing project - http://processing.org
Except where noted, code is written by Ben Fry and is
Copyright (c) 2004-05 Ben Fry and Casey Reas
Copyright (c) 2001-04 Massachusetts Institute of Technology
This program is free software; you can redistribute it and/or modify
@@ -40,6 +39,9 @@ import javax.swing.undo.*;
import com.apple.mrj.*;
/**
* Handles sketchbook mechanics for the sketch menu and file I/O.
*/
public class Sketchbook {
Editor editor;