Subversion Repositories Applications.gtt

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
60 jpm 1
<html>
2
	<head>
3
		<title>Documentation</title>
4
		<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
5
		<link rel='stylesheet' href='style.css' />
6
	</head>
7
 
8
	<body>
9
		<div align='center'>
10
		<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
11
			<tr>
12
				<td class='borderhg'>&nbsp;</td>
13
				<td class='borderh'>&nbsp;</td>
14
				<td class='cornerhd'></td>
15
			</tr>
16
			<tr>
17
				<td class='borderg'>&nbsp;</td>
18
				<td><a id="top"></a><h2>
19
<small>abstract</small> Class Component</h2><div class="description">
20
		<p>
21
			Un composant est un objet qui peut être ajouté à une <a href="Image.html">Image</a>. Les composants sont indépendants les uns des autres. La classe <a href="Component.html">Component</a> est une classe abstraite, dont doivent dériver tous les objets qui vont pouvoir être ajoutés sur une image.
22
		</p>
23
		<p>
24
			Sur un composant, l'axe des abscisses rejoint l'axe des ordonnées sur le coin haut-gauche. Le coin haut-gauche du composant a donc pour coordonnées (0, 0) et le coin bas-droite (largeur, hauteur). Par exemple, sur une image de largeur 100 et de hauteur 50, un point à 50 sur l'axe des abscisses et 25 sur l'axe des ordonnées sera au centre de l'image.
25
		</p>
26
	</div><div class="inherit">
27
			Les classes suivantes dérivent de Component :
28
				<ul>
29
<li><a href="ComponentGroup.html">ComponentGroup</a></li>
30
<li><a href="MathPlot.html">MathPlot</a></li>
31
<li><a href="Pie.html">Pie</a></li>
32
<li><a href="Plot.html">Plot</a></li>
33
</ul>
34
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="properties">
35
<li>
36
<span class="access">protected</span> <a href="Driver.html"><span class="type">Driver</span></a> <a href="Component.html#property.driver"><span class="argument">$driver</span></a>
37
</li>
38
<li>
39
<span class="access">public</span> <span class="type">float</span> <a href="Component.html#property.width"><span class="argument">$width</span></a>
40
</li>
41
<li>
42
<span class="access">public</span> <span class="type">float</span> <a href="Component.html#property.height"><span class="argument">$height</span></a>
43
</li>
44
<li>
45
<span class="access">public</span> <span class="type">float</span> <a href="Component.html#property.x"><span class="argument">$x</span></a>
46
</li>
47
<li>
48
<span class="access">public</span> <span class="type">float</span> <a href="Component.html#property.y"><span class="argument">$y</span></a>
49
</li>
50
<li>
51
<span class="access">public</span> <span class="type">int</span> <a href="Component.html#property.w"><span class="argument">$w</span></a>
52
</li>
53
<li>
54
<span class="access">public</span> <span class="type">int</span> <a href="Component.html#property.h"><span class="argument">$h</span></a>
55
</li>
56
<li>
57
<span class="access">public</span> <span class="type">int</span> <a href="Component.html#property.top"><span class="argument">$top</span></a>
58
</li>
59
<li>
60
<span class="access">public</span> <span class="type">int</span> <a href="Component.html#property.left"><span class="argument">$left</span></a>
61
</li>
62
<li>
63
<span class="access">protected</span> <span class="type">mixed</span> <a href="Component.html#property.background"><span class="argument">$background</span></a>
64
</li>
65
<li>
66
<span class="access">public</span> <a href="Side.html"><span class="type">Side</span></a> <a href="Component.html#property.padding"><span class="argument">$padding</span></a>
67
</li>
68
<li>
69
<span class="access">public</span> <a href="Side.html"><span class="type">Side</span></a> <a href="Component.html#property.space"><span class="argument">$space</span></a>
70
</li>
71
<li>
72
<span class="access">protected</span> <span class="type">bool</span> <a href="Component.html#property.auto"><span class="argument">$auto</span></a>
73
</li>
74
<li>
75
<span class="access">public</span> <a href="Label.html"><span class="type">Label</span></a> <a href="Component.html#property.title"><span class="argument">$title</span></a>
76
</li>
77
<li>
78
<span class="access">public</span> <a href="Legend.html"><span class="type">Legend</span></a> <a href="Component.html#property.legend"><span class="argument">$legend</span></a>
79
</li>
80
</ul><ul class="methods">
81
<li>
82
<span class="access">public</span> <a href="Component.html#method.__construct">__construct</a>()
83
	</li>
