Skip to content

Commit 6a2017d

Browse files
committed
initial version of JavaDoc Tool for Processing
0 parents  commit 6a2017d

20 files changed

Lines changed: 1889 additions & 0 deletions

.classpath

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
5+
<classpathentry combineaccessrules="false" kind="src" path="/processing-app"/>
6+
<classpathentry kind="output" path="bin"/>
7+
</classpath>

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.DS_Store
2+
bin
3+
tmp
4+
distribution

.project

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>processing-tool-template</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
</projectDescription>

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
## JavaDoc
2+
3+
This is a [Processing](http://www.processing.org/) Tool to generate JavaDoc from a Sketch.
4+

data/README

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
The data folder:
2+
If your tool is using files like images, sound files, any data file, etc.,
3+
put them into the data folder. When writing your tool you can use the
4+
following methods as a starting point to load or get files from the data folder,
5+
these are suggestions amongst many other solutions.
6+
7+
When using an Object which extends PApplet inside your tool, PApplet's internal
8+
methods such as loadImage, loadStrings, etc. will use your tool's data folder to find
9+
files to be loaded.
10+
11+
12+
13+
14+
15+
/**
16+
* load an image from the data folder or an absolute path. This
17+
* java.awt.Image can be displayed within a JFrame for example.
18+
*
19+
* @param theFilename
20+
* @return
21+
*/
22+
public Image loadImage(String theFilename) {
23+
if (theFilename.startsWith(File.separator)) {
24+
return new ImageIcon(theFilename).getImage();
25+
} else {
26+
URL img = this.getClass().getResource(getPath(theFilename));
27+
return new ImageIcon(img).getImage();
28+
}
29+
}
30+
31+
32+
/**
33+
* load an image from the data folder or an absolute path as a PImage.
34+
*
35+
* @param theFilename
36+
* @return
37+
*/
38+
public PImage loadPImage(String theFilename) {
39+
return new PImage(loadImage(theFilename));
40+
}
41+
42+
43+
/**
44+
* load a text file from the data folder or an absolute path.
45+
*
46+
* @param theFilename
47+
* @return
48+
*/
49+
public String loadString(String theFilename) {
50+
InputStream is = null;
51+
if (theFilename.startsWith(File.separator)) {
52+
try {
53+
is = new FileInputStream(loadFile(theFilename));
54+
} catch (FileNotFoundException e) {
55+
System.err.println("ERROR @ loadString() " + e);
56+
}
57+
} else {
58+
is = getClass().getResourceAsStream(getPath(theFilename));
59+
}
60+
InputStreamReader isr = new InputStreamReader(is);
61+
BufferedReader br = new BufferedReader(isr);
62+
int buffer;
63+
String result = "";
64+
try {
65+
while ((buffer = br.read()) != -1) {
66+
result += (char) buffer;
67+
}
68+
} catch (Exception e) {
69+
System.err.println("ERROR @ loadString() " + e);
70+
}
71+
return result;
72+
}
73+
74+
75+
/**
76+
* getPath will return the path to a file or folder inside the data folder
77+
* of the tool or an absolute path.
78+
*
79+
* @param theFilename
80+
* @return
81+
*/
82+
public String getPath(String theFilename) {
83+
if (theFilename.startsWith("/")) {
84+
return theFilename;
85+
}
86+
return File.separator + "data" + File.separator + theFilename;
87+
}
88+
89+
90+
/**
91+
* load a file from the data folder or an absolute path.
92+
*
93+
* @param theFilename
94+
* @return
95+
*/
96+
public File loadFile(String theFilename) {
97+
if (theFilename.startsWith(File.separator)) {
98+
return new File(theFilename);
99+
}
100+
String path = getClass().getResource(getPath(theFilename)).getPath();
101+
return new File(path);
102+
}
103+
104+
105+
106+
107+

examples/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
add examples for your tool here.

lib/README

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
The lib folder:
2+
In case your tool requires 3rd party libraries, which need to be
3+
added to the distribution, put them into the lib folder.
4+
These 3rd party libraries will be added to your distribution and are
5+
located next to your tool's jar file.
6+
7+
This does not apply to .jar files that are considered core processing libraries.

license.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
A code template to build tools for the Processing programming environment.
2+
3+
Part of the Processing project - http://processing.org
4+
5+
Copyright (c) 2011-2015 Elie Zananiri
6+
Copyright (c) 2008-2011 Andreas Schlegel
7+
8+
This program is free software; you can redistribute it and/or
9+
modify it under the terms of the GNU General Public License
10+
as published by the Free Software Foundation; either version 2
11+
of the License, or (at your option) any later version.
12+
13+
This program is distributed in the hope that it will be useful,
14+
but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
GNU General Public License for more details.
17+
18+
You should have received a copy of the GNU General Public License
19+
along with this program; if not, write to the Free Software
20+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

resources/README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
## How to install ##tool.name##
2+
3+
4+
### Install with the Contribution Manager
5+
6+
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.
7+
8+
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.
9+
10+
### Manual Install
11+
12+
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.
13+
14+
By default the following locations are used for your sketchbook folder:
15+
* For Mac users, the sketchbook folder is located inside `~/Documents/Processing`
16+
* For Windows users, the sketchbook folder is located inside `My Documents/Processing`
17+
18+
Download ##tool.name## from ##tool.url##
19+
20+
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.
21+
22+
The folder structure for tool ##tool.name## should be as follows:
23+
24+
```
25+
Processing
26+
tools
27+
##tool.name##
28+
examples
29+
tool
30+
##tool.name##.jar
31+
reference
32+
src
33+
```
34+
35+
Some folders like `examples` or `src` might be missing. After tool ##tool.name## has been successfully installed, restart the Processing application.
36+
37+
### Troubleshooting
38+
39+
If you're having trouble, try contacting the author [##author.name##](##author.url##).

resources/build.properties

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
# Create a Tool for the Processing open source programming language and
2+
# environment (http://www.processing.org)
3+
#
4+
# Customize the build properties to make the ant-build-process work for your
5+
# environment. How? Please read the comments below.
6+
#
7+
# The default properties are set for OS X. Please refer to comments for Windows
8+
# settings.
9+
10+
11+
# Where is your Processing sketchbook located?
12+
# If you are not sure, check the sketchbook location in your Processing
13+
# application preferences.
14+
# ${user.home} points the compiler to your home directory.
15+
# For windows the default path to your sketchbook would be
16+
# ${user.home}/My Documents/Processing (make adjustments below).
17+
18+
#sketchbook.location=${user.home}/My Documents/Processing
19+
sketchbook.location=${user.home}/Documents/Processing
20+
21+
22+
# Where are the jar files located that are required for compiling your Tool such
23+
# as e.g. core.jar?
24+
# By default the local classpath location points to folder libs inside Eclipse's
25+
# workspace (by default found in your home directory).
26+
# For Windows, the default path would be
27+
# ${user.home}/Documents/workspace/libs (make adjustments below)
28+
# For OS X,the following path will direct you into Processing's application
29+
# package, in case you put Processing inside your Applications folder.
30+
31+
#classpath.local.location=${user.home}/Documents/workspace/libs
32+
classpath.local.location=/Applications/Processing.app/Contents/Java
33+
34+
35+
# Add all jar files that are required for compiling your project to the local
36+
# and project classpath. Use a comma as delimiter. These jar files must be
37+
# inside your classpath.local.location folder.
38+
# For creating a Tool, both pde.jar and core.jar are required.
39+
40+
classpath.local.include=core.jar,pde.jar
41+
42+
43+
# Add Processing's libraries folder to the classpath.
44+
# If you don't need to include the libraries folder to your classpath, comment
45+
# out the following line.
46+
47+
classpath.libraries.location=${sketchbook.location}/libraries
48+
49+
50+
# Set the java version that should be used to compile your Tool.
51+
52+
java.target.version=1.8
53+
54+
55+
# Set the description of the Ant build.xml file.
56+
57+
ant.description=Processing Tool Ant build file.
58+
59+
60+
# Give your Tool a name. The name must not contain spaces or special characters.
61+
# When creating a tool, the name of the main class which implements Tool must be
62+
# the same as the value defined for project.name in your build.properties.
63+
64+
project.name=JavaDoc
65+
66+
67+
# The name as the user will see it. This can contain spaces and special
68+
# characters.
69+
70+
project.prettyName=JavaDoc
71+
72+
73+
# Use 'normal' or 'fast' as value for project.compile.
74+
# 'fast' will only compile the project into your sketchbook.
75+
# 'normal' will compile the distribution including the javadoc-reference and all
76+
# web-files (the compile process here takes longer).
77+
# All files compiled with project.compile=normal are stored
78+
# in the distribution folder.
79+
80+
project.compile=normal
81+
82+
83+
# Set your name and URL, used for the web page and properties file.
84+
85+
author.name=Henning Kiel
86+
author.url=https://github.com/hkiel
87+
88+
89+
# Set the web page for your Tool.
90+
# This is NOT a direct link to where to download it.
91+
92+
tool.url=https://github.com/hkiel/JavaDoc
93+
94+
95+
# Set the category (or categories) of your Tool from the following list:
96+
# "3D" "Animation" "Compilations" "Data"
97+
# "Fabrication" "Geometry" "GUI" "Hardware"
98+
# "I/O" "Language" "Math" "Simulation"
99+
# "Sound" "Utilities" "Typography" "Video & Vision"
100+
#
101+
# If a value other than those listed is used, your library will listed as
102+
# "Other". Many categories must be comma-separated.
103+
104+
tool.categories=Utilities
105+
106+
107+
# A short sentence (or fragment) to summarize the Tool's function. This will be
108+
# shown from inside the PDE when the Tool is being installed. Avoid repeating
109+
# the name of your Tool here. Also, avoid saying anything redundant like
110+
# mentioning that it's a Tool. This should start with a capitalized letter, and
111+
# end with a period.
112+
113+
tool.sentence=Generate JavaDoc for sketch.
114+
115+
116+
# Additional information suitable for the Processing website. The value of
117+
# 'sentence' always will be prepended, so you should start by writing the
118+
# second sentence here. If your Tool only works on certain operating systems,
119+
# mention it here.
120+
121+
tool.paragraph=
122+
123+
124+
# Set the source code repository for your project.
125+
# We recommend Bitbucket (https://bitbucket.org) or GitHub (https://github.com).
126+
127+
source.host=GitHub
128+
source.url=https://github.com/hkiel/JavaDoc
129+
source.repository=https://github.com/hkiel/JavaDoc.git
130+
131+
132+
# The current version of your Tool.
133+
# This number must be parsable as an int. It increments once with each release.
134+
# This is used to compare different versions of the same Tool, and check if an
135+
# update is available.
136+
137+
tool.version=1
138+
139+
140+
# The version as the user will see it.
141+
142+
tool.prettyVersion=1.0.0
143+
144+
145+
# The min and max revision of Processing compatible with your Tool.
146+
# Note that these fields use the revision and not the version of Processing,
147+
# parsable as an int. For example, the revision number for 2.2.1 is 227.
148+
# You can find the revision numbers in the change log: https://raw.githubusercontent.com/processing/processing/master/build/shared/revisions.txt
149+
# Only use maxRevision (or minRevision), when your Tool is known to break in a
150+
# later (or earlier) release. Otherwise, use the default value 0.
151+
152+
compatible.minRevision=0
153+
compatible.maxRevision=0
154+
155+
156+
# The platforms and Processing version that the Tool has been tested
157+
# against. This information is only used in the generated webpage.
158+
159+
tested.platform=osx,windows
160+
tested.processingVersion=4.1.1
161+
162+
163+
# Additional information for the generated webpage.
164+
165+
tool.copyright=(c) 2022
166+
tool.dependencies=?
167+
tool.keywords=javadoc
168+
169+
170+
# Include javadoc references into your project's javadocs.
171+
172+
javadoc.java.href=http://docs.oracle.com/javase/8/docs/api/
173+
javadoc.processing.href=http://processing.org/reference/

0 commit comments

Comments
 (0)