Initial JavaScriptMode commit
@@ -35,6 +35,7 @@ import javax.swing.tree.*;
|
||||
import processing.core.*;
|
||||
import processing.mode.android.AndroidMode;
|
||||
import processing.mode.java.*;
|
||||
import processing.mode.javascript.JavaScriptMode;
|
||||
|
||||
|
||||
/**
|
||||
@@ -215,7 +216,8 @@ public class Base {
|
||||
// TODO this will be dynamically loading modes in no time
|
||||
defaultMode = new JavaMode(this, getContentFile("modes/java"));
|
||||
Mode androidMode = new AndroidMode(this, getContentFile("modes/android"));
|
||||
modeList = new Mode[] { defaultMode, androidMode };
|
||||
Mode javaScriptMode = new JavaScriptMode(this, getContentFile("modes/javascript"));
|
||||
modeList = new Mode[] { defaultMode, androidMode, javaScriptMode };
|
||||
// defaultMode = androidMode;
|
||||
|
||||
// Get the sketchbook path, and make sure it's set properly
|
||||
|
||||
@@ -0,0 +1,272 @@
|
||||
package processing.mode.javascript;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import processing.app.Base;
|
||||
import processing.app.Mode;
|
||||
import processing.app.Sketch;
|
||||
import processing.app.SketchCode;
|
||||
import processing.core.PApplet;
|
||||
import processing.mode.java.JavaBuild;
|
||||
|
||||
/**
|
||||
* A collection of static methods to aid in building a
|
||||
* web page with Processing.js from a Sketch object.
|
||||
*/
|
||||
public class JavaScriptBuild {
|
||||
|
||||
// public static final String SIZE_REGEX
|
||||
|
||||
// public static final String PACKAGE_REGEX
|
||||
|
||||
/**
|
||||
* Answers with the first java doc style comment in the string,
|
||||
* or an empty string if no such comment can be found.
|
||||
*/
|
||||
public static String getDocString(String s) {
|
||||
String[] javadoc = PApplet.match(s, "/\\*{2,}(.*?)\\*+/");
|
||||
if (javadoc != null) {
|
||||
StringBuffer dbuffer = new StringBuffer();
|
||||
String[] pieces = PApplet.split(javadoc[1], '\n');
|
||||
for (String line : pieces) {
|
||||
// if this line starts with * characters, remove 'em
|
||||
String[] m = PApplet.match(line, "^\\s*\\*+(.*)");
|
||||
dbuffer.append(m != null ? m[1] : line);
|
||||
// insert the new line into the html to help w/ line breaks
|
||||
dbuffer.append('\n');
|
||||
}
|
||||
return dbuffer.toString().trim();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reads in a simple template file, with fields of the form '@@somekey@@'
|
||||
* and replaces each field with the value in the map for 'somekey', writing
|
||||
* the output to the output file.
|
||||
*
|
||||
* Keys not in the map will be replaced with empty strings.
|
||||
*
|
||||
* @param template File object mapping to the template
|
||||
* @param output File object handle to the output
|
||||
* @param args template keys, data values to replace them
|
||||
* @throws IOException when there are problems writing to or from the files
|
||||
*/
|
||||
public static void writeTemplate(File template, File output, Map<String, String> fields) throws IOException {
|
||||
BufferedReader reader = PApplet.createReader(template);
|
||||
PrintWriter theOutWriter = PApplet.createWriter(output);
|
||||
|
||||
String line = null;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
if (line.indexOf("@@") != -1) {
|
||||
StringBuffer sb = new StringBuffer(line);
|
||||
int start = 0, end = 0;
|
||||
while ((start = sb.indexOf("@@")) != -1) {
|
||||
if ((end = sb.indexOf("@@", start+1)) != -1) {
|
||||
String value = fields.get(sb.substring(start+2, end));
|
||||
sb.replace(start, end+2, value == null ? "" : value );
|
||||
} else {
|
||||
Base.showWarning("Problem writing file from template",
|
||||
"The template appears to have an unterminated " +
|
||||
"field. The output may look a little funny.",
|
||||
null);
|
||||
}
|
||||
}
|
||||
line = sb.toString();
|
||||
}
|
||||
theOutWriter.println(line);
|
||||
}
|
||||
theOutWriter.close();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
|
||||
|
||||
/**
|
||||
* The sketch this builder is working on.
|
||||
* <p>
|
||||
* Each builder instance should only work on a single sketch, so if
|
||||
* you have more than one sketch each will need a separate builder.
|
||||
*/
|
||||
protected Sketch sketch;
|
||||
|
||||
protected Mode mode;
|
||||
|
||||
protected File binFolder;
|
||||
|
||||
|
||||
public JavaScriptBuild(Sketch sketch) {
|
||||
this.sketch = sketch;
|
||||
this.mode = sketch.getMode();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Builds the sketch
|
||||
* <p>
|
||||
* The process goes a little something like this:
|
||||
* 1. rm -R bin/*
|
||||
* 2. cat *.pde > bin/sketchname.pde
|
||||
* 3. cp -r sketch/data/* bin/ (p.js doesn't recognize the data folder)
|
||||
* 4. series of greps to find height, width, name, desc
|
||||
* 5. cat template.html | sed 's/@@sketch@@/[name]/g' ... [many sed filters] > bin/index.html
|
||||
*
|
||||
* @param bin the output folder for the built sketch
|
||||
* @return boolean whether the build was successful
|
||||
*/
|
||||
public boolean build(File bin) {
|
||||
// make sure the user isn't playing "hide-the-sketch-folder" again
|
||||
sketch.ensureExistence();
|
||||
|
||||
this.binFolder = bin;
|
||||
|
||||
if (bin.exists()) {
|
||||
Base.removeDescendants(bin);
|
||||
} //else will be created during preprocesss
|
||||
|
||||
try {
|
||||
preprocess(bin);
|
||||
} catch (IOException e) {
|
||||
final String msg = "A problem occured while writing to the output folder.";
|
||||
Base.showWarning("Could not build the sketch", msg, e);
|
||||
return false;
|
||||
}
|
||||
|
||||
// move the data files
|
||||
if (sketch.hasDataFolder()) {
|
||||
try {
|
||||
Base.copyDir(sketch.getDataFolder(), bin);
|
||||
} catch (IOException e) {
|
||||
final String msg = "An exception occured while trying to copy the data folder. " +
|
||||
"You may have to manually move the contents of sketch/data to " +
|
||||
"the applet_js/ folder. Processing.js doesn't look for a data " +
|
||||
"folder, so lump them together.";
|
||||
Base.showWarning("Problem building the sketch", msg, e);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO Code folder contents ending in .js could be moved and added as script tags?
|
||||
|
||||
// get width and height
|
||||
int wide = PApplet.DEFAULT_WIDTH;
|
||||
int high = PApplet.DEFAULT_HEIGHT;
|
||||
|
||||
String scrubbed = JavaBuild.scrubComments(sketch.getCode(0).getProgram());
|
||||
String[] matches = PApplet.match(scrubbed, JavaBuild.SIZE_REGEX);
|
||||
|
||||
if (matches != null) {
|
||||
try {
|
||||
wide = Integer.parseInt(matches[1]);
|
||||
high = Integer.parseInt(matches[2]);
|
||||
// renderer
|
||||
} catch (NumberFormatException e) {
|
||||
// found a reference to size, but it didn't seem to contain numbers
|
||||
final String message =
|
||||
"The size of this applet could not automatically be\n" +
|
||||
"determined from your code. You'll have to edit the\n" +
|
||||
"HTML file to set the size of the applet.\n" +
|
||||
"Use only numeric values (not variables) for the size()\n" +
|
||||
"command. See the size() reference for an explanation.";
|
||||
Base.showWarning("Could not find applet size", message, null);
|
||||
}
|
||||
} // else no size() command found, defaults will be used
|
||||
|
||||
// final prep and write to template
|
||||
File templateFile = sketch.getMode().getContentFile("applet_js/template.html");
|
||||
File htmlOutputFile = new File(bin, "index.html");
|
||||
|
||||
Map<String, String> templateFields = new HashMap<String, String>();
|
||||
templateFields.put("width", String.valueOf(wide));
|
||||
templateFields.put("height", String.valueOf(high));
|
||||
templateFields.put("sketch", sketch.getName());
|
||||
templateFields.put("description", getSketchDescription());
|
||||
templateFields.put("source",
|
||||
"<a href=\"" + sketch.getName() + ".pde\">" +
|
||||
sketch.getName() + "</a>");
|
||||
|
||||
try{
|
||||
writeTemplate(templateFile, htmlOutputFile, templateFields);
|
||||
} catch (IOException ioe) {
|
||||
final String msg = "There was a problem writing the html template " +
|
||||
"to the build folder.";
|
||||
Base.showWarning("A problem occured during the build", msg, ioe);
|
||||
return false;
|
||||
}
|
||||
|
||||
// finally, add Processing.js
|
||||
try {
|
||||
Base.copyFile(sketch.getMode().getContentFile("applet_js/processing.js"),
|
||||
new File(bin, "processing.js"));
|
||||
} catch (IOException ioe) {
|
||||
final String msg = "There was a problem copying processing.js to the " +
|
||||
"build folder. You will have to manually add " +
|
||||
"processing.js to the build folder before the sketch " +
|
||||
"will run.";
|
||||
Base.showWarning("There was a problem writing to the build folder", msg, ioe);
|
||||
//return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Prepares the sketch code objects for use with Processing.js
|
||||
* @param bin the output folder
|
||||
*/
|
||||
public void preprocess(File bin) throws IOException {
|
||||
// essentially... cat sketchFolder/*.pde > bin/sketchname.pde
|
||||
StringBuffer bigCode = new StringBuffer();
|
||||
for (SketchCode sc : sketch.getCode()){
|
||||
if (sc.isExtension("pde")) {
|
||||
bigCode.append(sc.getProgram());
|
||||
bigCode.append("\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (!bin.exists()) {
|
||||
bin.mkdirs();
|
||||
}
|
||||
File bigFile = new File(bin, sketch.getName() + ".pde");
|
||||
Base.saveFile(bigCode.toString(), bigFile);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Parse the sketch to retrieve it's description. Answers with the first
|
||||
* java doc style comment in the main sketch file, or an empty string if
|
||||
* no such comment exists.
|
||||
*/
|
||||
public String getSketchDescription() {
|
||||
return getDocString(sketch.getCode(0).getProgram());
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Export
|
||||
|
||||
|
||||
/**
|
||||
* Export the sketch to the default applet_js folder.
|
||||
* @return success of the operation
|
||||
*/
|
||||
public boolean export() throws IOException {
|
||||
File applet_js = new File(sketch.getFolder(), "applet_js");
|
||||
return exportApplet_js(applet_js);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Export the sketch to the provided folder
|
||||
* @return success of the operation
|
||||
*/
|
||||
public boolean exportApplet_js(File appletfolder) throws IOException {
|
||||
return build(appletfolder);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,247 @@
|
||||
package processing.mode.javascript;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.io.File;
|
||||
|
||||
import javax.swing.JMenu;
|
||||
import javax.swing.JMenuItem;
|
||||
import javax.swing.JOptionPane;
|
||||
|
||||
import processing.app.Base;
|
||||
import processing.app.Editor;
|
||||
import processing.app.EditorToolbar;
|
||||
import processing.app.Formatter;
|
||||
import processing.app.Mode;
|
||||
import processing.mode.java.AutoFormat;
|
||||
|
||||
public class JavaScriptEditor extends Editor {
|
||||
private JavaScriptMode jsMode;
|
||||
|
||||
|
||||
protected JavaScriptEditor(Base base, String path, int[] location, Mode mode) {
|
||||
super(base, path, location, mode);
|
||||
jsMode = (JavaScriptMode) mode;
|
||||
}
|
||||
|
||||
|
||||
public EditorToolbar createToolbar() {
|
||||
return new JavaScriptToolbar(this, base);
|
||||
}
|
||||
|
||||
|
||||
public Formatter createFormatter() {
|
||||
return new AutoFormat();
|
||||
}
|
||||
|
||||
|
||||
// - - - - - - - - - - - - - - - - - -
|
||||
// Menu methods
|
||||
|
||||
|
||||
public JMenu buildFileMenu() {
|
||||
JMenuItem exportItem = Base.newJMenuItem("export title", 'E');
|
||||
exportItem.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
handleExport();
|
||||
}
|
||||
});
|
||||
return buildFileMenu(new JMenuItem[] { exportItem });
|
||||
}
|
||||
|
||||
|
||||
public JMenu buildSketchMenu() {
|
||||
return buildSketchMenu(new JMenuItem[] {});
|
||||
}
|
||||
|
||||
|
||||
public JMenu buildHelpMenu() {
|
||||
JMenu menu = new JMenu("Help ");
|
||||
JMenuItem item;
|
||||
|
||||
item = new JMenuItem("QuickStart for JS Devs");
|
||||
item.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Base.openURL("http://processingjs.org/reference/articles/jsQuickStart");
|
||||
}
|
||||
});
|
||||
menu.add(item);
|
||||
|
||||
item = new JMenuItem("QuickStart for Processing Devs");
|
||||
item.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Base.openURL("http://processingjs.org/reference/articles/p5QuickStart");
|
||||
}
|
||||
});
|
||||
menu.add(item);
|
||||
|
||||
/* TODO Implement an environment page
|
||||
item = new JMenuItem("Environment");
|
||||
item.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
showReference("environment" + File.separator + "index.html");
|
||||
}
|
||||
});
|
||||
menu.add(item);
|
||||
*/
|
||||
|
||||
/* TODO Implement a troubleshooting page
|
||||
item = new JMenuItem("Troubleshooting");
|
||||
item.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Base.openURL("http://wiki.processing.org/w/Troubleshooting");
|
||||
}
|
||||
});
|
||||
menu.add(item);
|
||||
*/
|
||||
|
||||
item = new JMenuItem("Reference");
|
||||
item.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
//TODO get offline reference archive corresponding to the release
|
||||
// packaged with this mode see: P.js ticket 1146 "Offline Reference"
|
||||
Base.openURL("http://processingjs.org/reference");
|
||||
}
|
||||
});
|
||||
menu.add(item);
|
||||
|
||||
item = Base.newJMenuItemShift("Find in Reference", 'F');
|
||||
item.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (textarea.isSelectionActive()) {
|
||||
Base.openURL(
|
||||
"http://www.google.com/search?q=" +
|
||||
textarea.getSelectedText() +
|
||||
"+site%3Ahttp%3A%2F%2Fprocessingjs.org%2Freference"
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
menu.add(item);
|
||||
|
||||
/* TODO FAQ
|
||||
item = new JMenuItem("Frequently Asked Questions");
|
||||
item.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Base.openURL("http://wiki.processing.org/w/FAQ");
|
||||
}
|
||||
});
|
||||
menu.add(item);
|
||||
*/
|
||||
|
||||
item = new JMenuItem("Visit Processingjs.org");
|
||||
item.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Base.openURL("http://processingjs.org/");
|
||||
}
|
||||
});
|
||||
menu.add(item);
|
||||
|
||||
// OSX has its own about menu
|
||||
if (!Base.isMacOS()) {
|
||||
menu.addSeparator();
|
||||
item = new JMenuItem("About Processing");
|
||||
item.addActionListener( new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
base.handleAbout();
|
||||
}
|
||||
});
|
||||
menu.add(item);
|
||||
}
|
||||
|
||||
return menu;
|
||||
}
|
||||
|
||||
|
||||
// - - - - - - - - - - - - - - - - - -
|
||||
|
||||
|
||||
public String getCommentPrefix() {
|
||||
return "//";
|
||||
}
|
||||
|
||||
|
||||
// - - - - - - - - - - - - - - - - - -
|
||||
|
||||
|
||||
/**
|
||||
* Call the export method of the sketch and handle the gui stuff
|
||||
*/
|
||||
public void handleExport() {
|
||||
if (handleExportCheckModified()) {
|
||||
toolbar.activate(JavaScriptToolbar.EXPORT);
|
||||
try {
|
||||
boolean success = jsMode.handleExport(sketch);
|
||||
if (success) {
|
||||
File appletJSFolder = new File(sketch.getFolder(), "applet_js");
|
||||
Base.openFolder(appletJSFolder);
|
||||
statusNotice("Finished exporting.");
|
||||
} else {
|
||||
// error message already displayed by handleExport
|
||||
}
|
||||
} catch (Exception e) {
|
||||
statusError(e);
|
||||
}
|
||||
toolbar.deactivate(JavaScriptToolbar.EXPORT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public boolean handleExportCheckModified() {
|
||||
if (sketch.isModified()) {
|
||||
Object[] options = { "OK", "Cancel" };
|
||||
int result = JOptionPane.showOptionDialog(this,
|
||||
"Save changes before export?",
|
||||
"Save",
|
||||
JOptionPane.OK_CANCEL_OPTION,
|
||||
JOptionPane.QUESTION_MESSAGE,
|
||||
null,
|
||||
options,
|
||||
options[0]);
|
||||
|
||||
if (result == JOptionPane.OK_OPTION) {
|
||||
handleSaveRequest(true);
|
||||
|
||||
} else {
|
||||
// why it's not CANCEL_OPTION is beyond me (at least on the mac)
|
||||
// but f-- it.. let's get this shite done..
|
||||
//} else if (result == JOptionPane.CANCEL_OPTION) {
|
||||
statusNotice("Export canceled, changes must first be saved.");
|
||||
//toolbar.clear();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public void handleSave() {
|
||||
toolbar.activate(JavaScriptToolbar.SAVE);
|
||||
super.handleSave();
|
||||
toolbar.deactivate(JavaScriptToolbar.SAVE);
|
||||
}
|
||||
|
||||
|
||||
public boolean handleSaveAs() {
|
||||
toolbar.activate(JavaScriptToolbar.SAVE);
|
||||
boolean result = super.handleSaveAs();
|
||||
toolbar.deactivate(JavaScriptToolbar.SAVE);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public void handleImportLibrary(String item) {
|
||||
Base.showWarning("Processing.js doesn't support libraries",
|
||||
"Libraries are not supported. Import statements are " +
|
||||
"ignored, and code relying on them will break.",
|
||||
null);
|
||||
}
|
||||
|
||||
|
||||
/** JavaScript mode has no runner. This method is empty. */
|
||||
public void internalCloseRunner() { }
|
||||
|
||||
|
||||
/** JavaScript mode does not run anything. This method is empty. */
|
||||
public void deactivateRun() { }
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package processing.mode.javascript;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
|
||||
import processing.app.Base;
|
||||
import processing.app.Editor;
|
||||
import processing.app.Mode;
|
||||
import processing.app.Sketch;
|
||||
import processing.app.syntax.PdeKeywords;
|
||||
import processing.core.PApplet;
|
||||
|
||||
/**
|
||||
* JS Mode is very simple. Since P.js is dependent on a browser there is
|
||||
* no runner, just an export so that users can debug in the browser of their
|
||||
* choice.
|
||||
*/
|
||||
public class JavaScriptMode extends Mode {
|
||||
|
||||
|
||||
// create a new editor with the mode
|
||||
public Editor createEditor(Base base, String path, int[] location) {
|
||||
return new JavaScriptEditor(base, path, location, this);
|
||||
}
|
||||
|
||||
|
||||
public JavaScriptMode(Base base, File folder) {
|
||||
super(base, folder);
|
||||
|
||||
try {
|
||||
loadKeywords();
|
||||
} catch (IOException e) {
|
||||
Base.showError("Problem loading keywords",
|
||||
"Could not load keywords.txt, please re-install Processing.", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void loadKeywords() throws IOException {
|
||||
File file = new File(folder, "keywords.txt");
|
||||
BufferedReader reader = PApplet.createReader(file);
|
||||
|
||||
tokenMarker = new PdeKeywords();
|
||||
keywordToReference = new HashMap<String, String>();
|
||||
|
||||
String line = null;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
String[] pieces = PApplet.trim(PApplet.split(line, '\t'));
|
||||
if (pieces.length >= 2) {
|
||||
String keyword = pieces[0];
|
||||
String coloring = pieces[1];
|
||||
|
||||
if (coloring.length() > 0) {
|
||||
tokenMarker.addColoring(keyword, coloring);
|
||||
}
|
||||
if (pieces.length == 3) {
|
||||
String htmlFilename = pieces[2];
|
||||
if (htmlFilename.length() > 0) {
|
||||
keywordToReference.put(keyword, htmlFilename);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// pretty printable name of the mode
|
||||
public String getTitle() {
|
||||
return "JavaScript";
|
||||
}
|
||||
|
||||
|
||||
// public EditorToolbar createToolbar(Editor editor) { }
|
||||
|
||||
|
||||
// public Formatter createFormatter() { }
|
||||
|
||||
|
||||
// public Editor createEditor(Base ibase, String path, int[] location) { }
|
||||
|
||||
|
||||
// ------------------------------------------------
|
||||
|
||||
|
||||
//TODO Add examples
|
||||
protected File[] getExampleCategoryFolders() {
|
||||
return new File[] {};
|
||||
/*
|
||||
return new File[] {
|
||||
new File(examplesFolder, "Basics"),
|
||||
new File(examplesFolder, "Topics"),
|
||||
new File(examplesFolder, "3D"),
|
||||
new File(examplesFolder, "Books")
|
||||
};
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
public String getDefaultExtension() {
|
||||
return "pde";
|
||||
}
|
||||
|
||||
|
||||
// all file extensions it supports
|
||||
public String[] getExtensions() {
|
||||
return new String[] {"pde", "pjs"};
|
||||
}
|
||||
|
||||
|
||||
public String[] getIgnorable() {
|
||||
return new String[] {
|
||||
"applet_js" // not sure what color to paint this bike shed
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------
|
||||
|
||||
|
||||
public boolean handleExport(Sketch sketch) throws IOException {
|
||||
JavaScriptBuild build = new JavaScriptBuild(sketch);
|
||||
return build.export();
|
||||
}
|
||||
|
||||
|
||||
//public boolean handleExportApplet(Sketch sketch) throws SketchException, IOException { }
|
||||
|
||||
|
||||
//public boolean handleExportApplication(Sketch sketch) throws SketchException, IOException { }
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package processing.mode.javascript;
|
||||
|
||||
import java.awt.Image;
|
||||
import java.awt.event.MouseEvent;
|
||||
|
||||
import javax.swing.JPopupMenu;
|
||||
|
||||
import processing.app.Base;
|
||||
import processing.app.Editor;
|
||||
import processing.app.EditorToolbar;
|
||||
|
||||
public class JavaScriptToolbar extends EditorToolbar {
|
||||
|
||||
// static protected final int RUN = 0;
|
||||
// static protected final int STOP = 1;
|
||||
|
||||
static protected final int NEW = 0;
|
||||
static protected final int OPEN = 1;
|
||||
static protected final int SAVE = 2;
|
||||
static protected final int EXPORT = 3;
|
||||
|
||||
|
||||
static public String getTitle(int index, boolean shift) {
|
||||
switch (index) {
|
||||
case NEW: return !shift ? "New" : "New Editor Window";
|
||||
case OPEN: return !shift ? "Open" : "Open in Another Window";
|
||||
case SAVE: return "Save";
|
||||
case EXPORT: return "Export for Web";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public JavaScriptToolbar(Editor editor, Base base) {
|
||||
super(editor, base);
|
||||
}
|
||||
|
||||
|
||||
public void init() {
|
||||
Image[][] images = loadImages();
|
||||
for (int i = 0; i < 4; i++) {
|
||||
addButton(getTitle(i, false), getTitle(i, true), images[i], i == NEW);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void handlePressed(MouseEvent e, int index) {
|
||||
boolean shift = e.isShiftDown();
|
||||
JavaScriptEditor jsEditor = (JavaScriptEditor) editor;
|
||||
|
||||
switch (index) {
|
||||
|
||||
case OPEN:
|
||||
JPopupMenu popup = editor.getMode().getToolbarMenu().getPopupMenu();
|
||||
popup.show(this, e.getX(), e.getY());
|
||||
break;
|
||||
|
||||
case NEW:
|
||||
if (shift) {
|
||||
base.handleNew();
|
||||
} else {
|
||||
base.handleNewReplace();
|
||||
}
|
||||
break;
|
||||
|
||||
case SAVE:
|
||||
jsEditor.handleSaveRequest(false);
|
||||
break;
|
||||
|
||||
case EXPORT:
|
||||
jsEditor.handleExport();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -131,7 +131,12 @@
|
||||
</fileset>
|
||||
</copy>
|
||||
-->
|
||||
|
||||
<copy todir="${target.path}/modes/javascript">
|
||||
<fileset dir="../javascript">
|
||||
<exclude name="**/._*" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy todir="${target.path}/modes/android">
|
||||
<fileset dir="../android">
|
||||
<include name="android-core.zip" />
|
||||
|
||||
@@ -0,0 +1,642 @@
|
||||
# LITERAL2 specifies constants
|
||||
|
||||
ADD LITERAL2
|
||||
ALIGN_CENTER LITERAL2
|
||||
ALIGN_LEFT LITERAL2
|
||||
ALIGN_RIGHT LITERAL2
|
||||
ALPHA LITERAL2
|
||||
ALPHA_MASK LITERAL2
|
||||
ALT LITERAL2
|
||||
AMBIENT LITERAL2
|
||||
ARROW LITERAL2
|
||||
ARGB LITERAL2
|
||||
BACKSPACE LITERAL2
|
||||
BASELINE LITERAL2
|
||||
BEVEL LITERAL2
|
||||
BLEND LITERAL2
|
||||
BLUE_MASK LITERAL2
|
||||
BLUR LITERAL2
|
||||
BOTTOM LITERAL2
|
||||
BURN LITERAL2
|
||||
CENTER LITERAL2
|
||||
CHATTER LITERAL2
|
||||
CODED LITERAL2
|
||||
COMPLAINT LITERAL2
|
||||
COMPOSITE LITERAL2
|
||||
COMPONENT LITERAL2
|
||||
CONCAVE_POLYGON LITERAL2
|
||||
CONTROL LITERAL2
|
||||
CONVEX_POLYGON LITERAL2
|
||||
CORNER LITERAL2
|
||||
CORNERS LITERAL2
|
||||
CLOSE LITERAL2
|
||||
CMYK LITERAL2
|
||||
CODED LITERAL2
|
||||
COMPLAINT LITERAL2
|
||||
CONTROL LITERAL2
|
||||
CORNER LITERAL2
|
||||
CORNERS LITERAL2
|
||||
CROSS LITERAL2
|
||||
CUSTOM LITERAL2
|
||||
DARKEST LITERAL2
|
||||
DEGREES LITERAL2
|
||||
DEG_TO_RAD LITERAL2
|
||||
DELETE LITERAL2
|
||||
DIAMETER LITERAL2
|
||||
DIFFERENCE LITERAL2
|
||||
DIFFUSE LITERAL2
|
||||
DILATE LITERAL2
|
||||
DIRECTIONAL LITERAL2
|
||||
DISABLE_ACCURATE_TEXTURES LITERAL2
|
||||
DISABLE_DEPTH_SORT LITERAL2
|
||||
DISABLE_DEPTH_TEST LITERAL2
|
||||
DISABLE_NATIVE_FONTS LITERAL2
|
||||
DISABLE_OPENGL_ERROR_REPORT LITERAL2
|
||||
DISABLE_OPENGL_2X_SMOOTH LITERAL2
|
||||
DISABLE_OPENGL_4X_SMOOTH LITERAL2
|
||||
DISABLE_TEXT_SMOOTH LITERAL2
|
||||
DISABLED LITERAL2
|
||||
DODGE LITERAL2
|
||||
DOWN LITERAL2
|
||||
DXF LITERAL2
|
||||
ENABLE_ACCURATE_TEXTURES LITERAL2
|
||||
ENABLE_DEPTH_SORT LITERAL2
|
||||
ENABLE_DEPTH_TEST LITERAL2
|
||||
ENABLE_NATIVE_FONTS LITERAL2
|
||||
ENABLE_OPENGL_2X_SMOOTH LITERAL2
|
||||
ENABLE_OPENGL_4X_SMOOTH LITERAL2
|
||||
ENABLE_OPENGL_ERROR_REPORT LITERAL2
|
||||
ENTER LITERAL2
|
||||
EPSILON LITERAL2
|
||||
ERODE LITERAL2
|
||||
ESC LITERAL2
|
||||
EXCLUSION LITERAL2
|
||||
GIF LITERAL2
|
||||
GRAY LITERAL2
|
||||
GREEN_MASK LITERAL2
|
||||
GROUP LITERAL2
|
||||
HALF LITERAL2
|
||||
HALF_PI LITERAL2
|
||||
HAND LITERAL2
|
||||
HARD_LIGHT LITERAL2
|
||||
HINT_COUNT LITERAL2
|
||||
HSB LITERAL2
|
||||
IMAGE LITERAL2
|
||||
INVERT LITERAL2
|
||||
JAVA2D LITERAL2
|
||||
JPEG LITERAL2
|
||||
LEFT LITERAL2
|
||||
LIGHTEST LITERAL2
|
||||
LINES LITERAL2
|
||||
LINUX LITERAL2
|
||||
MACOSX LITERAL2
|
||||
MAX_FLOAT LITERAL2
|
||||
MAX_INT LITERAL2
|
||||
MITER LITERAL2
|
||||
MODEL LITERAL2
|
||||
MOVE LITERAL2
|
||||
MULTIPLY LITERAL2
|
||||
NORMAL LITERAL2
|
||||
NO_DEPTH_TEST LITERAL2
|
||||
NTSC LITERAL2
|
||||
ONE LITERAL2
|
||||
OPAQUE LITERAL2
|
||||
OPEN LITERAL2
|
||||
OPENGL LITERAL2
|
||||
ORTHOGRAPHIC LITERAL2
|
||||
OVERLAY LITERAL2
|
||||
PAL LITERAL2
|
||||
P2D LITERAL2
|
||||
P3D LITERAL2
|
||||
PERSPECTIVE LITERAL2
|
||||
PI LITERAL2
|
||||
PIXEL_CENTER LITERAL2
|
||||
POINT LITERAL2
|
||||
POINTS LITERAL2
|
||||
POSTERIZE LITERAL2
|
||||
PROBLEM LITERAL2
|
||||
PROJECT LITERAL2
|
||||
QUAD_STRIP LITERAL2
|
||||
QUADS LITERAL2
|
||||
QUARTER_PI LITERAL2
|
||||
RAD_TO_DEG LITERAL2
|
||||
RADIUS LITERAL2
|
||||
RADIANS LITERAL2
|
||||
RED_MASK LITERAL2
|
||||
REPLACE LITERAL2
|
||||
RETURN LITERAL2
|
||||
RGB LITERAL2
|
||||
RIGHT LITERAL2
|
||||
ROUND LITERAL2
|
||||
SCREEN LITERAL2
|
||||
SECAM LITERAL2
|
||||
SHIFT LITERAL2
|
||||
SPECULAR LITERAL2
|
||||
SOFT_LIGHT LITERAL2
|
||||
SQUARE LITERAL2
|
||||
SUBTRACT LITERAL2
|
||||
SVIDEO LITERAL2
|
||||
TAB LITERAL2
|
||||
TARGA LITERAL2
|
||||
TEXT LITERAL2
|
||||
TFF LITERAL2
|
||||
THIRD_PI LITERAL2
|
||||
THRESHOLD LITERAL2
|
||||
TIFF LITERAL2
|
||||
TOP LITERAL2
|
||||
TRIANGLE_FAN LITERAL2
|
||||
TRIANGLES LITERAL2
|
||||
TRIANGLE_STRIP LITERAL2
|
||||
TUNER LITERAL2
|
||||
TWO LITERAL2
|
||||
TWO_PI LITERAL2
|
||||
UP LITERAL2
|
||||
WAIT LITERAL2
|
||||
WHITESPACE LITERAL2
|
||||
|
||||
|
||||
# KEYWORD1 specifies datatypes and keywords
|
||||
|
||||
ArrayList KEYWORD1
|
||||
Boolean KEYWORD1
|
||||
Byte KEYWORD1
|
||||
Character KEYWORD1
|
||||
Class KEYWORD1
|
||||
Double KEYWORD1
|
||||
Float KEYWORD1
|
||||
Integer KEYWORD1
|
||||
HashMap KEYWORD1
|
||||
String KEYWORD1
|
||||
StringBuffer KEYWORD1
|
||||
Thread KEYWORD1
|
||||
abstract KEYWORD1
|
||||
assert KEYWORD1
|
||||
boolean KEYWORD1
|
||||
break KEYWORD1
|
||||
byte KEYWORD1
|
||||
catch KEYWORD1
|
||||
char KEYWORD1
|
||||
class KEYWORD1
|
||||
continue KEYWORD1
|
||||
default KEYWORD1
|
||||
do KEYWORD1
|
||||
double KEYWORD1
|
||||
else KEYWORD1
|
||||
enum KEYWORD1
|
||||
extends KEYWORD1
|
||||
false KEYWORD1
|
||||
final KEYWORD1
|
||||
finally KEYWORD1
|
||||
for KEYWORD1
|
||||
float KEYWORD1
|
||||
if KEYWORD1
|
||||
implements KEYWORD1
|
||||
import KEYWORD1
|
||||
instanceof KEYWORD1
|
||||
int KEYWORD1
|
||||
interface KEYWORD1
|
||||
long KEYWORD1
|
||||
native KEYWORD1
|
||||
new KEYWORD1
|
||||
null KEYWORD1
|
||||
package KEYWORD1
|
||||
private KEYWORD1
|
||||
protected KEYWORD1
|
||||
public KEYWORD1
|
||||
return KEYWORD1
|
||||
short KEYWORD1
|
||||
static KEYWORD1
|
||||
strictfp KEYWORD1
|
||||
super KEYWORD1
|
||||
switch KEYWORD1
|
||||
synchronized KEYWORD1
|
||||
this KEYWORD1
|
||||
throw KEYWORD1
|
||||
throws KEYWORD1
|
||||
transient KEYWORD1
|
||||
true KEYWORD1
|
||||
try KEYWORD1
|
||||
void KEYWORD1
|
||||
volatile KEYWORD1
|
||||
while KEYWORD1
|
||||
|
||||
# Depricated API
|
||||
|
||||
arraycopy KEYWORD2 arraycopy_
|
||||
openStream KEYWORD2 openStream_
|
||||
|
||||
|
||||
# KEYWORD2 specifies methods and functions
|
||||
|
||||
cache KEYWORD2
|
||||
|
||||
|
||||
# THE TEXT ABOVE IS HAND-WRITTEN AND FOUND IN THE FILE "keywords_base.txt"
|
||||
# THE TEXT BELOW IS AUTO-GENERATED
|
||||
|
||||
|
||||
abs KEYWORD2 abs_
|
||||
acos KEYWORD2 acos_
|
||||
+= addassign
|
||||
+ addition
|
||||
alpha KEYWORD2 alpha_
|
||||
ambient KEYWORD2 ambient_
|
||||
ambientLight KEYWORD2 ambientLight_
|
||||
append KEYWORD2 append_
|
||||
applyMatrix KEYWORD2 applyMatrix_
|
||||
arc KEYWORD2 arc_
|
||||
Array KEYWORD1 Array
|
||||
[] arrayaccess
|
||||
arrayCopy KEYWORD2 arrayCopy_
|
||||
ArrayList KEYWORD1 ArrayList
|
||||
asin KEYWORD2 asin_
|
||||
= assign
|
||||
atan KEYWORD2 atan_
|
||||
atan2 KEYWORD2 atan2_
|
||||
background KEYWORD2 background_
|
||||
beginCamera KEYWORD2 beginCamera_
|
||||
beginRaw KEYWORD2 beginRaw_
|
||||
beginRecord KEYWORD2 beginRecord_
|
||||
beginShape KEYWORD2 beginShape_
|
||||
bezier KEYWORD2 bezier_
|
||||
bezierDetail KEYWORD2 bezierDetail_
|
||||
bezierPoint KEYWORD2 bezierPoint_
|
||||
bezierTangent KEYWORD2 bezierTangent_
|
||||
bezierVertex KEYWORD2 bezierVertex_
|
||||
binary KEYWORD2 binary_
|
||||
binary KEYWORD2 bitwiseAND_
|
||||
| bitwiseOR
|
||||
blend KEYWORD2 blend_
|
||||
blendColor KEYWORD2 blendColor_
|
||||
blue KEYWORD2 blue_
|
||||
boolean KEYWORD1 boolean
|
||||
boolean KEYWORD2 boolean_
|
||||
box KEYWORD2 box_
|
||||
break KEYWORD1 break
|
||||
brightness KEYWORD2 brightness_
|
||||
BufferedReader KEYWORD2 BufferedReader_
|
||||
readLine KEYWORD2 BufferedReader_readLine_
|
||||
byte KEYWORD1 byte
|
||||
byte KEYWORD2 byte_
|
||||
camera KEYWORD2 camera_
|
||||
case KEYWORD1 case
|
||||
catch KEYWORD1 catch
|
||||
ceil KEYWORD2 ceil_
|
||||
char KEYWORD1 char
|
||||
char KEYWORD2 char_
|
||||
char KEYWORD2 class_
|
||||
color KEYWORD2 color_
|
||||
color KEYWORD1 color_datatype
|
||||
colorMode KEYWORD2 colorMode_
|
||||
, comma
|
||||
// comment
|
||||
concat KEYWORD2 concat_
|
||||
?: KEYWORD1 conditional_
|
||||
constrain KEYWORD2 constrain_
|
||||
continue KEYWORD1 continue
|
||||
copy KEYWORD2 copy_
|
||||
cos KEYWORD2 cos_
|
||||
createFont KEYWORD2 createFont_
|
||||
createGraphics KEYWORD2 createGraphics_
|
||||
createImage KEYWORD2 createImage_
|
||||
createInput KEYWORD2 createInput_
|
||||
createOutput KEYWORD2 createOutput_
|
||||
createReader KEYWORD2 createReader_
|
||||
createWriter KEYWORD2 createWriter_
|
||||
{} curlybraces
|
||||
cursor KEYWORD2 cursor_
|
||||
curve KEYWORD2 curve_
|
||||
curveDetail KEYWORD2 curveDetail_
|
||||
curvePoint KEYWORD2 curvePoint_
|
||||
curveTangent KEYWORD2 curveTangent_
|
||||
curveTightness KEYWORD2 curveTightness_
|
||||
curveVertex KEYWORD2 curveVertex_
|
||||
day KEYWORD2 day_
|
||||
-- decrement
|
||||
default KEYWORD1 default
|
||||
degrees KEYWORD2 degrees_
|
||||
delay KEYWORD2 delay_
|
||||
directionalLight KEYWORD2 directionalLight_
|
||||
dist KEYWORD2 dist_
|
||||
/ divide
|
||||
/= divideassign
|
||||
/** doccomment
|
||||
. dot
|
||||
double KEYWORD1 double
|
||||
draw KEYWORD3 draw_
|
||||
ellipse KEYWORD2 ellipse_
|
||||
ellipseMode KEYWORD2 ellipseMode_
|
||||
else KEYWORD1 else
|
||||
emissive KEYWORD2 emissive_
|
||||
endCamera KEYWORD2 endCamera_
|
||||
endRaw KEYWORD2 endRaw_
|
||||
endRecord KEYWORD2 endRecord_
|
||||
endShape KEYWORD2 endShape_
|
||||
== equality
|
||||
exit KEYWORD2 exit_
|
||||
exp KEYWORD2 exp_
|
||||
expand KEYWORD2 expand_
|
||||
extends KEYWORD1 extends
|
||||
false KEYWORD1 false
|
||||
fill KEYWORD2 fill_
|
||||
filter KEYWORD2 filter_
|
||||
final KEYWORD1 final
|
||||
float KEYWORD1 float
|
||||
float KEYWORD2 float_
|
||||
floor KEYWORD2 floor_
|
||||
focusGained KEYWORD3 focusGained_
|
||||
focusLost KEYWORD3 focusLost_
|
||||
focused LITERAL2 focused
|
||||
for KEYWORD1 for_
|
||||
frameCount LITERAL2 frameCount
|
||||
frameRate KEYWORD2 frameRate_
|
||||
frameRate LITERAL2 frameRate
|
||||
frustum KEYWORD2 frustum_
|
||||
get KEYWORD2 get_
|
||||
< greaterthan
|
||||
<= greaterthanorequalto
|
||||
green KEYWORD2 green_
|
||||
HALF_PI LITERAL2 HALF_PI
|
||||
HashMap KEYWORD1 HashMap
|
||||
height LITERAL2 height
|
||||
hex KEYWORD2 hex_
|
||||
hint KEYWORD2 hint_
|
||||
hour KEYWORD2 hour_
|
||||
hue KEYWORD2 hue_
|
||||
if KEYWORD1 if_
|
||||
image KEYWORD2 image_
|
||||
imageMode KEYWORD2 imageMode_
|
||||
implements KEYWORD1 implements
|
||||
import KEYWORD1 import
|
||||
++ increment
|
||||
!= inequality
|
||||
int KEYWORD1 int
|
||||
int KEYWORD2 int_
|
||||
join KEYWORD2 join_
|
||||
key LITERAL2 key
|
||||
keyCode LITERAL2 keyCode
|
||||
keyPressed KEYWORD2 keyPressed_
|
||||
keyPressed LITERAL2 keyPressed
|
||||
keyReleased KEYWORD2 keyReleased_
|
||||
keyTyped KEYWORD2 keyTyped_
|
||||
<< leftshift
|
||||
lerp KEYWORD2 lerp_
|
||||
lerpColor KEYWORD2 lerpColor_
|
||||
< lessthan
|
||||
<= lessthanorequalto
|
||||
lightFalloff KEYWORD2 lightFalloff_
|
||||
lights KEYWORD2 lights_
|
||||
lightSpecular KEYWORD2 lightSpecular_
|
||||
line KEYWORD2 line_
|
||||
link KEYWORD2 link_
|
||||
loadBytes KEYWORD2 loadBytes_
|
||||
loadFont KEYWORD2 loadFont_
|
||||
loadImage KEYWORD2 loadImage_
|
||||
loadPixels KEYWORD2 loadPixels_
|
||||
loadShape KEYWORD2 loadShape_
|
||||
loadStrings KEYWORD2 loadStrings_
|
||||
log KEYWORD2 log_
|
||||
&& logicalAND
|
||||
! logicalNOT
|
||||
|| logicalOR
|
||||
long KEYWORD1 long
|
||||
loop KEYWORD2 loop_
|
||||
mag KEYWORD2 mag_
|
||||
map KEYWORD2 map_
|
||||
match KEYWORD2 match_
|
||||
matchAll KEYWORD2 matchAll_
|
||||
max KEYWORD2 max_
|
||||
millis KEYWORD2 millis_
|
||||
min KEYWORD2 min_
|
||||
- minus
|
||||
minute KEYWORD2 minute_
|
||||
modelX KEYWORD2 modelX_
|
||||
modelY KEYWORD2 modelY_
|
||||
modelZ KEYWORD2 modelZ_
|
||||
% modulo
|
||||
month KEYWORD2 month_
|
||||
mouseButton LITERAL2 mouseButton
|
||||
mouseClicked KEYWORD2 mouseClicked_
|
||||
mouseDragged KEYWORD2 mouseDragged_
|
||||
mouseMoved KEYWORD2 mouseMoved_
|
||||
mousePressed KEYWORD2 mousePressed_
|
||||
mousePressed LITERAL2 mousePressed
|
||||
mouseReleased KEYWORD2 mouseReleased_
|
||||
mouseX LITERAL2 mouseX
|
||||
mouseY LITERAL2 mouseY
|
||||
/* multilinecomment
|
||||
* multiply
|
||||
*= multiplyassign
|
||||
new KEYWORD1 new
|
||||
nf KEYWORD2 nf_
|
||||
nfc KEYWORD2 nfc_
|
||||
nfp KEYWORD2 nfp_
|
||||
nfs KEYWORD2 nfs_
|
||||
noCursor KEYWORD2 noCursor_
|
||||
noFill KEYWORD2 noFill_
|
||||
noise KEYWORD2 noise_
|
||||
noiseDetail KEYWORD2 noiseDetail_
|
||||
noiseSeed KEYWORD2 noiseSeed_
|
||||
noLights KEYWORD2 noLights_
|
||||
noLoop KEYWORD2 noLoop_
|
||||
norm KEYWORD2 norm_
|
||||
normal KEYWORD2 normal_
|
||||
noSmooth KEYWORD2 noSmooth_
|
||||
noStroke KEYWORD2 noStroke_
|
||||
noTint KEYWORD2 noTint_
|
||||
null KEYWORD1 null
|
||||
Object KEYWORD1 Object
|
||||
online LITERAL2 online
|
||||
open KEYWORD2 open_
|
||||
ortho KEYWORD2 ortho_
|
||||
param KEYWORD2 param_
|
||||
() parentheses
|
||||
perspective KEYWORD2 perspective_
|
||||
PFont KEYWORD1 PFont
|
||||
list KEYWORD2 PFont_list_
|
||||
PGraphics KEYWORD1 PGraphics
|
||||
beginDraw KEYWORD2 PGraphics_beginDraw_
|
||||
endDraw KEYWORD2 PGraphics_endDraw_
|
||||
PI LITERAL2 PI
|
||||
PImage KEYWORD1 PImage
|
||||
alpha KEYWORD2 PImage_alpha_
|
||||
blend KEYWORD2 PImage_blend_
|
||||
copy KEYWORD2 PImage_copy_
|
||||
filter KEYWORD2 PImage_filter_
|
||||
get KEYWORD2 PImage_get_
|
||||
height LITERAL2 PImage_height
|
||||
loadPixels KEYWORD2 PImage_loadPixels_
|
||||
mask KEYWORD2 PImage_mask_
|
||||
pixels LITERAL2 PImage_pixels
|
||||
resize KEYWORD2 PImage_resize_
|
||||
save KEYWORD2 PImage_save_
|
||||
set KEYWORD2 PImage_set_
|
||||
updatePixels KEYWORD2 PImage_updatePixels_
|
||||
width LITERAL2 PImage_width
|
||||
pixels LITERAL2 pixels
|
||||
pmouseX LITERAL2 pmouseX
|
||||
pmouseY LITERAL2 pmouseY
|
||||
point KEYWORD2 point_
|
||||
point KEYWORD2 pointLight_
|
||||
popMatrix KEYWORD2 popMatrix_
|
||||
popStyle KEYWORD3 popStyle_
|
||||
pow KEYWORD2 pow_
|
||||
print KEYWORD2 print_
|
||||
printCamera KEYWORD2 printCamera_
|
||||
println KEYWORD2 println_
|
||||
printMatrix KEYWORD2 printMatrix_
|
||||
printProjection KEYWORD2 printProjection_
|
||||
PrintWriter KEYWORD1 PrintWriter
|
||||
close KEYWORD2 PrintWriter_close_
|
||||
flush KEYWORD2 PrintWriter_flush_
|
||||
print KEYWORD2 PrintWriter_print_
|
||||
println KEYWORD2 PrintWriter_println_
|
||||
private KEYWORD1 private
|
||||
PShape KEYWORD1 PShape
|
||||
disableStyle KEYWORD2 PShape_disableStyle_
|
||||
enableStyle KEYWORD2 PShape_enableStyle_
|
||||
getChild KEYWORD2 PShape_getChild_
|
||||
height LITERAL2 PShape_height
|
||||
isVisible KEYWORD2 PShape_isVisible_
|
||||
resetMatrix KEYWORD2 PShape_resetMatrix_
|
||||
rotate KEYWORD2 PShape_rotate_
|
||||
rotateX KEYWORD2 PShape_rotateX_
|
||||
rotateY KEYWORD2 PShape_rotateY_
|
||||
rotateZ KEYWORD2 PShape_rotateZ_
|
||||
scale KEYWORD2 PShape_scale_
|
||||
setVisible KEYWORD2 PShape_setVisible_
|
||||
translate KEYWORD2 PShape_translate_
|
||||
width LITERAL2 PShape_width
|
||||
public KEYWORD1 public
|
||||
pushMatrix KEYWORD2 pushMatrix_
|
||||
pushStyle KEYWORD3 pushStyle_
|
||||
PVector KEYWORD1 PVector
|
||||
add KEYWORD2 PVector_add_
|
||||
angleBetween KEYWORD2 PVector_angleBetween_
|
||||
array KEYWORD2 PVector_array_
|
||||
copy KEYWORD2 PVector_copy_
|
||||
cross KEYWORD2 PVector_cross_
|
||||
dist KEYWORD2 PVector_dist_
|
||||
div KEYWORD2 PVector_div_
|
||||
dot KEYWORD2 PVector_dot_
|
||||
get KEYWORD2 PVector_get_
|
||||
limit KEYWORD2 PVector_limit_
|
||||
mag KEYWORD2 PVector_mag_
|
||||
mult KEYWORD2 PVector_mult_
|
||||
normalize KEYWORD2 PVector_normalize_
|
||||
set KEYWORD2 PVector_set_
|
||||
sub KEYWORD2 PVector_sub_
|
||||
quad KEYWORD2 quad_
|
||||
QUARTER_PI LITERAL2 QUARTER_PI
|
||||
radians KEYWORD2 radians_
|
||||
random KEYWORD2 random_
|
||||
randomSeed KEYWORD2 randomSeed_
|
||||
rect KEYWORD2 rect_
|
||||
rectMode KEYWORD2 rectMode_
|
||||
red KEYWORD2 red_
|
||||
redraw KEYWORD2 redraw_
|
||||
requestImage KEYWORD2 requestImage_
|
||||
resetMatrix KEYWORD2 resetMatrix_
|
||||
return KEYWORD1 return
|
||||
reverse KEYWORD2 reverse_
|
||||
<< rightshift
|
||||
rotate KEYWORD2 rotate_
|
||||
rotateX KEYWORD2 rotateX_
|
||||
rotateY KEYWORD2 rotateY_
|
||||
rotateZ KEYWORD2 rotateZ_
|
||||
round KEYWORD2 round_
|
||||
saturation KEYWORD2 saturation_
|
||||
save KEYWORD2 save_
|
||||
saveBytes KEYWORD2 saveBytes_
|
||||
saveFrame KEYWORD2 saveFrame_
|
||||
saveStream KEYWORD2 saveStream_
|
||||
saveStrings KEYWORD2 saveStrings_
|
||||
scale KEYWORD2 scale_
|
||||
screen LITERAL2 screen
|
||||
screenHeight LITERAL2 screenHeight
|
||||
screenWidth LITERAL2 screenWidth
|
||||
screenX KEYWORD2 screenX_
|
||||
screenY KEYWORD2 screenY_
|
||||
screenZ KEYWORD2 screenZ_
|
||||
second KEYWORD2 second_
|
||||
selectFolder KEYWORD2 selectFolder_
|
||||
selectInput KEYWORD2 selectInput_
|
||||
selectOutput KEYWORD2 selectOutput_
|
||||
; semicolon
|
||||
set KEYWORD2 set_
|
||||
setup KEYWORD3 setup_
|
||||
shape KEYWORD2 shape_
|
||||
shapeMode KEYWORD2 shapeMode_
|
||||
shearX KEYWORD2 shearX_
|
||||
shearY KEYWORD2 shearY_
|
||||
shininess KEYWORD2 shininess_
|
||||
shorten KEYWORD2 shorten_
|
||||
sin KEYWORD2 sin_
|
||||
size KEYWORD2 size_
|
||||
smooth KEYWORD2 smooth_
|
||||
sort KEYWORD2 sort_
|
||||
specular KEYWORD2 specular_
|
||||
sphere KEYWORD2 sphere_
|
||||
sphereDetail KEYWORD2 sphereDetail_
|
||||
splice KEYWORD2 splice_
|
||||
split KEYWORD2 split_
|
||||
splitTokens KEYWORD2 splitTokens_
|
||||
spotLight KEYWORD2 spotLight_
|
||||
sq KEYWORD2 sq_
|
||||
sqrt KEYWORD2 sqrt_
|
||||
static KEYWORD1 static
|
||||
status KEYWORD2 status_
|
||||
str KEYWORD2 str_
|
||||
String KEYWORD1 String
|
||||
charAt KEYWORD2 String_charAt_
|
||||
equals KEYWORD2 String_equals_
|
||||
indexOf KEYWORD2 String_indexOf_
|
||||
length KEYWORD2 String_length_
|
||||
substring KEYWORD2 String_substring_
|
||||
toLowerCase KEYWORD2 String_toLowerCase_
|
||||
toUpperCase KEYWORD2 String_toUpperCase_
|
||||
stroke KEYWORD2 stroke_
|
||||
strokeCap KEYWORD2 strokeCap_
|
||||
strokeJoin KEYWORD2 strokeJoin_
|
||||
strokeWeight KEYWORD2 strokeWeight_
|
||||
subset KEYWORD2 subset_
|
||||
-= subtractassign
|
||||
super KEYWORD1 super
|
||||
switch KEYWORD2 switch_
|
||||
tan KEYWORD2 tan_
|
||||
text KEYWORD2 text_
|
||||
textAlign KEYWORD2 textAlign_
|
||||
textAscent KEYWORD2 textAscent_
|
||||
textDescent KEYWORD2 textDescent_
|
||||
textFont KEYWORD2 textFont_
|
||||
textLeading KEYWORD2 textLeading_
|
||||
textMode KEYWORD2 textMode_
|
||||
textSize KEYWORD2 textSize_
|
||||
texture KEYWORD2 texture_
|
||||
textureMode KEYWORD2 textureMode_
|
||||
textWidth KEYWORD2 textWidth_
|
||||
this KEYWORD1 this
|
||||
tint KEYWORD2 tint_
|
||||
translate KEYWORD2 translate_
|
||||
triangle KEYWORD2 triangle_
|
||||
trim KEYWORD2 trim_
|
||||
true KEYWORD1 true
|
||||
try KEYWORD1 try
|
||||
TWO_PI LITERAL2 TWO_PI
|
||||
unbinary KEYWORD2 unbinary_
|
||||
unhex KEYWORD2 unhex_
|
||||
updatePixels KEYWORD2 updatePixels_
|
||||
vertex KEYWORD2 vertex_
|
||||
void KEYWORD1 void
|
||||
while KEYWORD1 while_
|
||||
width LITERAL2 width
|
||||
XMLElement KEYWORD1 XMLElement
|
||||
getChild KEYWORD2 XMLElement_getChild_
|
||||
getChildCount KEYWORD2 XMLElement_getChildCount_
|
||||
getChildren KEYWORD2 XMLElement_getChildren_
|
||||
getContent KEYWORD2 XMLElement_getContent_
|
||||
getFloat KEYWORD2 XMLElement_getFloat_
|
||||
getInt KEYWORD2 XMLElement_getInt_
|
||||
getName KEYWORD2 XMLElement_getName_
|
||||
getString KEYWORD2 XMLElement_getString_
|
||||
year KEYWORD2 year_
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 92 B |
|
After Width: | Height: | Size: 62 B |
|
After Width: | Height: | Size: 104 B |
|
After Width: | Height: | Size: 54 B |
|
After Width: | Height: | Size: 839 B |
|
After Width: | Height: | Size: 62 B |
|
After Width: | Height: | Size: 104 B |
|
After Width: | Height: | Size: 54 B |
|
After Width: | Height: | Size: 63 B |
@@ -0,0 +1,111 @@
|
||||
# GUI - STATUS
|
||||
status.notice.fgcolor = #000000
|
||||
status.notice.bgcolor = #818b95
|
||||
status.error.fgcolor = #ffffff
|
||||
status.error.bgcolor = #662000
|
||||
status.edit.fgcolor = #000000
|
||||
status.edit.bgcolor = #cc9900
|
||||
status.font = SansSerif,plain,12
|
||||
#status.font.macosx = Helvetica,plain,12
|
||||
|
||||
# GUI - TABS
|
||||
# settings for the tabs at the top
|
||||
# (tab images are stored in the lib/theme folder)
|
||||
header.bgcolor = #818b95
|
||||
header.text.selected.color = #1a1a00
|
||||
header.text.unselected.color = #ffffff
|
||||
header.text.font = SansSerif,plain,12
|
||||
#header.text.font.macosx = Helvetica,plain,12
|
||||
|
||||
# GUI - CONSOLE
|
||||
# font is handled by preferences, since size/etc is modifiable
|
||||
console.color = #000000
|
||||
console.output.color = #cccccc
|
||||
console.error.color = #ff3000
|
||||
|
||||
# GUI - BUTTONS
|
||||
buttons.bgcolor = #4a545e
|
||||
buttons.status.font = SansSerif,plain,12
|
||||
#buttons.status.font.macosx = Helvetica,plain,12
|
||||
buttons.status.color = #ffffff
|
||||
|
||||
# GUI - MODE
|
||||
#mode.button.bgcolor = #9ca6b0
|
||||
mode.button.font = SansSerif,plain,9
|
||||
#mode.button.font.macosx = Helvetica,plain,9
|
||||
#mode.button.color = #4a545e
|
||||
mode.button.color = #9ca6b0
|
||||
|
||||
# GUI - LINESTATUS
|
||||
linestatus.color = #ffffff
|
||||
linestatus.bgcolor = #29333d
|
||||
|
||||
# EDITOR - DETAILS
|
||||
|
||||
# foreground and background colors
|
||||
editor.fgcolor = #000000
|
||||
editor.bgcolor = #ffffff
|
||||
|
||||
# highlight for the current line
|
||||
editor.linehighlight.color=#e2e2e2
|
||||
# highlight for the current line
|
||||
editor.linehighlight=true
|
||||
|
||||
# caret blinking and caret color
|
||||
editor.caret.color = #333300
|
||||
|
||||
# color to be used for background when 'external editor' enabled
|
||||
editor.external.bgcolor = #c8d2dc
|
||||
|
||||
# selection color
|
||||
editor.selection.color = #ffcc00
|
||||
|
||||
# area that's not in use by the text (replaced with tildes)
|
||||
editor.invalid.style = #7e7e7e,bold
|
||||
|
||||
# little pooties at the end of lines that show where they finish
|
||||
editor.eolmarkers = false
|
||||
editor.eolmarkers.color = #999999
|
||||
|
||||
# bracket/brace highlighting
|
||||
editor.brackethighlight = true
|
||||
editor.brackethighlight.color = #006699
|
||||
|
||||
|
||||
# TEXT - KEYWORDS
|
||||
|
||||
# e.g abstract, final, private
|
||||
editor.keyword1.style = #cc6600,plain
|
||||
|
||||
# e.g. beginShape, point, line
|
||||
editor.keyword2.style = #cc6600,plain
|
||||
|
||||
# e.g. byte, char, short, color
|
||||
editor.keyword3.style = #cc6600,bold
|
||||
|
||||
|
||||
# TEXT - LITERALS
|
||||
|
||||
# constants: e.g. null, true, this, RGB, TWO_PI
|
||||
editor.literal1.style = #006699,plain
|
||||
|
||||
# p5 built in variables: e.g. mouseX, width, pixels
|
||||
editor.literal2.style = #006699,plain
|
||||
|
||||
# e.g. + - = /
|
||||
editor.operator.style = #000000,plain
|
||||
|
||||
# ?? maybe this is for words followed by a colon
|
||||
# like in case statements or goto
|
||||
editor.label.style = #7e7e7e,bold
|
||||
|
||||
|
||||
# TEXT - COMMENTS
|
||||
editor.comment1.style = #7e7e7e,plain
|
||||
editor.comment2.style = #7e7e7e,plain
|
||||
|
||||
|
||||
# LINE STATUS - editor line number status bar at the bottom of the screen
|
||||
linestatus.font = SansSerif,plain,10
|
||||
#linestatus.font.macosx = Helvetica,plain,10
|
||||
linestatus.height = 20
|
||||