84
<li>
85
<span class="access">public</span> <a href="Component.html#method.auto">auto</a>(<span class="type">bool</span> <span class="argument">$auto</span>)
86
	</li>
87
<li>
88
<span class="access">public</span> <a href="Component.html#method.setSize">setSize</a>(<span class="type">float</span> <span class="argument">$width</span>, <span class="type">float</span> <span class="argument">$height</span>)
89
	</li>
90
<li>
91
<span class="access">public</span> <a href="Component.html#method.setAbsSize">setAbsSize</a>(<span class="type">int</span> <span class="argument">$w</span>, <span class="type">int</span> <span class="argument">$h</span>)
92
	</li>
93
<li>
94
<span class="access">public</span> <a href="Component.html#method.setBackgroundColor">setBackgroundColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
95
	</li>
96
<li>
97
<span class="access">public</span> <a href="Component.html#method.setBackgroundGradient">setBackgroundGradient</a>(<a href="Gradient.html"><span class="type">Gradient</span></a> <span class="argument">$gradient</span>)
98
	</li>
99
<li>
100
<span class="access">public</span> <a href="Component.html#method.setBackgroundImage">setBackgroundImage</a>(<a href="Image.html"><span class="type">Image</span></a> <span class="argument">$image</span>)
101
	</li>
102
<li>
103
<span class="access">public</span> <span class="type">mixed</span> <a href="Component.html#method.getBackground">getBackground</a>(<span class="type">int</span> <span class="argument">$type</span>)
104
	</li>
105
<li>
106
<span class="access">public</span> <a href="Component.html#method.setPadding">setPadding</a>(<span class="type">int</span> <span class="argument">$left</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$right</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$top</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$bottom</span> := <span class="default">NULL</span>)
107
	</li>
108
<li>
109
<span class="access">public</span> <a href="Component.html#method.setSpace">setSpace</a>(<span class="type">int</span> <span class="argument">$left</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$right</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$top</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$bottom</span> := <span class="default">NULL</span>)
110
	</li>
111
<li>
112
<span class="access">public</span> <a href="Component.html#method.setCenter">setCenter</a>(<span class="type">float</span> <span class="argument">$x</span>, <span class="type">float</span> <span class="argument">$y</span>)
113
	</li>
114
<li>
115
<span class="access">public</span> <a href="Component.html#method.setAbsPosition">setAbsPosition</a>(<span class="type">int</span> <span class="argument">$left</span>, <span class="type">int</span> <span class="argument">$top</span>)
116
	</li>
117
<li>
118
<span class="access">public</span> <a href="Component.html#method.init">init</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>)
119
	</li>
120
<li>
121
<span class="access">public</span> <a href="Component.html#method.finalize">finalize</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>)
122
	</li>
123
<li>
124
<span class="access">abstract public</span> <span class="type">array</span> <a href="Component.html#method.getPosition">getPosition</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>)
125
	</li>
126
<li>
127
<span class="access">abstract public</span> <a href="Component.html#method.drawEnvelope">drawEnvelope</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>)
128
	</li>
129
<li>
130
<span class="access">abstract public</span> <a href="Component.html#method.drawComponent">drawComponent</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>, <span class="type">int</span> <span class="argument">$x1</span>, <span class="type">int</span> <span class="argument">$y1</span>, <span class="type">int</span> <span class="argument">$x2</span>, <span class="type">int</span> <span class="argument">$y2</span>, <span class="type">bool</span> <span class="argument">$aliasing</span>)
131
	</li>
132
<li>
133
<span class="access">protected</span> <a href="Component.html#method.getSpace">getSpace</a>(<span class="type">int</span> <span class="argument">$width</span>, <span class="type">int</span> <span class="argument">$height</span>)
134
	</li>
135
</ul><h2>Documentation</h2><ul class="doc">
136
<li class="property">
137
<a id="property.driver"></a><span class="access">protected</span> <a href="Driver.html"><span class="type">Driver</span></a> <a href="Component.html#property.driver"><span class="argument">$driver</span></a><div class="description">
138
				Un objet <a href="Driver.html">Driver</a> pour dessiner sur l'image.
139
			</div>
