Skip to content

Commit

Permalink
initial version of JavaDoc Tool for Processing
Browse files Browse the repository at this point in the history
  • Loading branch information
hkiel committed Dec 6, 2022
0 parents commit 6a2017d
Show file tree
Hide file tree
Showing 20 changed files with 1,889 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/processing-app"/>
<classpathentry kind="output" path="bin"/>
</classpath>
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
bin
tmp
distribution
17 changes: 17 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>processing-tool-template</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>
</projectDescription>
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## JavaDoc

This is a [Processing](http://www.processing.org/) Tool to generate JavaDoc from a Sketch.

107 changes: 107 additions & 0 deletions data/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
The data folder:
If your tool is using files like images, sound files, any data file, etc.,
put them into the data folder. When writing your tool you can use the
following methods as a starting point to load or get files from the data folder,
these are suggestions amongst many other solutions.

When using an Object which extends PApplet inside your tool, PApplet's internal
methods such as loadImage, loadStrings, etc. will use your tool's data folder to find
files to be loaded.





/**
* load an image from the data folder or an absolute path. This
* java.awt.Image can be displayed within a JFrame for example.
*
* @param theFilename
* @return
*/
public Image loadImage(String theFilename) {
if (theFilename.startsWith(File.separator)) {
return new ImageIcon(theFilename).getImage();
} else {
URL img = this.getClass().getResource(getPath(theFilename));
return new ImageIcon(img).getImage();
}
}


/**
* load an image from the data folder or an absolute path as a PImage.
*
* @param theFilename
* @return
*/
public PImage loadPImage(String theFilename) {
return new PImage(loadImage(theFilename));
}


/**
* load a text file from the data folder or an absolute path.
*
* @param theFilename
* @return
*/
public String loadString(String theFilename) {
InputStream is = null;
if (theFilename.startsWith(File.separator)) {
try {
is = new FileInputStream(loadFile(theFilename));
} catch (FileNotFoundException e) {
System.err.println("ERROR @ loadString() " + e);
}
} else {
is = getClass().getResourceAsStream(getPath(theFilename));
}
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
int buffer;
String result = "";
try {
while ((buffer = br.read()) != -1) {
result += (char) buffer;
}
} catch (Exception e) {
System.err.println("ERROR @ loadString() " + e);
}
return result;
}


/**
* getPath will return the path to a file or folder inside the data folder
* of the tool or an absolute path.
*
* @param theFilename
* @return
*/
public String getPath(String theFilename) {
if (theFilename.startsWith("/")) {
return theFilename;
}
return File.separator + "data" + File.separator + theFilename;
}


/**
* load a file from the data folder or an absolute path.
*
* @param theFilename
* @return
*/
public File loadFile(String theFilename) {
if (theFilename.startsWith(File.separator)) {
return new File(theFilename);
}
String path = getClass().getResource(getPath(theFilename)).getPath();
return new File(path);
}





1 change: 1 addition & 0 deletions examples/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add examples for your tool here.
7 changes: 7 additions & 0 deletions lib/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
The lib folder:
In case your tool requires 3rd party libraries, which need to be
added to the distribution, put them into the lib folder.
These 3rd party libraries will be added to your distribution and are
located next to your tool's jar file.

This does not apply to .jar files that are considered core processing libraries.
20 changes: 20 additions & 0 deletions license.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
A code template to build tools for the Processing programming environment.

Part of the Processing project - http://processing.org

Copyright (c) 2011-2015 Elie Zananiri
Copyright (c) 2008-2011 Andreas Schlegel

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
39 changes: 39 additions & 0 deletions resources/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## How to install ##tool.name##


### Install with the Contribution Manager

Add contributed tools by selecting the menu item _Tools__Add Tool..._ This will open the Contribution Manager, where you can browse for ##tool.name##, or any other tool you want to install.

Not all available tools have been converted to show up in this menu. If a tool isn't there, it will need to be installed manually by following the instructions below.

### Manual Install

Contributed tools may be downloaded separately and manually placed within the `tools` folder of your Processing sketchbook. To find (and change) the Processing sketchbook location on your computer, open the Preferences window from the Processing application (PDE) and look for the "Sketchbook location" item at the top.

By default the following locations are used for your sketchbook folder:
* For Mac users, the sketchbook folder is located inside `~/Documents/Processing`
* For Windows users, the sketchbook folder is located inside `My Documents/Processing`

Download ##tool.name## from ##tool.url##

Unzip and copy the contributed tool's folder into the `tools` folder in the Processing sketchbook. You will need to create this `tools` folder if it does not exist.

The folder structure for tool ##tool.name## should be as follows:

```
Processing
tools
##tool.name##
examples
tool
##tool.name##.jar
reference
src
```
Some folders like `examples` or `src` might be missing. After tool ##tool.name## has been successfully installed, restart the Processing application.

### Troubleshooting

If you're having trouble, try contacting the author [##author.name##](##author.url##).
173 changes: 173 additions & 0 deletions resources/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
# Create a Tool for the Processing open source programming language and
# environment (http://www.processing.org)
#
# Customize the build properties to make the ant-build-process work for your
# environment. How? Please read the comments below.
#
# The default properties are set for OS X. Please refer to comments for Windows
# settings.


# Where is your Processing sketchbook located?
# If you are not sure, check the sketchbook location in your Processing
# application preferences.
# ${user.home} points the compiler to your home directory.
# For windows the default path to your sketchbook would be
# ${user.home}/My Documents/Processing (make adjustments below).

#sketchbook.location=${user.home}/My Documents/Processing
sketchbook.location=${user.home}/Documents/Processing


# Where are the jar files located that are required for compiling your Tool such
# as e.g. core.jar?
# By default the local classpath location points to folder libs inside Eclipse's
# workspace (by default found in your home directory).
# For Windows, the default path would be
# ${user.home}/Documents/workspace/libs (make adjustments below)
# For OS X,the following path will direct you into Processing's application
# package, in case you put Processing inside your Applications folder.

#classpath.local.location=${user.home}/Documents/workspace/libs
classpath.local.location=/Applications/Processing.app/Contents/Java


# Add all jar files that are required for compiling your project to the local
# and project classpath. Use a comma as delimiter. These jar files must be
# inside your classpath.local.location folder.
# For creating a Tool, both pde.jar and core.jar are required.

classpath.local.include=core.jar,pde.jar


# Add Processing's libraries folder to the classpath.
# If you don't need to include the libraries folder to your classpath, comment
# out the following line.

classpath.libraries.location=${sketchbook.location}/libraries


# Set the java version that should be used to compile your Tool.

java.target.version=1.8


# Set the description of the Ant build.xml file.

ant.description=Processing Tool Ant build file.


# Give your Tool a name. The name must not contain spaces or special characters.
# When creating a tool, the name of the main class which implements Tool must be
# the same as the value defined for project.name in your build.properties.

project.name=JavaDoc


# The name as the user will see it. This can contain spaces and special
# characters.

project.prettyName=JavaDoc


# Use 'normal' or 'fast' as value for project.compile.
# 'fast' will only compile the project into your sketchbook.
# 'normal' will compile the distribution including the javadoc-reference and all
# web-files (the compile process here takes longer).
# All files compiled with project.compile=normal are stored
# in the distribution folder.

project.compile=normal


# Set your name and URL, used for the web page and properties file.

author.name=Henning Kiel
author.url=https://github.com/hkiel


# Set the web page for your Tool.
# This is NOT a direct link to where to download it.

tool.url=https://github.com/hkiel/JavaDoc


# Set the category (or categories) of your Tool from the following list:
# "3D" "Animation" "Compilations" "Data"
# "Fabrication" "Geometry" "GUI" "Hardware"
# "I/O" "Language" "Math" "Simulation"
# "Sound" "Utilities" "Typography" "Video & Vision"
#
# If a value other than those listed is used, your library will listed as
# "Other". Many categories must be comma-separated.

tool.categories=Utilities


# A short sentence (or fragment) to summarize the Tool's function. This will be
# shown from inside the PDE when the Tool is being installed. Avoid repeating
# the name of your Tool here. Also, avoid saying anything redundant like
# mentioning that it's a Tool. This should start with a capitalized letter, and
# end with a period.

tool.sentence=Generate JavaDoc for sketch.


# Additional information suitable for the Processing website. The value of
# 'sentence' always will be prepended, so you should start by writing the
# second sentence here. If your Tool only works on certain operating systems,
# mention it here.

tool.paragraph=


# Set the source code repository for your project.
# We recommend Bitbucket (https://bitbucket.org) or GitHub (https://github.com).

source.host=GitHub
source.url=https://github.com/hkiel/JavaDoc
source.repository=https://github.com/hkiel/JavaDoc.git


# The current version of your Tool.
# This number must be parsable as an int. It increments once with each release.
# This is used to compare different versions of the same Tool, and check if an
# update is available.

tool.version=1


# The version as the user will see it.

tool.prettyVersion=1.0.0


# The min and max revision of Processing compatible with your Tool.
# Note that these fields use the revision and not the version of Processing,
# parsable as an int. For example, the revision number for 2.2.1 is 227.
# You can find the revision numbers in the change log: https://raw.githubusercontent.com/processing/processing/master/build/shared/revisions.txt
# Only use maxRevision (or minRevision), when your Tool is known to break in a
# later (or earlier) release. Otherwise, use the default value 0.

compatible.minRevision=0
compatible.maxRevision=0


# The platforms and Processing version that the Tool has been tested
# against. This information is only used in the generated webpage.

tested.platform=osx,windows
tested.processingVersion=4.1.1


# Additional information for the generated webpage.

tool.copyright=(c) 2022
tool.dependencies=?
tool.keywords=javadoc


# Include javadoc references into your project's javadocs.

javadoc.java.href=http://docs.oracle.com/javase/8/docs/api/
javadoc.processing.href=http://processing.org/reference/
Loading

0 comments on commit 6a2017d

Please sign in to comment.