Added doclet and changed comments in PApplet.java

This commit is contained in:
Anadroid
2020-09-09 17:31:33 +02:00
parent d7a7ed6dca
commit 2e8a2b7ffd
58 changed files with 3964 additions and 423 deletions
File diff suppressed because it is too large Load Diff
+26
View File
@@ -0,0 +1,26 @@
Writing a custom doclet. The problem is including a custom jar (for json).
I'm running ant in the command line (ant compile) to build the doclet first and there are 2 options for running the doclet.
1. by running the processingrefBuild.sh
```
./processingrefBuild.sh
```
this gives "javadoc: error - In doclet class ProcessingWeblet, method start has thrown an exception java.lang.reflect.InvocationTargetException
java.lang.NoClassDefFoundError: org/json/JSONObject..." which I think means that the json jar needs to be included in the classpath also when running the javadoc comamand in the processingrefBuild.sh and I tried adding -classpath lib/ to the javadoc command and adding the lib to CLASSPATH in the terminal but didn't work. But maybe something else is a problem and not adding the lib to the classpath (this post https://javarevisited.blogspot.com/2011/06/noclassdeffounderror-exception-in.html has a bunch of reasons why this might be happening but nothing seems to be applicable or i tried it in a wrong way).
2. through ant by running the command
```
ant rundoc
```
this gives an error "javadoc: error - invalid flag: -d" so I'm guessing that the javadoc and doclet is not written correctly. If I remove the destdir from the javadoc tag it "works" in a sense that it doesn't give the flag error but then obviously there is no destdir so nothing happens
(this would also be the prefered option to do this in order to have everything in one place)
Additional info:
- Using JAVA 1.8 and Ant 1.10.8
+9
View File
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="Tools"/>
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry exported="true" kind="lib" path="lib/org.json.jar"/>
<classpathentry kind="lib" path="Tools/tools.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
+3
View File
@@ -0,0 +1,3 @@
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/
export JAVA_HOME;
+24
View File
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ReferenceGenerator</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<linkedResources>
<link>
<name>Tools</name>
<type>2</type>
<location>/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/lib</location>
</link>
</linkedResources>
</projectDescription>
@@ -0,0 +1,12 @@
#Wed Sep 12 09:51:20 EDT 2012
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
+32
View File
@@ -0,0 +1,32 @@
#!/bin/sh
#remove everything old
rm -rf ../tmp
#generate everything anew
javadoc -doclet ProcessingWeblet -docletpath bin/ -public \
-webref ../tmp/web-android \
-localref ../tmp/local-android \
-includeXMLTag android \
-templatedir ../templates \
-examplesdir ../api_examples \
-includedir ../api_examples/include \
-imagedir images \
-corepackage processing.xml \
-rootclass PGraphics \
-rootclass PConstants \
../../../processing/android/core/src/processing/android/core/*.java \
../../../processing/android/core/src/processing/android/xml/*.java \
../../../processing/net/src/processing/net/*.java \
../../../processing/serial/src/processing/serial/*.java
# ../../../processing/video/src/processing/video/*.java \
#copy over the css and sample images
cp -r ../../css ../tmp/web-android
cp -r ../../css ../tmp/local-android
mkdir ../tmp/web-android/images
mkdir ../tmp/local-android/images
cp -r ../../content/api_media/*.jpg ../tmp/web-android/images/
cp -r ../../content/api_media/*.gif ../tmp/web-android/images/
cp -r ../../content/api_media/*.png ../tmp/web-android/images/
cp -r ../../content/api_media/*.jpg ../tmp/local-android/images/
cp -r ../../content/api_media/*.gif ../tmp/local-android/images/
cp -r ../../content/api_media/*.png ../tmp/local-android/images/
Binary file not shown.
Binary file not shown.
+65
View File
@@ -0,0 +1,65 @@
<project name="Procesing Web Reference Generator" default="compile" basedir=".">
<description>
Build file for the Processing documentation generator.
Creates the ProcessingWeblet.class, which is used by javadoc to structure
the parsed Processing source code into the website reference.
</description>
<!-- set global properties for this build -->
<property name="src" location="src"/>
<property name="build" location="bin"/>
<property name="test" location="test"/>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
</target>
<path id="class.path">
<fileset dir="lib">
<include name="*.jar" />
</fileset>
</path>
<target name="rundoc">
<mkdir dir="docs" />
<javadoc access="public" destdir="docs">
<fileset dir="test" defaultexcludes="yes">
<include name="*" />
</fileset>
<classpath refid="class.path" />
<doclet name="ProcessingWeblet" path="bin">
<param name="-webref" value="../../reference"/>
<param name="-localref" value="../../distribution"/>
<param name="-templatedir" value="../templates"/>
<param name="-examplesdir" value="../../content/api_en"/>
<param name="-includedir" value="../../content/api_en/include"/>
<param name="-imagedir" value="images"/>
<param name="-encoding" value="UTF-8"/>
<param name="-corepackage" value="processing.data"/>
<param name="-corepackage" value="processing.event"/>
<param name="-corepackage" value="processing.opengl"/>
<param name="-rootclass" value="PConstants"/>
</doclet>
</javadoc>
</target>
<target name="compile" depends="clean,init"
description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<!-- Note that your environment JAVA_HOME now matters for building -->
<javac srcdir="${src}" destdir="${build}" source="1.8" target="1.8" includeantruntime="true">
<classpath refid="class.path" />
</javac>
</target>
<target name="clean"
description="clean up" >
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
</target>
</project>
Binary file not shown.
Binary file not shown.
+51
View File
@@ -0,0 +1,51 @@
#!/bin/sh
echo "[REFERENCE GENERATOR] Booting up..."
# PROCESSING_SRC_PATH=./test
PROCESSING_SRC_PATH=../../core/src
PROCESSING_LIB_PATH=../../java/libraries
REFERENCES_OUT_PATH=../../../processing-website
# GENERATE REFERENCE ENTRIES AND INDEX THROUGH JAVADOC - BY DAVID WICKS
echo "[REFERENCE GENERATOR] Source Path :: $PROCESSING_SRC_PATH"
echo "[REFERENCE GENERATOR] Library Path :: $PROCESSING_LIB_PATH"
echo "[REFERENCE GENERATOR] Removing previous version of the ref..."
rm -rf ../../reference
mkdir ../../reference
rm -rf ../../distribution
mkdir ../../distribution
rm -rf $REFERENCES_OUT_PATH/json
mkdir $REFERENCES_OUT_PATH/json
mkdir $REFERENCES_OUT_PATH/json/libraries
mkdir $REFERENCES_OUT_PATH/json/libraries/io
mkdir $REFERENCES_OUT_PATH/json/libraries/net
mkdir $REFERENCES_OUT_PATH/json/libraries/data
mkdir $REFERENCES_OUT_PATH/json/libraries/serial
mkdir $REFERENCES_OUT_PATH/json/libraries/opengl
mkdir $REFERENCES_OUT_PATH/json/libraries/sound
mkdir $REFERENCES_OUT_PATH/json/libraries/video
echo "[REFERENCE GENERATOR] Generating new javadocs..."
javadoc -doclet ProcessingWeblet \
-docletpath "bin/:lib/org.json.jar" \
-public \
-webref ../../reference \
-localref ../../distribution \
-templatedir ../templates \
-examplesdir ../../content/api_en \
-includedir ../../content/api_en/include \
-imagedir images \
-encoding UTF-8 \
$PROCESSING_SRC_PATH/processing/core/*.java \
$PROCESSING_SRC_PATH/processing/data/*.java \
$PROCESSING_SRC_PATH/processing/event/*.java \
$PROCESSING_SRC_PATH/processing/opengl/*.java \
$PROCESSING_LIB_PATH/io/src/processing/io/*.java \
$PROCESSING_LIB_PATH/net/src/processing/net/*.java \
$PROCESSING_LIB_PATH/serial/src/processing/serial/*.java \
$PROCESSING_LIB_PATH/../../../processing-video/src/processing/video/*.java \
$PROCESSING_LIB_PATH/../../../processing-sound/src/processing/sound/*.java \
-noisy
@@ -0,0 +1,183 @@
import java.io.IOException;
import writers.ClassWriter;
import writers.FieldWriter;
import writers.FunctionWriter;
import writers.IndexWriter;
import writers.LibraryWriter;
import writers.Shared;
import com.sun.javadoc.ClassDoc;
import com.sun.javadoc.FieldDoc;
import com.sun.javadoc.MethodDoc;
import com.sun.javadoc.RootDoc;
import com.sun.javadoc.Tag;
import com.sun.tools.doclets.standard.Standard;
import org.json.*;
/*
* @author David Wicks
* ProcessingWeblet generates the web reference for processing.org and download
* The source code of processing is parsed for webref tags to determine what gets included
* Flags for javadoc when running include:
* -templatedir where to find the html templates for output
* -examplesdir where to find the xml describing the examples to go in the reference
* -localref the local reference output directory
* -webref the web reference output directory
* -corepackage pass in as many of these as necessary to have things considered as part of the core (not a library) e.g -corepackage processing.xml
* -includedir where to find things that aren't in the source, but only in xml e.g. [] (arrayaccess)
*/
public class ProcessingWeblet extends Standard {
private static String examplesFlag = "-examplesdir";
private static String templateFlag = "-templatedir";
private static String outputFlag = "-webref";
private static String exceptionsFlag = "-includedir";
private static String imagesFlag = "-imagedir";
private static String localFlag = "-localref";
private static String coreFlag = "-corepackage"; //to allow for exceptions like XML being in the core
private static String verboseFlag = "-noisy";
private static String rootFlag = "-rootclass";
private static String xmlDescriptionFlag = "-includeXMLTag";
private static IndexWriter indexWriter;
public static boolean start(RootDoc root)
{
setConfig(root.options());
Shared.i().createBaseDirectories();
indexWriter = new IndexWriter();
try
{
// write out everything in the .java files:
// Classes, Methods, Fields ... see specific XxxWriters
System.out.println("\n===Writing .javadoc sourced reference.===");
writeContents(root);
// write out everything in the include directory:
// see: /api_en/include
System.out.println("===Source code @webref files written.===");
if (!Shared.i().getIncludeDirectory().equals(""))
{
System.out.println("\n===Writing XML-sourced reference.===");
//XMLReferenceWriter.write( Shared.i().getIncludeDirectory(), indexWriter);
System.out.println("===Include directory files written.===");
}
// write out the index file
System.out.println("\n===Telling the index to write itself.===");
indexWriter.write();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("===All finished in the weblet.===");
return true;
}
private static void setConfig(String[][] configOptions) {
//
Shared.i().corePackages.add("processing.core");
Shared.i().rootClasses.add("PApplet");
Shared.i().rootClasses.add("PConstants");
// look at all possible options (this .equals thing kills switch statements...or does it?)
for (String[] option : configOptions) {
if (option[0].equals(templateFlag)) {
Shared.i().setTemplateDirectory(option[1]);
} else if (option[0].equals(examplesFlag)) {
Shared.i().setExampleDirectory(option[1]);
} else if (option[0].equals(outputFlag)) {
Shared.i().setOutputDirectory(option[1]);
} else if (option[0].equals(exceptionsFlag)) {
// write out files based on exceptions index
Shared.i().setIncludeDirectory( option[1] );
} else if (option[0].equals(imagesFlag)) {
Shared.i().setImageDirectory(option[1]);
} else if( option[0].equals(localFlag) )
{
Shared.i().setLocalOutputDirectory(option[1]);
} else if( option[0].equals(coreFlag)){
Shared.i().corePackages.add(option[1]);
} else if(option[0].equals(verboseFlag)){
Shared.i().setNoisy(true);
} else if( option[0].equals(rootFlag)){
Shared.i().rootClasses.add(option[1]);
} else if( option[0].equals(xmlDescriptionFlag) ) {
Shared.i().addDescriptionTag( option[1] );
}
}
}
public static int optionLength(String option) {
if (option.equals(templateFlag) || option.equals(examplesFlag)
|| option.equals(outputFlag) || option.equals(rootFlag)
|| option.equals(exceptionsFlag) || option.equals(imagesFlag)
|| option.equals(localFlag) || option.equals(coreFlag)
|| option.equals(xmlDescriptionFlag)) {
return 2;
} else if ( option.equals(verboseFlag) ){
return 1;
}
return 0;
}
private static void writeContents(RootDoc root) throws IOException {
System.out.println("Write contents: ");
for( ClassDoc classDoc : root.classes() ){
if(Shared.i().isCore(classDoc)){
// Document the core functions and classes
if(Shared.i().isRootLevel(classDoc)){
//if it is in PApplet, PConstants or other classes where users can get
//the variables without using dot syntax
// document functions
MethodDoc[] functions = classDoc.methods();
for (MethodDoc fn : functions) {
// write out html reference
FunctionWriter.write(fn);
Tag[] tags = fn.tags(Shared.i().getWebrefTagName());
if (tags.length != 0) {
// add to the index under the @webref category:sub_category
indexWriter.addItem(fn, tags[0]);
}
}
//also need to add fields
for(FieldDoc doc : classDoc.fields()){
if(Shared.i().isWebref(doc)){
FieldWriter.write(doc);
indexWriter.addItem(doc, doc.tags(Shared.i().getWebrefTagName())[0] );
}
}
} else {
// document a class and its public properties
new ClassWriter().write( classDoc );
Tag[] classTags = classDoc.tags(Shared.i().getWebrefTagName());
if (classTags.length != 0) {
// add to the index under the @webref category:sub_category
indexWriter.addItem(classDoc, classTags[0]);
}
}
} else {
// Document the library passed in
if(Shared.i().isNoisy()) {
System.out.println("Loaded class: " + classDoc.name());
}
LibraryWriter writer = new LibraryWriter();
writer.write(classDoc.containingPackage());
}
}
}
}
@@ -0,0 +1,686 @@
package writers;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Locale;
import java.util.TimeZone;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpression;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import com.sun.javadoc.ClassDoc;
import com.sun.javadoc.ConstructorDoc;
import com.sun.javadoc.Doc;
import com.sun.javadoc.ExecutableMemberDoc;
import com.sun.javadoc.FieldDoc;
import com.sun.javadoc.MethodDoc;
import com.sun.javadoc.ParamTag;
import com.sun.javadoc.Parameter;
import com.sun.javadoc.ProgramElementDoc;
import com.sun.javadoc.SeeTag;
import com.sun.javadoc.Tag;
import org.json.*;
public class BaseWriter {
// Some utilities
public final static String MODE_JAVASCRIPT = "js";
public final static String jsonDir = "../../../processing-website/json/";
public BaseWriter()
{
}
protected static BufferedWriter makeWriter(String anchor) throws IOException
{
return makeWriter(anchor, false);
}
protected static String getWriterPath( String anchor, Boolean isLocal )
{
if (!isLocal) {
return Shared.i().getOutputDirectory() + "/" + anchor;
} else
{
return Shared.i().getLocalOutputDirectory() + anchor;
}
}
protected static BufferedWriter makeWriter(String anchor, Boolean isLocal) throws IOException {
FileWriter fw = new FileWriter( getWriterPath( anchor, isLocal ) );
return new BufferedWriter(fw);
}
protected static String getAnchor(ProgramElementDoc doc)
{
String ret = getAnchorFromName(getName(doc));
if(doc.containingClass() != null && !Shared.i().isRootLevel(doc.containingClass()))
{
ret = doc.containingClass().name() + "_" + ret;
}
if(!Shared.i().isCore(doc)){
//add package name to anchor
String[] parts = doc.containingPackage().name().split("\\.");
String pkg = parts[parts.length-1] + "/";
ret = "libraries/" + pkg + ret;
}
return ret;
}
protected static String getLocalAnchor(ProgramElementDoc doc)
{
String ret = getAnchorFromName(getName(doc));
if(doc.containingClass() != null){
ret = doc.containingClass().name() + "_" + ret;
}
return ret;
}
protected static String getReturnTypes(MethodDoc doc)
{
String ret = nameInPDE(doc.returnType().toString());
if(doc.containingClass() != null)
{
for(MethodDoc m : doc.containingClass().methods())
{
if( m.name().equals(doc.name()) && m.returnType() != doc.returnType() )
{
String name = getSimplifiedType( nameInPDE(m.returnType().toString()) );
if( ! ret.contains( name ) )
{ // add return type name if it's not already included
ret += ", " + name;
}
}
}
}
// add "or" (split first to make sure we don't mess up the written description)
ret = ret.replaceFirst( ",([^,]+)$", ", or$1" );
if( ! ret.matches(".+,.+,.+") )
{
ret = ret.replace( ",", "" );
}
return ret;
}
protected static String getSimplifiedType( String str )
{
if( str.equals("long") ){ return "int"; }
if( str.equals("double") ){ return "float"; }
return str;
}
protected static String getName(Doc doc) { // handle
String ret = doc.name();
if(doc instanceof MethodDoc)
{
ret = ret.concat("()");
} else if (doc.isField()){
// add [] if needed
FieldDoc d = (FieldDoc) doc;
ret = ret.concat(d.type().dimension());
}
return ret;
}
protected static String getAnchorFromName(String name){
// change functionName() to functionName_
if( name.endsWith("()") ){
name = name.replace("()", "_");
}
// change "(some thing)" to something
if( name.contains("(") && name.contains(")") ){
int start = name.lastIndexOf("(") + 1;
int end = name.lastIndexOf(")");
name = name.substring(start, end);
name = name.replace(" ", "");
}
// change thing[] to thing
if( name.contains("[]")){
name = name.replaceAll("\\[\\]", "");
}
// change "some thing" to "some_thing.html"
name = name.replace(" ", "_");
return name;
}
static protected String getBasicDescriptionFromSource(ProgramElementDoc doc) {
return getBasicDescriptionFromSource(longestText(doc));
}
static protected String getBriefDescriptionFromSource(ProgramElementDoc doc) {
Tag[] sta = doc.tags("brief");
if(sta.length > 0){
return sta[0].text();
}
return getBasicDescriptionFromSource(doc);
}
static protected String getWebDescriptionFromSource(ProgramElementDoc doc) {
Tag[] sta = doc.tags("webDescription");
if(sta.length > 0){
return sta[0].text();
}
return getBasicDescriptionFromSource(doc);
}
static protected String getWebBriefFromSource(ProgramElementDoc doc) {
Tag[] sta = doc.tags("webBrief");
if(sta.length > 0){
return sta[0].text();
}
return getBasicDescriptionFromSource(doc);
}
static protected String longestText(ProgramElementDoc doc){
if(Shared.i().isWebref(doc)){
//override longest rule if the element has an @webref tag
return doc.commentText();
}
String s = doc.commentText();
if( doc.isMethod() ){
for(ProgramElementDoc d : doc.containingClass().methods()){
if(d.name().equals(doc.name() ) ){
if(d.commentText().length() > s.length()){
s = d.commentText();
}
}
}
} else if(doc.isField()){
for(ProgramElementDoc d : doc.containingClass().fields()){
if(d.name().equals(doc.name() ) ){
if(d.commentText().length() > s.length()){
s = d.commentText();
}
}
}
}
return s;
}
static protected String getBasicDescriptionFromSource(String s){
String[] sa = s.split("(?i)(<h\\d>Advanced:?</h\\d>)|(=advanced)");
if (sa.length != 0)
s = sa[0];
return s;
}
static protected String getAdvancedDescriptionFromSource(ProgramElementDoc doc) {
return getAdvancedDescriptionFromString(longestText(doc));
}
static private String getAdvancedDescriptionFromString(String s) {
String[] sa = s.split("(?i)(<h\\d>Advanced:?</h\\d>)|(=advanced)");
if (sa.length > 1)
s = sa[1];
return s;
}
protected static HashMap<String, String> getDefaultDescriptionVars ()
{
HashMap<String, String> vars = new HashMap<String, String>();
vars.put("description title", "Description");
vars.put("description text", "");
return vars;
}
protected static String getTimestamp() {
Calendar now = Calendar.getInstance();
Locale us = new Locale("en");
return now.getDisplayName(Calendar.MONTH, Calendar.LONG, us)
+ " "
+ now.get(Calendar.DAY_OF_MONTH)
+ ", "
+ now.get(Calendar.YEAR)
+ " "
+ FileUtils.nf(now.get(Calendar.HOUR), 2)
+ ":"
+ FileUtils.nf(now.get(Calendar.MINUTE), 2)
+ ":"
+ FileUtils.nf(now.get(Calendar.SECOND), 2)
+ now.getDisplayName(Calendar.AM_PM, Calendar.SHORT, us)
.toLowerCase()
+ " "
+ TimeZone.getDefault().getDisplayName(
TimeZone.getDefault().inDaylightTime(now.getTime()),
TimeZone.SHORT, us);
}
/*
* Get all the syntax possibilities for a method
*/
protected static ArrayList<HashMap<String, String>> getSyntax(MethodDoc doc, String instanceName) throws IOException
{
TemplateWriter templateWriter = new TemplateWriter();
ArrayList<HashMap<String, String>> ret = new ArrayList<HashMap<String,String>>();
for( MethodDoc methodDoc : doc.containingClass().methods() )
{
if(Shared.i().shouldOmit(methodDoc)){
continue;
}
if( methodDoc.name().equals(doc.name() ))
{
HashMap<String, String> map = new HashMap<String, String>();
map.put("name", methodDoc.name());
map.put("object", instanceName);
ArrayList<HashMap<String, String>> parameters = new ArrayList<HashMap<String,String>>();
for( Parameter p : methodDoc.parameters() )
{
HashMap<String, String> paramMap = new HashMap<String, String>();
paramMap.put("parameter", p.name());
parameters.add(paramMap);
}
String params = templateWriter.writeLoop("method.parameter.partial.html", parameters, ", ");
map.put("parameters", params);
if( ! ret.contains(map) )
{
//don't put in duplicate function syntax
ret.add(map);
}
}
}
return ret;
}
private static String removePackage(String name)
{ // keep everything after the last dot
if( name.contains(".") )
{ return name.substring( name.lastIndexOf(".") + 1 ); }
return name;
}
private static String nameInPDE(String fullName)
{
if( fullName.contains("<") && fullName.endsWith(">") )
{ // if this type uses Java generics
String parts[] = fullName.split("<");
String generic = removePackage( parts[0] );
String specialization = removePackage( parts[1] );
specialization = specialization.substring( 0, specialization.length() - 1 );
return generic + "&lt;" + specialization + "&gt;";
}
return removePackage( fullName );
}
protected static String getUsage(ProgramElementDoc doc){
Tag[] tags = doc.tags("usage");
if(tags.length != 0){
return tags[0].text();
}
tags = doc.containingClass().tags("usage");
if(tags.length != 0){
return tags[0].text();
}
// return empty string if no usage is found
return "";
}
protected static String getInstanceName(ProgramElementDoc doc){
Tag[] tags = doc.containingClass().tags("instanceName");
if(tags.length != 0){
return tags[0].text().split("\\s")[0];
}
return "";
}
protected static String getInstanceDescription(ProgramElementDoc doc){
Tag[] tags = doc.containingClass().tags("instanceName");
if(tags.length != 0){
String s = tags[0].text();
return s.substring(s.indexOf(" "));
}
return "";
}
protected static ArrayList<JSONObject> getParameters(MethodDoc doc) throws IOException{
//get parent
ClassDoc cd = doc.containingClass();
ArrayList<JSONObject> ret = new ArrayList<JSONObject>();
if(!Shared.i().isRootLevel(cd)){
//add the parent parameter if this isn't a function of PApplet
JSONObject parent = new JSONObject();
try
{
ArrayList<String> paramType = new ArrayList<String>();
paramType.add(cd.name());
parent.put("name", getInstanceName(doc));
parent.put("type", paramType);
parent.put("description",getInstanceDescription(doc));
ret.add(parent);
} catch (JSONException ex)
{
ex.printStackTrace();
}
}
//get parameters from this and all other declarations of method
for( MethodDoc m : cd.methods() ){
if(Shared.i().shouldOmit(m)){
continue;
}
if(m.name().equals(doc.name())){
ret.addAll(parseParameters(m));
}
}
removeDuplicateParameters(ret);
return ret;
}
protected static ArrayList<JSONObject> getParameters(ClassDoc doc) throws IOException{
ArrayList<JSONObject> ret = new ArrayList<JSONObject>();
for( ConstructorDoc m : doc.constructors() ){
if(Shared.i().shouldOmit(m)){
continue;
}
ret.addAll(parseParameters(m));
}
removeDuplicateParameters(ret);
return ret;
}
protected static void removeDuplicateParameters(ArrayList<JSONObject> ret){
// combine duplicate parameter names with differing types
try
{
for(JSONObject parameter : ret)
{
String desc = parameter.getString("description");
JSONArray paramArray = parameter.getJSONArray("type");
if(!desc.endsWith(": "))
{
// if the chosen description has actual text
// e.g. float: something about the float
for(JSONObject parameter2 : ret)
{
String desc2 = parameter2.getString("description");
if(parameter2.getString("name").equals( parameter.getString("name") ) )
{
// freshen up our variable with the latest description
// for (int i=0; i < parameter2.get("type").size(); i++) {
// System.out.println("par " + parameter2.get("type").get(i));
// }
JSONArray paramArray2 = parameter2.getJSONArray("type");
String addItem = "";
for(int i = 0; i < paramArray.length(); i++)
{
for(int j = 0; j < paramArray2.length(); j++) {
if ( !paramArray.getString(i).equals(paramArray2.getString(j))) {
addItem = paramArray2.getString(j);
}
}
}
if (addItem != "") {
paramArray.put(addItem);
}
}
}
}
ArrayList<String> newList = new ArrayList<String>();
for (int i = 0; i < paramArray.length(); i++) {
if (!newList.contains(paramArray.getString(i))) {
newList.add(paramArray.getString(i));
}
}
parameter.put("type", newList);
}
//remove parameters without descriptions
for( int i=ret.size()-1; i >= 0; i-- )
{
if(ret.get(i).getString("description").equals(""))
{
ret.remove(i);
}
}
} catch (JSONException ex)
{
ex.printStackTrace();
}
}
protected static ArrayList<JSONObject> parseParameters(ExecutableMemberDoc doc){
ArrayList<JSONObject> paramList = new ArrayList<JSONObject>();
for( Parameter param : doc.parameters()){
String type = getSimplifiedType( nameInPDE(param.type().toString()) );
String name = param.name();
String desc = "";
for( ParamTag tag : doc.paramTags() ){
if(tag.parameterName().equals(name)){
desc = desc.concat( tag.parameterComment() );
}
}
JSONObject paramJSON = new JSONObject();
try
{
ArrayList<String> paramType = new ArrayList<String>();
paramType.add(type);
paramJSON.put("name", name);
paramJSON.put("type", paramType);
paramJSON.put("description", desc);
} catch (JSONException ex)
{
ex.printStackTrace();
}
paramList.add(paramJSON);
}
return paramList;
}
protected static ArrayList<SeeTag> getAllSeeTags( ProgramElementDoc doc )
{
ArrayList<SeeTag> ret = new ArrayList<SeeTag>();
ClassDoc cd = doc.containingClass();
if( cd != null && doc.isMethod() )
{ // if there is a containing class, get @see tags for all
// methods with the same name as this one
// Fixes gh issue 293
for( MethodDoc m : cd.methods() )
{
if(m.name().equals(doc.name()))
{
for( SeeTag tag : m.seeTags() )
{
ret.add( tag );
}
}
}
}
else
{ // if no containing class (e.g. doc is a class)
// just grab the see tags in the class doc comment
for( SeeTag tag : doc.seeTags() )
{
ret.add( tag );
}
}
return ret;
}
protected static ArrayList<String> getRelated( ProgramElementDoc doc ) throws IOException
{
TemplateWriter templateWriter = new TemplateWriter();
ArrayList<HashMap<String, String>> vars = new ArrayList<HashMap<String,String>>();
ArrayList<String> related = new ArrayList<String>();
// keep track of class members so that links to methods in e.g. PGraphics
// that are copied into PApplet are correctly linked.
HashMap<String, ProgramElementDoc> classMethods = new HashMap<String, ProgramElementDoc>();
HashMap<String, ProgramElementDoc> classFields = new HashMap<String, ProgramElementDoc>();
if( doc.isMethod() || doc.isField() )
{ // fill our maps
ClassDoc containingClass = doc.containingClass();
for( MethodDoc m : containingClass.methods() ) {
if( needsWriting( m ) ) {
classMethods.put( m.name(), m );
}
}
for( FieldDoc f : containingClass.fields() ) {
if( needsWriting( f ) ) {
classFields.put( f.name(), f );
}
}
}
// add link to each @see item
for( SeeTag tag : getAllSeeTags( doc ) )
{
HashMap<String, String> map = new HashMap<String, String>();
ProgramElementDoc ref = tag.referencedClass();
if( tag.referencedMember() != null )
{
ref = tag.referencedMember();
if( ref.isMethod() && classMethods.containsKey( ref.name() ) ) {
// link to the member as it is in this class, instead of
// as it is in another class
ProgramElementDoc prior = classMethods.get( ref.name() );
ref = prior;
}
else if ( ref.isField() && classFields.containsKey( ref.name() ) ) {
ProgramElementDoc prior = classFields.get( ref.name() );
ref = prior;
}
}
if( needsWriting( ref ) )
{ // add links to things that are actually written
map.put("anchor", getAnchor( ref ));
related.add(getAnchor(ref));
}
}
// add link to each @see_external item
for( Tag tag : doc.tags( Shared.i().getSeeAlsoTagName() ) )
{
// get xml for method
String filename = tag.text() + ".json";
String basePath = Shared.i().getJSONDirectory();
File f = new File( basePath + filename );
if( ! f.exists() )
{
basePath = Shared.i().getIncludeDirectory();
f = new File( basePath + filename );
}
if( f.exists() )
{
Document xmlDoc = Shared.loadXmlDocument( f.getPath() );
XPathFactory xpathFactory = XPathFactory.newInstance();
XPath xpath = xpathFactory.newXPath();
try
{
String name = (String) xpath.evaluate("//name", xmlDoc, XPathConstants.STRING);
// get anchor from original filename
String path = f.getAbsolutePath();
String anchorBase = path.substring( path.lastIndexOf("/")+1, path.indexOf(".xml"));
if( name.endsWith("()") )
{
if( !anchorBase.endsWith("_" ) )
{
anchorBase += "_";
}
}
String anchor = anchorBase;
// get method name from xml
// get anchor from method name
HashMap<String, String> map = new HashMap<String, String>();
map.put( "anchor", anchor );
related.add( anchor );
} catch (XPathExpressionException e)
{
e.printStackTrace();
}
}
}
return related;
}
protected static String getEvents(ProgramElementDoc doc){
return "";
}
/**
* Modes should support all API, so if XML not explicitly states "not supported", then assume it does.
*/
protected static boolean isModeSupported ( ProgramElementDoc doc, String mode ) {
return true;
}
protected static boolean needsWriting(ProgramElementDoc doc){
if( (doc != null) && Shared.i().isWebref(doc) )
{
return true;
}
return false;
}
public static String getCategory(Tag webref){
String firstPart = webref.text().split("\\s")[0];
String[] parts = firstPart.split(":");
if( parts.length > 1 ){
return parts[0];
}
return firstPart;
}
public static String getSubcategory(Tag webref){
String firstPart = webref.text().split("\\s")[0];
String[] parts = firstPart.split(":");
if( parts.length > 1 ){
return parts[1];
}
return "";
}
}
@@ -0,0 +1,159 @@
package writers;
import java.io.*;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import com.sun.javadoc.ClassDoc;
import com.sun.javadoc.ConstructorDoc;
import com.sun.javadoc.FieldDoc;
import com.sun.javadoc.MethodDoc;
import com.sun.javadoc.Parameter;
import com.sun.javadoc.ProgramElementDoc;
import com.sun.javadoc.Tag;
import org.json.*;
public class ClassWriter extends BaseWriter {
private ClassDoc classDoc;
private String libDir;
public ClassWriter() {
}
@SuppressWarnings("unchecked")
public void write( ClassDoc classDoc ) throws IOException {
if( needsWriting(classDoc) )
{
TemplateWriter templateWriter = new TemplateWriter();
this.classDoc = classDoc;
String classname = getName(classDoc);
String anchor = getAnchor(classDoc);
HashMap<String, String> vars = new HashMap<String, String>();
JSONObject classJSON = new JSONObject();
String fileName, folderName;
if (libDir != null) {
fileName = libDir + classname + ".json";
folderName = libDir;
}
else {
fileName = jsonDir + classname + ".json";
folderName = jsonDir;
}
Tag[] tags = classDoc.tags(Shared.i().getWebrefTagName());
String category = getCategory(tags[0]);
String subcategory = getSubcategory(tags[0]);
try
{
classJSON.put("type", "class");
// These vars will be inherited by method and field writers
classJSON.put("name", classname);
classJSON.put("classanchor", anchor);
String desc = getWebDescriptionFromSource(classDoc);
if ( desc != "" )
{
classJSON.put( "description", desc );
}
if( !Shared.i().isCore(classDoc))
{ // documenting a library
classJSON.put("isLibrary", "true" );
classJSON.put("csspath", "../../");
}
classJSON.put("brief", getWebBriefFromSource(classDoc));
ArrayList<JSONObject> methodSet = new ArrayList<JSONObject>();
ArrayList<JSONObject> fieldSet = new ArrayList<JSONObject>();
// Write all @webref methods for core classes (the tag tells us where to link to it in the index)
for (MethodDoc m : classDoc.methods()) {
if(needsWriting(m)){
MethodWriter.write((HashMap<String, String>)vars.clone(), m, classname, folderName);
methodSet.add(getPropertyInfo(m));
}
}
for (FieldDoc f : classDoc.fields()) {
if(needsWriting(f)){
FieldWriter.write((HashMap<String, String>)vars.clone(), f, classname);
fieldSet.add(getPropertyInfo(f));
}
}
ArrayList<String> constructors = getConstructors();
classJSON.put("category", category);
classJSON.put("subcategory", subcategory);
classJSON.put("methods", methodSet);
classJSON.put("classFields", fieldSet);
classJSON.put("constructors", constructors);
classJSON.put("parameters", getParameters(classDoc));
classJSON.put("related", getRelated(classDoc));
} catch (JSONException ex)
{
ex.printStackTrace();
}
try {
FileWriter file = new FileWriter(fileName);
file.write(classJSON.toString());
file.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
public void write( ClassDoc classDoc, String lib ) throws IOException {
libDir = lib;
write(classDoc);
}
private ArrayList<String> getConstructors()
{
ArrayList<String> constructors = new ArrayList<String>();
for( ConstructorDoc c : classDoc.constructors() )
{
if(Shared.i().shouldOmit(c)){
continue;
}
String constructor = c.name() + "(";
for( Parameter p : c.parameters() )
{
constructor += p.name() + ", ";
}
if( constructor.endsWith(", ") )
{
constructor = constructor.substring(0, constructor.length()-2) + ")";
}
constructors.add(constructor);
}
return constructors;
}
private JSONObject getPropertyInfo(ProgramElementDoc doc) {
JSONObject ret = new JSONObject();
try
{
ret.put("name", getName(doc));
ret.put("anchor", getLocalAnchor(doc));
ret.put("desc", getWebBriefFromSource(doc));
} catch (JSONException ex)
{
ex.printStackTrace();
}
return ret;
}
}
@@ -0,0 +1,114 @@
package writers;
import java.io.IOException;
import java.util.HashMap;
import java.util.ArrayList;
import java.io.*;
import com.sun.javadoc.ClassDoc;
import com.sun.javadoc.FieldDoc;
import com.sun.javadoc.Tag;
import org.json.*;
public class FieldWriter extends BaseWriter {
/**
*
* @param vars inherited from containing ClassDoc
* @param doc
* @throws IOException
*/
public static void write(HashMap<String, String> vars, FieldDoc doc, String classname) throws IOException
{
String filename = getAnchor(doc);
TemplateWriter templateWriter = new TemplateWriter();
JSONObject fieldJSON = new JSONObject();
String fileName;
if (classname != "") {
fileName = jsonDir + classname + "_" + getName(doc) + ".json";
} else {
fileName = jsonDir + getName(doc) + ".json";
}
Tag[] tags = doc.tags(Shared.i().getWebrefTagName());
String category = getCategory(tags[0]);
String subcategory = getSubcategory(tags[0]);
try
{
fieldJSON.put("type", "field");
fieldJSON.put("description", getWebDescriptionFromSource(doc));
fieldJSON.put("brief", getWebBriefFromSource(doc));
fieldJSON.put("category", category);
fieldJSON.put("subcategory", subcategory);
fieldJSON.put("name", getName(doc));
fieldJSON.put("related", getRelated(doc));
if(Shared.i().isRootLevel(doc.containingClass())){
fieldJSON.put("classname", "");
} else {
fieldJSON.put("classanchor", getLocalAnchor(doc.containingClass()));
fieldJSON.put("parameters", getParentParam(doc));
String syntax = templateWriter.writePartial("field.syntax.partial.html", getSyntax(doc));
ArrayList<String> syntaxList = new ArrayList<String>();
syntaxList.add(syntax);
fieldJSON.put("syntax", syntaxList);
}
} catch (JSONException ex)
{
ex.printStackTrace();
}
try {
FileWriter file = new FileWriter(fileName);
file.write(fieldJSON.toString());
file.close();
} catch (IOException e) {
e.printStackTrace();
}
}
public static void write(FieldDoc doc) throws IOException
{
String classname = "";
write(new HashMap<String, String>(), doc, classname);
}
protected static HashMap<String, String> getSyntax(FieldDoc doc){
HashMap<String, String> map = new HashMap<String, String>();
map.put("object", getInstanceName(doc));
map.put("field", getName(doc));
return map;
}
protected static ArrayList<JSONObject> getParentParam(FieldDoc doc){
ArrayList<JSONObject> retList = new ArrayList<JSONObject>();
JSONObject ret = new JSONObject();
try
{
ret.put("name", getInstanceName(doc));
ret.put("desc", getInstanceDescription(doc));
} catch (JSONException ex)
{
ex.printStackTrace();
}
retList.add(ret);
return retList;
}
protected static HashMap<String, String> getParent(FieldDoc doc){
HashMap<String, String> parent = new HashMap<String, String>();
ClassDoc cd = doc.containingClass();
parent.put("name", getInstanceName(doc));
parent.put("name", getInstanceName(doc));
parent.put("type", cd.name());
parent.put("description", getInstanceDescription(doc));
return parent;
}
}
@@ -0,0 +1,78 @@
package writers;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.text.NumberFormat;
//taken from processing source, yay
public class FileUtils {
static public String nf(int num, int digits) {
NumberFormat int_nf;
int_nf = NumberFormat.getInstance();
int_nf.setGroupingUsed(false); // no commas
int_nf.setMinimumIntegerDigits(digits);
return int_nf.format(num);
}
static public String[] loadStrings(String filename){
InputStream is = createInput(filename);
if (is != null) return loadStrings(is);
return null;
}
static public InputStream createInput(String filename) {
File file = new File(filename);
try {
return new FileInputStream(file);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
}
}
static public String[] loadStrings(InputStream input) {
try {
BufferedReader reader =
new BufferedReader(new InputStreamReader(input, "UTF-8"));
String lines[] = new String[100];
int lineCount = 0;
String line = null;
while ((line = reader.readLine()) != null) {
if (lineCount == lines.length) {
String temp[] = new String[lineCount << 1];
System.arraycopy(lines, 0, temp, 0, lineCount);
lines = temp;
}
lines[lineCount++] = line;
}
reader.close();
if (lineCount == lines.length) {
return lines;
}
// resize array to appropriate amount for these lines
String output[] = new String[lineCount];
System.arraycopy(lines, 0, output, 0, lineCount);
return output;
} catch (IOException e) {
e.printStackTrace();
//throw new RuntimeException("Error inside loadStrings()");
}
return null;
}
}
@@ -0,0 +1,62 @@
package writers;
import java.io.*;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import com.sun.javadoc.MethodDoc;
import com.sun.javadoc.Tag;
import org.json.*;
public class FunctionWriter extends BaseWriter {
static ArrayList<String> writtenFunctions;
public FunctionWriter(){}
public static void write(MethodDoc doc) throws IOException
{
if( needsWriting(doc)){
String anchor = getAnchor(doc);
TemplateWriter templateWriter = new TemplateWriter();
ArrayList<String> syntax = templateWriter.writeLoopSyntax("function.syntax.partial.html", getSyntax(doc, ""));
JSONObject functionJSON = new JSONObject();
String fileName = jsonDir + getName(doc).replace("()", "_") + ".json";
Tag[] tags = doc.tags(Shared.i().getWebrefTagName());
String category = getCategory(tags[0]);
String subcategory = getSubcategory(tags[0]);
try
{
functionJSON.put("type", "function");
functionJSON.put("name", getName(doc));
functionJSON.put("description", getWebDescriptionFromSource(doc));
functionJSON.put("brief", getWebBriefFromSource(doc));
functionJSON.put("category", category);
functionJSON.put("subcategory", subcategory);
functionJSON.put("syntax", syntax);
functionJSON.put("parameters", getParameters(doc));
functionJSON.put("related", getRelated(doc));
functionJSON.put("returns", getReturnTypes(doc));
} catch (JSONException ex)
{
ex.printStackTrace();
}
try {
FileWriter file = new FileWriter(fileName);
file.write(functionJSON.toString());
file.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
@@ -0,0 +1,174 @@
package writers;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import com.sun.javadoc.ProgramElementDoc;
import com.sun.javadoc.Tag;
public class IndexWriter extends BaseWriter {
class Alphabetizer implements Comparator<String>
{
public int compare(String o1, String o2) {
// TODO Auto-generated method stub
int tagEnd = o1.indexOf(">");
String inside1 = o1.substring( tagEnd + 1, tagEnd + 2 );
tagEnd = o2.indexOf(">");
String inside2 = o2.substring( tagEnd + 1, tagEnd + 2 );
// compare first letter for symbols
// check alphanumericity of both strings
if( inside1.matches( "[a-zA-Z0-9 ]+" ) && ! inside2.matches("[a-zA-Z0-9 ]+") )
{
// if only the second is a symbol
return 1;
}
else if( inside2.matches( "[a-zA-Z0-9 ]+" ) && ! inside1.matches("[a-zA-Z0-9 ]+") )
{
// if only the first is a symbol
return -1;
}
// compare whole strings, starting with words
inside1 = o1.substring( o1.indexOf(">") + 1, o1.length() );
inside2 = o2.substring( o2.indexOf(">") + 1, o2.length() );
// do a normal string comparison on the insides (not the html tags)
return String.CASE_INSENSITIVE_ORDER.compare( inside1, inside2 );
}
}
HashMap<String, ArrayList<String>> sections;
TemplateWriter templateWriter;
public IndexWriter(){
sections = new HashMap<String, ArrayList<String>>();
templateWriter = new TemplateWriter();
}
public void write() throws IOException{
templateWriter.write("index.template.html", getCompressedSections(), "index.html");
templateWriter.write("index.alphabetical.template.html", getAlphabetical(), "alpha.html");
}
private HashMap<String, String> getCompressedSections () {
HashMap<String, String> ret = new HashMap<String, String>();
for (String key : sections.keySet()) {
String value = "";
//make things alphabetical in their sections
Collections.sort( sections.get(key), new Alphabetizer() );
for (String s : sections.get(key))
{
if ( !value.contains(s) )
{
value = value.concat("\n").concat(s);
}
}
ret.put(key, value);
}
return ret;
}
private HashMap<String, String> getAlphabetical(){
HashMap<String, String> ret = new HashMap<String, String>();
ArrayList<String> all = new ArrayList<String>();
for(String key : sections.keySet()){
for( String s : sections.get(key)){
if( ! all.contains(s) )
{
all.add(s);
}
}
}
Collections.sort(all, new Alphabetizer() );
String value = "";
float numColumns = 3.0f;
int currentColumn = 0;
float perColumn = all.size()/numColumns;
float counter = 0.0f;
String startString = all.get(0);
String currentLetterGroup = startString.substring( startString.indexOf(">") + 1, startString.indexOf(">") + 2 );
// find the stuff inside brackets
for(String s : all){
counter++;
int tagEnd = s.indexOf(">");
String currentLetter = s.substring( tagEnd + 1, tagEnd + 2 );
if( currentLetter.matches( "[a-zA-Z0-9]") && ! currentLetter.equalsIgnoreCase( currentLetterGroup ) )
{ // add a break at letter change
value = value.concat("<br/>");
currentLetterGroup = currentLetter;
}
value = value.concat( s );
if( counter >= perColumn ){
counter = 0;
currentColumn++;
ret.put("c"+currentColumn, value);
value = "";
}
}
if(counter != 0){
currentColumn++;
ret.put("c"+currentColumn, value);
}
ret.put("isAlphabetical", "true");
return ret;
}
public void addItem ( ProgramElementDoc doc, Tag webref ) throws IOException {
String name = getName(doc);
String anchor = getAnchorFromName(name);
String category = getCategory(webref);
String subcategory = getSubcategory(webref);
String classes = isModeSupported(doc, MODE_JAVASCRIPT) ? "" : "no-js";
addItem(category, subcategory, name, anchor, classes);
}
public void addItem (String category, String subcategory, String name, String anchor, String classes ) throws IOException{
String key = getKey(category, subcategory);
HashMap<String, String> vars = new HashMap<String, String>();
vars.put("anchor", anchor);
vars.put("name", name);
vars.put("classes", classes);
String value = templateWriter.writePartial("index.entry.partial.html", vars);
if( sections.containsKey(key))
{
sections.get(key).add(value);
} else {
ArrayList<String> a = new ArrayList<String>();
a.add(value);
sections.put(key, a);
}
}
private String getKey(String category, String subCategory){
if( !subCategory.equals("") ){
String sub = subCategory.replaceAll(" ", "_");
return category.toLowerCase() + ":" + sub.toLowerCase();
}
return category.toLowerCase();
}
}
@@ -0,0 +1,130 @@
package writers;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;
import com.sun.javadoc.ClassDoc;
import com.sun.javadoc.MethodDoc;
import com.sun.javadoc.PackageDoc;
/**
* Writes the index page of libraries.
* Also grabs the xml files in lib/dir/events
* and sends them to the XMLReferenceWriter
*
* @author davidwicks
*
*/
public class LibraryIndexWriter extends IndexWriter {
HashMap<String,String> sections;
ArrayList<String> classes;
ArrayList<String> events;
TemplateWriter templateWriter;
public LibraryIndexWriter(PackageDoc doc, String outputPath){
sections = new HashMap<String,String>();
classes = new ArrayList<String>();
events = new ArrayList<String>();
templateWriter = new TemplateWriter();
writePartials(doc, outputPath);
}
private void writePartials(PackageDoc doc, String outputPath){
for( ClassDoc cd : doc.allClasses() ){
addItem(cd);
}
}
private void getXMLInformation(String path){
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
DocumentBuilder builder;
Document xmlDoc = null;
try {
builder = factory.newDocumentBuilder();
xmlDoc = builder.parse(path);
} catch (ParserConfigurationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SAXException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
System.out.println("WARNING: no index.xml file found at: " + path );
return;
}
XPathFactory xpathFactory = XPathFactory.newInstance();
XPath xpath = xpathFactory.newXPath();
try {
String name = (String) xpath.evaluate("//libraryName", xmlDoc, XPathConstants.STRING);
String desc = (String) xpath.evaluate("//libraryDescription", xmlDoc, XPathConstants.STRING);
sections.put("libraryname", name);
sections.put("librarydescription", desc);
} catch (XPathExpressionException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
private String explode(ArrayList<String> array){
String ret = "";
Collections.sort(array);
for(String s : array){
ret += s + "\n";
}
return ret;
}
public void write (String path) throws IOException {
templateWriter.write("library.index.template.html", sections, path+"index.html");
}
public void addItem (ClassDoc doc) {
ArrayList<HashMap<String, String>> methods = new ArrayList<HashMap<String,String>>();
HashMap<String, String> cmap = new HashMap<String, String>();
HashMap<String, String> map = new HashMap<String, String>();
map.put("name", getName(doc));
map.put("anchor", getLocalAnchor(doc));
methods.add(map);
for(MethodDoc m : doc.methods()){
if(Shared.i().isWebref(m)){
HashMap<String, String> methodMap = new HashMap<String, String>();
methodMap.put("name", getName(m));
methodMap.put("anchor", getLocalAnchor(m));
methods.add(methodMap);
}
}
cmap.put("methods", templateWriter.writeLoop("related.partial.html", methods));
cmap.put("classname", getName(doc) + " Class");
cmap.put("classdescription", getBriefDescriptionFromSource(doc));
classes.add(templateWriter.writePartial("library.section.partial.html", cmap));
}
public void addEvent(String name, String anchor){
HashMap<String, String> map = new HashMap<String, String>();
map.put("name", name);
map.put("anchor", getAnchorFromName(name));
events.add(templateWriter.writePartial("related.partial.html", map) + "\n");
}
}
@@ -0,0 +1,76 @@
package writers;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import com.sun.javadoc.ClassDoc;
import com.sun.javadoc.PackageDoc;
public class LibraryWriter extends BaseWriter {
PackageDoc doc;
String pkg;
LibraryIndexWriter indexWriter;
String dir;
static TemplateWriter templateWriter;
static ArrayList<String> writtenLibraries;
public LibraryWriter(){
if(templateWriter == null ){
templateWriter = new TemplateWriter();
}
if(writtenLibraries == null){
writtenLibraries = new ArrayList<String>();
}
}
public void write(PackageDoc doc)
{
// check for files that haven't been read
if(writtenLibraries.contains(doc.name())){
return;
}
writtenLibraries.add(doc.name());
String[] parts = doc.name().split("\\.");
String pkg = parts[parts.length-1] + "/";
dir = jsonDir + "libraries/"+pkg;
Shared.i().createOutputDirectory(dir);
indexWriter = new LibraryIndexWriter(doc, dir);
//grab all relevant information for the doc
for( ClassDoc classDoc : doc.allClasses() ){
// document the class if it has a @webref tag
try
{
new ClassWriter().write(classDoc, dir);
} catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
private void writeRemainingXml( String xmlDir )
{
File directory = new File( xmlDir );
File[] files = directory.listFiles();
for( File f : files )
{
if( f.getAbsolutePath().endsWith("xml") )
{
// try writing everything (will not overwrite any existing docs)
//XMLReferenceWriter.parseFile( f.getAbsoluteFile(), dir, indexWriter );
}
}
}
}
@@ -0,0 +1,77 @@
package writers;
import java.io.IOException;
import java.util.HashMap;
import java.util.ArrayList;
import com.sun.javadoc.MethodDoc;
import com.sun.javadoc.Tag;
import java.io.*;
import org.json.*;
public class MethodWriter extends BaseWriter {
public MethodWriter(){}
/**
*
*
* @param vars the inherited vars from the method's ClassDoc
* @param doc the method doc
* @throws IOException
*/
public static void write( HashMap<String, String> vars, MethodDoc doc, String classname, String foldername) throws IOException
{
String filename = getAnchor(doc);
TemplateWriter templateWriter = new TemplateWriter();
ArrayList<String> syntax = templateWriter.writeLoopSyntax("method.syntax.partial.html", getSyntax(doc, getInstanceName(doc)));
JSONObject methodJSON = new JSONObject();
String fileName = foldername + classname + "_" + getName(doc).replace("()", "_") + ".json";
Tag[] tags = doc.tags(Shared.i().getWebrefTagName());
String category = getCategory(tags[0]);
String subcategory = getSubcategory(tags[0]);
try
{
methodJSON.put("type", "function");
methodJSON.put("name", getName(doc));
methodJSON.put("description", getWebDescriptionFromSource(doc));
methodJSON.put("brief", getWebBriefFromSource(doc));
methodJSON.put("category", category);
methodJSON.put("subcategory", subcategory);
methodJSON.put("syntax", syntax);
methodJSON.put("parameters", getParameters(doc));
methodJSON.put("related", getRelated(doc));
methodJSON.put("returns", getReturnTypes(doc));
} catch (JSONException ex)
{
ex.printStackTrace();
}
try
{
if(Shared.i().isRootLevel(doc.containingClass())){
methodJSON.put("classname", "");
} else {
methodJSON.put("classanchor", getLocalAnchor(doc.containingClass()));
}
} catch (JSONException ex)
{
ex.printStackTrace();
}
try {
FileWriter file = new FileWriter(fileName);
file.write(methodJSON.toString());
file.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
@@ -0,0 +1,229 @@
package writers;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;
import com.sun.javadoc.Doc;
import com.sun.javadoc.ProgramElementDoc;
public class Shared {
// what we're looking for
private static Shared instance;
private String webrefTagName = "webref";
private String seeAlsoTagName = "see_external";
private String coreClassName = "PApplet";
private ArrayList<String> descriptionSets;
//where things go
private String outputDirectory = "web_reference";
private String localOutputDirectory = "local_reference";
private String imageDirectory = "images";
private String fileExtension = ".html";
//where things come from
private String templateDirectory = "templates";
private String exampleDirectory = "web_examples";
private String includeDirectory = "include";
private String jsonDirectory ="../../../processing-website/json/";
boolean noisy = false;
public ArrayList<String> corePackages;
public ArrayList<String> rootClasses;
private Shared(){
corePackages = new ArrayList<String>();
rootClasses = new ArrayList<String>();
descriptionSets = new ArrayList<String>();
addDescriptionTag("description");
}
public static Shared i()
{
if(instance == null)
{
instance = new Shared();
}
return instance;
}
public String getWebrefTagName(){
return webrefTagName;
}
public String getSeeAlsoTagName()
{
return seeAlsoTagName;
}
public void setIncludeDirectory( String s )
{
includeDirectory = s;
}
public String getIncludeDirectory()
{
return includeDirectory + "/";
}
public void setWebrefTagName(String webrefTagName)
{
this.webrefTagName = webrefTagName;
}
public void setCoreClassName(String coreClassName)
{
this.coreClassName = coreClassName;
}
public String getCoreClassName()
{
return coreClassName;
}
public void addDescriptionTag(String s) {
System.out.println( "Added description tag: " + s );
descriptionSets.add( "/root/"+s );
descriptionSets.add( "/root/js_mode/"+s );
}
public ArrayList<String> getDescriptionSets() {
return descriptionSets;
}
public void setOutputDirectory(String outputDirectory) {
this.outputDirectory = outputDirectory;
}
public String getOutputDirectory() {
return outputDirectory;
}
public void setFileExtension(String fileExtension) {
this.fileExtension = fileExtension;
}
public String getFileExtension() {
return fileExtension;
}
public void setTemplateDirectory(String templateDirectory) {
this.templateDirectory = templateDirectory;
}
public String getTemplateDirectory() {
return templateDirectory;
}
public String TEMPLATE_DIRECTORY(){
return templateDirectory + "/";
}
public void setExampleDirectory(String exampleDirectory) {
this.exampleDirectory = exampleDirectory;
}
public String getExampleDirectory() {
return exampleDirectory;
}
public String getJSONDirectory(){
return jsonDirectory + "/";
}
public void setImageDirectory(String imageDirectory) {
this.imageDirectory = imageDirectory;
}
public String getImageDirectory(){
return imageDirectory + "/";
}
public void setLocalOutputDirectory(String localOutputDirectory) {
this.localOutputDirectory = localOutputDirectory;
}
public String getLocalOutputDirectory()
{
return localOutputDirectory + "/";
}
public String OUTPUT_DIRECTORY()
{
return outputDirectory + "/";
}
public boolean isCore(ProgramElementDoc doc){
return corePackages.contains(doc.containingPackage().name());
}
public boolean isWebref(ProgramElementDoc doc){
return doc.tags(webrefTagName).length > 0;
}
public boolean isRootLevel(ProgramElementDoc doc){
if(doc.isClass() || doc.isInterface()){
return rootClasses.contains(doc.name());
} else {
return rootClasses.contains(doc.containingClass().name());
}
}
public boolean isNoisy(){
return noisy;
}
public void setNoisy(boolean b){
noisy = b;
}
public void createOutputDirectory(String dir){
System.out.println("Creating output directory: " + dir );
File f = new File(getLocalOutputDirectory() + dir);
f.mkdirs();
f = new File(OUTPUT_DIRECTORY() + dir);
f.mkdirs();
}
public static Document loadXmlDocument( String path )
{
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
DocumentBuilder builder;
Document doc = null;
try {
builder = factory.newDocumentBuilder();
doc = builder.parse( path );
} catch (ParserConfigurationException e) {
System.out.println("Failed to parse " + path );
System.out.println( e.getLocalizedMessage() );
} catch (SAXException e) {
System.out.println("Failed to parse " + path );
System.out.println( e.getLocalizedMessage() );
} catch (IOException e) {
System.out.println("Failed to parse " + path );
System.out.println( e.getLocalizedMessage() );
}
return doc;
}
public void createBaseDirectories(){
File f = new File(getLocalOutputDirectory());
f.mkdirs();
f = new File(OUTPUT_DIRECTORY());
f.mkdirs();
}
public boolean shouldOmit(Doc doc){
if( doc.tags("nowebref").length > 0 )
{
return true;
}
if( doc.tags("notWebref").length > 0 )
{
return true;
}
// if none found, we should include
return false;
}
}
@@ -0,0 +1,239 @@
package writers;
import java.io.BufferedWriter;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
public class TemplateWriter extends BaseWriter {
public static String varPrefix = "<!-- ";
public static String varSuffix = " -->";
static String[] genericFields = {"classname", "returns", "related", "parameters", "syntax", "webcontentpath"};
static String[] navFields = {"isLibrary", "isAlphabetical", "isLanguage"};
public TemplateWriter()
{
}
public void write( String templateName, HashMap<String, String> vars, String outputName ) throws IOException
{
for(String s : genericFields){
if( ! vars.containsKey(s)){
vars.put(s, "");
}
}
int unsetNavCount = 0;
for(String s : navFields){
if(!vars.containsKey(s)){
vars.put(s, "");
unsetNavCount++;
}else if(!vars.get(s).equals("")){
vars.put(s, "class='active'");
}
}
if(unsetNavCount == navFields.length){
vars.put("isLanguage", "class='active'");
}
Boolean written = write( templateName, vars, outputName, false );
write( templateName, vars, outputName, true );
if( written && Shared.i().isNoisy() )
{
System.out.println("Wrote " + outputName + " from template");
}
}
// returns a relative path to root (e.g. "../../" from "path/to/File.ext", or "" for "File.txt")
public String getRelativePathToRoot( String path )
{
String[] parts = path.split("/");
String ret = "";
for( int i = parts.length - 1; i > 0; --i )
{
ret += "../";
}
return ret;
}
private Boolean write( String templateName, HashMap<String, String> vars, String outputName, Boolean isLocal ) throws IOException
{
String[] templateFile = FileUtils.loadStrings(Shared.i().TEMPLATE_DIRECTORY() + templateName);
ArrayList<String> output = new ArrayList<String>();
vars.put("timestamp", getTimestamp());
if(isLocal)
{
vars.put( "webcontentpath", getRelativePathToRoot( outputName ) );
vars.put("jquery", writePartial("jquery.local.partial.html", vars));
vars.put("navigation", writePartial("nav.local.template.html", vars));
} else
{
vars.put( "webcontentpath", "/" );
vars.put("jquery", writePartial("jquery.web.partial.html", vars));
vars.put("navigation", writePartial("nav.web.template.html", vars));
}
File f = new File( getWriterPath( outputName, isLocal ) );
if( ! f.exists() )
{
BufferedWriter out = makeWriter(outputName, isLocal);
for( String line : templateFile )
{
// check if it contains a variable we want to replace, then replace it
line = writeLine(line, vars, false);
output.add(line);
}
for( String line : output )
{
out.write(line+"\n");
}
out.close();
return true;
}
else
{
return false;
}
}
public String writePartial( String templateName, HashMap<String, String> vars )
{ //use to write partials to be assigned to vars keys
String[] templateFile = FileUtils.loadStrings(Shared.i().TEMPLATE_DIRECTORY()+templateName);
String ret = "";
for( String line : templateFile )
{
line = writeLine(line, vars, false );
ret = ret.concat(line+"\n");
}
return ret;
}
public String writeLoop( String templateName, ArrayList<HashMap<String, String>> varSet )
{
return writeLoop(templateName, varSet, "\n");
}
public String writeLoop( String templateName, ArrayList<HashMap<String, String>> varSet, String separator )
{
String[] templateFile = FileUtils.loadStrings(Shared.i().TEMPLATE_DIRECTORY()+templateName);
String ret = "";
int index = 0;
for( HashMap<String, String> vars : varSet )
{
index++;
for( String line : templateFile )
{
ret = ret + writeLine(line, vars, (index == varSet.size()) ) + separator;
}
}
if(ret.endsWith(separator)){
ret = ret.substring(0, ret.lastIndexOf(separator));
}
return ret;
}
public ArrayList<String> writeLoopSyntax(String templateName, ArrayList<HashMap<String, String>> varSet)
{
String[] templateFile = FileUtils.loadStrings(Shared.i().TEMPLATE_DIRECTORY()+templateName);
ArrayList<String> syntaxList = new ArrayList<String>();
int index = 0;
for( HashMap<String, String> vars : varSet )
{
index++;
for( String line : templateFile )
{
syntaxList.add(writeLine(line, vars, (index == varSet.size()) ));
}
}
return syntaxList;
}
public ArrayList<String> writeFields(String templateName, ArrayList<HashMap<String, String>> varSet)
{
String[] templateFile = FileUtils.loadStrings(Shared.i().TEMPLATE_DIRECTORY()+templateName);
ArrayList<String> syntaxList = new ArrayList<String>();
int index = 0;
for( HashMap<String, String> vars : varSet )
{
index++;
for( String line : templateFile )
{
syntaxList.add(writeLine(line, vars, (index == varSet.size()) ));
}
}
return syntaxList;
}
private String writeLine(String line, HashMap<String, String> map, boolean isFinalLine )
{
for( String key : map.keySet())
{
if(line.contains(key))
{
String value = map.get(key);
value = value.replace("$", "\\$");
// what variable in html the value should replace
String var = varPrefix + key + varSuffix;
// place our value into the html
line = line.replaceFirst(var, value);
// find html that requires presence or lack of value
String requireStart = varPrefix + "require:" + key + varSuffix;
String requireEnd = varPrefix + "end" + varSuffix;
String requireAbsenceStart = varPrefix + "unless:" + key + varSuffix;
String unlessLastStart = varPrefix + "unless:last_fragment" + varSuffix;
if(value.equals(""))
{ //remove html around things that are absent (like images)
while(line.contains(requireStart))
{
String sub = line.substring(line.indexOf(requireStart), line.indexOf(requireEnd) + requireEnd.length());
line = line.replace(sub, "");
}
}
else
{
// remove things that should only exist in absence of this value
while(line.contains(requireAbsenceStart))
{
String sub = line.substring(line.indexOf(requireAbsenceStart), line.indexOf(requireEnd) + requireEnd.length());
line = line.replace(sub, "");
}
}
if( isFinalLine )
{
while(line.contains(unlessLastStart))
{
String sub = line.substring(line.indexOf(unlessLastStart), line.indexOf(requireEnd) + requireEnd.length());
line = line.replace(sub, "");
}
}
// finally, remove all the meta junk
line = line.replaceAll(requireStart, "");
line = line.replaceAll(requireEnd, "");
line = line.replaceAll(requireAbsenceStart, "");
line = line.replaceAll(unlessLastStart, "");
}
}
// Strip trailing whitespace (trim() removes beginning and end)
return line.replaceAll("\\s+$", "");
}
}
+133
View File
@@ -0,0 +1,133 @@
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
Part of the Processing project - http://processing.org
Copyright (c) 2012-13 The Processing Foundation
Copyright (c) 2004-12 Ben Fry and Casey Reas
Copyright (c) 2001-04 Massachusetts Institute of Technology
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation, version 2.1.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General
Public License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
*/
package processing.core;
import processing.data.*;
import processing.event.*;
import processing.event.Event;
import processing.opengl.*;
import java.applet.*;
import java.awt.*;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.InputEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.image.*;
import java.io.*;
import java.lang.reflect.*;
import java.net.*;
import java.text.*;
import java.util.*;
import java.util.regex.*;
import java.util.zip.*;
import javax.imageio.ImageIO;
import javax.swing.JFrame;
import javax.swing.JFileChooser;
import javax.swing.filechooser.FileSystemView;
/**
* Stripped-down "source" for testing reference generator
* @usage Web &amp; Application
*/
public class PApplet extends Applet
implements PConstants, Runnable,
MouseListener, MouseWheelListener, MouseMotionListener, KeyListener, FocusListener
{
/**
* ( begin auto-generated from mousePressed.xml )
*
* The <b>mousePressed()</b> function is called once after every time a
* mouse button is pressed. The <b>mouseButton</b> variable (see the
* related reference entry) can be used to determine which button has been pressed.
*
* ( end auto-generated )
* <h3>Advanced</h3>
*
* If you must, use
* int button = mouseEvent.getButton();
* to figure out which button was clicked. It will be one of:
* MouseEvent.BUTTON1, MouseEvent.BUTTON2, MouseEvent.BUTTON3
* Note, however, that this is completely inconsistent across
* platforms.
* @webref input:mouse
* @webDescription The <b>mousePressed()</b> function is called once after every time a
* mouse button is pressed. The <b>mouseButton</b> variable (see the
* related reference entry) can be used to determine which button has been pressed.
* @webExample examples1
*/
public void mousePressed() { }
public void mousePressed(MouseEvent event) {
mousePressed();
}
/**
* ( begin auto-generated from mouseDragged.xml )
*
* The <b>mouseDragged()</b> function is called once every time the mouse
* moves and a mouse button is pressed.
*
* ( end auto-generated )
* @webref input:mouse
* @webDescription test
* @webExample examples/example2.js
* @see PApplet#mousePressed
* @see PApplet#mousePressed()
*/
public void mouseDragged() { }
public void mouseDragged(MouseEvent event) {
mouseDragged();
}
/**
* ( begin auto-generated from mousePressed_var.xml )
*
* Variable storing if a mouse button is pressed. The value of the system
* variable <b>mousePressed</b> is true if a mouse button is pressed and
* false if a button is not pressed.
*
* ( end auto-generated )
* @webref input:mouse
* @webDescription test
* @webExample examples/example2.js
*/
public boolean mousePressed;
}
+111
View File
@@ -0,0 +1,111 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title><!-- classname --> \ Language (API) \ Processing 3+</title>
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Author" content="Processing Foundation" />
<meta name="Publisher" content="Processing Foundation" />
<meta name="Keywords" content="Processing, Sketchbook, Programming, Coding, Code, Art, Design" />
<meta name="Description" content="Processing is a flexible software sketchbook and a language for learning how to code within the context of the visual arts. Since 2001, Processing has promoted software literacy within the visual arts and visual literacy within technology." />
<meta name="Copyright" content="All contents copyright the Processing Foundation, Ben Fry, Casey Reas, and the MIT Media Laboratory" />
<script src="<!-- webcontentpath -->javascript/modernizr-2.6.2.touch.js" type="text/javascript"></script>
<link href="<!-- webcontentpath -->css/style.css" rel="stylesheet" type="text/css" />
</head>
<body id="Langauge-en" onload="" >
<!-- ==================================== PAGE ============================ -->
<div id="container">
<!-- ==================================== HEADER ============================ -->
<div id="ribbon">
<ul class="left">
<li class="highlight"><a href="http://processing.org/">Processing</a></li>
<li><a href="http://p5js.org/">p5.js</a></li>
<li><a href="http://py.processing.org/">Processing.py</a></li>
<li><a href="http://android.processing.org/">Processing for Android</a></li>
<li><a href="http://pi.processing.org/">Processing for Pi</a></li>
</ul>
<ul class="right">
<li><a href="https://processingfoundation.org/">Processing Foundation</a></li>
</ul>
<div class="clear"></div>
</div>
<div id="header">
<a href="/" title="Back to the Processing cover."><div class="processing-logo no-cover" alt="Processing cover"></div></a>
<form name="search" method="get" action="//www.google.com/search">
<p><input type="hidden" name="as_sitesearch" value="processing.org" />
<input type="text" name="as_q" value="" size="20" class="text" />
<input type="submit" value=" " /></p>
</form>
</div>
<!--
<div id="ribbon-announce">
<ul class="center">
<li><a href="https://donorbox.org/supportpf2019-fundraising-campaign" target="_blank">This season, we need your help! Click here to donate to #SupportP5!</a></li>
</ul>
<div class="clear"></div>
</div>-->
<a id="TOP" name="TOP"></a>
<div id="navigation">
<!-- navigation -->
</div>
<!-- ==================================== CONTENT - Headers ============================ -->
<div class="content">
<p class="ref-notice">This reference is for Processing 3.0+. If you have a previous version, use the reference included with your software in the Help menu. If you see any errors or have suggestions, <a href="https://github.com/processing/processing-docs/issues?state=open">please let us know</a>. If you prefer a more technical reference, visit the <a href="http://processing.github.io/processing-javadocs/core/">Processing Core Javadoc</a> and <a href="http://processing.github.io/processing-javadocs/libraries/">Libraries Javadoc</a>.</p>
<table cellpadding="0" cellspacing="0" border="0" class="ref-item">
<tr class="name-row">
<th scope="row">Name</th>
<td><h3><!-- classname --></h3></td>
</tr>
<!-- examples -->
<!-- description -->
<!-- require:fields --><tr class=""><th scope="row"><b>Fields</b></th><td><table cellpadding="0" cellspacing="0" border="0"><!-- fields --></table></td></tr><!-- end -->
<!-- require:methods --><tr class=""><th scope="row">Methods</th><td><table cellpadding="0" cellspacing="0" border="0"><!-- methods --></table></td></tr><!-- end -->
<!-- require:constructors --><tr class=""><th scope="row">Constructor</th><td><pre><!-- constructors --></pre></td></tr><!-- end -->
<!-- require:parameters --><tr class=""> <th scope="row">Parameters</th><td><table cellpadding="0" cellspacing="0" border="0"><!-- parameters --></table></td> </tr><!-- end -->
<!-- require:related --><tr class=""><th scope="row">Related</th><td><!-- related --></td></tr><!-- end -->
</table>
Updated on <!-- timestamp --><br /><br />
<!-- Creative Commons License -->
<div class="license">
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://processing.org/img/cc.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.
</div>
</div>
<!-- ==================================== FOOTER ============================ -->
<div id="footer">
<div id="copyright">Processing is an open project intiated by <a href="http://benfry.com/">Ben Fry</a> and <a href="http://reas.com">Casey Reas</a>. It is developed by a <a href="<!-- webcontentpath -->about/people.html">team of volunteers</a>. </div>
<div id="colophon">
<a href="<!-- webcontentpath -->copyright.html">&copy; Info</a>
</div>
</div>
</div>
<!-- jquery -->
<script src="<!-- webcontentpath -->javascript/site.js" type="text/javascript"></script>
</body>
</html>
@@ -0,0 +1,4 @@
<tr class="">
<th scope="row"><!-- description title --></th>
<td><!-- description text --></td>
</tr>
+2
View File
@@ -0,0 +1,2 @@
<div class="example"><!-- require:image --><img src="<!-- image -->" alt="example pic" /><!-- end --><pre <!-- require:image -->class="margin"<!-- end -->><!-- code --></pre></div>
<!-- unless:last_fragment --><!-- unless:image --><hr class="noshade" noshade="noshade" size="1"><!-- end --><!-- end -->
+1
View File
@@ -0,0 +1 @@
<!-- require:examples --><tr class=""><th scope="row">Examples</th><td><!-- examples --></td></tr><!-- end -->
@@ -0,0 +1 @@
<!-- object -->.<!-- field -->
@@ -0,0 +1 @@
<!-- name -->(<!-- parameters -->)
+111
View File
@@ -0,0 +1,111 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title><!-- require:classname --><!-- classname -->::<!-- end --><!-- name --> \ Language (API) \ Processing 3+</title>
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Author" content="Processing Foundation" />
<meta name="Publisher" content="Processing Foundation" />
<meta name="Keywords" content="Processing, Sketchbook, Programming, Coding, Code, Art, Design" />
<meta name="Description" content="Processing is a flexible software sketchbook and a language for learning how to code within the context of the visual arts. Since 2001, Processing has promoted software literacy within the visual arts and visual literacy within technology." />
<meta name="Copyright" content="All contents copyright the Processing Foundation, Ben Fry, Casey Reas, and the MIT Media Laboratory" />
<script src="<!-- webcontentpath -->javascript/modernizr-2.6.2.touch.js" type="text/javascript"></script>
<link href="<!-- webcontentpath -->css/style.css" rel="stylesheet" type="text/css" />
</head>
<body id="Langauge-en" onload="" >
<!-- ==================================== PAGE ============================ -->
<div id="container">
<!-- ==================================== HEADER ============================ -->
<div id="ribbon">
<ul class="left">
<li class="highlight"><a href="http://processing.org/">Processing</a></li>
<li><a href="http://p5js.org/">p5.js</a></li>
<li><a href="http://py.processing.org/">Processing.py</a></li>
<li><a href="http://android.processing.org/">Processing for Android</a></li>
<li><a href="http://pi.processing.org/">Processing for Pi</a></li>
</ul>
<ul class="right">
<li><a href="https://processingfoundation.org/">Processing Foundation</a></li>
</ul>
<div class="clear"></div>
</div>
<div id="header">
<a href="/" title="Back to the Processing cover."><div class="processing-logo no-cover" alt="Processing cover"></div></a>
<form name="search" method="get" action="//www.google.com/search">
<p><input type="hidden" name="as_sitesearch" value="processing.org" />
<input type="text" name="as_q" value="" size="20" class="text" />
<input type="submit" value=" " /></p>
</form>
</div>
<!--<div id="ribbon-announce">
<ul class="center">
<li><a href="https://donorbox.org/supportpf2019-fundraising-campaign" target="_blank">This season, we need your help! Click here to donate to #SupportP5!</a></li>
</ul>
<div class="clear"></div>
</div>-->
<a id="TOP" name="TOP"></a>
<div id="navigation">
<!-- navigation -->
</div>
<!-- ==================================== CONTENT - Headers ============================ -->
<div class="content">
<p class="ref-notice">This reference is for Processing 3.0+. If you have a previous version, use the reference included with your software in the Help menu. If you see any errors or have suggestions, <a href="https://github.com/processing/processing-docs/issues?state=open">please let us know</a>. If you prefer a more technical reference, visit the <a href="http://processing.github.io/processing-javadocs/core/">Processing Core Javadoc</a> and <a href="http://processing.github.io/processing-javadocs/libraries/">Libraries Javadoc</a>.</p>
<table cellpadding="0" cellspacing="0" border="0" class="ref-item">
<!-- require:classname --><tr class=""><th scope="row">Class</th><td><p><a href="<!-- classanchor -->"><!-- classname --></a></p></td></tr><!-- end -->
<tr class="name-row">
<th scope="row">Name</th>
<td><h3><!-- name --></h3></td>
</tr>
<tr class="">
<!-- examples -->
<!-- description -->
<!-- require:syntax --><tr class=""><th scope="row">Syntax</th><td><pre><!-- syntax --></pre></td></tr><!-- end -->
<!-- require:parameters --><tr class=""> <th scope="row">Parameters</th><td><table cellpadding="0" cellspacing="0" border="0"><!-- parameters --></table></td> </tr><!-- end -->
<!-- require:returns --><tr class=""><th scope="row">Returns</th><td class="code"><!-- returns --></td></tr><!-- end -->
<!-- require:related --><tr class=""><th scope="row">Related</th><td><!-- related --></td></tr><!-- end -->
</table>
Updated on <!-- timestamp --><br /><br />
<!-- Creative Commons License -->
<div class="license">
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://processing.org/img/cc.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.
</div>
</div>
<!-- ==================================== FOOTER ============================ -->
<div id="footer">
<div id="copyright">Processing is an open project intiated by <a href="http://benfry.com/">Ben Fry</a> and <a href="http://reas.com">Casey Reas</a>. It is developed by a <a href="http://processing.org/about/people/">team of volunteers</a>.</div>
<div id="colophon">
<a href="<!-- webcontentpath -->copyright.html">&copy; Info</a>
</div>
</div>
</div>
<!-- jquery -->
<script src="<!-- webcontentpath -->javascript/site.js" type="text/javascript"></script>
</body>
</html>
@@ -0,0 +1,104 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Alphabetical Language Reference (API) \ Processing 3+</title>
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Author" content="Processing Foundation" />
<meta name="Publisher" content="Processing Foundation" />
<meta name="Keywords" content="Processing, Sketchbook, Programming, Coding, Code, Art, Design" />
<meta name="Description" content="Processing is a flexible software sketchbook and a language for learning how to code within the context of the visual arts. Since 2001, Processing has promoted software literacy within the visual arts and visual literacy within technology." />
<meta name="Copyright" content="All contents copyright the Processing Foundation, Ben Fry, Casey Reas, and the MIT Media Laboratory" />
<script src="<!-- webcontentpath -->javascript/modernizr-2.6.2.touch.js" type="text/javascript"></script>
<link href="<!-- webcontentpath -->css/style.css" rel="stylesheet" type="text/css" />
</head>
<body id="A-Z" onload="" >
<!-- ==================================== PAGE ============================ -->
<div id="container">
<!-- ==================================== HEADER ============================ -->
<div id="ribbon">
<ul class="left">
<li class="highlight"><a href="http://processing.org/">Processing</a></li>
<li><a href="http://p5js.org/">p5.js</a></li>
<li><a href="http://py.processing.org/">Processing.py</a></li>
<li><a href="http://android.processing.org/">Processing for Android</a></li>
<li><a href="http://pi.processing.org/">Processing for Pi</a></li>
</ul>
<ul class="right">
<li><a href="https://processingfoundation.org/">Processing Foundation</a></li>
</ul>
<div class="clear"></div>
</div>
<div id="header">
<a href="/" title="Back to the Processing cover."><div class="processing-logo no-cover" alt="Processing cover"></div></a>
<form name="search" method="get" action="http://www.google.com/search">
<p><input type="hidden" name="as_sitesearch" value="processing.org" />
<input type="text" name="as_q" value="" size="20" class="text" />
<input type="submit" value=" " /></p>
</form>
</div>
<!--<div id="ribbon-announce">
<ul class="center">
<li><a href="https://donorbox.org/supportpf2019-fundraising-campaign" target="_blank">This season, we need your help! Click here to donate to #SupportP5!</a></li>
</ul>
<div class="clear"></div>
</div>-->
<div id="navigation">
<!-- navigation -->
</div>
<a id="TOP" name="TOP"></a>
<!-- ==================================== CONTENT - Headers ============================ -->
<div class="content">
<h1 class="large-header"><span class="black">Reference.</span> Processing was designed to be a flexible software sketchbook.</h1>
<!-- <script src="<! - - webcontentpath - - >javascript/mode-select.js" type="text/javascript"></script>
<div class="ref-top">
<div id="ref-mode-text" style="display: none">
Processing code can be run in <a href="<! - - webcontentpath - - >environment/index.html#Programming_modes">different modes</a>. This reference unites the standard and Javascript flavours. Use the links to the left to highlight any differences.
</div>
<div id="ref-mode-switch">
<ul><li><a href="#" mode="java">Standard Processing</a></li>
<li><a href="#" mode="js">JavaScript (Processing.js)</a></li>
</ul>
</div>
<div id="ref-mode-switch-bottom"></div>
</div> -->
<div class="ref-col">
<!-- c1 -->
</div>
<div class="ref-col">
<!-- c2 -->
</div>
<div class="ref-col">
<!-- c3 -->
</div>
</div>
<!-- ==================================== FOOTER ============================ -->
<div id="footer">
<div id="copyright">Processing was initiated by <a href="http://benfry.com/">Ben Fry</a> and <a href="http://reas.com">Casey Reas</a>. It is developed by a <a href="<!-- webcontentpath -->people.html">small team of volunteers</a>.</div>
<div id="colophon">
<a href="<!-- webcontentpath -->copyright.html">&copy; Info</a>
</div>
</div>
</div>
<!-- jquery -->
<script src="<!-- webcontentpath -->javascript/site.js" type="text/javascript"></script>
</body>
</html>
@@ -0,0 +1 @@
<a href="<!-- anchor -->" class="<!-- classes --> ref-link"><!-- name --></a>
+302
View File
@@ -0,0 +1,302 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Language Reference (API) \ Processing 3+</title>
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Author" content="Processing Foundation" />
<meta name="Publisher" content="Processing Foundation" />
<meta name="Keywords" content="Processing, Sketchbook, Programming, Coding, Code, Art, Design" />
<meta name="Description" content="Processing is a flexible software sketchbook and a language for learning how to code within the context of the visual arts. Since 2001, Processing has promoted software literacy within the visual arts and visual literacy within technology." />
<meta name="Copyright" content="All contents copyright the Processing Foundation, Ben Fry, Casey Reas, and the MIT Media Laboratory" />
<script src="<!-- webcontentpath -->javascript/modernizr-2.6.2.touch.js" type="text/javascript"></script>
<link href="<!-- webcontentpath -->css/style.css" rel="stylesheet" type="text/css" />
</head>
<body id="language" onload="" >
<!-- ==================================== PAGE ============================ -->
<div id="container">
<!-- ==================================== HEADER ============================ -->
<div id="ribbon">
<ul class="left">
<li class="highlight"><a href="http://processing.org/">Processing</a></li>
<li><a href="http://p5js.org/">p5.js</a></li>
<li><a href="http://py.processing.org/">Processing.py</a></li>
<li><a href="http://android.processing.org/">Processing for Android</a></li>
<li><a href="http://pi.processing.org/">Processing for Pi</a></li>
</ul>
<ul class="right">
<li><a href="https://processingfoundation.org/">Processing Foundation</a></li>
</ul>
<div class="clear"></div>
</div>
<div id="header">
<a href="/" title="Back to the Processing cover."><div class="processing-logo no-cover" alt="Processing cover"></div></a>
<form name="search" method="get" action="http://www.google.com/search">
<p><input type="hidden" name="as_sitesearch" value="processing.org" />
<input type="text" name="as_q" value="" size="20" class="text" />
<input type="submit" value=" " /></p>
</form>
</div>
<!--<div id="ribbon-announce">
<ul class="center">
<li><a href="https://donorbox.org/supportpf2019-fundraising-campaign" target="_blank">This season, we need your help! Click here to donate to #SupportP5!</a></li>
</ul>
<div class="clear"></div>
</div>-->
<div id="navigation">
<!-- navigation -->
</div>
<a id="TOP" name="TOP"></a>
<!-- ==================================== CONTENT - Headers ============================ -->
<div class="content">
<h1 class="large-header"><span class="black">Reference.</span> Processing was designed to be a flexible software sketchbook.</h1>
<!-- <script src="<!- - webcontentpath - - >javascript/mode-select.js" type="text/javascript"></script>
<div class="ref-top">
<div id="ref-mode-text" style="display: none">
Processing code can be run in <a href="<!- - webcontentpath - - >environment/index.html#Programming_modes">different modes</a>. This reference unites the standard and Javascript flavours. Use the links to the left to highlight any differences.
</div>
<div id="ref-mode-switch">
<ul><li><a href="#" mode="java">Standard Processing</a></li>
<li><a href="#" mode="js">JavaScript (Processing.js)</a></li>
</ul>
</div>
<div id="ref-mode-switch-bottom"></div>
</div> -->
<div class="ref-col">
<div class="category">
<b>Structure</b>
<br /><br />
<!-- structure -->
</div>
<div class="category">
<b>Environment</b>
<br /><br />
<!-- environment -->
</div>
<div class="category">
<b>Data</b>
<h5>Primitive</h5>
<!-- data:primitive -->
<h5>Composite</h5>
<!-- data:composite -->
<h5>Conversion</h5>
<!-- data:conversion -->
<h5>String Functions</h5>
<!-- data:string_functions -->
<h5>Array Functions</h5>
<!-- data:array_functions -->
</div>
<div class="category">
<b>Control</b>
<h5>Relational Operators</h5>
<!-- control:relational_operators -->
<h5>Iteration</h5>
<!-- control:iteration -->
<h5>Conditionals</h5>
<!-- control:conditionals -->
<h5>Logical Operators</h5>
<!-- control:logical_operators -->
</div>
</div><div class="ref-col">
<div class="category">
<b>Shape</b>
<br /><br />
<!-- shape -->
<h5>2D Primitives</h5>
<!-- shape:2d_primitives -->
<h5>Curves</h5>
<!-- shape:curves -->
<h5>3D Primitives</h5>
<!-- shape:3d_primitives -->
<h5>Attributes</h5>
<!-- shape:attributes -->
<h5>Vertex</h5>
<!-- shape:vertex -->
<h5>Loading &amp; Displaying</h5>
<!-- shape:loading_displaying -->
</div>
<div class="category">
<b>Input</b>
<h5>Mouse</h5>
<!-- input:mouse -->
<h5>Keyboard</h5>
<!-- input:keyboard -->
<h5>Files</h5>
<!-- input:files -->
<!--<h5>Web</h5>-->
<!-- input:web -->
<h5>Time &amp; Date</h5>
<!-- input:time_date -->
</div>
<div class="category">
<b>Output</b>
<h5>Text Area</h5>
<!-- output:text_area -->
<h5>Image</h5>
<!-- output:image -->
<h5>Files</h5>
<!-- output:files -->
</div>
<div class="category">
<b>Transform</b>
<br /><br />
<!-- transform -->
</div>
<div class="category">
<b>Lights, Camera</b>
<!-- lights_camera -->
<h5>Lights</h5>
<!-- lights_camera:lights -->
<h5>Camera</h5>
<!-- lights_camera:camera -->
<h5>Coordinates</h5>
<!-- lights_camera:coordinates -->
<h5>Material Properties</h5>
<!-- lights_camera:material_properties -->
</div>
</div><div class="ref-col">
<div class="category">
<b>Color</b>
<!-- color -->
<h5>Setting</h5>
<!-- color:setting -->
<h5>Creating &amp; Reading</h5>
<!-- color:creating_reading -->
</div>
<div class="category">
<b>Image</b>
<br /><br />
<!-- image -->
<h5>Loading &amp; Displaying</h5>
<!-- image:loading_displaying -->
<h5>Textures</h5>
<!-- image:textures -->
<h5>Pixels</h5>
<!-- image:pixels -->
</div>
<div class="category">
<b>Rendering</b>
<br /><br />
<!-- rendering -->
<h5>Shaders</h5>
<!-- rendering:shaders -->
</div>
<div class="category">
<b>Typography</b>
<br/><br/>
<!-- typography -->
<h5>Loading &amp; Displaying</h5>
<!-- typography:loading_displaying -->
<h5>Attributes</h5>
<!-- typography:attributes -->
<h5>Metrics</h5>
<!-- typography:metrics -->
</div>
<div class="category">
<b>Math</b>
<br/><br/>
<!-- math -->
<h5>Operators</h5>
<!-- math:operators -->
<h5>Bitwise Operators</h5>
<!-- math:bitwise_operators -->
<h5>Calculation</h5>
<!-- math:calculation -->
<h5>Trigonometry</h5>
<!-- math:trigonometry -->
<h5>Random</h5>
<!-- math:random -->
</div>
<div class="category">
<b>Constants</b>
<br /><br />
<!-- constants -->
</div></div>
</div>
<!-- ==================================== FOOTER ============================ -->
<div id="footer">
<div id="copyright">Processing was initiated by <a href="http://benfry.com/">Ben Fry</a> and <a href="http://reas.com">Casey Reas</a>. It is developed by a <a href="<!-- webcontentpath -->people/">small team of volunteers</a>.</div>
<div id="colophon">
<a href="<!-- webcontentpath -->copyright.html">&copy; Info</a>
</div>
</div>
</div>
<!-- jquery -->
<script src="<!-- webcontentpath -->javascript/site.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-40016511-1']);
_gaq.push(['_setDomainName', 'processing.org']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>
@@ -0,0 +1 @@
<script src="<!-- webcontentpath -->javascript/jquery-1.9.1.min.js"></script>
+2
View File
@@ -0,0 +1,2 @@
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="<!-- webcontentpath -->javascript/jquery-1.9.1.min.js"><\\/script>');</script>
@@ -0,0 +1,94 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Video \ Libraries \ Processing 3+</title>
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Author" content="Processing Foundation" />
<meta name="Publisher" content="Processing Foundation" />
<meta name="Keywords" content="Processing, Sketchbook, Programming, Coding, Code, Art, Design" />
<meta name="Description" content="Processing is a flexible software sketchbook and a language for learning how to code within the context of the visual arts. Since 2001, Processing has promoted software literacy within the visual arts and visual literacy within technology." />
<meta name="Copyright" content="All contents copyright the Processing Foundation, Ben Fry, Casey Reas, and the MIT Media Laboratory" />
<script src="<!-- webcontentpath -->javascript/modernizr-2.6.2.touch.js" type="text/javascript"></script>
<link href="<!-- webcontentpath -->css/style.css" rel="stylesheet" type="text/css" />
</head>
<body id="Library-index" onload="" >
<!-- ==================================== PAGE ============================ -->
<div id="container">
<!-- ==================================== HEADER ============================ -->
<div id="ribbon">
<ul class="left">
<li class="highlight"><a href="http://processing.org/">Processing</a></li>
<li><a href="http://p5js.org/">p5.js</a></li>
<li><a href="http://py.processing.org/">Processing.py</a></li>
<li><a href="http://android.processing.org/">Processing for Android</a></li>
<li><a href="http://pi.processing.org/">Processing for Pi</a></li>
</ul>
<ul class="right">
<li><a href="https://processingfoundation.org/">Processing Foundation</a></li>
</ul>
<div class="clear"></div>
</div>
<div id="header">
<a href="/" title="Back to the Processing cover."><div class="processing-logo no-cover" alt="Processing cover"></div></a>
<form name="search" method="get" action="http://www.google.com/search">
<p><input type="hidden" name="as_sitesearch" value="processing.org" />
<input type="text" name="as_q" value="" size="20" class="text" />
<input type="submit" value=" " /></p>
</form>
</div>
<div id="navigation">
<!-- navigation -->
</div>
<a id="TOP" name="TOP"></a>
<!-- ==================================== CONTENT - Headers ============================ -->
<div class="content">
<div class="lib-nav">
<a href="../index.html">Libraries</a><br />
</div>
<div class="colone">
<h2><!-- libraryname --></h2>
<!-- librarydescription -->
</div>
<div class="twocol">
<!-- classes -->
<h5><!-- libraryname --> Events</h5>
<!-- events -->
</div>
<div class="full">
<!-- extrainfo -->
</div>
</div>
<!-- ==================================== FOOTER ============================ -->
<div id="footer">
<div id="copyright">Processing was initiated by <a href="http://benfry.com/">Ben Fry</a> and <a href="http://reas.com">Casey Reas</a>. It is developed by a <a href="<!-- webcontentpath -->about/people.html">small team of volunteers</a>.</div>
<div id="colophon">
<a href="<!-- webcontentpath -->copyright.html">&copy; Info</a>
</div>
</div>
</div>
<!-- jquery -->
<script src="<!-- webcontentpath -->javascript/site.js" type="text/javascript"></script>
</body>
</html>
@@ -0,0 +1,4 @@
<h5><!-- classname --></h5>
<p><!-- classdescription --><!-- require:description --><br /><br /><!-- end -->
<!-- methods -->
</p>
@@ -0,0 +1 @@
<!-- parameter -->
@@ -0,0 +1 @@
<!-- object -->.<!-- name -->(<!-- parameters -->)
+8
View File
@@ -0,0 +1,8 @@
<div class="navBar" id="mainnav">
<a href="<!-- webcontentpath -->index.html" <!-- isLanguage -->>Language</a><br>
<a href="<!-- webcontentpath -->libraries/index.html" <!-- isLibrary -->>Libraries</a><br>
<a href="<!-- webcontentpath -->tools/index.html">Tools</a><br>
<a href="<!-- webcontentpath -->environment/index.html">Environment</a><br>
</div>
<script> document.querySelectorAll(".processing-logo")[0].className = "processing-logo"; </script>
+33
View File
@@ -0,0 +1,33 @@
<div class="navBar" id="mainnav">
<a href="/">Cover</a><br /><br />
<a href="/download/">Download</a><br />
<a href="/download/support.html">Donate</a><br /><br />
<!--<a href="/exhibition/">Exhibition</a><br /><br />-->
<a href="/reference/" class="active">Reference</a><br />
<a href="/reference/libraries/">Libraries</a><br />
<a href="/reference/tools/">Tools</a><br />
<a href="/reference/environment/">Environment</a><br /><br />
<a href="/tutorials/">Tutorials</a><br />
<a href="/examples/">Examples</a><br />
<a href="/books/">Books</a><br />
<!--<a href="/handbook/">Handbook</a><br /><br />-->
<a href="/overview/">Overview</a><br />
<a href="/people/">People</a><br /><br />
<!--<a href="/shop/">Shop</a><br /><br />-->
<a href="https://discourse.processing.org" class="outward"><span>&raquo;</span>Forum</a><br />
<a href="https://github.com/processing" class="outward"><span>&raquo;</span>GitHub</a><br />
<a href="https://github.com/processing/processing/issues?state=open" class="outward"><span>&raquo;</span>Issues</a><br />
<a href="https://github.com/processing/processing/wiki/" class="outward"><span>&raquo;</span>Wiki</a><br />
<a href="https://github.com/processing/processing/wiki/FAQ" class="outward"><span>&raquo;</span>FAQ</a><br />
<a href="https://twitter.com/processingOrg" class="outward"><span>&raquo;</span>Twitter</a><br />
<!--<a href="https://www.facebook.com/page.processing" class="outward"><span>&raquo;</span>Facebook</a><br />-->
<a href="https://medium.com/@ProcessingOrg/" class="outward"><span>&raquo;</span>Medium</a>
</div>
+4
View File
@@ -0,0 +1,4 @@
<tr class="">
<th scope="row" class="code"><!-- name --></th>
<td><!-- description --></td>
</tr>
+1
View File
@@ -0,0 +1 @@
<!-- name -->(<!-- desc -->)
+1
View File
@@ -0,0 +1 @@
<a class="code" href="<!-- anchor -->"><!-- name --></a><br />