140
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
141
</li>
142
<li class="property">
143
<a id="property.width"></a><span class="access">public</span> <span class="type">float</span> <a href="Component.html#property.width"><span class="argument">$width</span></a><div class="description">
144
				Largeur du composant entre 0 et 1. Représente une fraction de la largeur de l'image.
145
			</div>
146
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
147
</li>
148
<li class="property">
149
<a id="property.height"></a><span class="access">public</span> <span class="type">float</span> <a href="Component.html#property.height"><span class="argument">$height</span></a><div class="description">
150
				Hauteur du composant entre 0 et 1. Représente une fraction de la hauteur de l'image.
151
			</div>
152
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
153
</li>
154
<li class="property">
155
<a id="property.x"></a><span class="access">public</span> <span class="type">float</span> <a href="Component.html#property.x"><span class="argument">$x</span></a><div class="description">
156
				Position du composant sur l'axe des abscisses entre 0 et 1. Représente une fraction de la largeur de l'image.
157
			</div>
158
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
159
</li>
160
<li class="property">
161
<a id="property.y"></a><span class="access">public</span> <span class="type">float</span> <a href="Component.html#property.y"><span class="argument">$y</span></a><div class="description">
162
				Position du composant sur l'axe des ordonnées entre 0 et 1. Représente une fraction de la hauteur de l'image.
163
				Attention, la position 0 correspond au haut de l'image.
164
			</div>
165
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
166
</li>
167
<li class="property">
168
<a id="property.w"></a><span class="access">public</span> <span class="type">int</span> <a href="Component.html#property.w"><span class="argument">$w</span></a><div class="description">
169
				Largeur du composant en pixels.
170
			</div>
171
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
172
</li>
173
<li class="property">
174
<a id="property.h"></a><span class="access">public</span> <span class="type">int</span> <a href="Component.html#property.h"><span class="argument">$h</span></a><div class="description">
175
				Hauteur du composant en pixels.
176
			</div>
177
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
178
</li>
179
<li class="property">
180
<a id="property.top"></a><span class="access">public</span> <span class="type">int</span> <a href="Component.html#property.top"><span class="argument">$top</span></a><div class="description">
181
				Position du composant sur l'axe des ordonnées en pixels.
182
			</div>
183
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
184
</li>
185
<li class="property">
186
<a id="property.left"></a><span class="access">public</span> <span class="type">int</span> <a href="Component.html#property.left"><span class="argument">$left</span></a><div class="description">
187
				Position du composant sur l'axe des abscisses en pixels.
188
			</div>
189
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
190
</li>
191
<li class="property">
192
<a id="property.background"></a><span class="access">protected</span> <span class="type">mixed</span> <a href="Component.html#property.background"><span class="argument">$background</span></a><div class="description">
193
				Fond du composant. Peut être une <a href="Color.html">couleur</a>, un <a href="Gradient.html">dégradé</a> ou peut être laissé à NULL pour ne spécifier aucune couleur de fond.
194
			</div>
195
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
196
</li>
197
<li class="property">
198
<a id="property.padding"></a><span class="access">public</span> <a href="Side.html"><span class="type">Side</span></a> <a href="Component.html#property.padding"><span class="argument">$padding</span></a><div class="description">
199
				Espace interne du composant.
200
			</div>
201
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
202
</li>
203
<li class="property">
204
<a id="property.space"></a><span class="access">public</span> <a href="Side.html"><span class="type">Side</span></a> <a href="Component.html#property.space"><span class="argument">$space</span></a><div class="description">
205
				Espace interne dans la zone de dessin effective du composant. Les valeurs doivent être données en pourcentage de la taille de la zone de dessin.
206
				Le zone de dessin est la zone dans laquelle est dessiné le composant, c'est-à-dire la zone du composant amputée des axes et de l'<a href="Component.html#property.padding">espace interne</a>.
207
			</div>
208
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
209
</li>
210
<li class="property">
211
<a id="property.auto"></a><span class="access">protected</span> <span class="type">bool</span> <a href="Component.html#property.auto"><span class="argument">$auto</span></a><div class="description">
212
				Doit-on ajuster automatiquement le composant ?
213
			</div>
214
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
215
</li>
216
<li class="property">
217
<a id="property.title"></a><span class="access">public</span> <a href="Label.html"><span class="type">Label</span></a> <a href="Component.html#property.title"><span class="argument">$title</span></a><div class="description">
218
				Le titre du composant.
