Skip to content

Commit f738716

Browse files
committed
Adjustments for keywords
1 parent 36f192d commit f738716

7 files changed

Lines changed: 145 additions & 99 deletions

File tree

content/api_en/arc.xml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,31 @@ arc(50, 55, 80, 80, PI+QUARTER_PI, TWO_PI);
1515
]]></code>
1616
</example>
1717

18+
<example>
19+
<image>arc_2.png</image>
20+
<code><![CDATA[
21+
arc(50, 50, 80, 80, 0, PI+QUARTER_PI, OPEN);
22+
]]></code>
23+
</example>
24+
25+
<example>
26+
<image>arc_3.png</image>
27+
<code><![CDATA[
28+
arc(50, 50, 80, 80, 0, PI+QUARTER_PI, CHORD);
29+
]]></code>
30+
</example>
31+
32+
<example>
33+
<image>arc_4.png</image>
34+
<code><![CDATA[
35+
arc(50, 50, 80, 80, 0, PI+QUARTER_PI, PIE);
36+
]]></code>
37+
</example>
38+
1839
<description><![CDATA[
19-
Draws an arc to the screen. Arcs are drawn along the outer edge of an ellipse defined by the <b>a</b>, <b>b</b>, <b>c</b>, and <b>d</b> parameters. The origin of the arc's ellipse may be changed with the <b>ellipseMode()</b> function. Use the <b>start</b> and <b>stop</b> parameters to specify the angles (in radians) at which to draw the arc.
40+
Draws an arc to the screen. Arcs are drawn along the outer edge of an ellipse defined by the <b>a</b>, <b>b</b>, <b>c</b>, and <b>d</b> parameters. The origin of the arc's ellipse may be changed with the <b>ellipseMode()</b> function. Use the <b>start</b> and <b>stop</b> parameters to specify the angles (in radians) at which to draw the arc.<br />
41+
<br />
42+
There are three ways to draw an arc; the rendering technique used is defined by the optional seventh paramter. The default mode is OPEN, and the other options are CHORD and PIE. Each is shown in the above examples.
2043
]]></description>
2144

2245
</root>

content/api_media/arc_2.png

1.68 KB
Loading

content/api_media/arc_3.png

1.93 KB
Loading

content/api_media/arc_4.png

1.56 KB
Loading

generate/keywords_base.txt

Lines changed: 57 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# KEY
1+
# KEY 2.0b7+
22

3-
# LITERAL2 - constants
4-
# KEYWORD1 - Java datatypes and keywords
5-
# KEYWORD2 - functions
6-
# KEYWORD3 - methods (functions inside a class)
7-
# KEYWORD4 - fields (variables inside a class)
8-
# KEYWORD5 - Processing variables (width, height, focused, etc.)
3+
# LITERAL2 - Constants (QUARTER_PI, CORNERS, etc.)
4+
# KEYWORD1 - Java datatypes and keywords (void, int, boolean, etc.)
5+
# KEYWORD2 - Fields [variables within a class]
6+
# KEYWORD3 - Processing variables (width, height, focused, etc.)
7+
# FUNCTION1 - Functions
8+
# FUNCTION2 - Methods (functions inside a class)
99

1010
#
1111

12-
# LITERAL2 specifies constants
12+
# LITERAL2 - Constants (QUARTER_PI, CORNERS, etc.)
1313

1414
ADD LITERAL2 blend_
1515
ALIGN_CENTER LITERAL2
@@ -31,6 +31,7 @@ BOTTOM LITERAL2 textAlign_
3131
BURN LITERAL2 blend_
3232
CENTER LITERAL2
3333
CHATTER LITERAL2
34+
CHORD LITERAL2
3435
CLAMP LITERAL2
3536
CLICK LITERAL2
3637
CLOSE LITERAL2
@@ -125,6 +126,7 @@ P2D LITERAL2 size_
125126
P3D LITERAL2 size_
126127
PERSPECTIVE LITERAL2
127128
PI LITERAL2 PI
129+
PIE LITERAL2
128130
PIXEL_CENTER LITERAL2
129131
POINT LITERAL2
130132
POINTS LITERAL2
@@ -173,7 +175,7 @@ WAIT LITERAL2 cursor_
173175
WHITESPACE LITERAL2
174176

