| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -82,6 +82,9 @@ editor.brackethighlight.color = #006699 | |||
| 82 | 82 | ||
| 83 | 83 | # TEXT - syntax highlighting | |
| 84 | 84 | ||
| 85 | + editor.function1.style = #627516,plain | ||
| 86 | + editor.function2.style = #627516,bold | ||
| 87 | + | ||
| 85 | 88 | # e.g abstract, final, private | |
| 86 | 89 | editor.keyword1.style = #627516,plain | |
| 87 | 90 | # e.g. beginShape, point, line | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -76,7 +76,7 @@ public byte lookup(Segment text, int offset, int length, boolean paren) { | |||
| 76 | 76 | // continue; | |
| 77 | 77 | // } | |
| 78 | 78 | if (length == k.keyword.length) { | |
| 79 | - if (SyntaxUtilities.regionMatches(ignoreCase,text,offset, k.keyword)) { | ||
| 79 | + if (SyntaxUtilities.regionMatches(ignoreCase, text, offset, k.keyword)) { | ||
| 80 | 80 | return k.id; | |
| 81 | 81 | } | |
| 82 | 82 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -48,14 +48,17 @@ public void addColoring(String keyword, String coloring) { | |||
| 48 | 48 | if (keywordColoring == null) { | |
| 49 | 49 | keywordColoring = new KeywordMap(false); | |
| 50 | 50 | } | |
| 51 | - // text will be KEYWORD or LITERAL | ||
| 52 | - boolean isKey = (coloring.charAt(0) == 'K'); | ||
| 53 | 51 | // KEYWORD1 -> 0, KEYWORD2 -> 1, etc | |
| 54 | 52 | int num = coloring.charAt(coloring.length() - 1) - '1'; | |
| 55 | - byte id = (byte) ((isKey ? Token.KEYWORD1 : Token.LITERAL1) + num); | ||
| 56 | - // Making an assumption (..., you, me) that KEYWORD2 and KEYWORD3 | ||
| 57 | - // are the functions (at least that's what we're doing in P5 right now) | ||
| 58 | - keywordColoring.add(keyword, id, id == Token.KEYWORD2 || id == Token.KEYWORD3); | ||
| 53 | + // byte id = (byte) ((isKey ? Token.KEYWORD1 : Token.LITERAL1) + num); | ||
| 54 | + int id = 0; | ||
| 55 | + boolean paren = false; | ||
| 56 | + switch (coloring.charAt(0)) { | ||
| 57 | + case 'K': id = Token.KEYWORD1 + num; break; | ||
| 58 | + case 'L': id = Token.LITERAL1 + num; break; | ||
| 59 | + case 'F': id = Token.FUNCTION1 + num; paren = true; break; | ||
| 60 | + } | ||
| 61 | + keywordColoring.add(keyword, (byte) id, paren); | ||
| 59 | 62 | } | |
| 60 | 63 | ||
| 61 | 64 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -212,6 +212,12 @@ public PdeTextAreaDefaults(Mode theme) { | |||
| 212 | 212 | // byte, char, short, color | |
| 213 | 213 | styles[Token.KEYWORD3] = theme.getStyle("keyword3"); | |
| 214 | 214 | ||
| 215 | + // beginShape, point, line | ||
| 216 | + styles[Token.FUNCTION1] = theme.getStyle("function1"); | ||
| 217 | + | ||
| 218 | + // byte, char, short, color | ||
| 219 | + styles[Token.FUNCTION2] = theme.getStyle("function2"); | ||
| 220 | + | ||
| 215 | 221 | // constants: null, true, this, RGB, TWO_PI | |
| 216 | 222 | styles[Token.LITERAL1] = theme.getStyle("literal1"); | |
| 217 | 223 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,8 +20,8 @@ | |||
| 20 | 20 | * @author Slava Pestov | |
| 21 | 21 | * @version $Id$ | |
| 22 | 22 | */ | |
| 23 | - public class SyntaxUtilities | ||
| 24 | - { | ||
| 23 | + public class SyntaxUtilities { | ||
| 24 | + | ||
| 25 | 25 | /** | |
| 26 | 26 | * Checks if a subregion of a <code>Segment</code> is equal to a | |
| 27 | 27 | * string. | |
@@ -31,8 +31,7 @@ public class SyntaxUtilities | |||
| 31 | 31 | * @param match The string to match | |
| 32 | 32 | */ | |
| 33 | 33 | public static boolean regionMatches(boolean ignoreCase, Segment text, | |
| 34 | - int offset, String match) | ||
| 35 | - { | ||
| 34 | + int offset, String match) { | ||
| 36 | 35 | int length = offset + match.length(); | |
| 37 | 36 | char[] textArray = text.array; | |
| 38 | 37 | if(length > text.offset + text.count) | |
@@ -62,8 +61,7 @@ public static boolean regionMatches(boolean ignoreCase, Segment text, | |||
| 62 | 61 | * @param match The character array to match | |
| 63 | 62 | */ | |
| 64 | 63 | public static boolean regionMatches(boolean ignoreCase, Segment text, | |
| 65 | - int offset, char[] match) | ||
| 66 | - { | ||
| 64 | + int offset, char[] match) { | ||
| 67 | 65 | int length = offset + match.length; | |
| 68 | 66 | char[] textArray = text.array; | |
| 69 | 67 | if(length > text.offset + text.count) | |
@@ -84,28 +82,29 @@ public static boolean regionMatches(boolean ignoreCase, Segment text, | |||
| 84 | 82 | } | |
| 85 | 83 | ||
| 86 | 84 | ||
| 87 | - /** | ||
| 88 | - * Returns the default style table. This can be passed to the | ||
| 89 | - * <code>setStyles()</code> method of <code>SyntaxDocument</code> | ||
| 90 | - * to use the default syntax styles. | ||
| 91 | - */ | ||
| 92 | - public static SyntaxStyle[] getDefaultSyntaxStyles() | ||
| 93 | - { | ||
| 94 | - SyntaxStyle[] styles = new SyntaxStyle[Token.ID_COUNT]; | ||
| 95 | - | ||
| 96 | - styles[Token.COMMENT1] = new SyntaxStyle(Color.black,true,false); | ||
| 97 | - styles[Token.COMMENT2] = new SyntaxStyle(new Color(0x990033),true,false); | ||
| 98 | - styles[Token.KEYWORD1] = new SyntaxStyle(Color.black,false,true); | ||
| 99 | - styles[Token.KEYWORD2] = new SyntaxStyle(Color.magenta,false,false); | ||
| 100 | - styles[Token.KEYWORD3] = new SyntaxStyle(new Color(0x009600),false,false); | ||
| 101 | - styles[Token.LITERAL1] = new SyntaxStyle(new Color(0x650099),false,false); | ||
| 102 | - styles[Token.LITERAL2] = new SyntaxStyle(new Color(0x650099),false,true); | ||
| 103 | - styles[Token.LABEL] = new SyntaxStyle(new Color(0x990033),false,true); | ||
| 104 | - styles[Token.OPERATOR] = new SyntaxStyle(Color.black,false,true); | ||
| 105 | - styles[Token.INVALID] = new SyntaxStyle(Color.red,false,true); | ||
| 106 | - | ||
| 107 | - return styles; | ||
| 108 | - } | ||
| 85 | + // /** | ||
| 86 | + // * Returns the default style table. This can be passed to the | ||
| 87 | + // * <code>setStyles()</code> method of <code>SyntaxDocument</code> | ||
| 88 | + // * to use the default syntax styles. | ||
| 89 | + // */ | ||
| 90 | + // public static SyntaxStyle[] getDefaultSyntaxStyles() { | ||
| 91 | + // SyntaxStyle[] styles = new SyntaxStyle[Token.ID_COUNT]; | ||
| 92 | + // | ||
| 93 | + // styles[Token.COMMENT1] = new SyntaxStyle(Color.black,true,false); | ||
| 94 | + // styles[Token.COMMENT2] = new SyntaxStyle(new Color(0x990033),true,false); | ||
| 95 | + // styles[Token.KEYWORD1] = new SyntaxStyle(Color.black,false,true); | ||
| 96 | + // styles[Token.KEYWORD2] = new SyntaxStyle(Color.magenta,false,false); | ||
| 97 | + // styles[Token.KEYWORD3] = new SyntaxStyle(new Color(0x009600),false,false); | ||
| 98 | + // styles[Token.FUNCTION1] = new SyntaxStyle(Color.magenta,false,false); | ||
| 99 | + // styles[Token.FUNCTION2] = new SyntaxStyle(new Color(0x009600),false,false); | ||
| 100 | + // styles[Token.LITERAL1] = new SyntaxStyle(new Color(0x650099),false,false); | ||
| 101 | + // styles[Token.LITERAL2] = new SyntaxStyle(new Color(0x650099),false,true); | ||
| 102 | + // styles[Token.LABEL] = new SyntaxStyle(new Color(0x990033),false,true); | ||
| 103 | + // styles[Token.OPERATOR] = new SyntaxStyle(Color.black,false,true); | ||
| 104 | + // styles[Token.INVALID] = new SyntaxStyle(Color.red,false,true); | ||
| 105 | + // | ||
| 106 | + // return styles; | ||
| 107 | + // } | ||
| 109 | 108 | ||
| 110 | 109 | ||
| 111 | 110 | /** | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -76,9 +76,9 @@ public class Token | |||
| 76 | 76 | */ | |
| 77 | 77 | public static final byte KEYWORD3 = 8; | |
| 78 | 78 | ||
| 79 | - public static final byte KEYWORD4 = 9; | ||
| 79 | + public static final byte FUNCTION1 = 9; | ||
| 80 | 80 | ||
| 81 | - public static final byte KEYWORD5 = 10; | ||
| 81 | + public static final byte FUNCTION2 = 10; | ||
| 82 | 82 | ||
| 83 | 83 | /** | |
| 84 | 84 | * Operator token id. This can be used to mark an | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -88,8 +88,8 @@ PROCESSING 2.0b7 (REV 0215) - 25 November 2012 | |||
| 88 | 88 | + mousePressed() coloring now different from mousePressed | |
| 89 | 89 | http://code.google.com/p/processing/issues/detail?id=41 | |
| 90 | 90 | Still not necessarily perfect, but it's a big improvement. | |
| 91 | - Note for people implementing their own Modes: KEYWORD2 and | ||
| 92 | - KEYWORD3 are now reserved for functions with parens. | ||
| 91 | + Note for people implementing their own Modes: FUNCTION1 and | ||
| 92 | + FUNCTION2 have now been added for functions with parens. | ||
| 93 | 93 | ||
| 94 | 94 | + Fix ugly results from resize() command on PImage: | |
| 95 | 95 | http://code.google.com/p/processing/issues/detail?id=332 | |
@@ -102,7 +102,7 @@ PROCESSING 2.0b7 (REV 0215) - 25 November 2012 | |||
| 102 | 102 | + image(pgraphics, x, y, w, h) was only drawing once when shrinking. | |
| 103 | 103 | http://code.google.com/p/processing/issues/detail?id=1382 | |
| 104 | 104 | ||
| 105 | - + beginShape(QUAD) was not working with Java2D | ||
| 105 | + + beginShape(QUAD) was not working with Java2D. | ||
| 106 | 106 | http://code.google.com/p/processing/issues/detail?id=1365 | |
| 107 | 107 | ||
| 108 | 108 | + Relative coordinates not updated properly on closepath with SVG files. | |
@@ -179,6 +179,12 @@ PROCESSING 2.0b7 (REV 0215) - 25 November 2012 | |||
| 179 | 179 | + Resizeable frame crashes sketch with AMD video card. | |
| 180 | 180 | http://code.google.com/p/processing/issues/detail?id=1175 | |
| 181 | 181 | ||
| 182 | + + set(x, y, PImage) doesn't work with P2D/P3D. | ||
| 183 | + http://code.google.com/p/processing/issues/detail?id=1185 | ||
| 184 | + | ||
| 185 | + + begin/endShape with a single vertex causing crash on P2D/P3D. | ||
| 186 | + http://code.google.com/p/processing/issues/detail?id=1421 | ||
| 187 | + | ||
| 182 | 188 | [ android ] | |
| 183 | 189 | ||
| 184 | 190 | + Like the desktop release, removed default imports. This includes: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -74,6 +74,10 @@ A ortho() displays strange line widths | |||
| 74 | 74 | A http://code.google.com/p/processing/issues/detail?id=1285 | |
| 75 | 75 | A resizeable frame crashes sketch with AMD video card | |
| 76 | 76 | A http://code.google.com/p/processing/issues/detail?id=1175 | |
| 77 | + A set(x, y, PImage) doesn't work with P2D/P3D | ||
| 78 | + A http://code.google.com/p/processing/issues/detail?id=1185 | ||
| 79 | + A Processing 2.0b6 p2d / p3d arraylist pvector display issues | ||
| 80 | + A http://code.google.com/p/processing/issues/detail?id=1421 | ||
| 77 | 81 | ||
| 78 | 82 | _ implement mousePressed(Event) etc | |
| 79 | 83 | _ better to do this instead of bringing back the magic event | |
| Back | FazBrowse Home | New Git URL |
0 commit comments