219
				Si un titre est spécifié, il sera affiché sur l'image.
220
			</div>
221
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
222
</li>
223
<li class="property">
224
<a id="property.legend"></a><span class="access">public</span> <a href="Legend.html"><span class="type">Legend</span></a> <a href="Component.html#property.legend"><span class="argument">$legend</span></a><div class="description">
225
				La légende associée au composant.
226
			</div>
227
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
228
</li>
229
<li class="method">
230
<a id="method.__construct"></a><span class="access">public</span> <a href="Component.html#method.__construct">__construct</a>()
231
	<div class="description">
232
				Construit le composant en lui affectant une taille égale à celle de l'image et en le positionnant au centre de cette image.
233
				Le composant remplit donc toute la surface de l'image.
234
			</div>
235
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
236
</li>
237
<li class="method">
238
<a id="method.auto"></a><span class="access">public</span> <a href="Component.html#method.auto">auto</a>(<span class="type">bool</span> <span class="argument">$auto</span>)
239
	<div class="description">
240
				TRUE si le composant doit être automatiquement ajusté, FALSE sinon.
241
				La notion d'ajustage automatique est propre à chaque classe qui dérive de celle-ci.
242
				Par exemple, sur les histogrammes, si le composant n'est pas automatiquement ajusté, alors les barres ne seront pas centrées sur zéro mais sur leur valeur minimum.
243
			</div>
244
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
245
</li>
246
<li class="method">
247
<a id="method.setSize"></a><span class="access">public</span> <a href="Component.html#method.setSize">setSize</a>(<span class="type">float</span> <span class="argument">$width</span>, <span class="type">float</span> <span class="argument">$height</span>)
248
	<div class="description">
249
				Change la largeur $width et la hauteur $height du composant.
250
				Les nouvelles valeurs doivent être comprises entre 0 et 1 et correspondent à une fraction des largeur et hauteur de l'image à laquelle le composant appartient.
251
<pre>
252
 
253
&lt;?php
254
 
255
require_once "LinePlot.class.php";
256
 
257
$graph = new <a href="Graph.html">Graph</a>(400, 400);
258
 
259
// LinePLot dérive de Component
260
$plot = new <a href="LinePlot.html">LinePlot</a>(array(1, 2, 3));
261
 
262
// Le taille du composant sera 1 / 3 de celle de l'image, soit 133x133 pixels
263
$plot-&gt;<a href="Component.html#method.setSize">setSize</a>(1 / 3, 1 / 3);
264
 
265
$graph-&gt;<a href="Graph.html#method.add">add</a>($plot);
266
$graph-&gt;<a href="Graph.html#method.draw">draw</a>();
267
 
268
?&gt;
269
 
270
</pre>
271
			</div>
272
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
273
</li>
274
<li class="method">
275
<a id="method.setAbsSize"></a><span class="access">public</span> <a href="Component.html#method.setAbsSize">setAbsSize</a>(<span class="type">int</span> <span class="argument">$w</span>, <span class="type">int</span> <span class="argument">$h</span>)
276
	<div class="description">
277
				Donne une taille absolue au composant.
278
				La largeur $width et la hauteur $height doivent être données en pixels.
279
			</div>
280
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
281
</li>
282
<li class="method">
283
<a id="method.setBackgroundColor"></a><span class="access">public</span> <a href="Component.html#method.setBackgroundColor">setBackgroundColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
284
	<div class="description">
285
				Change la couleur de fond du composant.
286
			</div>
287
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
288
</li>
289
<li class="method">
290
<a id="method.setBackgroundGradient"></a><span class="access">public</span> <a href="Component.html#method.setBackgroundGradient">setBackgroundGradient</a>(<a href="Gradient.html"><span class="type">Gradient</span></a> <span class="argument">$gradient</span>)
291
	<div class="description">
292
				Change le dégradé de fond du composant.
293
			</div>
294
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
295
</li>
296
<li class="method">
297
<a id="method.setBackgroundImage"></a><span class="access">public</span> <a href="Component.html#method.setBackgroundImage">setBackgroundImage</a>(<a href="Image.html"><span class="type">Image</span></a> <span class="argument">$image</span>)
298
	<div class="description">
299
				Change l'image de fond du composant.
300
			</div>