175177

176-
# KEYWORD1 specifies datatypes and keywords
178+
# KEYWORD1 - Java datatypes and keywords (void, int, boolean, etc.)
177179

178180
Array KEYWORD1 Array
179181
ArrayList KEYWORD1 ArrayList
@@ -231,7 +233,6 @@ static KEYWORD1 static
231233
strictfp KEYWORD1
232234
super KEYWORD1 super
233235
switch KEYWORD1 switch
234-
synchronized KEYWORD1
235236
this KEYWORD1 this
236237
throw KEYWORD1
237238
throws KEYWORD1
@@ -240,67 +241,64 @@ true KEYWORD1 true
240241
try KEYWORD1 try
241242
void KEYWORD1 void
242243
volatile KEYWORD1
243-
while KEYWORD1 while
244244

245-
# Deprecated API
245+
# Special cases for color coding
246246

247-
arraycopy KEYWORD2 arrayCopy_
248-
openStream KEYWORD2 openStream_
249-
OPENGL LITERAL2 size_
250-
JAVA2D LITERAL2 size_
247+
for FUNCTION1 for
248+
if FUNCTION1 if
249+
switch FUNCTION1 switch
250+
synchronized FUNCTION1
251+
while FUNCTION1 while
251252

252253

253-
# KEYWORD2 specifies functions and KEYWORD3 specifies methods
254254
# These items are a part of Processing but are not included in the reference
255255

256-
boolean KEYWORD2 booleanconvert_
257-
byte KEYWORD2 byteconvert_
258-
cache KEYWORD2
259-
char KEYWORD2 charconvert_
260256
color KEYWORD1 color_datatype
261-
start KEYWORD2
262-
stop KEYWORD2
263-
breakShape KEYWORD2
264-
createPath KEYWORD2
265-
float KEYWORD2 floatconvert_
266-
int KEYWORD2 intconvert_
267-
str KEYWORD2 strconvert_
268-
loadMatrix KEYWORD2
269-
noHint KEYWORD2
270-
parseBoolean KEYWORD2
271-
parseByte KEYWORD2
272-
parseChar KEYWORD2
273-
parseFloat KEYWORD2
274-
parseInt KEYWORD2
275-
saveFile KEYWORD2
276-
savePath KEYWORD2
277-
sketchFile KEYWORD2
278-
sketchPath KEYWORD2
257+
258+
boolean FUNCTION1 booleanconvert_
259+
byte FUNCTION1 byteconvert_
260+
cache FUNCTION2
261+
char FUNCTION1 charconvert_
262+
start FUNCTION1
263+
stop FUNCTION1
264+
breakShape FUNCTION1
265+
createPath FUNCTION1
266+
float FUNCTION1 floatconvert_
267+
int FUNCTION1 intconvert_
268+
str FUNCTION1 strconvert_
269+
loadMatrix FUNCTION1
270+
parseBoolean FUNCTION1
271+
parseByte FUNCTION1
272+
parseChar FUNCTION1
273+
parseFloat FUNCTION1
274+
parseInt FUNCTION1
275+
saveFile FUNCTION1
276+
savePath FUNCTION1
277+
sketchFile FUNCTION1
278+
sketchPath FUNCTION1
279279
string KEYWORD2 strconvert_
280280

