Skip to content

Commit e2d5e91

Browse files
author
Andreas Göransson
committed
Merge remote-tracking branch 'origin/Alternative-API'
2 parents a65d4ca + ffc1ef8 commit e2d5e91

File tree

124 files changed

+38126
-1842
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+38126
-1842
lines changed

.settings/org.eclipse.core.resources.prefs

Lines changed: 0 additions & 2 deletions
This file was deleted.
Binary file not shown.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* JSON 4 Processing
3+
* Basic example 5: Loading JSON from a file
4+
*/
5+
6+
import org.json.*;
7+
8+
void setup(){
9+
JSON json = JSON.load(dataPath("data.json"));
10+
11+
println( json );
12+
}
13+
14+
void draw(){
15+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "My data file"
3+
"values": [
4+
1, 2, 3, 4
5+
]
6+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* JSON 4 Processing
3+
* Basic example 2: Creating a list of JSON values
4+
*/
5+
6+
import org.json.*;
7+
8+
void setup(){
9+
10+
// 1. Initialize the Array
11+
JSON myJsonArray = JSON.createArray();
12+
13+
// 2. Add some content to the array
14+
myJsonArray.append( 4 );
15+
myJsonArray.append( 2 );
16+
17+
println( myJsonArray );
18+
}
19+
20+
void draw(){
21+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* JSON 4 Processing
3+
* Basic example 3: Creating a list of JSON objects
4+
*/
5+
6+
import org.json.*;
7+
8+
void setup(){
9+
10+
// 1. Initialize the Array
11+
JSON myJsonUsers = JSON.createArray();
12+
13+
// 2. Create the first object & add to array
14+
JSON firstUser = JSON.createObject();
15+
firstUser.setString( "name", "Andreas" );
16+
firstUser.setInt( "age", 32 );
17+
myJsonUsers.append( firstUser );
18+
19+
// 3. Create the second object
20+
JSON secondUser = JSON.createObject();
21+
secondUser.setString( "name", "Maria" );
22+
secondUser.setInt( "age", 28 );
23+
myJsonUsers.append( secondUser );
24+
25+
println( myJsonUsers );
26+
}
27+
28+
void draw(){
29+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* JSON 4 Processing
3+
* Basic example 1: Creating a JSON object
4+
*
5+
* Good for sending values that has a specific meaning (complex values)
6+
*/
7+
8+
import org.json.*;
9+
10+
void setup(){
11+
12+
// 1. Initialize the object
13+
JSON myJsonObject = JSON.createObject();
14+
15+
// 2. Add some content to the object
16+
myJsonObject.setInt( "myIntegerValue", 7 );
17+
18+
println( myJsonObject );
19+
}
20+
21+
void draw(){
22+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* JSON 4 Processing
3+
* Basic example 3: Parsing a JSON formatted string
4+
*/
5+
6+
import org.json.*;
7+
8+
void setup(){
9+
10+
// 1. Get the json-string (we'll just create one...)
11+
String jsonstring = "{\"myIntegerValue\":7}";
12+
13+
// 2. Initialize the object
14+
JSON myJsonObject = JSON.parse(jsonstring);
15+
16+
println( myJsonObject );
17+
}
18+
19+
void draw(){
20+
}
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4+
<head>
5+
<title>json4processing</title>
6+
<meta name="description" content="a library for the programming environment processing" />
7+
<meta name="keywords" content="processing.org, library" />
8+
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
9+
<meta http-equiv="Content-Language" content="en-us" />
10+
<meta name="ROBOTS" content="index,follow,archive" />
11+
<meta http-equiv="imagetoolbar" content="false" />
12+
<meta name="MSSmartTagsPreventParsing" content="true" />
13+
<meta name="author" content="##author##" />
14+
<meta name="Rating" content="General" />
15+
<meta name="revisit-after" content="7 Days" />
16+
<meta name="doc-class" content="Living Document" />
17+
<link rel="stylesheet" type="text/css" href="./stylesheet.css">
18+
</head>
19+
<body>
20+
<div id="container">
21+
22+
<div id="header">
23+
<h1>json4processing</h1>
24+
</div>
25+
26+
<div id="menu" class="clear">
27+
<ul>
28+
<li><a href="#about">About</a> \ </li>
29+
<li><a href="#download">Download</a> \ </li>
30+
<li><a href="#download">Installation</a> \ </li>
31+
<li><a href="#examples">Examples</a> \ </li>
32+
<li><a href="./reference/index.html" target="_blank">Reference</a></li>
33+
<!-- <li><a href="#demos">Demos</a> \ </li> -->
34+
<!-- <li><a href="#misc">Misc</a> \ </li> -->
35+
<!-- <li><a href="#images">Images</a> \ </li> -->
36+
</ul>
37+
</div>
38+
39+
<div id="content" class="clear">
40+
41+
<div id="about">
42+
<h2>json4processing</h2>
43+
<p>
44+
A library by <a href="##yourLink##">Andreas Goransson</a> for the programming environment <a href="http://www.processing.org" target="_blank">processing</a>. Last update, 04/07/2013.
45+
</p>
46+
<p>
47+
Feel free to replace this paragraph with a description of the library. Contributed libraries are developed, documented, and maintained by members of the Processing community. Further directions are included with each library. For feedback and support, please post to the Discourse. We strongly encourage all libraries to be open source, but not all of them are.
48+
</p>
49+
</div>
50+
51+
52+
53+
<div id="download" class="clear">
54+
<h2>Download</h2>
55+
<p>
56+
Download json4processing version 0.1.6 in
57+
<a href="./download/json4processing-0.1.6.zip">.zip format</a>.
58+
</p>
59+
<h2>Installation</h2>
60+
<p>
61+
Unzip and put the extracted json4processing folder into the libraries folder of your processing sketches. Reference and examples are included in the json4processing folder.
62+
</p>
63+
</div>
64+
65+
66+
<div id="resources">
67+
<p><strong>Keywords</strong> ?</p>
68+
<p><strong>Reference</strong>. Have a look at the javadoc reference <a href="./reference/index.html" target="_blank">here</a>. a copy of the reference is included in the .zip as well.</p>
69+
<p><strong>Source</strong>. The source code of json4processing is available at <a href="https://github.com/agoransson/JSON-processing">github</a>, and its repository can be browsed <a href="https://github.com/agoransson/JSON-processing" target="_blank">here</a>.</p>
70+
</div>
71+
72+
<div id="examples" class="clear">
73+
<h2>Examples</h2>
74+
<p>Find a list of examples in the current distribution of json4processing, or have a look at them by following the links below.</p>
75+
<ul>
76+
<li><a href="examples/create_json_from_file/create_json_from_file.pde">create_json_from_file</a></li> <li><a href="examples/create_jsonarray/create_jsonarray.pde">create_jsonarray</a></li> <li><a href="examples/create_jsonarray_of_objects/create_jsonarray_of_objects.pde">create_jsonarray_of_objects</a></li> <li><a href="examples/create_jsonobject/create_jsonobject.pde">create_jsonobject</a></li> <li><a href="examples/create_jsonobject_from_string/create_jsonobject_from_string.pde">create_jsonobject_from_string</a></li>
77+
</ul>
78+
</div>
79+
80+
81+
<div id="info">
82+
<h2>Tested</h2>
83+
<p>
84+
<!-- on which platform has the library been tested? -->
85+
<strong>Platform</strong> linux, windows
86+
87+
<!-- which processing version did you use for testing your library? -->
88+
<br /><strong>Processing</strong> 1.5.1
89+
90+
<!-- does your library depend on any other library or framework? -->
91+
<br /><strong>Dependencies</strong> ?
92+
</p>
93+
</div>
94+
95+
96+
<!-- use the demos section for a list of applets run in a browser. -->
97+
<!--
98+
<div id="demos" class="clear">
99+
<h2>demos</h2>
100+
<p>
101+
find a list of online applet demos below.
102+
103+
<ul>
104+
<li><a href="./applets/demo/index.html">demo</a></li>
105+
</ul>
106+
</p>
107+
</div>
108+
-->
109+
110+
<!-- use the misc section for other relevant information. Activate the link to the misc section in the menu above. -->
111+
<!--
112+
<div id="misc" class="clear">
113+
<p></p>
114+
</div>
115+
-->
116+
117+
<!-- use the images/screenshots section. Activate the link to the misc section in the menu above. -->
118+
<!--
119+
<div id="images" class="clear">
120+
</div>
121+
-->
122+
123+
124+
<br class="clear" />
125+
</div>
126+
127+
<div id="footer">
128+
<p>by Andreas Goransson, (c) 2011.</p>
129+
</div>
130+
</div>
131+
</body>
132+
</html>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2+
<!-- NewPage -->
3+
<html lang="sv">
4+
<head>
5+
<!-- Generated by javadoc (version 1.7.0_09) on Sun Apr 07 21:00:07 CEST 2013 -->
6+
<title>All Classes (Javadocs: json4processing)</title>
7+
<meta name="date" content="2013-04-07">
8+
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
9+
</head>
10+
<body>
11+
<h1 class="bar">All Classes</h1>
12+
<div class="indexContainer">
13+
<ul>
14+
<li><a href="org/json/CDL.html" title="class in org.json" target="classFrame">CDL</a></li>
15+
<li><a href="org/json/Cookie.html" title="class in org.json" target="classFrame">Cookie</a></li>
16+
<li><a href="org/json/CookieList.html" title="class in org.json" target="classFrame">CookieList</a></li>
17+
<li><a href="org/json/HTTP.html" title="class in org.json" target="classFrame">HTTP</a></li>
18+
<li><a href="org/json/HTTPTokener.html" title="class in org.json" target="classFrame">HTTPTokener</a></li>
19+
<li><a href="org/json/JSON.html" title="class in org.json" target="classFrame">JSON</a></li>
20+
<li><a href="org/json/JSONArr.html" title="class in org.json" target="classFrame">JSONArr</a></li>
21+
<li><a href="org/json/JSONException.html" title="class in org.json" target="classFrame">JSONException</a></li>
22+
<li><a href="org/json/JSONML.html" title="class in org.json" target="classFrame">JSONML</a></li>
23+
<li><a href="org/json/JSONObj.html" title="class in org.json" target="classFrame">JSONObj</a></li>
24+
<li><a href="org/json/JSONString.html" title="interface in org.json" target="classFrame"><i>JSONString</i></a></li>
25+
<li><a href="org/json/JSONStringer.html" title="class in org.json" target="classFrame">JSONStringer</a></li>
26+
<li><a href="org/json/JSONTokener.html" title="class in org.json" target="classFrame">JSONTokener</a></li>
27+
<li><a href="org/json/JSONWriter.html" title="class in org.json" target="classFrame">JSONWriter</a></li>
28+
<li><a href="org/json/XML.html" title="class in org.json" target="classFrame">XML</a></li>
29+
<li><a href="org/json/XMLTokener.html" title="class in org.json" target="classFrame">XMLTokener</a></li>
30+
</ul>
31+
</div>
32+
</body>
33+
</html>

0 commit comments

Comments
 (0)