From cc2412d0a17f43259d1f1afd6b89c67cfca0a1b5 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Sat, 15 Nov 2014 23:16:53 -0700 Subject: [PATCH 1/5] release notes!!! --- build/shared/revisions.txt | 158 +++++++++++++++++++++++++++++++++++++ 1 file changed, 158 insertions(+) diff --git a/build/shared/revisions.txt b/build/shared/revisions.txt index d297af2a1..6387798ef 100644 --- a/build/shared/revisions.txt +++ b/build/shared/revisions.txt @@ -1,3 +1,161 @@ +PROCESSING 3.0a5 (REV 0232) - 16 November 2014 + +Hello from the University of Denver! This release has tons of bug fixing +and incorporating various pull requests. + + +[ changes ] + ++ Removed the sound library, it's now available as its own library + from the Library Manager. + ++ Change how languages are loaded, adding a local override. + ++ Update to use JRE/JDK 7u72 . + ++ Implement the active() method for Serial and Server + https://github.com/processing/processing/issues/2364 + https://github.com/processing/processing/pull/2588 + ++ Detect CMYK JPEG images and return null + https://community.oracle.com/thread/1272045?start=0&tstart=0 + ++ Fix XML.getString() with a default when no attrs are present at all. + It was causing a NullPointerException; this also fixes getInt(), et al. + ++ Fix how dictionary classes return '0' for missing values. Add optional + second parameter so that it's possible to avoid the exceptions. + ++ Fix how nulls are handled with Table.replace() + ++ Add (simple) ODS writer to Table + ++ Add addRows(Table) method (more efficient, one resize) + ++ Support "header" option with ODS files + + +[ bug fixes ] + ++ Remove debug message printed to the console when the control key + is pressed, when using the new editor. + ++ size(640,360 , P3D) doesn't work properly (strange spacing) + https://github.com/processing/processing/issues/2924 + https://github.com/processing/processing/pull/2925 + ++ Fix the shortcut keybindings in editor tab popup menu + https://github.com/processing/processing/issues/179 + https://github.com/processing/processing/pull/2821 + ++ Fix for ToolTipManager error + https://github.com/processing/processing/issues/2926 + ++ Confusing message: The shader doesn't have a uniform called "foo" + https://github.com/processing/processing/issues/2593 + ++ Exceptions in P3D / P2D not showing up properly + https://github.com/processing/processing/issues/2930 + + +[ contributed fixes ] + ++ Cmd + H runs sketch instead of hiding the PDE (OS X) + https://github.com/processing/processing/issues/2881 + ++ Migrate to unsynchronized data structures + https://github.com/processing/processing/pull/2863 + ++ Improve contrib manager localization + https://github.com/processing/processing/pull/2870 + ++ Fix typo in spanish translation + https://github.com/processing/processing/pull/2906 + ++ Update ECJ, use 1.7 as source and target Java version + https://github.com/processing/processing/pull/2907 + ++ Fix infinite recursion in sound library + https://github.com/processing/processing/pull/2897 + ++ Add missing generic type parameters + https://github.com/processing/processing/pull/2899 + ++ Remove unused Base.builtOnce instance variable + https://github.com/processing/processing/pull/2864 + ++ Other miscellaneous fixes + https://github.com/processing/processing/pull/2865 + ++ Moved the language stuff to its own separate folder + https://github.com/processing/processing/pull/2941 + ++ Some minor UpdateChecker refactorings + https://github.com/processing/processing/pull/2830 + ++ Minor improvements to the Contribution Manager's updates check + https://github.com/processing/processing/pull/2861 + ++ Make Cut and Copy in the edit menu active only if some text is selected + https://github.com/processing/processing/pull/2834 + ++ Fix renaming from RGB to Rgb.java and others + https://github.com/processing/processing/pull/2825 + ++ Sketches should only write to the console of their editor window + https://github.com/processing/processing/issues/153 + https://github.com/processing/processing/issues/2858 + https://github.com/processing/processing/pull/2827 + ++ Extend translations and update German language + https://github.com/processing/processing/pull/2949 + ++ NullPointerException message when Server writes to a disconnected client + https://github.com/processing/processing/issues/2577 + https://github.com/processing/processing/pull/2578 + ++ Fix check in loadShader() + https://github.com/processing/processing/pull/2867 + ++ Refined PShader uniform missing message fixes + https://github.com/processing/processing/pull/2869 + ++ Use correct parameter types in FloatList methods + https://github.com/processing/processing/pull/2902 + ++ Pass correct offset to glCopyTexSubImage2D + https://github.com/processing/processing/pull/2898 + ++ beginShape(POINTS) not working for PShape + https://github.com/processing/processing/issues/2912 + https://github.com/processing/processing/pull/2915 + ++ Multiple blending fixes & improvements + https://github.com/processing/processing/pull/2921 + https://github.com/processing/processing/issues/2807 + https://github.com/processing/processing/issues/1224 + https://github.com/processing/processing/pull/2601 + https://github.com/processing/processing/issues/1844 + ++ Prevent lerpColor from always rounding down + https://github.com/processing/processing/issues/2812 + https://github.com/processing/processing/pull/2813 + ++ Allow mask() with PGraphicsJava2D + https://github.com/processing/processing/pull/2910 + ++ OpenGL renderers ignore vertex winding in contours + https://github.com/processing/processing/issues/2665 + https://github.com/processing/processing/pull/2927 + ++ NPE when calling Client.ip() after the connection has been closed + https://github.com/processing/processing/issues/2576 + https://github.com/processing/processing/pull/2922 + + +. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + + PROCESSING 3.0a4 (REV 0231) - 12 September 2014 Another release to deal with a handful of bugs found in the last alpha. From ffdfb2a400058db8012c2ccd8c51a83abd3755bf Mon Sep 17 00:00:00 2001 From: Jakub Valtar Date: Sun, 16 Nov 2014 14:15:13 +0100 Subject: [PATCH 2/5] Highlighting of keywords with parens, fixes #2099 --- .../processing/app/syntax/PdeKeywords.java | 21 ++++++++++++++----- .../app/syntax/PdeTextAreaDefaults.java | 1 + app/src/processing/app/syntax/Token.java | 15 +++++++------ build/shared/lib/defaults.txt | 1 + java/keywords.txt | 18 +++++++++------- pdex/keywords.txt | 18 +++++++++------- 6 files changed, 49 insertions(+), 25 deletions(-) diff --git a/app/src/processing/app/syntax/PdeKeywords.java b/app/src/processing/app/syntax/PdeKeywords.java index 8d8b60b23..c726a19b8 100644 --- a/app/src/processing/app/syntax/PdeKeywords.java +++ b/app/src/processing/app/syntax/PdeKeywords.java @@ -50,13 +50,24 @@ public class PdeKeywords extends TokenMarker { int num = coloring.charAt(coloring.length() - 1) - '1'; // byte id = (byte) ((isKey ? Token.KEYWORD1 : Token.LITERAL1) + num); int id = 0; - boolean paren = false; switch (coloring.charAt(0)) { - case 'K': id = Token.KEYWORD1 + num; break; - case 'L': id = Token.LITERAL1 + num; break; - case 'F': id = Token.FUNCTION1 + num; paren = true; break; + case 'K': + id = Token.KEYWORD1 + num; + keywordColoring.add(keyword, (byte) id, false); + if (id == Token.KEYWORD6) { + // these can be followed by parens + keywordColoring.add(keyword, (byte) id, true); + } + break; + case 'L': + id = Token.LITERAL1 + num; + keywordColoring.add(keyword, (byte) id, false); + break; + case 'F': + id = Token.FUNCTION1 + num; + keywordColoring.add(keyword, (byte) id, true); + break; } - keywordColoring.add(keyword, (byte) id, paren); } diff --git a/app/src/processing/app/syntax/PdeTextAreaDefaults.java b/app/src/processing/app/syntax/PdeTextAreaDefaults.java index 33427f864..e375881ed 100644 --- a/app/src/processing/app/syntax/PdeTextAreaDefaults.java +++ b/app/src/processing/app/syntax/PdeTextAreaDefaults.java @@ -215,6 +215,7 @@ public class PdeTextAreaDefaults extends TextAreaDefaults { styles[Token.KEYWORD3] = mode.getStyle("keyword3"); styles[Token.KEYWORD4] = mode.getStyle("keyword4"); styles[Token.KEYWORD5] = mode.getStyle("keyword5"); + styles[Token.KEYWORD6] = mode.getStyle("keyword6"); styles[Token.FUNCTION1] = mode.getStyle("function1"); styles[Token.FUNCTION2] = mode.getStyle("function2"); diff --git a/app/src/processing/app/syntax/Token.java b/app/src/processing/app/syntax/Token.java index e037e55f7..0083ff3df 100644 --- a/app/src/processing/app/syntax/Token.java +++ b/app/src/processing/app/syntax/Token.java @@ -56,32 +56,35 @@ public class Token { /** Datatypes (int, boolean, etc.) */ public static final byte KEYWORD5 = 10; + + /** Keywords which can be followed by parenthesis */ + public static final byte KEYWORD6 = 11; /** Functions */ - public static final byte FUNCTION1 = 11; + public static final byte FUNCTION1 = 12; /** Methods (functions inside a class) */ - public static final byte FUNCTION2 = 12; + public static final byte FUNCTION2 = 13; /** Loop/function-like blocks (for, while, etc.) */ - public static final byte FUNCTION3 = 13; + public static final byte FUNCTION3 = 14; /** Built-in Processing functions (setup, draw, mouseDragged). */ - public static final byte FUNCTION4 = 14; + public static final byte FUNCTION4 = 15; /** * Operator token id. This can be used to mark an * operator. (eg, SQL mode marks +, -, etc with this * token type) */ - public static final byte OPERATOR = 15; + public static final byte OPERATOR = 16; /** * Invalid token id. This can be used to mark invalid * or incomplete tokens, so the user can easily spot * syntax errors. */ - public static final byte INVALID = 16; + public static final byte INVALID = 17; /** The total number of defined token ids. */ public static final byte ID_COUNT = INVALID + 1; diff --git a/build/shared/lib/defaults.txt b/build/shared/lib/defaults.txt index 5b8928628..d8ae69110 100644 --- a/build/shared/lib/defaults.txt +++ b/build/shared/lib/defaults.txt @@ -248,6 +248,7 @@ editor.token.keyword2.style = #33997e,plain editor.token.keyword3.style = #669900,plain editor.token.keyword4.style = #d94a7a,plain editor.token.keyword5.style = #e2661a,plain +editor.token.keyword6.style = #33997e,plain editor.token.literal1.style = #7D4793,plain editor.token.literal2.style = #718a62,plain diff --git a/java/keywords.txt b/java/keywords.txt index 31a83fb22..a47253175 100644 --- a/java/keywords.txt +++ b/java/keywords.txt @@ -180,9 +180,7 @@ WHITESPACE LITERAL2 # Java keywords (void, import, , etc.) abstract KEYWORD1 -assert KEYWORD1 break KEYWORD1 break -case KEYWORD1 case class KEYWORD1 class continue KEYWORD1 continue default KEYWORD1 default @@ -202,12 +200,8 @@ package KEYWORD1 private KEYWORD1 private protected KEYWORD1 public KEYWORD1 public -return KEYWORD1 return static KEYWORD1 static -strictfp KEYWORD1 -super KEYWORD1 super -this KEYWORD1 this -throw KEYWORD1 +strictfp KEYWORD1 throws KEYWORD1 transient KEYWORD1 true KEYWORD1 true @@ -215,6 +209,16 @@ void KEYWORD1 void volatile KEYWORD1 +# Java keywords which can be followed by a parenthesis + +assert KEYWORD6 +case KEYWORD6 case +return KEYWORD6 return +super KEYWORD6 super +this KEYWORD6 this +throw KEYWORD6 + + # Datatypes Array KEYWORD5 Array diff --git a/pdex/keywords.txt b/pdex/keywords.txt index a7f20baa2..c7fe84e88 100644 --- a/pdex/keywords.txt +++ b/pdex/keywords.txt @@ -180,9 +180,7 @@ WHITESPACE LITERAL2 # Java keywords (void, import, , etc.) abstract KEYWORD1 -assert KEYWORD1 break KEYWORD1 break -case KEYWORD1 case class KEYWORD1 class continue KEYWORD1 continue default KEYWORD1 default @@ -202,12 +200,8 @@ package KEYWORD1 private KEYWORD1 private protected KEYWORD1 public KEYWORD1 public -return KEYWORD1 return static KEYWORD1 static -strictfp KEYWORD1 -super KEYWORD1 super -this KEYWORD1 this -throw KEYWORD1 +strictfp KEYWORD1 throws KEYWORD1 transient KEYWORD1 true KEYWORD1 true @@ -215,6 +209,16 @@ void KEYWORD1 void volatile KEYWORD1 +# Java keywords which can be followed by a parenthesis + +assert KEYWORD6 +case KEYWORD6 case +return KEYWORD6 return +super KEYWORD6 super +this KEYWORD6 this +throw KEYWORD6 + + # Datatypes Array KEYWORD5 Array From 6f803fecfda48019dca3b011949d399f3d7fea3c Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Sun, 16 Nov 2014 09:45:52 -0700 Subject: [PATCH 3/5] note about the keyword fix --- todo.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/todo.txt b/todo.txt index 5cb26bcc6..20b1988eb 100644 --- a/todo.txt +++ b/todo.txt @@ -14,9 +14,10 @@ X add local override (needs documentation) X figure out copyDir() problems before pull o moving window to a new location is broken due to the pull X update to use new 7u72 version of JRE (and JDK) stuff - -manindra -X ToolTipManager error +X `return` keyword not treated as such when followed by a bracket +X https://github.com/processing/processing/issues/2099 +X https://github.com/processing/processing/pull/2958 +X ToolTipManager error fix from Manindra X https://github.com/processing/processing/issues/2926 pulls @@ -114,8 +115,6 @@ _ https://github.com/processing/processing/issues/1898 help me -_ `return` keyword not treated as such when followed by a bracket -_ https://github.com/processing/processing/issues/2099 _ IllegalArgumentException when clicking between editor windows _ https://github.com/processing/processing/issues/2530 _ "String index out of range" error From c53c82771e9a9b5415804125b5f0c02c7663c59e Mon Sep 17 00:00:00 2001 From: Manindra Moharana Date: Sun, 16 Nov 2014 10:07:06 -0700 Subject: [PATCH 4/5] fixed completion offset bug, grey color disabled for now --- .../processing/mode/experimental/ASTGenerator.java | 11 ++++++----- .../mode/experimental/CompletionCandidate.java | 4 ++++ .../mode/experimental/ErrorCheckerService.java | 4 ---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/pdex/src/processing/mode/experimental/ASTGenerator.java b/pdex/src/processing/mode/experimental/ASTGenerator.java index 23d37464e..3df3e7f8e 100644 --- a/pdex/src/processing/mode/experimental/ASTGenerator.java +++ b/pdex/src/processing/mode/experimental/ASTGenerator.java @@ -988,10 +988,9 @@ public class ASTGenerator { continue; matchedClass = matchedClass.substring(d + 1); //class name - candidates.add(new CompletionCandidate(matchedClass, "" - + matchedClass + " : " + "" - + matchedClass2.substring(0, d) + "", matchedClass - + "", CompletionCandidate.PREDEF_CLASS)); // display package name in grey + candidates.add(new CompletionCandidate(matchedClass, + matchedClass + " : " + + matchedClass2.substring(0, d) , matchedClass, CompletionCandidate.PREDEF_CLASS)); // display package name in grey //log("-> " + className); } } @@ -1082,8 +1081,10 @@ public class ASTGenerator { || candidates.get(i).getType() == CompletionCandidate.PREDEF_METHOD) { CompletionCandidate cc = candidates.get(i - 1); String label = cc.getLabel(); + log(label); int x = label.lastIndexOf(')'); - cc.setLabel(cc.getElementName() + "(...)" + label.substring(x + 1)); + cc.setLabel((cc.getLabel().contains("") ? "" : "") + + cc.getElementName() + "(...)" + label.substring(x + 1)); cc.setCompletionString(cc.getElementName() + "("); ignoredSome = true; continue; diff --git a/pdex/src/processing/mode/experimental/CompletionCandidate.java b/pdex/src/processing/mode/experimental/CompletionCandidate.java index ae889b0c4..fe1a292ab 100644 --- a/pdex/src/processing/mode/experimental/CompletionCandidate.java +++ b/pdex/src/processing/mode/experimental/CompletionCandidate.java @@ -117,6 +117,10 @@ public class CompletionCandidate implements Comparable{ f.getDeclaringClass().getName(); elementName = f.getName(); type = PREDEF_FIELD; +// "" +// + matchedClass + " : " + "" +// + matchedClass2.substring(0, d) + "", matchedClass +// + "" label = f.getName() + " : " + f.getType().getSimpleName() + " - " + f.getDeclaringClass().getSimpleName(); completionString = elementName; diff --git a/pdex/src/processing/mode/experimental/ErrorCheckerService.java b/pdex/src/processing/mode/experimental/ErrorCheckerService.java index 753f8066a..a1fea5ffc 100644 --- a/pdex/src/processing/mode/experimental/ErrorCheckerService.java +++ b/pdex/src/processing/mode/experimental/ErrorCheckerService.java @@ -1017,10 +1017,6 @@ public class ErrorCheckerService implements Runnable{ //astGenerator.suggestImports(missingClass); String[] si = astGenerator.getSuggestImports(missingClass); if(si != null && si.length > 0){ -// log("Suggested imps"); -// for (int j = 0; j < si.length; j++) { -// log(si[j]); -// } p.setImportSuggestions(si); errorData[i][0] = "" + problemsList.get(i).getMessage() From 60ec10bf53fc3d45231d0fb744bb184a43b67881 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Sun, 16 Nov 2014 10:12:31 -0700 Subject: [PATCH 5/5] fix is3D/set3D mixup, add getVertexCount() warning --- build/shared/revisions.txt | 12 ++++++++++-- core/src/processing/core/PGraphicsJava2D.java | 4 ++-- core/src/processing/core/PShape.java | 11 ++++++++++- core/src/processing/opengl/PGraphics2D.java | 4 ++-- core/src/processing/opengl/PGraphics3D.java | 4 ++-- core/todo.txt | 4 ++++ 6 files changed, 30 insertions(+), 9 deletions(-) diff --git a/build/shared/revisions.txt b/build/shared/revisions.txt index 6387798ef..28d565493 100644 --- a/build/shared/revisions.txt +++ b/build/shared/revisions.txt @@ -6,12 +6,12 @@ and incorporating various pull requests. [ changes ] -+ Removed the sound library, it's now available as its own library ++ Removed the sound library. It's now available as its own library from the Library Manager. + Change how languages are loaded, adding a local override. -+ Update to use JRE/JDK 7u72 . ++ Update to use JRE/JDK 7u72 + Implement the active() method for Serial and Server https://github.com/processing/processing/issues/2364 @@ -34,6 +34,10 @@ and incorporating various pull requests. + Support "header" option with ODS files ++ Show a warning when calling getVertexCount() on GROUP or PRIMITIVE shapes + https://github.com/processing/processing/issues/2873 + https://github.com/processing/processing-docs/issues/167 + [ bug fixes ] @@ -152,6 +156,10 @@ and incorporating various pull requests. https://github.com/processing/processing/issues/2576 https://github.com/processing/processing/pull/2922 ++ 'return' keyword not treated as such when followed by a bracket + https://github.com/processing/processing/issues/2099 + https://github.com/processing/processing/pull/2958 + . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . diff --git a/core/src/processing/core/PGraphicsJava2D.java b/core/src/processing/core/PGraphicsJava2D.java index 4c7fb35e8..0bef72841 100644 --- a/core/src/processing/core/PGraphicsJava2D.java +++ b/core/src/processing/core/PGraphicsJava2D.java @@ -513,7 +513,7 @@ public class PGraphicsJava2D extends PGraphics { } else if (type == PShape.GEOMETRY) { shape = new PShape(pg, PShape.GEOMETRY); } - shape.is3D(false); + shape.set3D(false); return shape; } @@ -584,7 +584,7 @@ public class PGraphicsJava2D extends PGraphics { shape.setParams(p); } - shape.is3D(false); + shape.set3D(false); return shape; } diff --git a/core/src/processing/core/PShape.java b/core/src/processing/core/PShape.java index 9aae40799..a51275c59 100644 --- a/core/src/processing/core/PShape.java +++ b/core/src/processing/core/PShape.java @@ -112,6 +112,9 @@ public class PShape implements PConstants { public static final String NO_SUCH_VERTEX_ERROR = "%1$s vertex index does not exist"; + static public final String NO_VERTICES_ERROR = + "getVertexCount() only works with PATH or GEOMETRY shapes"; + // boundary box of this shape //protected float x; //protected float y; @@ -539,7 +542,7 @@ public class PShape implements PConstants { } - public void is3D(boolean val) { + public void set3D(boolean val) { is3D = val; } @@ -2051,6 +2054,9 @@ public class PShape implements PConstants { * @see PShape#setVertex(int, float, float) */ public int getVertexCount() { + if (family == GROUP || family == PRIMITIVE) { + PGraphics.showWarning(NO_VERTICES_ERROR); + } return vertexCount; } @@ -2100,6 +2106,7 @@ public class PShape implements PConstants { return vertices[index][Z]; } + /** * @webref pshape:method * @brief Sets the vertex at the index position @@ -2119,6 +2126,7 @@ public class PShape implements PConstants { vertices[index][Y] = y; } + /** * @param z the z value for the vertex */ @@ -2133,6 +2141,7 @@ public class PShape implements PConstants { vertices[index][Z] = z; } + /** * @param vec the PVector to define the x, y, z coordinates */ diff --git a/core/src/processing/opengl/PGraphics2D.java b/core/src/processing/opengl/PGraphics2D.java index b3fc4e890..1812c111e 100644 --- a/core/src/processing/opengl/PGraphics2D.java +++ b/core/src/processing/opengl/PGraphics2D.java @@ -308,7 +308,7 @@ public class PGraphics2D extends PGraphicsOpenGL { } else if (type == PShape.GEOMETRY) { shape = new PShapeOpenGL(pg, PShape.GEOMETRY); } - shape.is3D(false); + shape.set3D(false); return shape; } @@ -379,7 +379,7 @@ public class PGraphics2D extends PGraphicsOpenGL { shape.setParams(p); } - shape.is3D(false); + shape.set3D(false); return shape; } diff --git a/core/src/processing/opengl/PGraphics3D.java b/core/src/processing/opengl/PGraphics3D.java index 77edcc9f0..c37941c78 100644 --- a/core/src/processing/opengl/PGraphics3D.java +++ b/core/src/processing/opengl/PGraphics3D.java @@ -191,7 +191,7 @@ public class PGraphics3D extends PGraphicsOpenGL { } else if (type == PShape.GEOMETRY) { shape = new PShapeOpenGL(pg, PShape.GEOMETRY); } - shape.is3D(true); + shape.set3D(true); return shape; } @@ -272,7 +272,7 @@ public class PGraphics3D extends PGraphicsOpenGL { shape.setParams(p); } - shape.is3D(true); + shape.set3D(true); return shape; } } \ No newline at end of file diff --git a/core/todo.txt b/core/todo.txt index 3f4072f98..7074d7c9f 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -1,6 +1,10 @@ 0232 core (3.0a5) X detect CMYK JPEG images and return null X https://community.oracle.com/thread/1272045?start=0&tstart=0 +X show a warning when calling getVertexCount() on GROUP or PRIMITIVE shapes +X https://github.com/processing/processing/issues/2873 +X https://github.com/processing/processing-docs/issues/167 +X replace is3D(boolean) with set3D() data X fix XML.getString() with a default when no attrs are present at all