281-
#KEYWORD3 is an experimental designation for methods
282-
readLine KEYWORD3 BufferedReader_readLine_
283-
close KEYWORD3 PrintWriter_close_
284-
flush KEYWORD3 PrintWriter_flush_
285-
print KEYWORD3 PrintWriter_print_
286-
println KEYWORD3 PrintWriter_println_
287-
charAt KEYWORD3 String_charAt_
288-
equals KEYWORD3 String_equals_
289-
indexOf KEYWORD3 String_indexOf_
290-
length KEYWORD3 String_length_
291-
substring KEYWORD3 String_substring_
292-
toLowerCase KEYWORD3 String_toLowerCase_
293-
toUpperCase KEYWORD3 String_toUpperCase_
294281

295-
# Temporary additions 3 September 2012 as the reference is getting updated
282+
readLine FUNCTION2 BufferedReader_readLine_
283+
close FUNCTION2 PrintWriter_close_
284+
flush FUNCTION2 PrintWriter_flush_
285+
print FUNCTION2 PrintWriter_print_
286+
println FUNCTION2 PrintWriter_println_
287+
charAt FUNCTION2 String_charAt_
288+
equals FUNCTION2 String_equals_
289+
indexOf FUNCTION2 String_indexOf_
290+
length FUNCTION2 String_length_
291+
substring FUNCTION2 String_substring_
292+
toLowerCase FUNCTION2 String_toLowerCase_
293+
toUpperCase FUNCTION2 String_toUpperCase_
296294

297-
beginContour KEYWORD2
298-
endContour KEYWORD2
299-
end KEYWORD2
300-
addChild KEYWORD2
301295

302-
clip KEYWORD2
303-
noClip KEYWORD2
296+
# Temporary additions 3 September 2012 as the reference is getting updated
297+
298+
beginContour FUNCTION1
299+
endContour FUNCTION1
300+
end FUNCTION1
301+
addChild FUNCTION1
304302

305303

306304
# Operators are without KEYWORDS

generate/keywords_create.cgi

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
#require 'globals.pl';
44

55

6-
# CURRENT BUGS
7-
# Making a line with \t\tblank
8-
# fixed: [] array access symbols are not appearing
9-
# ??? there are overlaps when methods are included (blend() and image.blend())
6+
# KEY 2.0b7+
7+
# LITERAL2 - Constants (QUARTER_PI, CORNERS, etc.)
8+
# KEYWORD1 - Java datatypes and keywords (void, int, boolean, etc.)
9+
# KEYWORD2 - Fields [variables within a class]
10+
# KEYWORD3 - Processing variables (width, height, focused, etc.)
11+
# FUNCTION1 - Functions
12+
# FUNCTION2 - Methods (functions inside a class)
1013

1114

1215
$dir = "../content/api_en/";
@@ -141,39 +144,31 @@ sub strip_name
141144

