Initial mobile website check in

This commit is contained in:
francisli
2005-01-27 06:48:42 +00:00
parent dd0a7090b1
commit cce150ac8c
157 changed files with 10493 additions and 0 deletions
+178
View File
@@ -0,0 +1,178 @@
body {
background: #fff;
font-family: Geneva, Tahoma, Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: normal;
color: #553;
text-decoration: none;
margin-top: 0;
margin-left: 0;
margin-right: 0;
margin-bottom: 0;
}
h3 {
font-family: Geneva, Tahoma, Verdana, Arial, Helvetica, sans-serif;
font-size: 19px;
font-weight: normal;
font-decoration: none;
color: #996;
padding: 0px;
margin: 0px;
}
h4 {
font-family: Geneva, Tahoma, Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
text-decoration: none;
color: #998;
padding: 0px;
margin: 0px;
}
td {
font-family: Geneva, Tahoma, Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #663
}
select {
font-family: Geneva, Tahoma, Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
background-color : #fff;
height: 15px;
width: 200px;
color: #663;
border: 1px #06c solid
}
pre {
margin-top: 0px;
}
a:link {
color: #d60;
font-size: 11px;
font-family: Geneva, Tahoma, Verdana, Arial, Helvetica, sans-serif;
text-decoration: underlined;
background-color : transparent;
}
a:visited {
color: #d60;
font-size: 11px;
font-family: Geneva, Tahoma, Verdana, Arial, Helvetica, sans-serif;
text-decoration: underlined;
background-color : transparent;
}
a:hover {
color: #bb3;
font-size: 11px;
font-family: Geneva, Tahoma, Verdana, Arial, Helvetica, sans-serif;
text-decoration: underlined;
background-color : #000;
}
a:active {
color: #d60;
font-size: 11px;
font-family: Geneva, Tahoma, Verdana, Arial, Helvetica, sans-serif;
text-decoration: none;
background-color : transparent;
}
.inputnav {
font-family: Geneva, Tahoma, Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: normal;
color: #333333;
}
.pad {
padding-right: 10px;
}
.unlinked {
font-size: 11px;
color: #999966;
font-family: Geneva, Arial, Helvetica, sans-serif;
}
.subtitle {
font-size: 11px;
font-style: italic;
color: #666633;
}
.backslash {
color: #996600;
}
.column {
float: left;
width: 250px;
margin: 0px;
padding: 0px;
}
.column2x {
float: left;
width: 500px;
margin: 0px;
padding: 0px;
}
.reffieldheader {
vertical-align: top;
width: 100px;
padding-right: 20px;
padding-bottom: 40px;
}
.reffield {
vertical-align: top;
width: 560px;
padding-bottom: 40px;
}
#head {
position: relative;
left: 0px;
width: 750px;
margin: 5px 50px 0px 50px;
padding: 0px 0px 0px 0px;
}
#navigation {
position: relative;
left: 0px;
width: 750px;
margin: 0px 50px 0px 50px;
padding: 0px 0px 0px 0px;
}
#backnavigation {
position: relative;
left: 0px;
width: 800px;
margin: 40px 50px 0px 0px;
padding: 0px 0px 0px 0px;
}
#content {
position: relative;
left: 0px;
width: 750px;
margin: 40px 50px 0px 50px;
padding: 0px 0px 0px 0px;
}
#footer {
position: relative;
clear: both;
left: 0px;
width: 750px;
margin: 0px 50px 20px 50px;
padding: 100px 0px 0px 0px;
}
+19
View File
@@ -0,0 +1,19 @@
<?php
$PAGE_TITLE = "Processing Mobile >> Download";
require '../header.inc.php';
?>
<h2>Processing Mobile pre-Alpha</h2>
<ol>
<li>Download and install the Wireless Toolkit (WTK) from Sun. The latest version is 2.1.<br><br>
<a href="http://java.sun.com/products/j2mewtoolkit/">http://java.sun.com/products/j2mewtoolkit/</a><br>&nbsp;</li>
<li>Download and install Processing Mobile.<br><br>
0071 pre-ALPHA&nbsp;&nbsp;|&nbsp;&nbsp;17 10 2004&nbsp;&nbsp;Windows <a href="processing-0071-expert.zip">Expert</a><br>&nbsp;</li>
<li>Modify <b>preferences.txt</b> to include the following line, based on the installation location of the WTK:<br>
<br>
wtk.path=C:\WTK21<br>&nbsp;</li>
</ol>
<?php
require '../footer.inc.php';
?>
+8
View File
@@ -0,0 +1,8 @@
</div>
<div id="footer">
<a href="http://www.processing.org" target="_blank">Processing</a> is
&copy; 2004-2001 Massachusetts Institute of Technology and Interaction
Design Institute Ivrea </p>
</div>
</body>
</html>
+81
View File
@@ -0,0 +1,81 @@
<?php
require 'settings.inc.php';
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title><?php echo $PAGE_TITLE ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
<link rel="stylesheet" href="<?php echo SITE_ROOT?>css/mobile.css" type="text/css">
</head>
<body>
<div id="head">
<img src="<?php echo SITE_ROOT?>images/wiring.jpg" width="97" height="47">
</div>
<div id="navigation">
<img src="<?php echo SITE_ROOT?>images/nav_bottomarrow.gif" width="33" height="25" align="absmiddle">
<?php if ($_SERVER['PHP_SELF'] == SITE_ROOT . 'index.php') { ?>
Cover
<?php } else { ?>
<a href="<?php echo SITE_ROOT ?>index.php">Cover</a>
<?php } ?>
<span class="backslash">\</span>
<?php if (strstr($_SERVER['PHP_SELF'], SITE_ROOT . 'reference/') === false) { ?>
<a href="<?php echo SITE_ROOT ?>reference/index.php">Reference</a>
<?php } else { ?>
Reference
<?php } ?>
<span class="backslash">\</span>
<?php if (strstr($_SERVER['PHP_SELF'], SITE_ROOT . 'examples/') === false) { ?>
<a href="<?php echo SITE_ROOT ?>examples/index.php">Examples</a>
<?php } else { ?>
Examples
<?php } ?>
<span class="backslash">\</span>
<?php if (strstr($_SERVER['PHP_SELF'], SITE_ROOT . 'download/') === false) { ?>
<a href="<?php echo SITE_ROOT ?>download/index.php">Download</a>
<?php } else { ?>
Download
<?php } ?>
<span class="backslash">\</span>
<?php if (strstr($_SERVER['PHP_SELF'], SITE_ROOT . 'discourse/') === false) { ?>
<a href="<?php echo SITE_ROOT ?>discourse/index.php">Discourse</a>
<?php } else { ?>
Discourse
<?php } ?>
</div>
<?php if ($PAGE_SHOWBACKINDEX) { ?>
<div id="backnavigation">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="right" width="50">
<a href="index.php">
<img src="<?php echo SITE_ROOT?>images/back_off.gif" width="38" height="30" border="0" align="middle">
</a>
</td>
<td valign="middle">
<a href="index.php">
Index
</a>
</td>
</tr>
</table>
</div>
<?php } ?>
<div id="content">
+17
View File
@@ -0,0 +1,17 @@
<?php
$PAGE_TITLE = "Processing Mobile";
require 'header.inc.php';
?>
<img align="left" src="images/wiring_cover_small.jpg" width="590" height="300">
<div class="column">
&nbsp;
</div>
<div class="column">
<br>
Processing Mobile allows software written using the Processing programming
language and development environment to run on Java Powered mobile devices.
</div>
<?php
require 'footer.inc.php';
?>
+3
View File
@@ -0,0 +1,3 @@
<?php
phpinfo();
?>
+93
View File
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>Array</name>
<category>Data</category>
<subcategory>Composite</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
int[] numbers = new int[3];
numbers[0] = 90;
numbers[1] = 150;
numbers[2] = 30;
int a = numbers[0] + numbers[1]; // Sets variable a to 240
int b = numbers[1] + numbers[2]; // Sets variable b to 180
</code>
</example>
<example>
<image></image>
<code>
int[] numbers = { 90, 150, 30 };
int a = numbers[0] + numbers[1]; // Sets variable a to 240
int b = numbers[1] + numbers[2]; // Sets variable b to 180
</code>
</example>
<example>
<image></image>
<code>
int degrees = 360;
float[] cos_vals = new float[degrees];
for(int i=0; i &lt; degrees; i++) {
cos_vals[i] = cos(TWO_PI/degrees * i);
}
</code>
</example>
<description>
An array is a list of data. It is possible to have an array of any type of data. Each piece of data in an array is identified by an index number representing its position in the array. The first element in the array is <b>[0]</b>, the second element is <b>[1]</b>, and so on. Arrays are similar to objects, so they must be created with the keyword <b>new</b>. Every array has a variable <b>length</b> which is an integer value for the total number of elements in the array.
</description>
<syntax>
<c>datatype</c>[] <c>var</c>
<c>var</c>[<c>element</c>] = <c>value</c>
<c>var</c>.length
</syntax>
<parameter>
<label>datatype</label>
<description>any primitive or compound datatype, including user defined classes</description>
</parameter>
<parameter>
<label>var</label>
<description>any valid variable name</description>
</parameter>
<parameter>
<label>element</label>
<description>int: must not exceed the length of the array - 1</description>
</parameter>
<parameter>
<label>value</label>
<description>data to assign to the array element, must be the same datatype as the array</description>
</parameter>
<returns></returns>
<related></related>
<availability>1.0</availability>
<type>Object</type>
<partof>PDE</partof>
</root>
+84
View File
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>Object</name>
<category>Data</category>
<subcategory>Composite</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
// Declare and contruct two objects (h1, h2) from the class HLine
HLine h1 = new HLine(20, 2.0);
HLine h2 = new HLine(50, 2.5);
void setup()
{
size(200, 200);
framerate(30);
}
void loop() {
background(204);
h1.update();
h2.update();
}
class HLine {
float ypos, speed;
HLine (float y, float s) {
ypos = y;
speed = s;
}
void update() {
ypos += speed;
if (ypos > width) {
ypos = 0;
}
line(0, ypos, width, ypos);
}
}
</code>
</example>
<description>
Objects are instances of classes. A class is a grouping of related methods (functions) and fields (variables and constants).
</description>
<syntax>
<c>class</c> <c>instance</c>
</syntax>
<parameter>
<label>class</label>
<description>the class to created the object from</description>
</parameter>
<parameter>
<label>instance</label>
<description>any variable name</description>
</parameter>
<returns></returns>
<related>
class
</related>
<availability>1.0</availability>
<type>Object</type>
<partof>PDE</partof>
</root>
+108
View File
@@ -0,0 +1,108 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>String</name>
<category>Data</category>
<subcategory>Composite</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
String str1 = "CCCP";
char data[] = {'C', 'C', 'C', 'P'};
String str2 = new String(data);
println(str1); // Prints "CCCP" to the console
println(str2); // Prints "CCCP" to the console
</code>
</example>
<description>
A string is a sequence of characters. The class <b>String</b> includes methods for examining individual characters, comparing strings, searching strings, extracting parts of strings, and for converting an entire string uppercase and lowercase. Strings are always defined inside double quotes ("Abc") and characters are always defined inside single quotes('A'). <br /> <br />There are more string methods than those linked from this page. Additional <b>String</b> documentation is located at http://java.sun.com/j2se/1.4.2/docs/api/
</description>
<syntax></syntax>
<parameter>
<label></label>
<description></description>
</parameter>
<field>
<fname></fname>
<fdescription></fdescription>
</field>
<method>
<mname>charAt()</mname>
<mdescription>Returns the character at the specified index</mdescription>
</method>
<method>
<mname>equals()</mname>
<mdescription>Compares a string to a specified object</mdescription>
</method>
<method>
<mname>indexOf()</mname>
<mdescription>Returns the index value of the first occurance of a character within the input string</mdescription>
</method>
<method>
<mname>length()</mname>
<mdescription>Returns the number of characters in the input string</mdescription>
</method>
<method>
<mname>substring()</mname>
<mdescription>Returns a new string that is part of the input string</mdescription>
</method>
<method>
<mname>toLowerCase()</mname>
<mdescription>Converts all the characters to lower case</mdescription>
</method>
<method>
<mname>toUpperCase()</mname>
<mdescription>Converts all the characters to upper case</mdescription>
</method>
<constructor>
String(<c>data</c>)
String(<c>data</c>, <c>offset</c>, <c>length</c>)
</constructor>
<cparameter>
<clabel>data</clabel>
<cdescription>byte[] or char[]: array of bytes to be decoded into characters or array of characters to be combined into a string</cdescription>
</cparameter>
<cparameter>
<clabel>offset</clabel>
<cdescription>int: index of the first character</cdescription>
</cparameter>
<cparameter>
<clabel>length</clabel>
<cdescription>int: number of characters</cdescription>
</cparameter>
<returns></returns>
<related>
char
text()
</related>
<availability>1.0</availability>
<type>Object</type>
<partof>PDE</partof>
</root>
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>charAt()</name>
<category>String</category>
<subcategory>Method</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
String str = "CCCP";
char c1 = str.charAt(0);
char c2 = str.charAt(1);
char c3 = str.charAt(str.length()-1);
println(c1 + ":" + c2 + ":" + c3); // Prints 'C:C:P'
</code>
</example>
<description>
Returns the character at the specified index. An index ranges from 0 to the length of the string minus 1. The first character of the sequence is at index 0, the next at index 1, etc.
</description>
<syntax>
charAt(<c>index</c>)
</syntax>
<parameter>
<label>index</label>
<description>int: the index of the character</description>
</parameter>
<returns>char</returns>
<related>
</related>
<availability>1.0</availability>
<type>Method</type>
<partof>Core</partof>
</root>
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>equals()</name>
<category>String</category>
<subcategory>Method</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
String str1 = "CCCP";
String str2 = "CCCP";
// Tests to see if str1 is equal to str2
if(str1.equals(str2) == true) {
println("Equal"); // They are equal so this line will print
} else {
println("Not equal");
}
</code>
</example>
<description>
Compares two strings to see if they are the same. This method is necessary because it's not possible to compare strings using the equality operator (==). Returns <b>true</b> if the strings are the same and <b>false</b> if they are not.
</description>
<syntax>
equals(<c>str</c>)
</syntax>
<parameter>
<label>str</label>
<description>String: any valid String</description>
</parameter>
<returns>Boolean</returns>
<related>
</related>
<availability>1.0</availability>
<type>Method</type>
<partof>Core</partof>
</root>
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>indexOf()</name>
<category>String</category>
<subcategory>Method</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
String str = "CCCP";
int p1 = str.indexOf("C");
int p2 = str.indexOf("P");
int p3 = str.indexOf("CP");
println(p1 + ":" + p2 + ":" + p3); // Prints '0:3:2'
</code>
</example>
<description>
Tests to see if a substring is embedded in a string and returns the index position of the first occurance of the substring defined in the <b>str</b> parameter. If the <b>str</b> parameter is not found in the string, -1 is returned.
</description>
<syntax>
indexOf(<c>str</c>)
indexOf(<c>str</c>, <c>fromIndex</c>)
</syntax>
<parameter>
<label>str</label>
<description>String: the substring to search</description>
</parameter>
<parameter>
<label>fromIndex</label>
<description>int: the index from which to start the search</description>
</parameter>
<returns>int</returns>
<related>
</related>
<availability>1.0</availability>
<type>Method</type>
<partof>Core</partof>
</root>
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>length()</name>
<category>String</category>
<subcategory>Method</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
String str1 = "CCCP";
String str2 = "Rabbit";
int l1 = str1.length();
int l2 = str2.length();
println(l1 + ":" + l2); // Prints '4:6'
</code>
</example>
<description>
Returns the total number of characters included in the string as an integer number. <br />Note: You find the size of an array with the length field which works a little differently from String's <b>length()</b> method.
</description>
<syntax>
charAt()
</syntax>
<parameter>
<label></label>
<description></description>
</parameter>
<returns>int</returns>
<related>
</related>
<availability>1.0</availability>
<type>Method</type>
<partof>Core</partof>
</root>
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>substring()</name>
<category>String</category>
<subcategory>Method</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
String str1 = "CCCP";
String str2 = "Rabbit";
String ss1 = str1.substring(2); // Returns "CP"
String ss2 = str2.substring(3); // Returns "bit"
String ss3 = str1.substring(0, 2); // Returns "CC"
println(ss1 + ":" + ss2 + ":" + ss3); // Prints 'CP:bit:CC'
</code>
</example>
<description>
Returns a new string that is a part of the original string. When using the <b>endIndex</b> parameter, the string between <b>beginIndex</b> and <b>endIndex</b>-1 is returned.
</description>
<syntax>
substring(<b>beginIndex</b>)
substring(<b>beginIndex</b>, <b>endIndex</b>)
</syntax>
<parameter>
<label>beginIndex</label>
<description>int: position from which to begin (inclusive)</description>
</parameter>
<parameter>
<label>endIndex</label>
<description>int: position from which to end (exclusive)</description>
</parameter>
<returns>None</returns>
<related>
</related>
<availability>1.0</availability>
<type>Method</type>
<partof>Core</partof>
</root>
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>toLowerCase()</name>
<category>String</category>
<subcategory>Method</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
String str1 = "CCCP";
String str2 = "Rabbit";
str1 = str1.toLowerCase();
str2 = str2.toLowerCase();
println(str1 + ":" + str2); // Prints cccp:rabbit
</code>
</example>
<description>
Converts all of the characters in the string to lowercase. For example, "ABC" will convert to "abc".
</description>
<syntax>
toLowerCase()
</syntax>
<parameter>
<label></label>
<description></description>
</parameter>
<returns>String</returns>
<related>
</related>
<availability>1.0</availability>
<type>Method</type>
<partof>Core</partof>
</root>
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>toUpperCase()</name>
<category>String</category>
<subcategory>Method</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
String str1 = "Cccp";
String str2 = "Rabbit";
str1 = str1.toUpperCase();
str2 = str2.toUpperCase();
println(str1 + ":" + str2); // Prints CCCP:RABBIT
</code>
</example>
<description>
Converts all of the characters in the string to uppercase. For example, "abc" will convert to "ABC".
</description>
<syntax>
charAt()
</syntax>
<parameter>
<label>sx</label>
<description>int: X coordinate of the pixel in source image</description>
</parameter>
<returns>String</returns>
<related>
</related>
<availability>1.0</availability>
<type>Method</type>
<partof>Core</partof>
</root>
+51
View File
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>abs()</name>
<category>Math</category>
<subcategory>Calcuation</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
int a = abs(153); // Sets a to 153
int b = abs(-15); // Sets b to 15
float c = abs(12.234); // Sets c to 12.234
float d = abs(-9.23); // Sets d to 9.23
</code>
</example>
<description>
Calculates the absolute value (magnitude) of a number. The absolute value of a number is always positive.
</description>
<syntax>
abs(<c>value</c>)
</syntax>
<parameter>
<label>value</label>
<description>float or int</description>
</parameter>
<returns>float or int (depending on the input values)</returns>
<related></related>
<availability>1.0</availability>
<type>Function</type>
<partof>PDE</partof>
</root>
+59
View File
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>+= (add assign)</name>
<category>Math</category>
<subcategory>Operators</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
int a = 50;
int b = 23;
a += b; // sets "a" to 73
</code>
</example>
<description>
Combines addition with assignment. The expression <b>a += b</b> is equivalent to <b>a = a + b</b>.
</description>
<syntax>
<c>value1</c> += <c>value2</c>
</syntax>
<parameter>
<label>value1</label>
<description>int or float</description>
</parameter>
<parameter>
<label>value2</label>
<description>any numberical value the same datatype as value1</description>
</parameter>
<returns></returns>
<related>
= (assign)
+ (add)
-= (subtract assign)
</related>
<availability>1.0</availability>
<type>Operator</type>
<partof>PDE</partof>
</root>
+80
View File
@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>+ (addition)</name>
<category>Math</category>
<subcategory>Operators</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
int a = 50 + 5; // Sets a to 55
int b = a + 5; // Sets b to 60
</code>
</example>
<example>
<image></image>
<code>
String s1 = "Chernenko";
String s2 = "Brezhnev";
String sc1 = s1 + s2;
String sc2 = s1 + ", Andropov, " + s2;
println(sc1); // Prints ChernenkoBrezhnev
println(sc2); // Prints Chernenko, Andropov, Brezhnev
</code>
</example>
<example>
<image></image>
<code>
String s1 = "Gorbachev";
int i = 1987;
String sc1 = s1 + i;
println(sc1); // Prints Gorbachev1987
</code>
</example>
<description>
Adds two values or concatenates string values. As a mathematical operator, it calculates the sum of two values. As a string operator, it combines two strings into one and converts from primitive datatypes into the String datatype if necessary.
</description>
<syntax>
<c>value1</c> + <c>value2</c>
</syntax>
<parameter>
<label>value1</label>
<description>String, int, float, char, byte, boolean</description>
</parameter>
<parameter>
<label>value2</label>
<description>String, int, float, char, byte, boolean</description>
</parameter>
<returns></returns>
<related>
++ (increment)
+= (add assign)
- (minus)
</related>
<availability>1.0</availability>
<type>Operator</type>
<partof>PDE</partof>
</root>
+53
View File
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>append()</name>
<category>Data</category>
<subcategory>Array Functions</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
String sa1[] = { "OH ", "NY ", "CA "};
String sa2[] = append(sa1, "MA ");
print(sa2); // Prints "OH NY CA MA"
</code>
</example>
<description>
Expands an array by one element and adds data to the new position. The datatype of the <b>element</b> parameter must be the same as the datatype of the array.
</description>
<syntax>
append(<c>array</c>, <c>element</c>)
</syntax>
<parameter>
<label>array</label>
<description>boolean[], byte[], char[], int[], float[], or String[]</description>
</parameter>
<parameter>
<label>element</label>
<description>new data for the array</description>
</parameter>
<returns>Array (the same datatype as the input)</returns>
<related>
shorten()
expand()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
<level>Extended</level>
</root>
+66
View File
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>[] (array access)</name>
<category>Structure</category>
<subcategory></subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
int[] numbers = new int[3];
numbers[0] = 90;
numbers[1] = 150;
numbers[2] = 30;
int a = numbers[0] + numbers[1]; // Sets variable a to 240
int b = numbers[1] + numbers[2]; // Sets variable b to 180
</code>
</example>
<description>
The array access operator is used to specify a location within an array. The data at this location can be defined with the syntax <b>array[element] = value</b> or read with the syntax <b>value = array[element]</b>.
</description>
<syntax>
<c>datatype</c>[]
<c>array</c>[<c>element</c>]
</syntax>
<parameter>
<label>datatype</label>
<description>any primitive or compound datatype, including user defined classes</description>
</parameter>
<parameter>
<label>array</label>
<description>any valid variable name</description>
</parameter>
<parameter>
<label>element</label>
<description>int: must not exceed the length of the array - 1</description>
</parameter>
<returns></returns>
<related>
Array
</related>
<availability>1.0</availability>
<type>Operator</type>
<partof>PDE</partof>
</root>
+58
View File
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>= (assign)</name>
<category>Structure</category>
<subcategory></subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
int a;
a = 30; // Assigns for value 30 to the variable "a"
a = a + 40; // Assigns the value 70 to the variable "a"
</code>
</example>
<description>
Assigns a value to a variable. The "=" sign does not mean "equals", but is used to place data within a variable. The "=" operator is formally called the assignment operator. There are many different types of variables (int, floats, strings, etc.) and the assignment operator can only assign values which are the same type as the variable it is assigning. For example, if the variable is of type <b>int</b>, the value must also be an <b>int</b>.
</description>
<syntax>
<c>var</c> = <c>value</c>
</syntax>
<parameter>
<label>var</label>
<description>any valid variable name</description>
</parameter>
<parameter>
<label>value</label>
<description>any value of the same type as the variable. For example, if the variable is of type "int", the value must also be an int</description>
</parameter>
<returns></returns>
<related>
+= (add assign)
-= (subtract assign)
</related>
<availability>1.0</availability>
<type>Operator</type>
<partof>PDE</partof>
</root>
+96
View File
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>background()</name>
<category>Color</category>
<subcategory>Setting</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>background_.gif</image>
<code>
background(51);
</code>
</example>
<example>
<image>background_2.gif</image>
<code>
background(255, 204, 0);
</code>
</example>
<example>
<image>background_4.jar</image>
<code>
void loop() {
background(255, 204, 0);
line(0, 0, mouseX, mouseY);
line(100, 0, mouseX, mouseY);
line(100, 100, mouseX, mouseY);
line(0, 100, mouseX, mouseY);
}
</code>
</example>
<example>
<image>background_3.jpg</image>
<code>
PImage b;
b = loadImage("laDefense.jpg");
background(b);
</code>
</example>
<description>
The <b>background()</b> function sets the color used for the background of the Processing window. The default background is light gray. In the <b>loop()</b> function, the background color is used to refresh the display window between frames. It is possible to load a JPG or GIF image as the background by loading an image which is the same size as the display window. The image must be in the data directory of the sketch for it to load properly.
</description>
<syntax>
background(<c>value1</c>)
background(<c>value1</c>, <c>value2</c>, <c>value3</c>)
background(<c>image</c>)
</syntax>
<parameter>
<label>value1</label>
<description>int or float: red or hue value (depending on the current color mode)</description>
</parameter>
<parameter>
<label>value2</label>
<description>int or float: green or saturation value (depending on the current color mode)</description>
</parameter>
<parameter>
<label>value3</label>
<description>int or float: blue or brightness value (depending on the current color mode)</description>
</parameter>
<parameter>
<label>image</label>
<description>PImage: the name of a PImage the same size as the display window</description>
</parameter>
<returns>None</returns>
<related>
colorMode()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
</root>
+170
View File
@@ -0,0 +1,170 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>beginShape()</name>
<category>Shape</category>
<subcategory>Vertex</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>beginShape_.gif</image>
<code>
beginShape(POINTS);
vertex(30, 20);
vertex(85, 20);
vertex(85, 75);
vertex(30, 75);
endShape();
</code>
</example>
<example>
<image>beginShape_2.gif</image>
<code>
beginShape(LINES);
vertex(30, 20);
vertex(85, 20);
vertex(85, 75);
vertex(30, 75);
endShape();
</code>
</example>
<example>
<image>beginShape_3.gif</image>
<code>
beginShape(LINE_STRIP);
vertex(30, 20);
vertex(85, 20);
vertex(85, 75);
vertex(30, 75);
endShape();
</code>
</example>
<example>
<image>beginShape_4.gif</image>
<code>
beginShape(LINE_LOOP);
vertex(30, 20);
vertex(85, 20);
vertex(85, 75);
vertex(30, 75);
endShape();
</code>
</example>
<example>
<image>beginShape_5.gif</image>
<code>
beginShape(TRIANGLES);
vertex(30, 75);
vertex(40, 20);
vertex(50, 75);
vertex(60, 20);
vertex(70, 75);
vertex(80, 20);
vertex(90, 75);
endShape();
</code>
</example>
<example>
<image>beginShape_6.gif</image>
<code>
beginShape(TRIANGLE_STRIP);
vertex(30, 75);
vertex(40, 20);
vertex(50, 75);
vertex(60, 20);
vertex(70, 75);
vertex(80, 20);
vertex(90, 75);
endShape();
</code>
</example>
<example>
<image>beginShape_7.gif</image>
<code>
beginShape(QUADS);
vertex(30, 20);
vertex(30, 75);
vertex(50, 75);
vertex(50, 20);
vertex(65, 20);
vertex(65, 75);
vertex(85, 75);
vertex(85, 20);
endShape();
</code>
</example>
<example>
<image>beginShape_8.gif</image>
<code>
beginShape(QUAD_STRIP);
vertex(30, 20);
vertex(30, 75);
vertex(50, 75);
vertex(50, 20);
vertex(65, 20);
vertex(65, 75);
vertex(85, 75);
vertex(85, 20);
endShape();
</code>
</example>
<example>
<image>beginShape_9.gif</image>
<code>
beginShape(POLYGON);
vertex(20, 20);
vertex(40, 20);
vertex(40, 40);
vertex(60, 40);
vertex(60, 60);
vertex(20, 60);
endShape();
</code>
</example>
<description>
Using the <b>beginShape()</b> and <b>endShape()</b> functions allow creating more complex forms. <b>beginShape()</b> begins recording vertices for a shape and endShape() stops recording. The <b>beginShape()</b> function requires a parameter to tell it which type of shape to create from the provided vertices. The parameters available for beginShape() are LINES, LINE_STRIP, LINE_LOOP, TRIANGLES, TRIANGLE_STRIP, QUADS, QUAD_STRIP, and POLYGON. After calling the <b>beginShape()</b> function, a series of <b>vertex()</b> commands must follow. To stop drawing the shape, call <b>endShape()</b>. The <b>vertex()</b> function with two parameters specifies a position in 2D and the vertex() function with three parameters specifies a position in 3D. Each shape will be outlined with the current stroke color and filled with the fill color. Transformations such as <b>translate()</b>, <b>rotate()</b>, and <b>scale()</b> do not work within <b>beginShape()</b>.
</description>
<syntax>
beginShape(<c>MODE</c>)
</syntax>
<parameter>
<label>MODE</label>
<description>Either LINES, LINE_STRIP, LINE_LOOP, TRIANGLES, TRIANGLE_STRIP, QUADS, QUAD_STRIP, POLYGON</description>
</parameter>
<returns>None</returns>
<related>
endShape()
vertex()
curveVertex()
bezierVertex()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
</root>
+101
View File
@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>bezier()</name>
<category>Shape</category>
<subcategory>Curves</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>bezier_.gif</image>
<code>
stroke(255, 102, 0);
line(85, 20, 10, 10);
line(90, 90, 15, 80);
stroke(0, 0, 0);
bezier(85, 20, 10, 10, 90, 90, 15, 80);
</code>
</example>
<example>
<image>bezier_2.gif</image>
<code>
stroke(255, 102, 0);
line(30, 20, 80, 5);
line(80, 75, 30, 75);
stroke(0, 0, 0);
bezier(30, 20, 80, 5, 80, 75, 30, 75);
</code>
</example>
<description>
Draws a Bezier curve on the screen. These curves are defined by a series of anchor and control points. The first two parameters specify the first anchor point and the last two parameters specify the other anchor point. The middle parameters specify the control points which define the shape of the curve. Bezier curves were developed by French engineer Pierre Bezier.
</description>
<syntax>
bezier(<c>x1</c>, <c>y1</c>, <c>x2</c>, <c>y2</c>, <c>x3</c>, <c>y3</c>, <c>x4</c>, <c>y4</c>);
</syntax>
<parameter>
<label>x1</label>
<description>int or float: x-coordinate of the first anchor point</description>
</parameter>
<parameter>
<label>y1</label>
<description>int or float: y-coordinate of the first anchor point</description>
</parameter>
<parameter>
<label>x2</label>
<description>int or float: x-coordinate of the first control point</description>
</parameter>
<parameter>
<label>y2</label>
<description>int or float: y-coordinate of the first control point</description>
</parameter>
<parameter>
<label>x3</label>
<description>int or float: x-coordinate of the second control point</description>
</parameter>
<parameter>
<label>y3</label>
<description>int or float: y-coordinate of the second control point</description>
</parameter>
<parameter>
<label>x4</label>
<description>int or float: x-coordinate of the second anchor point</description>
</parameter>
<parameter>
<label>y4</label>
<description>int or float: y-coordinate of the second anchor point</description>
</parameter>
<returns>None</returns>
<related>
bezierVertex()
curve()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
</root>
+68
View File
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>bezierVertex()</name>
<category>Shape</category>
<subcategory>Vertex</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>bezierVertex_.gif</image>
<code>
beginShape(LINE_STRIP);
bezierVertex(30, 20);
bezierVertex(80, 0);
bezierVertex(80, 75);
bezierVertex(30, 75);
endShape();
</code>
</example>
<description>
Specifies vertex coordinates for Bezier curves. This function must be used between <b>beginShape()</b> and <b>endShape()</b>. These curves are defined by a series of anchor and control points. Bezier curves were developed by French engineer Pierre Bezier.
</description>
<syntax>
bezierVertex(<c>x</c>, <c>y</c>)
bezierVertex(<c>x</c>, <c>y</c>, <c>z</c>)
</syntax>
<parameter>
<label>x</label>
<description>The x-coordinate of the vertex, either a float or int</description>
</parameter>
<parameter>
<label>y</label>
<description>The y-coordinate of the vertex, either a float or int</description>
</parameter>
<parameter>
<label>z</label>
<description>The z-coordinate of the vertex, either a float or int</description>
</parameter>
<returns></returns>
<related>
curveVertex()
vertex()
bezier()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
</root>
+74
View File
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>&amp; (bitwise AND)</name>
<category>Math</category>
<subcategory>Bitwise Operators</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
int a = 207; // In binary: 11001111
int b = 61; // In binary: 00111101
int c = a &amp; b; // In binary: 00001101
println(c); // Prints "13", the decimal equivalent to 00001101
</code>
</example>
<example>
<image></image>
<code>
color argb = color(204, 204, 51, 255);
// The sytax "&amp; 0xFF" compares the binary
// representation of the two values and
// makes all but the last 8 bits into a 0.
// "0xFF" is 00000000000000000000000011111111
int a = argb >> 24 &amp; 0xFF;
int r = argb >> 16 &amp; 0xFF;
int g = argb >> 8 &amp; 0xFF;
int b = argb &amp; 0xFF;
fill(r, g, b, a);
rect(30, 20, 55, 55);
</code>
</example>
<description>
Compares each corresponding bit in the binary representation of the values. For each comparison two 1's yeild 1, 1 and 0 yeild 0, and two 0's yeild 0. This is easy to see when we look at the binary representation of numbers<br /><br /><pre> 11010110 // 214<br />&amp; 01011100 // 92<br /> --------<br /> 01010100 // 84</pre><br />To see the binary representation of a number, use the <b>binary()</b> function with <b>println()</b>.
</description>
<syntax>
<c>value</c> &amp; <c>value2</c>
</syntax>
<parameter>
<label>value1</label>
<description>int, char, byte</description>
</parameter>
<parameter>
<label>value2</label>
<description>int, char, byte</description>
</parameter>
<returns></returns>
<related>
| (bitwise OR)
binary()
</related>
<availability>1.0</availability>
<type>Operator</type>
<partof>PDE</partof>
<level>Extended</level>
</root>
+71
View File
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>| (bitwise OR)</name>
<category>Math</category>
<subcategory>Bitwise Operators</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
int a = 205; // In binary: 11001101
int b = 45; // In binary: 00101101
int c = a | b; // In binary: 11101101
println(c); // Prints "237", the decimal equivalent to 11101101
</code>
</example>
<example>
<image></image>
<code>
int a = 255 &lt;&lt; 24; // Binary: 11111111000000000000000000000000
int r = 204 &lt;&lt; 16; // Binary: 00000000110011000000000000000000
int g = 204 &lt;&lt; 8; // Binary 00000000000000001100110000000000
int b = 51; // Binary: 00000000000000000000000000110011
// OR the values together: 11111111110011001100110000110011
color argb = a | r | g | b;
fill(argb);
rect(30, 20, 55, 55);
</code>
</example>
<description>
Compares each corresponding bit in the binary representation of the values. For each comparison two 1's yeild 1, 1 and 0 yeild 1, and two 0's yeild 0. This is easy to see when we look at the binary representation of numbers<br /><br /><pre> 11010110 // 214<br />&amp; 01011100 // 92<br /> --------<br /> 11011110 // 222</pre><br />To see the binary representation of a number, use the <b>binary()</b> function with <b>println()</b>.
</description>
<syntax>
<c>value</c> | <c>value2</c>
</syntax>
<parameter>
<label>value1</label>
<description>int, char, byte</description>
</parameter>
<parameter>
<label>value2</label>
<description>int, char, byte</description>
</parameter>
<returns></returns>
<related>
&amp; (bitwise AND)
binary()
</related>
<availability>1.0</availability>
<type>Operator</type>
<partof>PDE</partof>
<level>Extended</level>
</root>
+57
View File
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>blue()</name>
<category>Color</category>
<subcategory>Creating &amp; Reading</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>blue_.gif</image>
<code>
noStroke();
color c = color(0, 126, 255);
fill(c);
rect(15, 20, 35, 60);
float value = blue(c); // Sets "value" to "255"
fill(value);
rect(50, 20, 35, 60);
</code>
</example>
<description>
Extracts the blue element from a color.
</description>
<syntax>
blue(<c>color</c>)
</syntax>
<parameter>
<label>color</label>
<description>any value of the color datatype</description>
</parameter>
<returns>float</returns>
<related>
red()
green()
hue()
saturation()
brightness()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
</root>
+65
View File
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>boolean</name>
<category>Data</category>
<subcategory>Primitive</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>boolean.gif</image>
<code>
boolean a = false;
if (!a) {
rect(30, 20, 50, 50);
}
a = true;
if (a) {
line(20, 10, 90, 80);
line(20, 80, 90, 10);
}
</code>
</example>
<description>
Datatype for the Boolean values <b>true</b> and <b>false</b>. It is common to use <b>boolean</b>values with control statements to determine the flow of a program. The first time a variable is written, it must be declared with a statement expressing its datatype.
</description>
<syntax>
boolean <c>var</c>
boolean <c>var</c> = <c>booleanvalue</c>
</syntax>
<parameter>
<label>var</label>
<description>variable name referencing the value</description>
</parameter>
<parameter>
<label>booleanvalue</label>
<description>true or false</description>
</parameter>
<returns></returns>
<related>
true
false
</related>
<availability>1.0</availability>
<type>Datatype</type>
<partof>PDE</partof>
</root>
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>boolean()</name>
<category>Data</category>
<subcategory>Conversion</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
float f = 0.0;
boolean b = boolean(f);
println(f + " : " + b); // Prints "0.0 : false"
int i = 1;
b = boolean(i);
println(i + " : " + b); // Prints "1 : true"
i = 3445;
b = boolean(i);
println(i + " : " + b); // Prints "3445 : true"
</code>
</example>
<description>
Converts a primitive datatype, string, or array to its boolean representation. The number 0 evaluates to false and all other numbers evaluate to true.
</description>
<syntax>
boolean(<c>val</c>)
</syntax>
<parameter>
<label>val</label>
<description>int, float, char, byte, String, int[], float[], char[], byte[], String[]</description>
</parameter>
<returns>byte</returns>
<related>
boolean
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>IDE</partof>
</root>
+60
View File
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>break</name>
<category>Control</category>
<subcategory>Conditionals</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
char letter = 'B';
switch(letter) {
case 'A':
println("Alpha"); // Does not execute
break;
case 'B':
println("Bravo"); // Prints "Bravo"
break;
default:
println("Zulu"); // Does not execute
break;
}
</code>
</example>
<description>
Ends the execution of a structure such as switch(), for(), or while() and jumps to the next statement after.
</description>
<syntax>
<c>break</c>
</syntax>
<parameter>
<label></label>
<description></description>
</parameter>
<returns></returns>
<related>
switch()
for()
while()
</related>
<availability>1.0</availability>
<type>Keyword</type>
<partof>Java</partof>
<level>extended</level>
</root>
+58
View File
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>brightness()</name>
<category>Color</category>
<subcategory>Creating &amp; Reading</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>brightness_.gif</image>
<code>
noStroke();
colorMode(HSB, 255);
color c = color(0, 126, 255);
fill(c);
rect(15, 20, 35, 60);
float value = brightness(c); // Sets "value" to "255"
fill(value);
rect(50, 20, 35, 60);
</code>
</example>
<description>
Extracts the brightness value from a color.
</description>
<syntax>
brightness(<c>color</c>)
</syntax>
<parameter>
<label>color</label>
<description>any value of the color datatype</description>
</parameter>
<returns>float</returns>
<related>
red()
green()
blue()
hue()
saturation()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
<level>Extended</level>
</root>
+61
View File
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>byte</name>
<category>Data</category>
<subcategory>Primitive</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
byte a; // Declare variable "a" of type byte
a = 23; // Assign "a" the value 23
byte b = -128; // Declare variable "b" and assign it the value -128
byte c = a + b; // Declare variable "c" and assign it the sum of "a" and "b"
</code>
</example>
<description>
Datatype for bytes, 8 bits of information storing numerical values from 127 to -128. Bytes are a convenient datatype for sending information to and from the serial port and for representing letters in a simpler format than the <b>char</b> datatype. The first time a variable is written, it must be declared with a statement expressing its datatype. Subsequent uses of this variable must not reference the datatype because Processing will think the variable is being declared again.
</description>
<syntax>
byte <c>var</c>
byte <c>var</c> = <c>value</c>
</syntax>
<parameter>
<label>var</label>
<description>variable name referencing the value</description>
</parameter>
<parameter>
<label>value</label>
<description>a number between 127 to -128</description>
</parameter>
<returns></returns>
<related>
int
float
boolean
</related>
<availability>1.0</availability>
<type>Datatype</type>
<partof>PDE</partof>
</root>
+61
View File
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>byte()</name>
<category>Data</category>
<subcategory>Conversion</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
float f = 65.0;
byte b = byte(f);
println(f + " : " + b); // Prints "65.0 : 65"
char c = 'E';
b = byte(c);
println(c + " : " + b); // Prints "E : 69"
f = 130.0;
b = byte(f);
println(f + " : " + b); // Prints "130.0 : -126"
</code>
</example>
<description>
Converts a primitive datatype, string, or array to its byte representation. A byte can only be a whole number between -128 and 127, therefore when a number outside this range is converted, its value wraps to the corresponding byte representation.
</description>
<syntax>
byte(<c>val</c>)
</syntax>
<parameter>
<label>val</label>
<description>int, float, char, boolean, String, int[], float[], char[], boolean[], String[]</description>
</parameter>
<returns>byte</returns>
<related>
byte
int()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>IDE</partof>
</root>
+69
View File
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>case</name>
<category>Control</category>
<subcategory>Conditionals</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
char letter = 'B';
switch(letter) {
case 'A':
println("Alpha"); // Does not execute
break;
case 'B':
println("Bravo"); // Prints "Bravo"
break;
default:
println("Zulu"); // Does not execute
break;
}
</code>
</example>
<description>
Denotes the different labels to be evaluated with the parameter in the <b>switch()</b> structure.
</description>
<syntax>
case <c>label</c>: <c>statements</c>
</syntax>
<parameter>
<label>label</label>
<description>byte, char, or int</description>
</parameter>
<parameter>
<label>statements</label>
<description>one or more valid statements</description>
</parameter>
<returns></returns>
<related>
switch()
default
break
</related>
<availability>1.0</availability>
<type>Keyword</type>
<partof>Java</partof>
<level>extended</level>
</root>
+51
View File
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>ceil()</name>
<category>Math</category>
<subcategory>Calculation</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
float x = 8.22;
float a = ceil(x); // Set "a" to 9.0
</code>
</example>
<description>
Calculates the closest value that is greater than or equal to the value of the parameter. For example, <b>ceil(9.03)</b> returns the value 10.0.
</description>
<syntax>
ceil(<c>value</c>)
</syntax>
<parameter>
<label>value</label>
<description>float</description>
</parameter>
<returns>float</returns>
<related>
floor()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>PDE</partof>
</root>
+58
View File
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>char</name>
<category>Data</category>
<subcategory>Primitive</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
char m; // Declare variable "m" of type char
m = 'A'; // Assign "m" the value "A"
int n = '&amp;'; // Declare variable "n" and assign it the value "&amp;"
</code>
</example>
<description>
Datatype for characters, typographic symbols such as A, d, and $. A <b>char</b> stores letters and symbols in the Unicode format, a coding system developed to support a variety of world languages. Each <b>char</b> is two bytes (16 bits) in length and is distinguished by surrounding it with single quotes. Character escapes may also stored as a <b>char</b>. For example, the representation for the "delete" key is '\377'. The first time a variable is written, it must be declared with a statement expressing its datatype. Subsequent uses of this variable must not reference the datatype because Processing will think the variable is being declared again.
</description>
<syntax>
char <c>var</c>
char <c>var</c> = <c>value</c>
</syntax>
<parameter>
<label>var</label>
<description>variable name referencing the value</description>
</parameter>
<parameter>
<label>value</label>
<description>any character</description>
</parameter>
<returns></returns>
<related>
String
</related>
<availability>1.0</availability>
<type>Datatype</type>
<partof>PDE</partof>
</root>
+63
View File
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>char()</name>
<category>Data</category>
<subcategory>Conversion</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
int i = 65;
char c = char(i);
println(i + " : " + c); // Prints "65 : A"
float f = 72.4;
c = char(f);
println(f + " : " + c); // Prints "72.4 : H"
boolean b = true;
c = char(b);
println(b + " : " + c); // Prints "true : t"
</code>
</example>
<description>
Converts a primitive datatype, string, or array to a numeric character representation.
</description>
<syntax>
char(<c>val</c>)
</syntax>
<parameter>
<label>val</label>
<description>int, float, byte, boolean, String, int[], float[], byte[], boolean[], String[]</description>
</parameter>
<returns>char</returns>
<related>
char
int()
float()
byte()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>IDE</partof>
</root>
+80
View File
@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>class</name>
<category>Structure</category>
<subcategory></subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
// Declare and contruct two objects (h1, h2) from the class HLine
HLine h1 = new HLine(20, 2.0);
HLine h2 = new HLine(50, 2.5);
void setup()
{
size(200, 200);
framerate(30);
}
void loop() {
background(204);
h1.update();
h2.update();
}
class HLine {
float ypos, speed;
HLine (float y, float s) {
ypos = y;
speed = s;
}
void update() {
ypos += speed;
if (ypos > width) {
ypos = 0;
}
line(0, ypos, width, ypos);
}
}
</code>
</example>
<description>
Keyword used to indicate the declaration of a class. A class is a composite of data and methods (functions) which may be instantiated as objects. The first letter of a class name is usually uppercase to separate it from other kinds of variables. A related tutorial on <a href="http://java.sun.com/docs/books/tutorial/java/concepts/index.html" target="_blank">Object-Oriented Programming</a> is hosted from the Sun website.
</description>
<syntax>
class <c>ClassName</c> {
<c>statements</c>
}
</syntax>
<parameter>
<label>ClassName</label>
<description>Any valid variable name</description>
</parameter>
<parameter>
<label>statements</label>
<description>any valid statements</description>
</parameter>
<returns></returns>
<related>
Object
</related>
<availability>1.0</availability>
<type>Keyword</type>
<partof>PDE</partof>
</root>
+78
View File
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>color()</name>
<category>Color</category>
<subcategory>Creating &amp; Reading</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>color_.gif</image>
<code>
color c1 = color(102, 102, 0);
fill(c1);
noStroke();
rect(30, 20, 55, 55);
</code>
</example>
<description>
Creates colors which may be stored in variables of the <b>color</b> datatype. The parameters are interpreted as RGB or HSB values depending on the current <b>colorMode()</b>. The default mode is RGB values from 0 to 255 and therefore, the function call <b>color(255, 204, 0)</b> will return a bright yellow color. The <b>color()</b> function packs the information input through its parameters into a 32 bit number in the following order AAAAAAAARRRRRRRRGGGGGGGGBBBBBBBB where R is the red/hue value, G is green/saturation, and B is blue/brightness.
</description>
<syntax>
color(<c>gray</c>)
color(<c>gray</c>, <c>alpha</c>)
color(<c>value1</c>, <c>value2</c>, <c>value3</c>)
color(<c>value1</c>, <c>value2</c>, <c>value3</c>, <c>alpha</c>)
</syntax>
<parameter>
<label>gray</label>
<description>int or float: number specifying value between white and black</description>
</parameter>
<parameter>
<label>alpha</label>
<description>int or float: relative to current color range</description>
</parameter>
<parameter>
<label>value1</label>
<description>int or float: red or hue values relative to the current color range</description>
</parameter>
<parameter>
<label>value2</label>
<description>int or float: green or saturation values relative to the current color range</description>
</parameter>
<parameter>
<label>value3</label>
<description>int or float: blue or brightness values relative to the current color range</description>
</parameter>
<returns>color</returns>
<related>
color
colorMode()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
</root>
+91
View File
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>colorMode()</name>
<category>Color</category>
<subcategory>Setting</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>colorMode_.jpg</image>
<code>
noStroke();
colorMode(RGB, 100);
for(int i=0; i&lt;100; i++) {
for(int j=0; j&lt;100; j++) {
stroke(i, j, 0);
point(i, j);
}
}
</code>
</example>
<example>
<image>colorMode_2.jpg</image>
<code>
noStroke();
colorMode(HSB, 100);
for(int i=0; i&lt;100; i++) {
for(int j=0; j&lt;100; j++) {
stroke(i, j, 100);
point(i, j);
}
}
</code>
</example>
<description>
Changes the way Processing interprets color data. By default, <b>fill()</b>, <b>stroke()</b>, and <b>background()</b> colors are set by values between 0 and 255 using the RGB color model. It is possible to change the numerical range used for specifying colors and to switch color systems. For example, calling <b>colorMode(RGB, 1.0)</b> will specify that values are specified between 0 and 1. The limits for defining colors are altered by setting the parameters range1, range2, and range 3.
</description>
<syntax>
colorMode(<c>mode</c>);
colorMode(<c>mode</c>, <c>range</c>);
colorMode(<c>mode</c>, <c>range1</c>, <c>range2</c>, <c>range3</c>);
</syntax>
<parameter>
<label>mode</label>
<description>Either RGB or HSB, corresponding to Red/Green/Blue and Hue/Saturation/Brightness</description>
</parameter>
<parameter>
<label>range</label>
<description>int or float: range for all color elements</description>
</parameter>
<parameter>
<label>range1</label>
<description>int or float: range for the red or hue depending on the current color mode</description>
</parameter>
<parameter>
<label>range2</label>
<description>int or float: range for the green or saturation depending on the current color mode</description>
</parameter>
<parameter>
<label>range3</label>
<description>int or float: range for the blue or brightness depending on the current color mode</description>
</parameter>
<returns>None</returns>
<related>
background()
fill()
stroke()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
<level>Extended</level>
</root>
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>color</name>
<category>Data</category>
<subcategory>Primitive</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>color.gif</image>
<code>
color c1 = color(204, 153, 0);
color c2 = #FFCC00;
noStroke();
fill(c1);
rect(0, 0, 25, 100);
fill(c2);
rect(25, 0, 25, 100);
color c3 = get(10, 50);
fill(c3);
rect(50, 0, 50, 100);
</code>
</example>
<description>
Datatype for storing color values. Colors may be assigned with <b>get()</b> and <b>color()</b> or they may be specified directly using hexadecimal notation such as <b>#FFCC00</b>. Colors are 32 bits of information ordered as AAAAAAAARRRRRRRRGGGGGGGGBBBBBBBB where the A's contain the alpha value, the R's are the red/hue value, G's are green/saturation, and B's are blue/brightness. Color is a datatype unique to Processing.
</description>
<syntax>
color <c>var</c>
color <c>var</c> = <c>colorvalue</c>
</syntax>
<parameter>
<label>var</label>
<description>variable name referencing the value</description>
</parameter>
<parameter>
<label>colorvalue</label>
<description>any color value</description>
</parameter>
<returns></returns>
<related>
colorMode()
color()
</related>
<availability>1.0</availability>
<type>Datatype</type>
<partof>PDE</partof>
</root>
+57
View File
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>, (comma)</name>
<category>Structure</category>
<subcategory></subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<applet></applet>
<code>
// Comma used to separate a list of variable declarations
int a=20, b=30, c=80;
// Comma used to separate a list of values assigned to an array
int[] d = { 20, 60, 80 };
// Comma used to separate a list of parameters passed to a function
line(a, b, c, b);
line(d[0], d[1], d[2], d[1]);
</code>
</example>
<description>
Separates parameters in function calls and elements during assignment.
</description>
<syntax>
value1, ..., valueN
</syntax>
<parameter>
<label>value1, ..., valueN</label>
<description>any int, float, byte, boolean, color, char, String</description>
</parameter>
<returns></returns>
<related></related>
<availability>1.0</availability>
<type>Operator</type>
<partof>PDE</partof>
</root>
+53
View File
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>// (comment)</name>
<category>Structure</category>
<subcategory></subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
// Draws two lines which divides the window
// into four quadrants
line(0, 50, 100, 50); // Draw the horizontal line
line(50, 0, 50, 100); // Draw the vertical line
</code>
</example>
<description>
Explanatory notes embedded within the code. Comments are used to remind yourself and to inform others about the function of your program. Single-line comments are signified with the <b>//</b> characters. Comments are ignored by the compiler.
</description>
<syntax>
// <c>comment</c>
</syntax>
<parameter>
<label>comment</label>
<description>any sequence of characters</description>
</parameter>
<returns></returns>
<related>
/* */ (multiline comment)
</related>
<availability>1.0</availability>
<type>Operator</type>
<partof>PDE</partof>
</root>
+51
View File
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>concat()</name>
<category>Data</category>
<subcategory>Array Functions</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
String sa1[] = { "OH ", "NY ", "CA "};
String sa2[] = { "KY ", "IN ", "MA "};
String sa3[] = concat(sa1, sa2);
print(sa3); // Prints "OH NY CA KY IN MA "
</code>
</example>
<description>
Concatenates two arrays. For example, concatenating the array { 1, 2, 3 } and the array { 4, 5, 6 } yields { 1, 2, 3, 4, 5, 6 }. Both parameters must be arrays of the same datatype.
</description>
<syntax>
concat(<c>array1</c>, <c>array2</c>)
</syntax>
<parameter>
<label>array</label>
<description>booleans[], bytes[], chars[], ints[], floats[], or Strings[]</description>
</parameter>
<returns>Array (the same datatype as the input)</returns>
<related>
splice()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
<level>Extended</level>
</root>
+66
View File
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>?: (conditional)</name>
<category>Control</category>
<subcategory>Conditionals</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
int s = 0;
for(int i=5; i&lt;100; i+=5) {
s = (i &lt; 50) ? 0 : 255;
stroke(s);
line(30, i, 80, i);
}
</code>
</example>
<description>
A shortcut for writing an <b>if()</b> and <b>else</b> structure. If the <b>condition</b> evaluates to <b>true</b>, <b>expression1</b> is evaluated and returned. If the <b>condition</b> evaluates to <b>false</b>, <b>expression2</b> is evaluated and returned.<br /><br />The following conditional: <br /><pre>condition : expression1 ? expression2</pre><br />is equivalent to this structure: <br /><pre>if(condition) {<br /> expression1 <br />} else { <br /> expression2 <br />}</pre>
</description>
<syntax>
<c>condition</c> ? <c>expression1</c> : <c>expression2</c>
</syntax>
<parameter>
<label>condition</label>
<description>any valid expression which evaluates to true or false</description>
</parameter>
<parameter>
<label>expression1</label>
<description>any valid expression</description>
</parameter>
<parameter>
<label>expression2</label>
<description>any valid expression</description>
</parameter>
<returns>Variable, dependent on the datatype of the expressions</returns>
<related>
if()
else
</related>
<availability>1.0</availability>
<type>Structure</type>
<partof>PDE</partof>
<level>Extended</level>
</root>
+66
View File
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>constrain()</name>
<category>Math</category>
<subcategory>Calculation</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>constrain_.jar</image>
<code>
void loop()
{
background(204);
float mx = constrain(mouseX, 30, 70);
rect(mx-10, 40, 20, 20);
}
</code>
</example>
<description>
Constrains a value to not exceed a maximum and minimum value.
</description>
<syntax>
constrain(<c>value</c>, <c>min</c>, <c>max</c>)
</syntax>
<parameter>
<label>value</label>
<description>int or float: the value to constrain</description>
</parameter>
<parameter>
<label>min</label>
<description>int or float: minimum limit</description>
</parameter>
<parameter>
<label>max</label>
<description>int or float: maximum limit</description>
</parameter>
<returns>float or int (depending on the input values)</returns>
<related>
max()
min()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>PDE</partof>
</root>
+55
View File
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>contract()</name>
<category>Data</category>
<subcategory>Array Functions</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
int[] ia = {0, 1, 2, 3, 4, 5, 6, 7};
println(ia.length); // Prints "8"
ia = contract(ia, 5);
println(ia.length); // Prints "5"
</code>
</example>
<description>
Decreases the size of an array. The required <b>newSize</b> parameter provides precise control over the decrease in size.
</description>
<syntax>
contract(<c>array</c>, <c>newSize</c>)
</syntax>
<parameter>
<label>array</label>
<description>booleans[], bytes[], chars[], ints[], floats[], or Strings[]</description>
</parameter>
<parameter>
<label>newSize</label>
<description>positive int: new size for the array</description>
</parameter>
<returns>Array (the same datatype as the input)</returns>
<related>
expand()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
<level>Extended</level>
</root>
+66
View File
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>{} (curly braces)</name>
<category>Structure</category>
<subcategory></subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
int[] a = { 5, 20, 25, 45, 70 };
void setup() {
size(100, 100);
}
void loop() {
for(int i=0; i&lt;a.length; i++) {
line(0, a[i], 50, a[i]);
}
}
</code>
</example>
<description>
Define the beginning and end of functions blocks and statement blocks such as the <b>for()</b> and <b>if()</b> structures. Curly braces are also used for defining inital values in array declarations.
</description>
<syntax>
{ <c>statements</c> }
{ <c>ele0</c>, ..., <c>eleN</c> }
</syntax>
<parameter>
<label>statements</label>
<description>any sequence of valid statements</description>
</parameter>
<parameter>
<label>ele0 ... eleN</label>
<description>list of elements separated by commas</description>
</parameter>
<returns></returns>
<related>
() (parentheses)
</related>
<availability>1.0</availability>
<type>Operator</type>
<partof>PDE</partof>
</root>
+91
View File
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>curve()</name>
<category>Shape</category>
<subcategory>Curves</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>curve_.gif</image>
<code>
stroke(255, 102, 0);
curve(5, 26, 5, 26, 73, 24, 73, 61);
stroke(0);
curve(5, 26, 73, 24, 73, 61, 15, 65);
stroke(255, 102, 0);
curve(73, 24, 73, 61, 15, 65, 15, 65);
</code>
</example>
<description>
Draws a curved line on the screen. The first and second parameters specify the first anchor point and the last two parameters specify the second anchor. The middle parameters specify the points for defining the shape of the curve. Longer curves can be created by putting a series of <b>curve()</b> functions together. An additional function called <b>curveTightness()</b> provides control for the visual quality of the curve. The <b>curve()</b> function is an implementation of Catmull-Rom splines.
</description>
<syntax>
curve(<c>x1</c>, <c>y1</c>, <c>x2</c>, <c>y2</c>, <c>x3</c>, <c>y3</c>, <c>x4</c>, <c>y4</c>);
</syntax>
<parameter>
<label>x1</label>
<description>int or float: x-coordinate of the first anchor</description>
</parameter>
<parameter>
<label>y1</label>
<description>int or float: y-coordinate of the first anchor</description>
</parameter>
<parameter>
<label>x2</label>
<description>int or float: x-coordinate of the first point</description>
</parameter>
<parameter>
<label>y2</label>
<description>int or float: y-coordinate of the first point</description>
</parameter>
<parameter>
<label>x3</label>
<description>int or float: x-coordinate of the second point</description>
</parameter>
<parameter>
<label>y3</label>
<description>int or float: y-coordinate of the second point</description>
</parameter>
<parameter>
<label>x4</label>
<description>int or float: x-coordinate of the second anchor</description>
</parameter>
<parameter>
<label>y4</label>
<description>int or float: y-coordinate of the second anchor</description>
</parameter>
<returns>None</returns>
<related>
curveVertex()
bezier()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
</root>
+71
View File
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>curveVertex()</name>
<category>Shape</category>
<subcategory>Vertex</subcategory>
<usage>Application &amp; Web</usage>
<example>
<image>curveVertex_.gif</image>
<code>
beginShape(LINE_STRIP);
curveVertex(84, 91);
curveVertex(84, 91);
curveVertex(68, 19);
curveVertex(21, 17);
curveVertex(32, 100);
curveVertex(32, 100);
endShape();
</code>
</example>
<description>
Specifies vertex coordinates for curves. This function may only be called between <b>beginShape()</b> and <b>endShape()</b>. The <b>curveVertex()</b> function is an implementation of Catmull-Rom splines.
</description>
<syntax>
curveVertex(<c>x</c>, <c>y</c>)
curveVertex(<c>x</c>, <c>y</c>, <c>z</c>)
</syntax>
<parameter>
<label>x</label>
<description>The x-coordinate of the vertex, either a float or int</description>
</parameter>
<parameter>
<label>y</label>
<description>The y-coordinate of the vertex, either a float or int</description>
</parameter>
<parameter>
<label>z</label>
<description>The z-coordinate of the vertex, either a float or int</description>
</parameter>
<returns>None</returns>
<related>
beginShape()
endShape()
vertex()
bezierVertex()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
</root>
+73
View File
@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>day()</name>
<category>Input/Output</category>
<subcategory>Time &amp; Date</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>day_.jar</image>
<code>
void setup() {
PFont metaBold;
metaBold = loadFont("fonts/Meta-Bold.vlw.gz");
setFont(metaBold, 44);
hint(SMOOTH_IMAGES);
}
void loop() {
int d = day(); // Values from 1 - 31
int m = month(); // Values from 1 - 12
int y = year(); // 2003, 2004, 2005, etc.
String s = String.valueOf(d);
text(s, 10, 28);
s = String.valueOf(m);
text(s, 10, 56);
s = String.valueOf(y);
text(s, 10, 84);
}
</code>
</example>
<description>
Processing communicates with the clock on your computer. The <b>day()</b> function returns the current day as a value from 1 - 31.
</description>
<syntax>
day()
</syntax>
<parameter>
<label></label>
<description></description>
</parameter>
<returns>int</returns>
<related>
millis()
second()
minute()
hour()
day()
month()
year()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
</root>
+54
View File
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>-- (decrement)</name>
<category>Math</category>
<subcategory>Operators</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
int a = 5; // Sets "a" to 5
int b = a--; // Sets "b" to 5, then decrements "a" to 4
int c = a; // Sets "c" to 4
</code>
</example>
<description>
Substracts the value of an integer variable by 1. Equivalent to the operation <b>i = i - 1</b>. If the value of the variable <b>i</b> is five, then the expression <b>i--</b> decreases the value of <b>i</b> to 4.
</description>
<syntax>
<c>var</c>--
</syntax>
<parameter>
<label>var</label>
<description>int</description>
</parameter>
<returns></returns>
<related>
- (minus)
-= (subtract assign)
++ (increment)
</related>
<availability>1.0</availability>
<type>Operator</type>
<partof>PDE</partof>
</root>
+64
View File
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>default</name>
<category>Control</category>
<subcategory>Conditionals</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
char letter = 'F';
switch(letter) {
case 'A':
println("Alpha"); // Does not execute
break;
case 'B':
println("Bravo"); // Does not execute
break;
default:
println("Zulu"); // Prints "Zulu"
break;
}
</code>
</example>
<description>
Keyword for defining the default condition of a <b>switch()</b>. If none of the case labels match the <b>switch()</b> parameter, the statement(s) after the <b>default</b> syntax are executed. Switch structures don't require a <b>default</b>.
</description>
<syntax>
default: <c>statements</c>
</syntax>
<parameter>
<label>statements</label>
<description>one or more valid statements to be executed</description>
</parameter>
<returns></returns>
<related>
switch()
break
case
</related>
<availability>1.0</availability>
<type>Keyword</type>
<partof>Java</partof>
<level>Extended</level>
</root>
+57
View File
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>delay()</name>
<category>Environment</category>
<subcategory></subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>delay_.jar</image>
<code>
int pos = 0;
void loop() {
background(204);
pos++;
line(pos, 20, pos, 80);
if(pos &gt; width) {
pos = 0;
}
delay(250); // Stops the program for 250 milliseconds
}
</code>
</example>
<description>
Forces the program to stop running for a specified time. Delay times are specified in thousandths of a second. The function call <b>delay(3000)</b> will stop the program for three seconds. This function causes the program to stop as soon as it is called, except if the program is running the loop() for the first time, it will complete the loop before stopping.
</description>
<syntax>
delay(<c>milliseconds</c>)
</syntax>
<parameter>
<label>milliseconds</label>
<description>int: specified as milliseconds (there are 1000 milliseconds in 1 second)</description>
</parameter>
<returns>None</returns>
<related></related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
</root>
+80
View File
@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>dist()</name>
<category>Math</category>
<subcategory>Calculation</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>dist_.jar</image>
<code>
// Sets the background gray value based on
// the distance of the mouse from the center
void loop() {
float d = dist(50, 50, mouseX, mouseY);
fill(d*4);
rect(0, 0, 99, 99);
}
</code>
</example>
<description>
Calculates the distance between two points.
</description>
<syntax>
dist(<c>x1</c>, <c>y1</c>, <c>x2</c>, <c>y2</c>);
dist(<c>x1</c>, <c>y1</c>, <c>z1</c>, <c>x2</c>, <c>y2</c>, <c>z2</c>);
</syntax>
<parameter>
<label>x1</label>
<description>int or float: x-coordinate of the first point</description>
</parameter>
<parameter>
<label>y1</label>
<description>int or float: y-coordinate of the first point</description>
</parameter>
<parameter>
<label>z1</label>
<description>int or float: z-coordinate of the first point</description>
</parameter>
<parameter>
<label>x2</label>
<description>int or float: x-coordinate of the second point</description>
</parameter>
<parameter>
<label>y2</label>
<description>int or float: y-coordinate of the second point</description>
</parameter>
<parameter>
<label>z2</label>
<description>int or float: z-coordinate of the second point</description>
</parameter>
<returns>float</returns>
<related></related>
<availability>1.0</availability>
<type>Function</type>
<partof>PDE</partof>
</root>
+57
View File
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>/ (divide)</name>
<category>Math</category>
<subcategory>Operators</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
int g = 50 / 5; // Sets g 10
int h = g / 5; // Sets h 2
</code>
</example>
<description>
Divides the value of the second parameter by the value of the first parameter. The answer to the equation 20 / 4 is 5. The number 20 is the sum of 4 of the number 5. As an equation we see that 4 + 4 + 4 + 4 + 4 = 20.
</description>
<syntax>
<c>value1</c> / <c>value2</c>
</syntax>
<parameter>
<label>value1</label>
<description>int or float</description>
</parameter>
<parameter>
<label>value2</label>
<description>int or float, but not zero (it is not possible divide by zero)</description>
</parameter>
<returns></returns>
<related>
* (multiply)
% (modulo)
</related>
<availability>1.0</availability>
<type>Operator</type>
<partof>PDE</partof>
</root>
+90
View File
@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>. (dot)</name>
<category>Structure</category>
<subcategory></subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
// Declare and contruct two objects (h1, h2) from the class HLine
HLine h1 = new HLine(20, 1.0);
HLine h2 = new HLine(50, 5.0);
void setup() {
size(200, 200);
}
void loop() {
if(h2.speed &gt; 1.0) {
h2.speed -= 0.01;
}
h1.update();
h2.update();
}
class HLine {
float ypos, speed;
HLine (float y, float s) {
ypos = y;
speed = s;
}
void update() {
ypos += speed;
if (ypos &gt; width) {
ypos = 0;
}
line(0, ypos, width, ypos);
}
}
</code>
</example>
<description>
Provides access to an object's methods and data. An object is an instance of a class and contains is a grouping of methods (object functions) and data (object variables and constants). The dot operator directs the program to the information encapsulated within an object.
</description>
<syntax>
<c>object</c>.<c>method()</c>
<c>object</c>.<c>data</c>
</syntax>
<parameter>
<label>object</label>
<description>the object you want to access</description>
</parameter>
<parameter>
<label>method()</label>
<description>method encapsulated in the object</description>
</parameter>
<parameter>
<label>data</label>
<description>variable or constant encapsulated in the object</description>
</parameter>
<returns></returns>
<related>
Object
</related>
<availability>1.0</availability>
<type>Operator</type>
<partof>PDE</partof>
</root>
+69
View File
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>draw()</name>
<category>Structure</category>
<subcategory></subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<applet></applet>
<code>
void setup() {
size(200, 200);
noStroke();
}
int a = 0;
void draw() {
fill(a);
a = a + 1;
if (a &gt; width) {
a = 0;
}
rect(a, 0, 2, 200);
}
</code>
</example>
<description>
Continuously executes the lines of code contained inside its block until the program is stopped or <b>noLoop()</b> is called. Calling <b>redraw()</b> will cause the code inside <b>draw()</b> to execute once and calling <b>loop()</b> will cause the code inside <b>draw()</b> to execute continuously. The <b>draw()</b> function is used in conjunction with <b>setup()</b>. The number of times <b>draw()</b> executes in each second may be controlled with the <b>delay()</b> and <b>framerate()</b> functions.
</description>
<syntax>
draw() {
<c>statements</c>
}
</syntax>
<parameter>
<label>statements</label>
<description>A sequence of statements to be executed over and over again</description>
</parameter>
<returns>None</returns>
<related>
setup()
loop()
noLoop()
</related>
<availability>1.0</availability>
<type>Processing Function</type>
<partof>PDE</partof>
</root>
+65
View File
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>ellipse()</name>
<category>Shape</category>
<subcategory>2D Primitives</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>ellipse_.gif</image>
<code>
ellipse(56, 46, 55, 55);
</code>
</example>
<description>
Draws an ellipse (oval) in the display window. An ellipse with an equal <b>width</b> and <b>height</b> is a circle. The first two parameters set the location, the third sets the width, and the fourth sets the height. The origin may be changed with the <b>ellipseMode()</b> function.
</description>
<syntax>
ellipse(<c>x</c>, <c>y</c>, <c>width</c>, <c>height</c>)
</syntax>
<parameter>
<label>x</label>
<description>int or float: x-coordinate of the ellipse</description>
</parameter>
<parameter>
<label>y</label>
<description>int or float: y-coordinate of the ellipse</description>
</parameter>
<parameter>
<label>width</label>
<description>int or float: width of the ellipse</description>
</parameter>
<parameter>
<label>height</label>
<description>int or float: height of the ellipse</description>
</parameter>
<returns>None</returns>
<related>
ellipseMode()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
</root>
+47
View File
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>ellipseMode()</name>
<category>Shape</category>
<subcategory>2D Primitives</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>ellipseMode_.gif</image>
<code>
ellipseMode(CENTER);
ellipse(35, 35, 50, 50);
ellipseMode(CORNER);
fill(102);
ellipse(35, 35, 50, 50);
</code>
</example>
<description>
The origin of the ellipse is modified by the <b>ellipseMode()</b> function. The default configuration is <b>ellipseMode(CENTER)</b>, which specifies the location of the ellipse as the center of the shape. The CENTER_RADIUS mode is the same, but the width and height parameters to <b>ellipse()</b> specify the radius of the ellipse, rather than the diameter. The CORNER mode draws the shape from the upper-left corner of its bounding box. The CORNERS mode uses the four parameters to <b>ellipse()</b> to set two opposing corners of the ellipse's bounding box. The parameter must be written in "ALL CAPS" because Processing is a case sensitive language.
</description>
<syntax>
ellipseMode(<c>MODE</c>)
</syntax>
<parameter>
<label>MODE</label>
<description>Either CENTER, CENTER_RADIUS, CORNER, CORNERS.</description>
</parameter>
<returns>None</returns>
<related>
ellipse()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
</root>
+88
View File
@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>else</name>
<category>Control</category>
<subcategory>Conditionals</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>else.gif</image>
<code>
for(int i = 5; i &lt; 95; i += 5) {
if(i &lt; 35) {
line( 30, i, 80, i );
} else {
line( 20, i, 90, i );
}
}
</code>
</example>
<example>
<image>else2.gif</image>
<code>
for(int i = 5; i &lt; 95; i += 5) {
if(i &lt; 35) {
line( 30, i, 80, i );
} else if (i &lt; 65) {
line( 20, i, 90, i );
} else {
line( 0, i, 100, i );
}
}
</code>
</example>
<description>
Extends the <b>if()</b> structure allowing the program to choose between two or more block of code. It specifies a block of code to execute when the expression in <b>if()</b> is <b>false</b>.
</description>
<syntax>
if(<c>expression</c>) {
<c>statements</c>
} else {
<c>statements</c>
}
if(<c>expression</c>) {
<c>statements</c>
} else if(<c>expression</c>) {
<c>statements</c>
} else {
<c>statements</c>
}
</syntax>
<parameter>
<label>expression</label>
<description>any valid expression that evaluates to true or false</description>
</parameter>
<parameter>
<label>statements</label>
<description>one or more statements to be executed</description>
</parameter>
<returns></returns>
<related>
if()
</related>
<availability>1.0</availability>
<type>Keyword</type>
<partof>PDE</partof>
</root>
+55
View File
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>endShape()</name>
<category>Shape</category>
<subcategory>Vertex</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>endShape_.gif</image>
<code>
beginShape(LINE_STRIP);
vertex(30, 20);
vertex(85, 20);
vertex(85, 75);
vertex(30, 75);
endShape();
</code>
</example>
<description>
The <b>endShape()</b> function is the companion to <b>beginShape()</b> and may only be called after the later. When <b>endshape()</b> is called, all of image data defined since the previous call to <b>beginShape()</b> is written into the image buffer.
</description>
<syntax>
beginShape()
</syntax>
<parameter>
<label></label>
<description></description>
</parameter>
<returns>None</returns>
<related>
beginShape()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
</root>
+63
View File
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>== (equality)</name>
<category>Control</category>
<subcategory>Relational Operators</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
int a = 23;
int b = 23;
if(a == b) {
println("variables a and b are equal");
}
</code>
</example>
<description>
Determines if two values are equivalent. The equality operator is different from the assignment operator.
</description>
<syntax>
<c>value1</c> == <c>value2</c>
</syntax>
<parameter>
<label>value1</label>
<description>int, float, char, byte, boolean, String</description>
</parameter>
<parameter>
<label>value2</label>
<description>int, float, char, byte, boolean, String</description>
</parameter>
<returns></returns>
<related>
&gt; (greater than)
&lt; (less than)
&gt;= (greater than or equal to)
&lt;= (less than or equal to)
!= (inequality)
</related>
<availability>1.0</availability>
<type>Operator</type>
<partof>PDE</partof>
</root>
+61
View File
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>expand()</name>
<category>Data</category>
<subcategory>Array Functions</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
int[] ia = {0, 1, 3, 4};
println(ia.length); // Prints "4"
ia = expand(ia);
println(ia.length); // Prints "8"
ia = expand(ia, 512);
println(ia.length); // Prints "512"
</code>
</example>
<description>
Increases the size of an array. By default, this function doubles the size of the array, but the optional <b>newSize</b> parameter provides precise control over the increase in size.
</description>
<syntax>
expand(<c>array</c>)
expand(<c>array</c>, <c>newSize</c>)
</syntax>
<parameter>
<label>array</label>
<description>booleans[], bytes[], chars[], ints[], floats[], or Strings[]</description>
</parameter>
<parameter>
<label>newSize</label>
<description>positive int: new size for the array</description>
</parameter>
<returns>Array (the same datatype as the input)</returns>
<related>
contract()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
<level>Extended</level>
</root>
+56
View File
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>false</name>
<category>Structure</category>
<subcategory></subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
rect(30, 20, 50, 50);
boolean b = false;
if(b == false) {
line(20, 10, 90, 80); // This line draws
} else {
line(20, 80, 90, 10);
}
</code>
</example>
<description>
Reserved word representing the logical value "false". Only variables of type <b>boolean</b> may be assigned the value <b>false</b>
</description>
<syntax>
false
</syntax>
<parameter>
<label></label>
<description></description>
</parameter>
<parameter>
<label>statements</label>
<description>any valid statements</description>
</parameter>
<returns></returns>
<related>
true
boolean
</related>
<availability>1.0</availability>
<type>Keyword</type>
<partof>PDE</partof>
</root>
+90
View File
@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>fill()</name>
<category>Color</category>
<subcategory>Setting</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>fill_.gif</image>
<code>
fill(153);
rect(30, 20, 55, 55);
</code>
</example>
<example>
<image>fill_2.gif</image>
<code>
fill(204, 102, 0);
rect(30, 20, 55, 55);
</code>
</example>
<description>
Sets the color used to fill shapes. For example, if you call <b>fill(204, 102, 0)</b> and draw a rectangle it will be filled with orange. This color is either specified in terms of the RGB or HSB color depending on the current <b>colorMode()</b>. The default color space is RGB, with each value in the range from 0 to 255. The version of <b>fill()</b> with one parameter specifies a gray value, the version with three parameters specifies a color, and the version with four parameters specifies a color with an alpha value. <i>Note: the value for the parameter "gray" must be less than or equal to the current maximum value as specified by <b>colorMode()</b>. The default value is 255.</i>
</description>
<syntax>
fill(<c>gray</c>)
fill(<c>gray</c>, <c>alpha</c>)
fill(<c>value1</c>, <c>value2</c>, <c>value3</c>)
fill(<c>color</c>)
fill(<c>color</c>, <c>alpha</c>)
fill(<c>value1</c>, <c>value2</c>, <c>value3</c>, <c>alpha</c>)
</syntax>
<parameter>
<label>gray</label>
<description>int or float: number specifying value between white and black</description>
</parameter>
<parameter>
<label>value1</label>
<description>int or float: red or hue value</description>
</parameter>
<parameter>
<label>value2</label>
<description>int or float: green or saturation value</description>
</parameter>
<parameter>
<label>value3</label>
<description>int or float: blue or brightness value</description>
</parameter>
<parameter>
<label>alpha</label>
<description>int or float: opacity of the fill</description>
</parameter>
<parameter>
<label>color</label>
<description>color: any value of the color datatype</description>
</parameter>
<returns>None</returns>
<related>
noFill()
colorMode()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
</root>
+51
View File
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>floor()</name>
<category>Math</category>
<subcategory>Calculation</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
float x = 2.88;
float a = floor(x); // Set "a" to 2.0
</code>
</example>
<description>
Calculates the closest value that is less than or equal to the value of the parameter.
</description>
<syntax>
floor(<c>value</c>)
</syntax>
<parameter>
<label>value</label>
<description>float</description>
</parameter>
<returns>float</returns>
<related>
ceil()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>PDE</partof>
</root>
+102
View File
@@ -0,0 +1,102 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>for()</name>
<category>Control</category>
<subcategory>Iteration</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>for_.gif</image>
<applet></applet>
<code>
for(int i=0; i&lt;40; i=i+1) {
line(30, i, 80, i);
}
</code>
</example>
<example>
<image>for_2.gif</image>
<applet></applet>
<code>
for(int i=0; i&lt;80; i=i+5) {
line(30, i, 80, i);
}
</code>
</example>
<example>
<image>for_3.gif</image>
<applet></applet>
<code>
for(int i=40; i&lt;80; i=i+5) {
line(30, i, 80, i);
}
</code>
</example>
<example>
<image>for_4.gif</image>
<applet></applet>
<code>
for(int i=30; i&lt;80; i=i+5) {
for(int j=0; j&lt;80; j=j+5) {
point(i, j);
}
}
</code>
</example>
<description>
Controls a sequence of repetitions. A <b>for()</b> structure has three parts: <b>init</b>, <b>test</b>, and <b>update</b>. Each part must be separated by a semi-colon ";". The loop continues until the test evaluates to <b>false</b>. When a <b>for()</b> structure is executed, the following sequence of events occurs:<br />1. The init statement is executed<br />2. The test is evaluated to be true or false<br />3. If the test is true, jump to step 4. If the test is False, jump to step 6<br />4. Execute the statements within the block<br />5. Execute the update statement and jump to step 2<br />6. Exit the loop.
</description>
<syntax>
for(<c>init</c>; <c>test</c>; <c>update</c>) {
<c>statements</c>
}
</syntax>
<parameter>
<label>init</label>
<description>statement executed once when beginning loop</description>
</parameter>
<parameter>
<label>test</label>
<description>if the test evaluates to <b>true</b>, the statements execute</description>
</parameter>
<parameter>
<label>update</label>
<description>executes at the end of each iteration</description>
</parameter>
<parameter>
<label>statements</label>
<description>collection of statements executed each time through the loop</description>
</parameter>
<returns></returns>
<related>
while()
</related>
<availability>1.0</availability>
<type>Structure</type>
<partof>PDE</partof>
</root>
+63
View File
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>&gt; (greater than)</name>
<category>Control</category>
<subcategory>Relational Operators</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
int a = 5;
int b = 13;
if(b &gt; a) {
println("variable b is larger the variable a");
}
</code>
</example>
<description>
Tests if the value on the left is larger than the value on the right.
</description>
<syntax>
<c>value1</c> > <c>value2</c>
</syntax>
<parameter>
<label>value1</label>
<description>int or float</description>
</parameter>
<parameter>
<label>value2</label>
<description>int or float</description>
</parameter>
<returns></returns>
<related>
&lt; (less than)
&gt;= (greater than or equal to)
&lt;= (less than or equal to)
== (equality)
!= (inequality)
</related>
<availability>1.0</availability>
<type>Operator</type>
<partof>PDE</partof>
</root>
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>&gt;= (greater than or equal to)</name>
<category>Control</category>
<subcategory>Relational Operators</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
int a = 23;
int b = 23;
if(a &gt;= b) {
println("variable a is greater or equal to variable b ")
}
</code>
</example>
<description>
Tests if the value on the left is larger than the value on the right or if the values are equivalent.
</description>
<syntax>
<c>value1</c> >= <c>value2</c>
</syntax>
<parameter>
<label>value1</label>
<description>int or float</description>
</parameter>
<parameter>
<label>value2</label>
<description>int or float</description>
</parameter>
<returns></returns>
<related>
&gt; (greater than)
&lt; (less than)
&lt;= (less than or equal to)
== (equality)
!= (inequality)
</related>
<availability>1.0</availability>
<type>Operator</type>
<partof>PDE</partof>
</root>
+57
View File
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>green()</name>
<category>Color</category>
<subcategory>Creating &amp; Reading</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>green_.gif</image>
<code>
noStroke();
color c = color(0, 126, 255);
fill(c);
rect(15, 20, 35, 60);
float value = green(c); // Sets "value" to "126"
fill(value);
rect(50, 20, 35, 60);
</code>
</example>
<description>
Extracts the green value from a color.
</description>
<syntax>
green(<c>color</c>)
</syntax>
<parameter>
<label>color</label>
<description>any value of the color datatype</description>
</parameter>
<returns>float</returns>
<related>
red()
blue()
hue()
saturation()
brightness()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
</root>
+53
View File
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>height</name>
<category>Environment</category>
<subcategory></subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>height.gif</image>
<code>
noStroke();
background(0);
rect(40, 0, 20, height);
rect(60, 0, 20, height/2);
</code>
</example>
<description>
System variable which stores the height of the display window. This value is set by the second parameter of the <b>size()</b> function. For example, the function call <b>size(320, 240)</b> sets the <b>height</b> variable to the value 240. The value of <b>height</b> is zero until <b>size()</b> is called.
</description>
<syntax>
height
</syntax>
<parameter>
<label></label>
<description></description>
</parameter>
<returns></returns>
<related>
width
</related>
<availability>1.0</availability>
<type>System variable</type>
<partof>Core</partof>
</root>
+62
View File
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>hour()</name>
<category>Input/Output</category>
<subcategory>Time &amp; Date</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>hour_.jar</image>
<code>
void loop() {
background(204);
int s = second(); // Values from 0 - 59
int m = minute(); // Values from 0 - 59
int h = hour(); // Values from 0 - 23
line(s, 0, s, 33);
line(m, 33, m, 66);
line(h, 66, h, 100);
}
</code>
</example>
<description>
Processing communicates with the clock on your computer. The <b>hour()</b> function returns the current hour as a value from 0 - 23.
</description>
<syntax>
hour()
</syntax>
<parameter>
<label></label>
<description></description>
</parameter>
<returns>int</returns>
<related>
millis()
second()
minute()
day()
month()
year()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
</root>
+61
View File
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>hue()</name>
<category>Color</category>
<subcategory>Creating &amp; Reading</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>hue_.gif</image>
<code>
noStroke();
colorMode(HSB, 255);
color c = color(0, 126, 255);
fill(c);
rect(15, 20, 35, 60);
float value = hue(c); // Sets "value" to "0"
fill(value);
rect(50, 20, 35, 60);
</code>
</example>
<description>
Extracts the hue value from a color.
</description>
<syntax>
hue(<c>color</c>)
</syntax>
<parameter>
<label>color</label>
<description>any value of the color datatype</description>
</parameter>
<returns>float</returns>
<related>
red()
green()
blue()
saturation()
brightness()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
<level>Extended</level>
</root>
+63
View File
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>if()</name>
<category>Control</category>
<subcategory>Conditionals</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>if_.gif</image>
<code>
for(int i=5; i&lt;height; i+=5) {
stroke(255); //Set the color to white
if(i &lt; 35) { //When "i" is less than "35"...
stroke(0); //...set the color to black
}
line(30, i, 80, i);
}
</code>
</example>
<description>
Allows the program to make a decision about which code to execute. If the <b>expression</b> evaluates to <b>true</b>, the statements enclosed within the block are executed and if the <b>expression</b> evaluates to <b>false</b> the statements are not executed.
</description>
<syntax>
if(<c>expression</c>) {
<c>statements</c>
}
</syntax>
<parameter>
<label>expression</label>
<description>any valid expression that evaluates to true or false</description>
</parameter>
<parameter>
<label>statements</label>
<description>one or more statements to be executed</description>
</parameter>
<returns></returns>
<related>
else
</related>
<availability>1.0</availability>
<type>Structure</type>
<partof>PDE</partof>
</root>
+54
View File
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>++ (increment)</name>
<category>Math</category>
<subcategory>Operators</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
int a = 1; // Sets "a" to 1
int b = a++; // Sets "b" to 1, then increments "a" to 2
int c = a; // Sets "c" to 2
</code>
</example>
<description>
Increases the value of an integer variable by 1. Equivalent to the operation <b>i = i + 1</b>. If the value of the variable <b>i</b> is five, then the expression <b>i++</b> increases the value of <b>i</b> to 6.
</description>
<syntax>
value++
</syntax>
<parameter>
<label>value</label>
<description>int</description>
</parameter>
<returns></returns>
<related>
+ (add)
+= (add assign)
-- (decrement)
</related>
<availability>1.0</availability>
<type>Operator</type>
<partof>PDE</partof>
</root>
+64
View File
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>!= (inequality)</name>
<category>Control</category>
<subcategory>Relational Operators</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
int a = 22;
int b = 23;
if(a != b) {
println("variable a is not equal to variable b");
}
</code>
</example>
<description>
Determines if one expression is not equivalent to another.
</description>
<syntax>
<c>value1</c> != <c>value2</c>
</syntax>
<parameter>
<label>value1</label>
<description>int, float, char, byte, boolean, String</description>
</parameter>
<parameter>
<label>value2</label>
<description>int, float, char, byte, boolean, String</description>
</parameter>
<returns></returns>
<related>
&gt; (greater than)
&lt; (less than)
&gt;= (greater than or equal to)
&lt;= (less than or equal to)
== (equality)
</related>
<availability>1.0</availability>
<type>Operator</type>
<partof>PDE</partof>
</root>
+60
View File
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>int</name>
<category>Data</category>
<subcategory>Primitive</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
int a; // Declare variable "a" of type int
a = 23; // Assign "a" the value 23
int b = -256; // Declare variable "b" and assign it the value -256
int c = a + b; // Declare variable "c" and assign it the sum of "a" and "b"
</code>
</example>
<description>
Datatype for integers, numbers without a decimal point. Integers can be as large as 2,147,483,647 and as low as -2,147,483,648. They are stored as 32 bits of information. The first time a variable is written, it must be declared with a statement expressing its datatype. Subsequent uses of this variable must not reference the datatype because Processing will think the variable is being declared again.
</description>
<syntax>
int <c>var</c>
int <c>var</c> = <c>value</c>
</syntax>
<parameter>
<label>var</label>
<description>variable name referencing the value</description>
</parameter>
<parameter>
<label>value</label>
<description>any integer value</description>
</parameter>
<returns></returns>
<related>
splitInts()
float
</related>
<availability>1.0</availability>
<type>Datatype</type>
<partof>PDE</partof>
</root>
+57
View File
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>int()</name>
<category>Data</category>
<subcategory>Conversion</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
float f = 65.0;
int i = int(f);
println(f + " : " + i); // Prints "65.0 : 65"
char c = 'E';
i = int(c);
println(c + " : " + i); // Prints "E : 69"
</code>
</example>
<description>
Converts a primitive datatype, string, or array to its integer representation.
</description>
<syntax>
int(<c>value</c>)
</syntax>
<parameter>
<label>value</label>
<description>float, char, byte, boolean, String, float[], char[], byte[], boolean[], String[]</description>
</parameter>
<returns>int</returns>
<related>
int
float()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>IDE</partof>
</root>
+110
View File
@@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>join()</name>
<category>Data</category>
<subcategory>String Functions</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
// works identically with float[] and String[]
int list[] = new list[3];
list[0] = 8;
list[1] = 67;
list[2] = 5;
String formatted = join(list, ", ");
// formatted now contains "8, 67, 5"
// to format the number of digits used
// the '3' means to pad with zeroes up to 3 digits
String withzeroes = join(list, " ", 3);
// withzeros now contains "008 067 005"
// for floats, formatting is more complicated because
// there are also digits after the decimal point.
float f[] = new float[3];
f[0] = 1.3;
f[1] = 92.8;
f[2] = 0.7;
// 3 digits on the left of the decimal point
// 2 digits to the right of the decimal point
String zerofloats = join(f, " ", 3, 2);
// zerofloats now contains "001.30 092.80 007.70"
// or if you don't want to pad the left-hand side
// a zero will say to ignore and don't pad
String lesspadding = join(f, " ", 0, 2);
// lesspadding now contains "1.30 92.80 7.70"
</code>
</example>
<description>
Combines an array of elements into one String.
</description>
<syntax>
join(<c>anyArray</c>, <c>separator</c>)
join(<c>intArray</c>, <c>separator</c>, <c>digits</c>)
join(<c>floatArray</c>, <c>separator</c>, <c>left</c>, <c>right</c>)
</syntax>
<parameter>
<label>array</label>
<description>array of strings, ints, or floats</description>
</parameter>
<parameter>
<label>intArray</label>
<description>array of ints</description>
</parameter>
<parameter>
<label>floatArray</label>
<description>array of floats</description>
</parameter>
<parameter>
<label>separator</label>
<description>String: a string to be placed between each item</description>
</parameter>
<parameter>
<label>digits</label>
<description>int: number of digits to pad with zeroes</description>
</parameter>
<parameter>
<label>left</label>
<description>int: number of digits to the left of the decimal point</description>
</parameter>
<parameter>
<label>right</label>
<description>int: number of digits to the right of the decimal point</description>
</parameter>
<returns>String</returns>
<related>
split()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
<level>Extended</level>
</root>
+86
View File
@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>key</name>
<category>Input/Output</category>
<subcategory>Keyboard</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>key.jar</image>
<code>
// Click on the window to give it focus
// and press the 'B' key
void loop() {
if(keyPressed) {
if (key == 'b' || key == 'B') {
fill(0);
}
} else {
fill(255);
}
rect(25, 25, 50, 50);
}
</code>
</example>
<example>
<image>key2.jar</image>
<code>
// Click on the window to give it focus
// and press the up and down arrow keys
void loop() {
if(keyPressed) {
if (key == UP) {
fill(255);
} else if (key == DOWN) {
fill(0);
}
} else {
fill(126);
}
rect(25, 25, 50, 50);
}
</code>
</example>
<description>
The system variable <b>key</b> always contains the value of the most recently pressed key on the keyboard. For detecting the arrow keys, the <b>key</b> variable is set to either UP, DOWN, LEFT, or RIGHT. Other special key constants are ALT, CONTROL, and SHIFT.
</description>
<syntax>
key
</syntax>
<parameter>
<label></label>
<description></description>
</parameter>
<returns></returns>
<related>
keyPressed
keyCode
keyPressed()
keyReleased()
</related>
<availability>1.0</availability>
<type>System variable</type>
<partof>Core</partof>
</root>
+72
View File
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>keyPressed()</name>
<category>Input/Output</category>
<subcategory>Keyboard</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>keyPressed_.jar</image>
<code>
// Click on the image to give it focus,
// and then press any key
int value = 0;
void loop() {
fill(value);
rect(25, 25, 50, 50);
}
void keyPressed()
{
if(value == 0) {
value = 255;
} else {
value = 0;
}
}
</code>
</example>
<description>
The <b>keyPressed()</b> function is called once every time a key is pressed. As a general rule, nothing should be draw within the <b>keyPressed()</b> block.
</description>
<syntax>
void keyPressed() {
<c>statements</c>
}
</syntax>
<parameter>
<label></label>
<description></description>
</parameter>
<returns>None</returns>
<related>
keyPressed
key
keyCode
keyReleased()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
</root>
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>keyPressed</name>
<category>Input/Output</category>
<subcategory>Keyboard</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>keyPressed.jar</image>
<code>
// Click on the image to give it focus
// and press any key
// Note: the rectangle in this example may
// flicker as the operating system may
// register a long key press as a repetition
// of key presses
void loop() {
if (keyPressed == true) {
fill(0);
} else {
fill(255);
}
rect(25, 25, 50, 50);
}
</code>
</example>
<description>
The boolean system variable <b>keyPressed</b> is <b>true</b> if any key is pressed and <b>false</b> if no keys are pressed.
</description>
<syntax>
keyPressed
</syntax>
<parameter>
<label></label>
<description></description>
</parameter>
<returns></returns>
<related>
key
keyCode
keyPressed()
keyReleased()
</related>
<availability>1.0</availability>
<type>System variable</type>
<partof>Core</partof>
</root>
+72
View File
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>keyReleased()</name>
<category>Input/Output</category>
<subcategory>Keyboard</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>keyReleased_.jar</image>
<code>
// Click on the image to give it focus,
// and then press any key
int value = 0;
void loop() {
fill(value);
rect(25, 25, 50, 50);
}
void keyReleased()
{
if(value == 0) {
value = 255;
} else {
value = 0;
}
}
</code>
</example>
<description>
The <b>keyReleased()</b> function is called once every time a key is released. As a general rule, nothing should be draw within the <b>keyReleased()</b> block.
</description>
<syntax>
void keyReleased() {
<c>statements</c>
}
</syntax>
<parameter>
<label></label>
<description></description>
</parameter>
<returns>None</returns>
<related>
keyPressed
key
keyCode
keyPressed()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
</root>
+77
View File
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>&lt;&lt; (left shift)</name>
<category>Math</category>
<subcategory>Bitwise Operators</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
int m = 1 &lt;&lt; 3; // In binary: 1 to 1000
println(m); // Prints "8"
int n = 1 &lt;&lt; 8; // In binary: 1 to 100000000
println(n); // Prints "256"
int o = 2 &lt;&lt; 3; // In binary: 10 to 10000
println(o); // Prints "16"
int p = 13 &lt;&lt; 1; // In binary: 1101 to 11010
println(p); // Prints "26"
</code>
</example>
<example>
<image></image>
<code>
// Packs four 8 bit numbers into one 32 bit number
int a = 255; // Binary: 00000000000000000000000011111111
int r = 204; // Binary: 00000000000000000000000011001100
int g = 204; // Binary: 00000000000000000000000011001100
int b = 51; // Binary: 00000000000000000000000000110011
a = a &lt;&lt; 24; // Binary: 11111111000000000000000000000000
r = r &lt;&lt; 16; // Binary: 00000000110011000000000000000000
g = g &lt;&lt; 8; // Binary: 00000000000000001100110000000000
// Equivalent to "color argb = color(r, g, b, a)" but faster
color argb = a | r | g | b;
fill(argb);
rect(30, 20, 55, 55);
</code>
</example>
<description>
Shifts bits to the left. The number to the left of the operator is shifted the number of places specified by the number to the right. Each shift to the left doubles the number, therefore each left shift multiplies the original number by 2. Use the left shift for fast multiplication or to pack a group of numbers together into one larger number. Left shifting only works with integers or numbers which automatically convert to an integer such at byte and char.
</description>
<syntax>
<c>value</c> &lt;&lt; <c>n</c>
</syntax>
<parameter>
<label>value</label>
<description>int: the value to shift</description>
</parameter>
<parameter>
<label>n</label>
<description>int: the number of places to shift left</description>
</parameter>
<returns></returns>
<related>
>> (right shift)
</related>
<availability>1.0</availability>
<type>Operator</type>
<partof>PDE</partof>
<level>Extended</level>
</root>
+86
View File
@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>lerp()</name>
<category>Math</category>
<subcategory>Calculation</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>lerp_.gif</image>
<code>
float a = 20;
float b = 80;
float c = lerp(a, b, .2);
float d = lerp(a, b, .5);
float e = lerp(a, b, .8);
beginShape(POINTS);
vertex(a, 50);
vertex(b, 50);
vertex(c, 50);
vertex(d, 50);
vertex(e, 50);
endShape();
</code>
</example>
<example>
<image>lerp_2.gif</image>
<code>
int x1 = 15;
int y1 = 10;
int x2 = 80;
int y2 = 90;
line(x1, y1, x2, y2);
for(int i=0; i&lt;=10; i++) {
float x = lerp(x1, x2, i/10.0) + 10;
float y = lerp(y1, y2, i/10.0);
point(x, y);
}
</code>
</example>
<description>
Calculates a number between two numbers at a specific increment. The <b>amt</b> parameter is the amount to interpolate between the two values where 0.0 equal to the first point, 0.1 is very near the first point, 0.5 is half-way in between, etc. The lerp function is convenient for creating motion along a strait path and for drawing dotted lines.
</description>
<syntax>
lerp(<c>value1</c>, <c>value2</c>, <c>amt</c>)
</syntax>
<parameter>
<label>value1</label>
<description>float or int: first value</description>
</parameter>
<parameter>
<label>value2</label>
<description>float or int: second value</description>
</parameter>
<parameter>
<label>amt</label>
<description>float: between 0.0 and 1.0</description>
</parameter>
<returns>float</returns>
<related>
curvePoint()
bezierPoint()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
<level>Extended</level>
</root>
+63
View File
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>&lt; (less than)</name>
<category>Control</category>
<subcategory>Relational Operators</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
int a = 22;
int b = 23;
if(a &lt; b) {
println("variable a is less then variable b ");
}
</code>
</example>
<description>
Tests if the value on the left is smaller than the value on the right.
</description>
<syntax>
<c>value1</c> &lt; <c>value2</c>
</syntax>
<parameter>
<label>value1</label>
<description>int or float</description>
</parameter>
<parameter>
<label>value2</label>
<description>int or float</description>
</parameter>
<returns></returns>
<related>
&gt; (greater than)
&gt;= (greater than or equal to)
&lt;= (less than or equal to)
== (equality)
!= (inequality)
</related>
<availability>1.0</availability>
<type>Operator</type>
<partof>PDE</partof>
</root>
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>&lt;= (less than or equal to)</name>
<category>Control</category>
<subcategory>Relational Operators</subcategory>
<usage></usage>
<example>
<image></image>
<code>
int a = 22;
int b = 23;
if(a &lt;= b) {
println("variable a is less or equal to variable b ");
}
</code>
</example>
<description>
Tests if the value on the left is less than the value on the right or if the values are equivalent.
</description>
<syntax>
<c>value1</c> &lt;= <c>value2</c>
</syntax>
<parameter>
<label>value1</label>
<description>int or float</description>
</parameter>
<parameter>
<label>value2</label>
<description>int or float</description>
</parameter>
<returns></returns>
<related>
&gt; (greater than)
&lt; (less than)
&gt;= (greater than or equal to)
== (equality)
!= (inequality)
</related>
<availability>1.0</availability>
<type>Operator</type>
<partof>PDE</partof>
</root>
+87
View File
@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>line()</name>
<category>Shape</category>
<subcategory>2D Primitives</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>line_.gif</image>
<code>
line(30, 20, 85, 75);
</code>
</example>
<example>
<image>line_2.gif</image>
<code>
line(30, 20, 85, 20);
stroke(126);
line(85, 20, 85, 75);
stroke(255);
line(85, 75, 30, 75);
</code>
</example>
<description>
A line is a direct path between two points. The version of <b>line()</b> with four parameters draws the line in the XY plane at Z=0. The version with six parameters allows the line to be placed anywhere within XYZ space. To color a line, use the <b>stroke()</b> function. A line cannot be filled, therefore the <b>fill()</b> method will not affect the color of a line. Lines are drawn with a width of one pixel.
</description>
<syntax>
line(<c>x1</c>, <c>y1</c>, <c>x2</c>, <c>y2</c>);
line(<c>x1</c>, <c>y1</c>, <c>z1</c>, <c>x2</c>, <c>y2</c>, <c>z2</c>);
</syntax>
<parameter>
<label>x1</label>
<description>int or float: x-coordinate of the first point</description>
</parameter>
<parameter>
<label>y1</label>
<description>int or float: y-coordinate of the first point</description>
</parameter>
<parameter>
<label>z1</label>
<description>int or float: z-coordinate of the first point</description>
</parameter>
<parameter>
<label>x2</label>
<description>int or float: x-coordinate of the second point</description>
</parameter>
<parameter>
<label>y2</label>
<description>int or float: y-coordinate of the second point</description>
</parameter>
<parameter>
<label>z2</label>
<description>int or float: z-coordinate of the second point</description>
</parameter>
<returns>None</returns>
<related>
beginShape()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
</root>
+68
View File
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>loadBytes()</name>
<category>Input/Output</category>
<subcategory>Files</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
// open a file and read its binary data
byte b[] = loadBytes("something.dat");
// print each value, from 0 to 255
for (int i = 0; i &lt; b.length; i++) {
// every tenth number, start a new line
if ((i % 10) == 0) {
println();
}
// bytes are from -128 to 127, this converts to 0 to 255
int a = b[i] &amp; 0xff;
print(a + " ");
}
// print a blank line at the end
println();
</code>
</example>
<description>
Reads the contents of a file or url and places it in a byte array. If a file is specified, it must be located in the sketch's "data" directory/folder.
</description>
<syntax>
loadBytes(<c>filename</c>);
</syntax>
<parameter>
<label>filename</label>
<description>String: name of a file in the data folder or a url.</description>
</parameter>
<returns>byte[]</returns>
<related>
loadStrings()
saveStrings()
saveBytes()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
<level>Extended</level>
</root>
+56
View File
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>loadStrings()</name>
<category>Input/Output</category>
<subcategory>Files</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
String lines[] = loadStrings("list.txt");
println("there are " + lines.length + " lines");
for (int i=0; i &lt; lines.length; i++) {
println(lines[i]);
}
</code>
</example>
<description>
Reads the contents of a file or url and creates a String array of its individual lines. If a file is specified, it must be located in the sketch's "data" directory/folder.
</description>
<syntax>
loadStrings(<c>filename</c>)
</syntax>
<parameter>
<label>filename</label>
<description>String: name of the file or url to load</description>
</parameter>
<returns>String[]</returns>
<related>
loadBytes()
saveStrings()
saveBytes()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
<level>Extended</level>
</root>
+54
View File
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>log()</name>
<category>Math</category>
<subcategory>Calculation</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
void setup() {
int i = 12;
println(log(i));
println(log10(i));
}
// Calculates the base-10 logarithm of a number
float log10 (int x) {
return (log(x) / log(10));
}
</code>
</example>
<description>
Calculates the natural logarithm (the base-<i>e</i> logarithm) of a number. This function expects the values greater than 0.0.
</description>
<syntax>
log(<c>value</c>)
</syntax>
<parameter>
<label>value</label>
<description>int or float: number must be greater then 0.0</description>
</parameter>
<returns>float</returns>
<related>
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
<level>Extended</level>
</root>
+64
View File
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>&amp;&amp; (logical AND)</name>
<category>Control</category>
<subcategory>Logical Operators</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>logicalAND.gif</image>
<code>
for(int i=5; i&lt;=95; i+=5) {
if((i &gt; 35) &amp;&amp; (i &lt; 60)) {
stroke(0); //Set color to black
} else {
stroke(255); //Set color to white
}
line(30, i, 80, i);
}
</code>
</example>
<description>
Compares two expressions and returns <b>true</b> only if both evaluate to <b>true</b>. Returns <b>false</b> if one or both evaluate to <b>false</b>. The following list shows all possible combinations:<br /><br /><tt>true &amp;&amp; false // Evaluates false because the second is false <br />false &amp;&amp; true // Evaluates false because the first is false <br />true &amp;&amp; true // Evaluates true because both are true <br />false &amp;&amp; false // Evaluates false because both are false</tt>
</description>
<syntax>
<c>expression1</c> &amp;&amp; <c>expression2</c>
</syntax>
<parameter>
<label>expression1</label>
<description>any valid expression</description>
</parameter>
<parameter>
<label>expression2</label>
<description>any valid expression</description>
</parameter>
<returns></returns>
<related>
|| (logical OR)
! (logical NOT)
if()
</related>
<availability>1.0</availability>
<type>Operator</type>
<partof>PDE</partof>
</root>
+60
View File
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>! (logical NOT)</name>
<category>Control</category>
<subcategory>Logical Operators</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>logicalNOT.gif</image>
<code>
boolean a = false;
if (!a) {
rect(30, 20, 50, 50);
}
a = true;
if (a) {
line(20, 10, 90, 80);
line(20, 80, 90, 10);
}
</code>
</example>
<description>
Inverts the Boolean value of an expression. Returns <b>true</b> if the expression is <b>false</b> and returns <b>false</b> if the expression is <b>true</b>. If the expression <b>(a>b)</b> evaluates to true, then <b>!(a>b)</b> evaluates to false.
</description>
<syntax>
!<c>expression</c>
</syntax>
<parameter>
<label>expression</label>
<description>any valid expression</description>
</parameter>
<returns></returns>
<related>
|| (logical OR)
&amp;&amp; (logical AND)
if()
</related>
<availability>1.0</availability>
<type>Operator</type>
<partof>PDE</partof>
</root>
+61
View File
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>|| (logical OR)</name>
<category>Control</category>
<subcategory>Logical Operators</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>logicalOR.gif</image>
<code>
for(int i=5 ; i&lt;=95; i+=5) {
if((i &lt; 35) || (i &gt; 60)) {
line(30, i, 80, i);
}
}
</code>
</example>
<description>
Compares two expressions and returns <b>true</b> if one or both evaluate to <b>true</b>. Returns <b>false</b> only if both expressions are <b>false</b>. The following list shows all possible combinations:<br /><br /><tt>true || false // Evaluates true because the first is true <br />false || true // Evaluates true because the second is true <br />true || true // Evaluates true because both are true <br />false || false // Evaluates false because both are false</tt>
</description>
<syntax>
<c>expression1</c> || <c>expression2</c>
</syntax>
<parameter>
<label>expression1</label>
<description>any valid expression</description>
</parameter>
<parameter>
<label>expression2</label>
<description>any valid expression</description>
</parameter>
<returns></returns>
<related>
&amp;&amp; (logical AND)
! (logical NOT)
if()
</related>
<availability>1.0</availability>
<type>Operator</type>
<partof>PDE</partof>
</root>
+73
View File
@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>loop()</name>
<category>Structure</category>
<subcategory></subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<applet></applet>
<code>
void setup() {
size(200, 200);
noLoop();
}
float x = 0;
void draw() {
background(204);
x = x + .1;
if (x > width) {
x = 0;
}
line(x, 0, x, height);
}
void mousePressed() {
loop();
}
void mouseReleased() {
noLoop();
}
</code>
</example>
<description>
Causes Processing to continuously execute the code within <b>draw()</b>. If <b>noLoop()</b> is called, the code in <b>draw()</b> stops executing.
</description>
<syntax>
loop()
</syntax>
<parameter>
<label></label>
<description></description>
</parameter>
<returns>None</returns>
<related>
noLoop()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>PDE</partof>
</root>
+63
View File
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>max()</name>
<category>Math</category>
<subcategory>Calculation</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
int a = max(5, 9); // Sets "a" to 9
int b = max(-4, -12); // Sets "b" to -4
float c = max(12.3, 230.24); // Sets "c" to 230.24
</code>
</example>
<description>
Determines the largest value in a sequence of numbers.
</description>
<syntax>
max(<c>value1</c>, <c>value2</c>)
max(<c>value1</c>, <c>value2</c>, <c>value 3</c>)
</syntax>
<parameter>
<label>value1</label>
<description>int or float</description>
</parameter>
<parameter>
<label>value2</label>
<description>int or float</description>
</parameter>
<parameter>
<label>value3</label>
<description>int or float</description>
</parameter>
<returns>int or float (depending on the inputs)</returns>
<related>
min()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>PDE</partof>
</root>
+60
View File
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>millis()</name>
<category>Input/Output</category>
<subcategory>Time &amp; Date</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>millis_.jar</image>
<code>
void loop() {
float m = millis();
fill(m % 255);
rect(25, 25, 50, 50);
}
</code>
</example>
<description>
Returns the number of milliseconds (thousandths of a second) since starting an applet. This information is often used for timing animation sequences.
</description>
<syntax>
millis()
</syntax>
<parameter>
<label></label>
<description></description>
</parameter>
<returns>int</returns>
<related>
millis()
second()
minute()
hour()
day()
month()
year()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
</root>

Some files were not shown because too many files have changed in this diff Show More