forked from jdf/processing-py-site
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathObject.xml
More file actions
61 lines (44 loc) · 1.27 KB
/
Object.xml
File metadata and controls
61 lines (44 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>Object</name>
<category>Data</category>
<subcategory>Composite</subcategory>
<usage>Web & Application</usage>
<example>
<image />
<code><![CDATA[
class HLine(object): # Class definition
def __init__(self, ypos, stroke_color): # Object constructor
self.ypos = ypos
self.stroke_color = stroke_color
def display(self): # Display method
stroke(self.stroke_color)
line(0, self.ypos, width, self.ypos)
# Declare and construct two objects (h1 and h2) of the class HLine(object):
h1 = HLine(20, 0)
h2 = HLine(50, 255)
background(127)
h1.display()
h2.display()
]]></code>
</example>
<description><![CDATA[
Objects are instances of classes. A class is a grouping of related methods (functions) and fields (variables and constants).
]]></description>
<syntax>
<c>instanceName</c> = <c>ClassName()</c>
</syntax>
<parameter>
<label>ClassName</label>
<description><![CDATA[the class from which to create the new object]]></description>
</parameter>
<parameter>
<label>instanceName</label>
<description><![CDATA[the name for the new object]]></description>
</parameter>
<returns></returns>
<related>class</related>
<availability>1.0</availability>
<type>Object</type>
<partof>PYDE</partof>
</root>