301
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
302
</li>
303
<li class="method">
304
<a id="method.getBackground"></a><span class="access">public</span> <span class="type">mixed</span> <a href="Component.html#method.getBackground">getBackground</a>(<span class="type">int</span> <span class="argument">$type</span>)
305
	<div class="description">
306
				Retourne le fond de l'image. Cela peut être une <a href="Color.html">couleur</a>, un <a href="Gradient.html">dégradé</a> ou encore une <a href="Image.html">image</a>. Si aucun fond n'a été spécifié, cette méthode retourne NULL.
307
			</div>
308
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
309
</li>
310
<li class="method">
311
<a id="method.setPadding"></a><span class="access">public</span> <a href="Component.html#method.setPadding">setPadding</a>(<span class="type">int</span> <span class="argument">$left</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$right</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$top</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$bottom</span> := <span class="default">NULL</span>)
312
	<div class="description">
313
				Change l'espace interne du composant.
314
				Les valeurs doivent être données en pixels.
315
			</div>
316
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
317
</li>
318
<li class="method">
319
<a id="method.setSpace"></a><span class="access">public</span> <a href="Component.html#method.setSpace">setSpace</a>(<span class="type">int</span> <span class="argument">$left</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$right</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$top</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$bottom</span> := <span class="default">NULL</span>)
320
	<div class="description">
321
				Change l'espace interne dans la zone de dessin effective du composant. Les valeurs doivent être données en pourcentage de la taille de la zone de dessin.
322
				Le zone de dessin est la zone dans laquelle est dessiné le composant, c'est-à-dire la zone du composant amputée des axes et de l'<a href="Component.html#property.padding">espace interne</a>.
323
<pre>
324
 
325
&lt;?php
326
 
327
require_once "LinePlot.class.php";
328
 
329
$graph = new <a href="Graph.html">Graph</a>(400, 400);
330
 
331
$plot = new <a href="LinePlot.html">LinePlot</a>(array(43, 23, 65, 37));
332
$plot-&gt;<a href="Component.html#method.setSpace">setSpace</a>(10, 10, 20, 20);
333
 
334
$graph-&gt;<a href="Graph.html#method.add">add</a>($plot);
335
$graph-&gt;<a href="Graph.html#method.draw">draw</a>();
336
 
337
?&gt;
338
 
339
</pre>
340
			</div>
341
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
342
</li>
343
<li class="method">
344
<a id="method.setCenter"></a><span class="access">public</span> <a href="Component.html#method.setCenter">setCenter</a>(<span class="type">float</span> <span class="argument">$x</span>, <span class="type">float</span> <span class="argument">$y</span>)
345
	<div class="description">
346
				Change la position du centre du composant sur l'image.
347
				Les nouvelles positions $x et $y représentent une fraction des largeur et hauteur de l'image.
348
				Attention, la position 0 pour $y place le centre du composant en haut de l'image. La position 1 le place en bas de l'image.
349
<pre>
350
 
351
&lt;?php
352
 
353
require_once "LinePlot.class.php";
354
 
355
$graph = new <a href="Graph.html">Graph</a>(400, 400);
356
 
357
// LinePLot dérive de Component
358
$plot = new <a href="LinePlot.html">LinePlot</a>(array(1, 2, 3));
359
 
360
// Le taille du composant sera 1 / 3 de celle de l'image, soit 133x133 pixels
361
$plot-&gt;<a href="Component.html#method.setSize">setSize</a>(1 / 3, 1 / 3);
362
// Place le composant en haut à gauche
363
$plot-&gt;<a href="Component.html#method.setCenter">setCenter</a>(1 / 6, 1 / 6);
364
 
365
$graph-&gt;<a href="Graph.html#method.add">add</a>($plot);
366
$graph-&gt;<a href="Graph.html#method.draw">draw</a>();
367
 
368
?&gt;
369
 
370
</pre>
371
			</div>
372
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
373
</li>
374
<li class="method">
375
<a id="method.setAbsPosition"></a><span class="access">public</span> <a href="Component.html#method.setAbsPosition">setAbsPosition</a>(<span class="type">int</span> <span class="argument">$left</span>, <span class="type">int</span> <span class="argument">$top</span>)
376
	<div class="description">
377
				Change la position du composant sur l'image.
378
				Contrairement à <a href="Component.html#method.setCenter">setCenter()</a>, cette méthode ne place pas le composant par rapport à son centre, mais par rapport à son coin haut-gauche. Les positions $left à gauche et $top pour la hauteur doivent être données en pixels.
