Merge pull request #6 from sampottinger/pr_1_simple_fixes

Simple fixes in response to #1 feedback on processing4 mainline
This commit is contained in:
A Samuel Pottinger
2019-10-06 18:03:53 -07:00
committed by GitHub
10 changed files with 131 additions and 266 deletions
+61 -50
View File
@@ -281,6 +281,9 @@ public class PApplet implements PConstants {
* @see PApplet#get(int, int, int, int)
* @see PApplet#set(int, int, int)
* @see PImage
* @see PApplet#pixelDensity()
* @see PApplet#pixelWidth
* @see PApplet#pixelHeight
*/
public int[] pixels;
@@ -1214,7 +1217,8 @@ public class PApplet implements PConstants {
/**
* @webref environment
* @param density 1 or 2
*
* @see PApplet#pixelWidth
* @see PApplet#pixelHeight
*/
public void pixelDensity(int density) {
//println(density + " " + this.pixelDensity);
@@ -2004,6 +2008,9 @@ public class PApplet implements PConstants {
* @param height height of the display window in units of pixels
* @see PApplet#width
* @see PApplet#height
* @see PApplet#setup()
* @see PApplet#settings()
* @see PApplet#fullScreen()
*/
public void size(int width, int height) {
// Check to make sure the width/height have actually changed. It's ok to
@@ -12166,11 +12173,11 @@ public class PApplet implements PConstants {
/**
* ( begin auto-generated from square.xml )
*
* Draws a square to the screen. A square is a four-sided shape with
* every angle at ninety degrees and each side is the same length.
* By default, the first two parameters set the location of the
* upper-left corner, the third sets the width and height. The way
* these parameters are interpreted, however, may be changed with the
* Draws a square to the screen. A square is a four-sided shape with
* every angle at ninety degrees and each side is the same length.
* By default, the first two parameters set the location of the
* upper-left corner, the third sets the width and height. The way
* these parameters are interpreted, however, may be changed with the
* <b>rectMode()</b> function.
*
* ( end auto-generated )
@@ -12279,9 +12286,9 @@ public class PApplet implements PConstants {
/**
* ( begin auto-generated from circle.xml )
*
* Draws a circle to the screen. By default, the first two parameters
* set the location of the center, and the third sets the shape's width
* and height. The origin may be changed with the <b>ellipseMode()</b>
* Draws a circle to the screen. By default, the first two parameters
* set the location of the center, and the third sets the shape's width
* and height. The origin may be changed with the <b>ellipseMode()</b>
* function.
*
* ( end auto-generated )
@@ -12577,17 +12584,17 @@ public class PApplet implements PConstants {
* ( begin auto-generated from curvePoint.xml )
*
* Evalutes the curve at point t for points a, b, c, d. The parameter t
* varies between 0 and 1, a and d are points on the curve, and b and c are
* the control points. This can be done once with the x coordinates and a
* varies between 0 and 1, a and d are the control points, and b and c are
* the points on the curve. This can be done once with the x coordinates and a
* second time with the y coordinates to get the location of a curve at t.
*
* ( end auto-generated )
*
* @webref shape:curves
* @param a coordinate of first point on the curve
* @param b coordinate of second point on the curve
* @param c coordinate of third point on the curve
* @param d coordinate of fourth point on the curve
* @param a coordinate of first control point
* @param b coordinate of first point on the curve
* @param c coordinate of second point on the curve
* @param d coordinate of second control point
* @param t value between 0 and 1
* @see PGraphics#curve(float, float, float, float, float, float, float, float, float, float, float, float)
* @see PGraphics#curveVertex(float, float)
@@ -13323,28 +13330,28 @@ public class PApplet implements PConstants {
/**
* ( begin auto-generated from push.xml )
*
* The <b>push()</b> function saves the current drawing style
* settings and transformations, while <b>pop()</b> restores these
* settings. Note that these functions are always used together.
* They allow you to change the style and transformation settings
* and later return to what you had. When a new state is started
* with push(), it builds on the current style and transform
* The <b>push()</b> function saves the current drawing style
* settings and transformations, while <b>pop()</b> restores these
* settings. Note that these functions are always used together.
* They allow you to change the style and transformation settings
* and later return to what you had. When a new state is started
* with push(), it builds on the current style and transform
* information.<br />
* <br />
* <b>push()</b> stores information related to the current
* transformation state and style settings controlled by the
* following functions: <b>rotate()</b>, <b>translate()</b>,
* <b>scale()</b>, <b>fill()</b>, <b>stroke()</b>, <b>tint()</b>,
* <b>strokeWeight()</b>, <b>strokeCap()</b>, <b>strokeJoin()</b>,
* <b>imageMode()</b>, <b>rectMode()</b>, <b>ellipseMode()</b>,
* <b>colorMode()</b>, <b>textAlign()</b>, <b>textFont()</b>,
* <b>push()</b> stores information related to the current
* transformation state and style settings controlled by the
* following functions: <b>rotate()</b>, <b>translate()</b>,
* <b>scale()</b>, <b>fill()</b>, <b>stroke()</b>, <b>tint()</b>,
* <b>strokeWeight()</b>, <b>strokeCap()</b>, <b>strokeJoin()</b>,
* <b>imageMode()</b>, <b>rectMode()</b>, <b>ellipseMode()</b>,
* <b>colorMode()</b>, <b>textAlign()</b>, <b>textFont()</b>,
* <b>textMode()</b>, <b>textSize()</b>, <b>textLeading()</b>.<br />
* <br />
* The <b>push()</b> and <b>pop()</b> functions were added with
* Processing 3.5. They can be used in place of <b>pushMatrix()</b>,
* <b>popMatrix()</b>, <b>pushStyles()</b>, and <b>popStyles()</b>.
* The difference is that push() and pop() control both the
* transformations (rotate, scale, translate) and the drawing styles
* The <b>push()</b> and <b>pop()</b> functions were added with
* Processing 3.5. They can be used in place of <b>pushMatrix()</b>,
* <b>popMatrix()</b>, <b>pushStyles()</b>, and <b>popStyles()</b>.
* The difference is that push() and pop() control both the
* transformations (rotate, scale, translate) and the drawing styles
* at the same time.
*
* ( end auto-generated )
@@ -13361,28 +13368,28 @@ public class PApplet implements PConstants {
/**
* ( begin auto-generated from pop.xml )
*
* The <b>pop()</b> function restores the previous drawing style
* settings and transformations after <b>push()</b> has changed them.
* Note that these functions are always used together. They allow
* you to change the style and transformation settings and later
* return to what you had. When a new state is started with push(),
* The <b>pop()</b> function restores the previous drawing style
* settings and transformations after <b>push()</b> has changed them.
* Note that these functions are always used together. They allow
* you to change the style and transformation settings and later
* return to what you had. When a new state is started with push(),
* it builds on the current style and transform information.<br />
* <br />
* <br />
* <b>push()</b> stores information related to the current
* transformation state and style settings controlled by the
* following functions: <b>rotate()</b>, <b>translate()</b>,
* <b>scale()</b>, <b>fill()</b>, <b>stroke()</b>, <b>tint()</b>,
* <b>strokeWeight()</b>, <b>strokeCap()</b>, <b>strokeJoin()</b>,
* <b>imageMode()</b>, <b>rectMode()</b>, <b>ellipseMode()</b>,
* <b>colorMode()</b>, <b>textAlign()</b>, <b>textFont()</b>,
* <b>push()</b> stores information related to the current
* transformation state and style settings controlled by the
* following functions: <b>rotate()</b>, <b>translate()</b>,
* <b>scale()</b>, <b>fill()</b>, <b>stroke()</b>, <b>tint()</b>,
* <b>strokeWeight()</b>, <b>strokeCap()</b>, <b>strokeJoin()</b>,
* <b>imageMode()</b>, <b>rectMode()</b>, <b>ellipseMode()</b>,
* <b>colorMode()</b>, <b>textAlign()</b>, <b>textFont()</b>,
* <b>textMode()</b>, <b>textSize()</b>, <b>textLeading()</b>.<br />
* <br />
* The <b>push()</b> and <b>pop()</b> functions were added with
* Processing 3.5. They can be used in place of <b>pushMatrix()</b>,
* <b>popMatrix()</b>, <b>pushStyles()</b>, and <b>popStyles()</b>.
* The difference is that push() and pop() control both the
* transformations (rotate, scale, translate) and the drawing styles
* The <b>push()</b> and <b>pop()</b> functions were added with
* Processing 3.5. They can be used in place of <b>pushMatrix()</b>,
* <b>popMatrix()</b>, <b>pushStyles()</b>, and <b>popStyles()</b>.
* The difference is that push() and pop() control both the
* transformations (rotate, scale, translate) and the drawing styles
* at the same time.
*
* ( end auto-generated )
@@ -14859,6 +14866,8 @@ public class PApplet implements PConstants {
/**
* gray number specifying value between white and black
*
* @param gray value between black and white, by default 0 to 255
*/
public void specular(float gray) {
if (recorder != null) recorder.specular(gray);
@@ -14924,6 +14933,8 @@ public class PApplet implements PConstants {
/**
* gray number specifying value between white and black
*
* @param gray value between black and white, by default 0 to 255
*/
public void emissive(float gray) {
if (recorder != null) recorder.emissive(gray);
+53 -49
View File
@@ -2732,11 +2732,11 @@ public class PGraphics extends PImage implements PConstants {
/**
* ( begin auto-generated from square.xml )
*
* Draws a square to the screen. A square is a four-sided shape with
* every angle at ninety degrees and each side is the same length.
* By default, the first two parameters set the location of the
* upper-left corner, the third sets the width and height. The way
* these parameters are interpreted, however, may be changed with the
* Draws a square to the screen. A square is a four-sided shape with
* every angle at ninety degrees and each side is the same length.
* By default, the first two parameters set the location of the
* upper-left corner, the third sets the width and height. The way
* these parameters are interpreted, however, may be changed with the
* <b>rectMode()</b> function.
*
* ( end auto-generated )
@@ -2931,9 +2931,9 @@ public class PGraphics extends PImage implements PConstants {
/**
* ( begin auto-generated from circle.xml )
*
* Draws a circle to the screen. By default, the first two parameters
* set the location of the center, and the third sets the shape's width
* and height. The origin may be changed with the <b>ellipseMode()</b>
* Draws a circle to the screen. By default, the first two parameters
* set the location of the center, and the third sets the shape's width
* and height. The origin may be changed with the <b>ellipseMode()</b>
* function.
*
* ( end auto-generated )
@@ -3424,17 +3424,17 @@ public class PGraphics extends PImage implements PConstants {
* ( begin auto-generated from curvePoint.xml )
*
* Evalutes the curve at point t for points a, b, c, d. The parameter t
* varies between 0 and 1, a and d are points on the curve, and b and c are
* the control points. This can be done once with the x coordinates and a
* varies between 0 and 1, a and d are the control points, and b and c are
* the points on the curve. This can be done once with the x coordinates and a
* second time with the y coordinates to get the location of a curve at t.
*
* ( end auto-generated )
*
* @webref shape:curves
* @param a coordinate of first point on the curve
* @param b coordinate of second point on the curve
* @param c coordinate of third point on the curve
* @param d coordinate of fourth point on the curve
* @param a coordinate of first control point
* @param b coordinate of first point on the curve
* @param c coordinate of second point on the curve
* @param d coordinate of second control point
* @param t value between 0 and 1
* @see PGraphics#curve(float, float, float, float, float, float, float, float, float, float, float, float)
* @see PGraphics#curveVertex(float, float)
@@ -5167,28 +5167,28 @@ public class PGraphics extends PImage implements PConstants {
/**
* ( begin auto-generated from push.xml )
*
* The <b>push()</b> function saves the current drawing style
* settings and transformations, while <b>pop()</b> restores these
* settings. Note that these functions are always used together.
* They allow you to change the style and transformation settings
* and later return to what you had. When a new state is started
* with push(), it builds on the current style and transform
* The <b>push()</b> function saves the current drawing style
* settings and transformations, while <b>pop()</b> restores these
* settings. Note that these functions are always used together.
* They allow you to change the style and transformation settings
* and later return to what you had. When a new state is started
* with push(), it builds on the current style and transform
* information.<br />
* <br />
* <b>push()</b> stores information related to the current
* transformation state and style settings controlled by the
* following functions: <b>rotate()</b>, <b>translate()</b>,
* <b>scale()</b>, <b>fill()</b>, <b>stroke()</b>, <b>tint()</b>,
* <b>strokeWeight()</b>, <b>strokeCap()</b>, <b>strokeJoin()</b>,
* <b>imageMode()</b>, <b>rectMode()</b>, <b>ellipseMode()</b>,
* <b>colorMode()</b>, <b>textAlign()</b>, <b>textFont()</b>,
* <b>push()</b> stores information related to the current
* transformation state and style settings controlled by the
* following functions: <b>rotate()</b>, <b>translate()</b>,
* <b>scale()</b>, <b>fill()</b>, <b>stroke()</b>, <b>tint()</b>,
* <b>strokeWeight()</b>, <b>strokeCap()</b>, <b>strokeJoin()</b>,
* <b>imageMode()</b>, <b>rectMode()</b>, <b>ellipseMode()</b>,
* <b>colorMode()</b>, <b>textAlign()</b>, <b>textFont()</b>,
* <b>textMode()</b>, <b>textSize()</b>, <b>textLeading()</b>.<br />
* <br />
* The <b>push()</b> and <b>pop()</b> functions were added with
* Processing 3.5. They can be used in place of <b>pushMatrix()</b>,
* <b>popMatrix()</b>, <b>pushStyles()</b>, and <b>popStyles()</b>.
* The difference is that push() and pop() control both the
* transformations (rotate, scale, translate) and the drawing styles
* The <b>push()</b> and <b>pop()</b> functions were added with
* Processing 3.5. They can be used in place of <b>pushMatrix()</b>,
* <b>popMatrix()</b>, <b>pushStyles()</b>, and <b>popStyles()</b>.
* The difference is that push() and pop() control both the
* transformations (rotate, scale, translate) and the drawing styles
* at the same time.
*
* ( end auto-generated )
@@ -5204,28 +5204,28 @@ public class PGraphics extends PImage implements PConstants {
/**
* ( begin auto-generated from pop.xml )
*
* The <b>pop()</b> function restores the previous drawing style
* settings and transformations after <b>push()</b> has changed them.
* Note that these functions are always used together. They allow
* you to change the style and transformation settings and later
* return to what you had. When a new state is started with push(),
* The <b>pop()</b> function restores the previous drawing style
* settings and transformations after <b>push()</b> has changed them.
* Note that these functions are always used together. They allow
* you to change the style and transformation settings and later
* return to what you had. When a new state is started with push(),
* it builds on the current style and transform information.<br />
* <br />
* <br />
* <b>push()</b> stores information related to the current
* transformation state and style settings controlled by the
* following functions: <b>rotate()</b>, <b>translate()</b>,
* <b>scale()</b>, <b>fill()</b>, <b>stroke()</b>, <b>tint()</b>,
* <b>strokeWeight()</b>, <b>strokeCap()</b>, <b>strokeJoin()</b>,
* <b>imageMode()</b>, <b>rectMode()</b>, <b>ellipseMode()</b>,
* <b>colorMode()</b>, <b>textAlign()</b>, <b>textFont()</b>,
* <b>push()</b> stores information related to the current
* transformation state and style settings controlled by the
* following functions: <b>rotate()</b>, <b>translate()</b>,
* <b>scale()</b>, <b>fill()</b>, <b>stroke()</b>, <b>tint()</b>,
* <b>strokeWeight()</b>, <b>strokeCap()</b>, <b>strokeJoin()</b>,
* <b>imageMode()</b>, <b>rectMode()</b>, <b>ellipseMode()</b>,
* <b>colorMode()</b>, <b>textAlign()</b>, <b>textFont()</b>,
* <b>textMode()</b>, <b>textSize()</b>, <b>textLeading()</b>.<br />
* <br />
* The <b>push()</b> and <b>pop()</b> functions were added with
* Processing 3.5. They can be used in place of <b>pushMatrix()</b>,
* <b>popMatrix()</b>, <b>pushStyles()</b>, and <b>popStyles()</b>.
* The difference is that push() and pop() control both the
* transformations (rotate, scale, translate) and the drawing styles
* The <b>push()</b> and <b>pop()</b> functions were added with
* Processing 3.5. They can be used in place of <b>pushMatrix()</b>,
* <b>popMatrix()</b>, <b>pushStyles()</b>, and <b>popStyles()</b>.
* The difference is that push() and pop() control both the
* transformations (rotate, scale, translate) and the drawing styles
* at the same time.
*
* ( end auto-generated )
@@ -6940,6 +6940,8 @@ public class PGraphics extends PImage implements PConstants {
/**
* gray number specifying value between white and black
*
* @param gray value between black and white, by default 0 to 255
*/
public void specular(float gray) {
colorCalc(gray);
@@ -7017,6 +7019,8 @@ public class PGraphics extends PImage implements PConstants {
/**
* gray number specifying value between white and black
*
* @param gray value between black and white, by default 0 to 255
*/
public void emissive(float gray) {
colorCalc(gray);
+1 -7
View File
@@ -3049,13 +3049,7 @@ int testFunction(int dst, int src) {
*/
try {
byte tiff[] = new byte[768];
System.arraycopy(
TIFF_HEADER,
0,
tiff,
0,
TIFF_HEADER.length
);
System.arraycopy(TIFF_HEADER, 0, tiff, 0, TIFF_HEADER.length);
tiff[30] = (byte) ((pixelWidth >> 8) & 0xff);
tiff[31] = (byte) ((pixelWidth) & 0xff);
+10 -6
View File
@@ -2980,12 +2980,16 @@ public class PShape implements PConstants {
*/
public boolean contains(float x, float y) {
if (family == PATH) {
// apply the inverse transformation matrix to the point coordinates
PMatrix inverseCoords = matrix.get();
inverseCoords.invert(); // maybe cache this?
inverseCoords.invert(); // maybe cache this?
PVector p = new PVector();
inverseCoords.mult(new PVector(x,y),p);
PVector p = new PVector(x, y);
if (matrix != null) {
// apply the inverse transformation matrix to the point coordinates
PMatrix inverseCoords = matrix.get();
// TODO why is this called twice? [fry 190724]
// commit was https://github.com/processing/processing/commit/027fc7a4f8e8d0a435366eae754304eea282512a
inverseCoords.invert(); // maybe cache this?
inverseCoords.invert(); // maybe cache this?
inverseCoords.mult(new PVector(x, y), p);
}
// http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html
boolean c = false;
+1 -1
View File
@@ -31,7 +31,7 @@ import java.awt.*;
* We have to register a quit handler to safely shut down the sketch,
* otherwise OS X will just kill the sketch when a user hits Cmd-Q.
* In addition, we have a method to set the dock icon image so we look more
* like a native desktop.
* like a native application.
*
* This is a stripped-down version of what's in processing.app.platform to fix
* <a href="https://github.com/processing/processing/issues/3301">3301</a>.
+1 -1
View File
@@ -12,7 +12,7 @@ import processing.core.PApplet;
/**
* A simple table class to use a String as a lookup for an double value.
*
* @webref data:composite
* @nowebref
* @see IntDict
* @see StringDict
*/
+1 -1
View File
@@ -17,7 +17,7 @@ import processing.core.PApplet;
* Functions like sort() and shuffle() always act on the list itself. To get
* a sorted copy, use list.copy().sort().
*
* @webref data:composite
* @nowebref
* @see IntList
* @see StringList
*/
+1 -1
View File
@@ -22,7 +22,7 @@ import processing.core.PApplet;
* Functions like sort() and shuffle() always act on the list itself. To get
* a sorted copy, use list.copy().sort().
*
* @webref data:composite
* @nowebref
* @see FloatList
* @see StringList
*/
+2
View File
@@ -49,6 +49,8 @@ public class StringList implements Iterable<String> {
/**
* Construct a StringList from a random pile of objects. Null values will
* stay null, but all the others will be converted to String values.
*
* @nowebref
*/
public StringList(Object... items) {
count = items.length;
-150
View File
@@ -1,150 +0,0 @@
<?xml version="1.0"?>
<project name="PDE X" default="build">
<property file="build.properties" />
<!-- Figure out the platform. Needed for quick install path. -->
<condition property="platform" value="macosx">
<os family="mac" />
</condition>
<condition property="platform" value="windows">
<os family="windows" />
</condition>
<condition property="platform" value="linux">
<and>
<os family="unix" />
<not>
<os family="mac" />
</not>
</and>
</condition>
<!-- Figure out the platform-specific output directory. -->
<condition property="target.path" value="../build/macosx/work/Processing.app/Contents/Java">
<os family="mac" />
</condition>
<condition property="target.path" value="../build/linux/work">
<os family="unix" />
</condition>
<condition property="target.path" value="../build/windows/work">
<os family="windows" />
</condition>
<target name="clean" description="Clean the build directories">
<delete dir="bin" />
<delete file="mode/${lib.name}.jar" />
<!--<echo message="Platform is ${platform}." />-->
</target>
<target name="compile" description="Compile sources">
<condition property="core-built">
<available file="${core.library.path}/core.jar" />
</condition>
<fail unless="core-built" message="Please build the core library first and make sure it sits in ../core/library/core.jar" />
<mkdir dir="bin" />
<javac source="1.7"
target="1.7"
destdir="bin"
encoding="UTF-8"
debug="off"
includeAntRuntime="false"
compiler="org.eclipse.jdt.core.JDTCompilerAdapter"
classpath="${core.library.path}/core.jar;
${app.library.path}/lib/ant.jar;
${app.library.path}/lib/ant-launcher.jar;
${app.library.path}/lib/antlr-4.7.2-complete.jar;
${app.library.path}/lib/apple.jar;
${app.library.path}/lib/jna.jar;
${app.library.path}/lib/org-netbeans-swing-outline.jar;
${app.library.path}/pde.jar;
mode/jdi.jar;
mode/jdimodel.jar;
mode/com.ibm.icu_52.1.0.v201404241930.jar;
mode/org.eclipse.core.contenttype_3.4.200.v20140207-1251.jar;
mode/org.eclipse.core.jobs_3.6.0.v20140424-0053.jar;
mode/org.eclipse.core.resources_3.9.1.v20140825-1431.jar;
mode/org.eclipse.core.runtime_3.10.0.v20140318-2214.jar;
mode/org.eclipse.equinox.common_3.6.200.v20130402-1505.jar;
mode/org.eclipse.equinox.preferences_3.5.200.v20140224-1527.jar;
mode/org.eclipse.jdt.core_3.10.0.v20140902-0626.jar;
mode/org.eclipse.osgi_3.10.1.v20140909-1633.jar;
mode/org.eclipse.text_3.5.300.v20130515-1451.jar;
mode/classpath-explorer-1.0.jar;
mode/jsoup-1.7.1.jar;">
<src path="src" />
<compilerclasspath path="../java/mode/ecj.jar" />
</javac>
</target>
<target name="build" depends="compile" description="Build the 3.0 editor">
<jar basedir="bin" destfile="mode/${lib.name}.jar" />
</target>
<target name="install" depends="build" description="Install to mode folder">
<delete file="${target.path}/modes/${lib.name}/mode/${lib.name}.jar" />
<copy todir="${target.path}/modes/${lib.name}/mode">
<fileset file="mode/${lib.name}.jar" />
</copy>
</target>
<target name="package" depends="build" description="Package PDE X">
<delete dir="${dist}" />
<property name="bundle" value="${dist}/${lib.name}" />
<mkdir dir="${bundle}" />
<mkdir dir="${bundle}/mode" />
<copy todir="${bundle}/mode">
<fileset dir="mode" />
</copy>
<mkdir dir="${bundle}/src" />
<copy todir="${bundle}/src">
<fileset dir="src" />
</copy>
<mkdir dir="${bundle}/data" />
<copy todir="${bundle}/data">
<fileset dir="data" />
</copy>
<mkdir dir="${bundle}/application" />
<copy todir="${bundle}/application">
<fileset dir="application" />
</copy>
<mkdir dir="${bundle}/theme" />
<copy todir="${bundle}/theme">
<fileset dir="theme" />
</copy>
<copy todir="${bundle}">
<fileset file="keywords.txt" />
</copy>
<copy todir="${bundle}">
<fileset file="mode.properties" />
</copy>
<replaceregexp file="${bundle}/mode.properties" flags="g" match="@@version@@" replace="${release}" />
<replaceregexp file="${bundle}/mode.properties" flags="g" match="@@pretty-version@@" replace="${prettyVersion}" />
</target>
<target name="full_install" depends="package"
description="Full install to mode folder">
<delete dir="${target.path}/modes/${lib.name}" />
<copy todir="${target.path}/modes/">
<fileset dir="dist" />
</copy>
</target>
</project>