142145
sub set_category
143146
{
144-
145-
#if($type =~ s/constant/constant/i) {
146-
# $category = "LITERAL2";
147-
#} elsif ($type =~ s/variable/variable/i || $type =~ s/field/field/i ) {
148-
# $category = "LITERAL2";
149-
#} elsif ($type =~ s/datatype/datatype/i || $type =~ s/structure/structure/i ||
150-
# $type =~ s/keyword/keyword/i || $type =~ s/object/object/i ) {
151-
# $category = "KEYWORD1";
152-
#} elsif ($type =~ s/function/method/i || $type =~ s/method/method/i ) {
153-
# $category = "KEYWORD2";
154-
#} else {
155-
# $category = "";
156-
#}
157-
158-
#if($type =~ s/processing//i) {
159-
# $category = "KEYWORD3";
160-
#}
161147

162148
# Set the default
163-
$category = "KEYWORD2";
149+
$category = "FUNCTION1";
164150

165-
# Find methods and fields and modify
166-
if ($name eq $subcat) {
167-
$category = "KEYWORD1";
168-
} elsif($subcat =~ s/method/method/i) {
169-
$category = "KEYWORD3";
151+
#if ($name eq $subcat) {
152+
# $category = "KEYWORD1";
153+
#} elsif($subcat =~ s/method/method/i) {
154+
# $category = "FUNCTION2";
155+
#} elsif($subcat =~ s/field/field/i) {
156+
# $category = "KEYWORD2";
157+
#} elsif($cat =~ s/constants/constants/i) {
158+
# $category = "LITERAL2";
159+
#} elsif ($type eq "variable") {
160+
# $category = "KEYWORD3";
161+
#}
162+
163+
if ($subcat =~ s/method/method/i) {
164+
$category = "FUNCTION2";
165+
} elsif($name eq $subcat) {
166+
$category = "KEYWORD1";
170167
} elsif($subcat =~ s/field/field/i) {
171-
#The category KEYWORD4 was invented 27 Nov 2011 for fields -- CR
172-
#$category = "KEYWORD4";
173-
$category = "KEYWORD3";
174-
} elsif($cat =~ s/constants/constants/i) {
175-
$category = "LITERAL2";
176-
} elsif ($type eq "variable") {
168+
$category = "KEYWORD2";
169+
} elsif($type eq "variable") {
170+
$category = "KEYWORD3";
171+
} elsif ($cat =~ s/constants/constants/i) {
177172
$category = "LITERAL2";
178173
}
179174

todo.txt

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ $ Prepare MODE images for JavaScript, Android --CR
1515

1616
2.0 REFERENCE
1717

18-
$ Updates the keywords file
19-
2018
RELATED LINKS WITHIN THE REFERENCE
2119

2220
- Add @see in the source where appropriate, PShape methods need obvious help --SM
@@ -54,8 +52,6 @@ loadXXX with second parameter for file type:
5452

5553
- add clear() in place of background(0, 0, 0, 0), this clears the background, only applicable to off-screen buffers
5654

57-
- arc() with different options
58-
5955
- write reference for getChild() re: OBJ
6056

6157
OPEN QUESTIONS
@@ -108,6 +104,8 @@ Anyhow… something to dream about for the future. Andres had brought it up sinc
108104

109105
DONE FOR 2.0 REFERENCE
110106

107+
x Updates the keywords file
108+
x arc() with different options
111109
o change "shape" parameter in shape() to "shp" to match "img" in image()
112110
x hide the "source" parameter from the Reference for createShape()
113111
x 835 Improve mouseX, mouseY, pmouseX, pmouseY documentation --BF
@@ -261,6 +259,7 @@ x Done
261259

262260
2.0 EXAMPLES
263261

262+
- Table --DS,JT
264263
- New Minim Examples --CR
265264
- Remove super.stop() and stop() from examples -- CR, MINIM
266265
- Modify Capture examples to use new setup API
@@ -269,7 +268,6 @@ o PGL
269268
o new JSON? -- DS,JT
270269
x New PVector --DS
271270
x New PShape --DS
272-
- Table --DS,JT
273271
o add stringIntPair to Hashmap --DS // Ben is still sorting out this API
274272
x New P3D --CR,DS,AC
275273
x New Regex --DS
@@ -445,4 +443,36 @@ Key:
445443
- To do
446444
$ In progress
447445
o N/A anymore
448-
x Done
446+
x Done
447+
448+
// // // // // // // // // // // // // // // // // // // // //
449+
450+
New site navigation
451+
452+
COVER
453+
DOWNLOAD
454+
EXHIBITION
455+
(REFERENCE)
456+
Category
457+
A-Z
458+
Libraries
459+
Tools
460+
Environment
461+
(LEARNING)
462+
Tutorials
463+
Basics
464+
Topics
465+
Books
466+
SHOP
467+
(ABOUT)
468+
Overview
469+
*Foundation
470+
People
471+
Patrons
472+
473+
LINKS
474+
*Forum <http://forum.processing.org>
475+
Wiki
476+
*Bugs <http://code.google.com/p/processing/issues/list>
477+
Source <https://github.com/processing/>
478+
Feed

0 commit comments

Comments
 (0)