379
				Attention, la position 0 pour $top place le composant en haut de l'image.
380
<pre>
381
 
382
&lt;?php
383
 
384
require_once "LinePlot.class.php";
385
 
386
$graph = new <a href="Graph.html">Graph</a>(400, 400);
387
 
388
// LinePLot dérive de Component
389
$plot = new <a href="LinePlot.html">LinePlot</a>(array(1, 2, 3));
390
 
391
// Le taille du composant sera 1 / 3 de celle de l'image, soit 133x133 pixels
392
$plot-&gt;<a href="Component.html#method.setSize">setSize</a>(1 / 3, 1 / 3);
393
// Place le composant en haut à gauche
394
$plot-&gt;<a href="Component.html#method.setAbsPosition">setAbsPosition</a>(0, 0);
395
 
396
$graph-&gt;<a href="Graph.html#method.add">add</a>($plot);
397
$graph-&gt;<a href="Graph.html#method.draw">draw</a>();
398
 
399
?&gt;
400
 
401
</pre>
402
			</div>
403
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
404
</li>
405
<li class="method">
406
<a id="method.init"></a><span class="access">public</span> <a href="Component.html#method.init">init</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>)
407
	<div class="description">
408
 				Initialise le composant avant son affichage.
409
			</div>
410
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
411
</li>
412
<li class="method">
413
<a id="method.finalize"></a><span class="access">public</span> <a href="Component.html#method.finalize">finalize</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>)
414
	<div class="description">
415
 				Finalize l'affichage du composant.
416
			</div>
417
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
418
</li>
419
<li class="method">
420
<a id="method.getPosition"></a><span class="access">abstract public</span> <span class="type">array</span> <a href="Component.html#method.getPosition">getPosition</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>)
421
	<div class="description">
422
				Retourne la position de la zone de dessin effective du composant.
423
				Les coordonnées doivent être retournées sous la forme d'un tableau de quatre valeurs.
424
				Les première et deuxième valeurs sont les positions en abscisse et en ordonnée du coin haut-gauche de la zone de dessin.
425
				Les troisième et quatrième valeurs sont les positions en abscisse et en ordonnée du coin bas-droit de la zone de dessin.
426
			</div>
427
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
428
</li>
429
<li class="method">
430
<a id="method.drawEnvelope"></a><span class="access">abstract public</span> <a href="Component.html#method.drawEnvelope">drawEnvelope</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>)
431
	<div class="description">
432
				Dessine l'enveloppe autour de la zone de dessin effective du composant.
433
				Cette enveloppe comprend généralement les axes et la grille du composant.
434
			</div>
435
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
436
</li>
437
<li class="method">
438
<a id="method.drawComponent"></a><span class="access">abstract public</span> <a href="Component.html#method.drawComponent">drawComponent</a>(<a href="Driver.html"><span class="type">Driver</span></a> <span class="argument">$driver</span>, <span class="type">int</span> <span class="argument">$x1</span>, <span class="type">int</span> <span class="argument">$y1</span>, <span class="type">int</span> <span class="argument">$x2</span>, <span class="type">int</span> <span class="argument">$y2</span>, <span class="type">bool</span> <span class="argument">$aliasing</span>)
439
	<div class="description">
440
				Dessine effectivement le composant, c'est-à-dire le graphique.
441
				Le paramètre $aliasing est à TRUE si l'anti-aliasing est activé, FALSE sinon.
442
			</div>
443
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
444
</li>
445
<li class="method">
446
<a id="method.getSpace"></a><span class="access">protected</span> <a href="Component.html#method.getSpace">getSpace</a>(<span class="type">int</span> <span class="argument">$width</span>, <span class="type">int</span> <span class="argument">$height</span>)
447
	<div class="description">
448
				Convertit l'espace interne du composant de pourcentages en pixels, en fonction de la taille $width et de la hauteur $height, exprimées en pixels.
449
			</div>
450
<div class="description-bottom"><a href="Component.html#top">Remonter</a></div>
451
</li>
452
</ul>
453
</td>
454
				<td class='borderd'>&nbsp;</td>
455
			</tr>
456
			<tr>
457
				<td class='cornerbg'></td>
458
				<td class='borderb'>&nbsp;</td>
459
				<td class='cornerbd'></td>
460
			</tr>
461
		</table>
462
		</div>
463
	</body>
464
</html>