disable min/max warnings, clean up some documentation

This commit is contained in:
Ben Fry
2022-01-11 09:37:35 -05:00
parent 299c7a810e
commit c2a2c028fd
+48 -50
View File
@@ -81,7 +81,7 @@ import processing.opengl.*;
* project of our (tiny) size, we should be focusing on the future, rather
* than working around legacy Java code.
*/
@SuppressWarnings({"unused", "FinalStaticMethod"})
@SuppressWarnings({"unused", "FinalStaticMethod", "ManualMinMaxCalculation"})
public class PApplet implements PConstants {
//public class PApplet extends PSketch { // possible in the next alpha
/** Full name of the Java version (i.e. 1.5.0_11). */
@@ -454,7 +454,7 @@ public class PApplet implements PConstants {
*
* <h3>Advanced:</h3>
*
* If running on Mac OS, a ctrl-click will be interpreted as the right-hand
* If running on macOS, a ctrl-click will be interpreted as the right-hand
* mouse button (unlike Java, which reports it as the left mouse).
* @webref input:mouse
* @webBrief Shows which mouse button is pressed
@@ -567,10 +567,10 @@ public class PApplet implements PConstants {
* <a href="https://docs.oracle.com/javase/8/docs/api/java/awt/event/KeyEvent.html">KeyEvent</a>
* reference.
* <br /><br />
* There are issues with how <b>keyCode</b> behaves across different renderers
* and operating systems. Watch out for unexpected behavior as you switch
* renderers and operating systems and you are using keys are aren't mentioned
* in this reference entry.
* There are issues with how <b>keyCode</b> behaves across different
* renderers and operating systems. Watch out for unexpected behavior
* as you switch renderers and operating systems, and also whenever
* you are using keys not mentioned in this reference entry.
* <br /><br />
* If you are using P2D or P3D as your renderer, use the
* <a href="https://jogamp.org/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/newt/event/KeyEvent.html">NEWT KeyEvent constants</a>.
@@ -580,7 +580,7 @@ public class PApplet implements PConstants {
* When "key" is set to CODED, this will contain a Java key code.
* <p>
* For the arrow keys, keyCode will be one of UP, DOWN, LEFT and RIGHT.
* Also available are ALT, CONTROL and SHIFT. A full set of constants
* ALT, CONTROL and SHIFT are also available. A full set of constants
* can be obtained from java.awt.event.KeyEvent, from the VK_XXXX variables.
*
* @webref input:keyboard
@@ -656,9 +656,9 @@ public class PApplet implements PConstants {
protected boolean redraw = true;
/**
* The system variable <b>frameCount</b> contains the number of frames
* displayed since the program started. Inside <b>setup()</b> the value is
* 0 and and after the first iteration of draw it is 1, etc.
* The system variable <b>frameCount</b> contains the number o
* frames displayed since the program started. Inside <b>setup()</b>
* the value is 0 and during the first iteration of draw it is 1, etc.
*
* @webref environment
* @webBrief The system variable that contains the number of frames
@@ -802,7 +802,7 @@ public class PApplet implements PConstants {
/**
* @param method "size" or "fullScreen"
* @param args parameters passed to the function so we can show the user
* @param args parameters passed to the function to show the user
* @return true if safely inside the settings() method
*/
boolean insideSettings(String method, Object... args) {
@@ -890,32 +890,31 @@ public class PApplet implements PConstants {
/**
*
* The <b>settings()</b> function is new with Processing 3.0.
* It's not needed in most sketches. It's only useful when it's
* absolutely necessary to define the parameters to <b>size()</b>
* with a variable. Alternately, the <b>settings()</b> function
* is necessary when using Processing code outside of the
* Processing Development Environment (PDE). For example, when
* using the Eclipse code editor, it's necessary to use
* <b>settings()</b> to define the <b>size()</b> and
* <b>smooth()</b> values for a sketch.</b>.
* <br /> <br />
* The <b>settings()</b> method runs before the sketch has been
* set up, so other Processing functions cannot be used at that
* point. For instance, do not use loadImage() inside settings().
* The settings() method runs "passively" to set a few variables,
* compared to the <b>setup()</b> command that call commands in
* the Processing API.
*
* @webref environment
* @webBrief Used when absolutely necessary to define the parameters to <b>size()</b>
* with a variable
* @see PApplet#fullScreen()
* @see PApplet#setup()
* @see PApplet#size(int,int)
* @see PApplet#smooth()
*/
* The <b>settings()</b> function is new with Processing 3.0.
* It's not needed in most sketches. It's only useful when it's
* absolutely necessary to define the parameters to <b>size()</b>
* with a variable. Alternately, the <b>settings()</b> function
* is necessary when using Processing code outside the
* Processing Development Environment (PDE). For example, when
* using the Eclipse code editor, it's necessary to use
* <b>settings()</b> to define the <b>size()</b> and
* <b>smooth()</b> values for a sketch.</b>.
* <br /> <br />
* The <b>settings()</b> method runs before the sketch has been
* set up, so other Processing functions cannot be used at that
* point. For instance, do not use loadImage() inside settings().
* The settings() method runs "passively" to set a few variables,
* compared to the <b>setup()</b> command that call commands in
* the Processing API.
*
* @webref environment
* @webBrief Used when absolutely necessary to define the parameters to <b>size()</b>
* with a variable
* @see PApplet#fullScreen()
* @see PApplet#setup()
* @see PApplet#size(int,int)
* @see PApplet#smooth()
*/
public void settings() {
// is this necessary? (doesn't appear to be, so removing)
//size(DEFAULT_WIDTH, DEFAULT_HEIGHT, JAVA2D);
@@ -1038,21 +1037,20 @@ public class PApplet implements PConstants {
/**
* This function is new with Processing 3.0. It makes it
* possible for Processing to render using all of the
* pixels on high resolutions screens like Apple Retina
* displays and Windows High-DPI displays. This function
* can only be run once within a program and it must be
* used right after <b>size()</b> in a program without a <b>setup()</b>
* and used within <b>setup()</b> when a program has one. The
* This function makes it possible to render using all the pixels
* on high resolutions screens like Apple Retina and Windows HiDPI.
* This function can only be run once within a program, and must
* be called right after <b>size()</b> in a program without a
* <b>setup()</b> function, or within <b>setup()</b> if present.
*
* <b>pixelDensity()</b> should only be used with hardcoded
* numbers (in almost all cases this number will be 2)
* or in combination with <b>displayDensity()</b> as in the
* third example above.
*
* When the pixel density is set to more than 1, it
* changes all of the pixel operations including the way
* <b>get()</b>, <b>set()</b>, <b>blend()</b>, <b>copy()</b>, and <b>updatePixels()</b>
* When the pixel density is set to more than 1, it changes the
* pixel operations including the way <b>get()</b>, <b>set()</b>,
* <b>blend()</b>, <b>copy()</b>, and <b>updatePixels()</b>
* all work. See the reference for <b>pixelWidth</b> and
* pixelHeight for more information.
*
@@ -1062,7 +1060,7 @@ public class PApplet implements PConstants {
* about this on the <b>settings()</b> reference page.
*
* @webref environment
* @webBrief It makes it possible for Processing to render using all of the
* @webBrief It makes it possible for Processing to render using all the
* pixels on high resolutions screens
* @param density 1 or 2
* @see PApplet#pixelWidth
@@ -1370,7 +1368,7 @@ public class PApplet implements PConstants {
} else {
t = e;
}
// check for RuntimeException, and allow to bubble up
// check for RuntimeException, and allow it to bubble up
if (t instanceof RuntimeException) {
// re-throw exception
throw (RuntimeException) t;
@@ -1411,7 +1409,7 @@ public class PApplet implements PConstants {
entries.remove(object);
methods.remove(object);
} else {
// Currently iterating the list of methods, remove this afterwards
// Iterates the list of methods, remove this afterwards
removals.add(object);
}
}