mirror of
https://github.com/processing/processing4.git
synced 2026-02-14 02:45:36 +01:00
fixes and tweaks for new javadoc
This commit is contained in:
@@ -750,7 +750,7 @@ public class Sketch {
|
||||
// make sure there doesn't exist a tab with that name already
|
||||
// but ignore this situation for the first tab, since it's probably being
|
||||
// resaved (with the same name) to another location/folder.
|
||||
for (int i = 1; i < codeCount; i++) {
|
||||
for (int i = 1; i < codeCount; i++) {
|
||||
if (newName.equals(code[i].getPrettyName())) {
|
||||
Base.showMessage("Nope",
|
||||
"You can't save the sketch as \"" + newName + "\"\n" +
|
||||
@@ -1182,7 +1182,6 @@ public class Sketch {
|
||||
* successful, re-export with purty set to true.
|
||||
*
|
||||
* @param buildPath Location to copy all the .java files
|
||||
* @param purty true if output should use indents and newlines
|
||||
* @return null if compilation failed, main class name if not
|
||||
*/
|
||||
public String preprocess(String buildPath) throws RunnerException {
|
||||
|
||||
@@ -130,8 +130,8 @@ public class PdePreprocessor {
|
||||
|
||||
String[] defaultImports;
|
||||
|
||||
// these ones have the .* at the end, since a class name might be at the end
|
||||
// instead of .* which would make trouble other classes using this can lop
|
||||
// these ones have the .* at the end, since a class name might be at the end
|
||||
// instead of .* which would make trouble other classes using this can lop
|
||||
// off the . and anything after it to produce a package name consistently.
|
||||
//public String extraImports[];
|
||||
ArrayList<String> programImports;
|
||||
@@ -149,8 +149,8 @@ public class PdePreprocessor {
|
||||
static public boolean foundMain;
|
||||
|
||||
String indent;
|
||||
|
||||
PrintStream stream;
|
||||
|
||||
PrintStream stream;
|
||||
Reader programReader;
|
||||
String buildPath;
|
||||
String name;
|
||||
@@ -181,7 +181,7 @@ public class PdePreprocessor {
|
||||
char[] indentChars = new char[tabSize];
|
||||
Arrays.fill(indentChars, ' ');
|
||||
indent = new String(indentChars);
|
||||
|
||||
|
||||
// need to reset whether or not this has a main()
|
||||
foundMain = false;
|
||||
|
||||
@@ -270,7 +270,7 @@ public class PdePreprocessor {
|
||||
File streamFile = new File(buildPath, name + ".java");
|
||||
stream = new PrintStream(new FileOutputStream(streamFile));
|
||||
int importsLength = writeImports(stream);
|
||||
|
||||
|
||||
// return the length of the imports plus the extra lines for declarations
|
||||
return importsLength + 2;
|
||||
}
|
||||
@@ -278,7 +278,6 @@ public class PdePreprocessor {
|
||||
|
||||
/**
|
||||
* preprocesses a pde file and write out a java file
|
||||
* @param pretty true if should also space out/indent lines
|
||||
* @return the classname of the exported Java
|
||||
*/
|
||||
//public String write(String program, String buildPath, String name,
|
||||
@@ -368,7 +367,7 @@ public class PdePreprocessor {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected void writeParseTree(String filename, AST ast) {
|
||||
try {
|
||||
PrintStream stream = new PrintStream(new FileOutputStream(filename));
|
||||
@@ -382,7 +381,7 @@ public class PdePreprocessor {
|
||||
stream.println("</document>");
|
||||
writer.close();
|
||||
} catch (IOException e) {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -413,11 +412,11 @@ public class PdePreprocessor {
|
||||
}
|
||||
out.println();
|
||||
count += defaultImports.length + 1;
|
||||
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Write any required header material (eg imports, class decl stuff)
|
||||
*
|
||||
@@ -428,21 +427,21 @@ public class PdePreprocessor {
|
||||
void writeDeclaration(PrintStream out, String className) {
|
||||
|
||||
String indent = " ";
|
||||
|
||||
|
||||
if (programType == JAVA) {
|
||||
// Print two blank lines so that the offset doesn't change
|
||||
out.println();
|
||||
out.println();
|
||||
|
||||
|
||||
} else if (programType == ACTIVE) {
|
||||
// Print an extra blank line so the offset is identical to the others
|
||||
out.println("public class " + className + " extends PApplet {");
|
||||
out.println();
|
||||
|
||||
|
||||
} else if (programType == STATIC) {
|
||||
out.println("public class " + className + " extends PApplet {");
|
||||
out.print(indent + "public void setup() {");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -469,8 +468,8 @@ public class PdePreprocessor {
|
||||
out.println("}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public ArrayList<String> getExtraImports() {
|
||||
return programImports;
|
||||
}
|
||||
|
||||
@@ -67,9 +67,9 @@ public interface PConstants {
|
||||
/** stroke weight */
|
||||
static public final int SW = 17;
|
||||
|
||||
|
||||
// transformations (2D and 3D)
|
||||
|
||||
|
||||
// transformations (2D and 3D)
|
||||
|
||||
static public final int TX = 18; // transformed xyzw
|
||||
static public final int TY = 19;
|
||||
static public final int TZ = 20;
|
||||
@@ -79,9 +79,9 @@ public interface PConstants {
|
||||
static public final int VZ = 23;
|
||||
static public final int VW = 24;
|
||||
|
||||
|
||||
// material properties
|
||||
|
||||
|
||||
// material properties
|
||||
|
||||
// Ambient color (usually to be kept the same as diffuse)
|
||||
// fill(_) sets both ambient and diffuse.
|
||||
static public final int AR = 25;
|
||||
@@ -111,7 +111,7 @@ public interface PConstants {
|
||||
|
||||
static public final int VERTEX_FIELD_COUNT = 36;
|
||||
|
||||
|
||||
|
||||
// renderers known to processing.core
|
||||
|
||||
static final String P2D = "processing.core.PGraphics2D";
|
||||
@@ -276,17 +276,17 @@ public interface PConstants {
|
||||
|
||||
static final int POLYGON = 20;
|
||||
static final int PATH = 21;
|
||||
|
||||
|
||||
static final int RECT = 30;
|
||||
static final int ELLIPSE = 31;
|
||||
static final int ARC = 32;
|
||||
|
||||
|
||||
static final int SPHERE = 40;
|
||||
static final int BOX = 41;
|
||||
|
||||
|
||||
// shape closing modes
|
||||
|
||||
|
||||
|
||||
// shape closing modes
|
||||
|
||||
static final int OPEN = 1;
|
||||
static final int CLOSE = 2;
|
||||
|
||||
@@ -299,13 +299,13 @@ public interface PConstants {
|
||||
static final int CORNERS = 1;
|
||||
/** Draw mode from the center, and using the radius */
|
||||
static final int RADIUS = 2;
|
||||
/**
|
||||
/**
|
||||
* Draw from the center, using second pair of values as the diameter.
|
||||
* Formerly called CENTER_DIAMETER in alpha releases.
|
||||
*/
|
||||
static final int CENTER = 3;
|
||||
/**
|
||||
* Synonym for the CENTER constant. Draw from the center,
|
||||
/**
|
||||
* Synonym for the CENTER constant. Draw from the center,
|
||||
* using second pair of values as the diameter.
|
||||
*/
|
||||
static final int DIAMETER = 3;
|
||||
@@ -325,7 +325,7 @@ public interface PConstants {
|
||||
|
||||
/** texture coordinates in 0..1 range */
|
||||
static final int NORMAL = 1;
|
||||
/** @deprecated, use NORMAL instead */
|
||||
/** @deprecated use NORMAL instead */
|
||||
static final int NORMALIZED = 1;
|
||||
/** texture coordinates based on image width/height */
|
||||
static final int IMAGE = 2;
|
||||
@@ -417,8 +417,8 @@ public interface PConstants {
|
||||
static final int WAIT = Cursor.WAIT_CURSOR;
|
||||
|
||||
|
||||
// hints - hint values are positive for the alternate version,
|
||||
// negative of the same value returns to the normal/default state
|
||||
// hints - hint values are positive for the alternate version,
|
||||
// negative of the same value returns to the normal/default state
|
||||
|
||||
static final int ENABLE_OPENGL_2X_SMOOTH = 1;
|
||||
static final int ENABLE_OPENGL_4X_SMOOTH = 2;
|
||||
@@ -427,27 +427,27 @@ public interface PConstants {
|
||||
|
||||
static final int DISABLE_DEPTH_TEST = 4;
|
||||
static final int ENABLE_DEPTH_TEST = -4;
|
||||
|
||||
|
||||
static final int ENABLE_DEPTH_SORT = 5;
|
||||
static final int DISABLE_DEPTH_SORT = -5;
|
||||
|
||||
|
||||
static final int DISABLE_OPENGL_ERROR_REPORT = 6;
|
||||
static final int ENABLE_OPENGL_ERROR_REPORT = -6;
|
||||
|
||||
|
||||
static final int ENABLE_ACCURATE_TEXTURES = 7;
|
||||
static final int DISABLE_ACCURATE_TEXTURES = -7;
|
||||
|
||||
static final int HINT_COUNT = 10;
|
||||
|
||||
|
||||
|
||||
|
||||
// error messages
|
||||
|
||||
static final String ERROR_BACKGROUND_IMAGE_SIZE =
|
||||
static final String ERROR_BACKGROUND_IMAGE_SIZE =
|
||||
"background image must be the same size as your application";
|
||||
static final String ERROR_BACKGROUND_IMAGE_FORMAT =
|
||||
"background images should be RGB or ARGB";
|
||||
|
||||
static final String ERROR_TEXTFONT_NULL_PFONT =
|
||||
static final String ERROR_TEXTFONT_NULL_PFONT =
|
||||
"A null PFont was passed to textFont()";
|
||||
|
||||
static final String ERROR_PUSHMATRIX_OVERFLOW =
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -25,7 +25,7 @@
|
||||
package processing.core;
|
||||
|
||||
/**
|
||||
* A class to describe a two or three dimensional vector.
|
||||
* A class to describe a two or three dimensional vector.
|
||||
* <p>
|
||||
* The result of all functions are applied to the vector itself, with the
|
||||
* exception of cross(), which returns a new PVector (or writes to a specified
|
||||
@@ -130,18 +130,12 @@ public class PVector {
|
||||
|
||||
/**
|
||||
* Get a copy of this vector.
|
||||
* @return
|
||||
*/
|
||||
public PVector get() {
|
||||
return new PVector(x, y, z);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param target
|
||||
* @return
|
||||
*/
|
||||
public float[] get(float[] target) {
|
||||
if (target == null) {
|
||||
return new float[] { x, y, z };
|
||||
@@ -292,7 +286,7 @@ public class PVector {
|
||||
|
||||
/**
|
||||
* Multiply each element of one vector by the elements of another vector.
|
||||
* @param n the value to multiply by
|
||||
* @param v the vector to multiply by
|
||||
*/
|
||||
public void mult(PVector v) {
|
||||
x *= v.x;
|
||||
@@ -302,7 +296,7 @@ public class PVector {
|
||||
|
||||
|
||||
/**
|
||||
* Multiply each element of one vector by the individual elements of another
|
||||
* Multiply each element of one vector by the individual elements of another
|
||||
* vector, and return the result as a new PVector.
|
||||
*/
|
||||
static public PVector mult(PVector v1, PVector v2) {
|
||||
@@ -311,7 +305,7 @@ public class PVector {
|
||||
|
||||
|
||||
/**
|
||||
* Multiply each element of one vector by the individual elements of another
|
||||
* Multiply each element of one vector by the individual elements of another
|
||||
* vector, and write the result into a target vector.
|
||||
* @param v1 the first vector
|
||||
* @param v2 the second vector
|
||||
@@ -358,7 +352,7 @@ public class PVector {
|
||||
return target;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Divide each element of one vector by the elements of another vector.
|
||||
*/
|
||||
@@ -370,7 +364,7 @@ public class PVector {
|
||||
|
||||
|
||||
/**
|
||||
* Multiply each element of one vector by the individual elements of another
|
||||
* Multiply each element of one vector by the individual elements of another
|
||||
* vector, and return the result as a new PVector.
|
||||
*/
|
||||
static public PVector div(PVector v1, PVector v2) {
|
||||
@@ -379,7 +373,7 @@ public class PVector {
|
||||
|
||||
|
||||
/**
|
||||
* Divide each element of one vector by the individual elements of another
|
||||
* Divide each element of one vector by the individual elements of another
|
||||
* vector, and write the result into a target vector.
|
||||
* @param v1 the first vector
|
||||
* @param v2 the second vector
|
||||
|
||||
Reference in New Issue
Block a user