OSDN Git Service

Version 0.6.139, fix Node.animate when no.
[pettanr/clientJs.git] / 0.6.x / js / 20_ui / 15_ScrollBox.js
1 \r
2 \r
3 function X_UI_ScrollBox_momentum( current, start, time, lowerMargin, wrapperSize, deceleration ){\r
4         var distance = current - start,\r
5                 speed    = Math.abs( distance ) / time,\r
6                 destination,\r
7                 duration;\r
8 \r
9         deceleration = deceleration === undefined ? 0.0006 : deceleration;\r
10 \r
11         destination  = current + ( speed * speed ) / ( 2 * deceleration ) * ( distance < 0 ? -1 : 1 );\r
12         duration     = speed / deceleration;\r
13 \r
14         if( destination < lowerMargin ){\r
15                 destination = wrapperSize ? lowerMargin - ( wrapperSize / 2.5 * ( speed / 8 ) ) : lowerMargin;\r
16                 distance    = Math.abs( destination - current );\r
17                 duration    = distance / speed;\r
18         } else\r
19         if ( destination > 0 ) {\r
20                 destination = wrapperSize ? wrapperSize / 2.5 * ( speed / 8 ) : 0;\r
21                 distance    = Math.abs( current ) + destination;\r
22                 duration    = distance / speed;\r
23         };\r
24 \r
25         return {\r
26                 destination : Math.round( destination ),\r
27                 duration    : duration\r
28         };\r
29 };\r
30 \r
31 var X_UI_ScrollBox_SUPPORT_ATTRS = {\r
32                 // スクロール開始するために必要な移動距離、縦か横、どちらか制限する場合、より重要\r
33                 directionLockThreshold : [     10, X.UI.Dirty.CLEAN, X.UI.Attr.USER.UINODE, X.UI.Attr.Type.LENGTH ],\r
34                 scrollXEnabled         : [   true, X.UI.Dirty.CLEAN, X.UI.Attr.USER.UINODE, X.UI.Attr.Type.BOOLEAN ],\r
35                 scrollYEnabled         : [   true, X.UI.Dirty.CLEAN, X.UI.Attr.USER.UINODE, X.UI.Attr.Type.BOOLEAN ],\r
36                 scrollEnabled          : [   true, X.UI.Dirty.CLEAN, X.UI.Attr.USER.UINODE, X.UI.Attr.Type.BOOLEAN ],\r
37                 bounceEnabled          : [   true, X.UI.Dirty.CLEAN, X.UI.Attr.USER.UINODE, X.UI.Attr.Type.BOOLEAN ],\r
38                 bounceTime             : [    600, X.UI.Dirty.CLEAN, X.UI.Attr.USER.UINODE, X.UI.Attr.Type.TIME ],\r
39                 useWheel               : [   true, X.UI.Dirty.CLEAN, X.UI.Attr.USER.UINODE, X.UI.Attr.Type.BOOLEAN ],\r
40                 useKey                 : [   true, X.UI.Dirty.CLEAN, X.UI.Attr.USER.UINODE, X.UI.Attr.Type.BOOLEAN ],\r
41                 hasScrollShadow        : [   true, X.UI.Dirty.CLEAN, X.UI.Attr.USER.UINODE, X.UI.Attr.Type.BOOLEAN ],\r
42                 scrollShadowColor      : [ '#000', X.UI.Dirty.CLEAN, X.UI.Attr.USER.UINODE, X.UI.Attr.Type.COLOR ]\r
43         };\r
44 \r
45 \r
46 X.UI._ScrollBox = X.UI._ChromeBox.inherits(\r
47         '_ScrollBox',\r
48         X_Class.PRIVATE_DATA | X_Class.SUPER_ACCESS,\r
49         {\r
50                 //elmScroll     : null,\r
51                 //elmScroller   : null,\r
52                 //elmScrollbar  : null,\r
53                 \r
54                 directionLockThreshold : 10,\r
55                 scrollXEnabled         : true,\r
56                 scrollYEnabled         : true,\r
57                 scrollEnabled          : true,\r
58                 bounceEnabled          : true,\r
59                 momentumEnabled        : true,\r
60                 bounceTime             : 600,\r
61                 useWheel               : true,\r
62                 useKey                 : true,\r
63                 hasScrollShadow        : true,\r
64                 scrollShadowColor      : '#000',\r
65                 \r
66                 supportAttrs    : XUI_Attr_createAttrDef( X.UI.Attr.Support, X_UI_ScrollBox_SUPPORT_ATTRS ),\r
67                 \r
68                 scrolling       : false,\r
69                 \r
70                 initiated       : '',\r
71                 moved               : false,\r
72                 directionLocked : '',\r
73                 startTime       : 0,\r
74                 endTime         : 0,\r
75                 isAnimating     : false,\r
76                 isInTransition  : false,\r
77 \r
78                 hasHScroll      : false,\r
79                 hasVScroll      : false,\r
80 \r
81                 wrapperOffset   : 0,\r
82                 wheelTimeout    : 0,\r
83                 requestFrameID  : 0,\r
84                 \r
85                 fontSize        : 0,\r
86                 \r
87                 scrollX         : 0, // px\r
88                 scrollY         : 0, // px\r
89                 maxScrollX      : 0, // px\r
90                 maxScrollY      : 0, // px\r
91                 startX          : 0, // px\r
92                 startY          : 0, // px\r
93                 absStartX       : 0, // px\r
94                 absStartY       : 0, // px\r
95                 pointX          : 0, // px\r
96                 pointY          : 0, // px\r
97                 distX               : 0, // px\r
98                 distY               : 0, // px\r
99                 directionX      : 0, // px\r
100                 directionY      : 0, // px      \r
101                 scrollXPercent  : 0, // この値は scroll 不要になっても保持される。 scroll 必要時に参照される\r
102                 scrollYPercent  : 0,\r
103                 \r
104                 lastScrollWidth  : 0,\r
105                 lastScrollHeight : 0,\r
106                 lastBoxWidth     : 0,\r
107                 lastBoxHeight    : 0,\r
108                 \r
109                 _containerNode : null,\r
110                 scrollManager  : null,\r
111                 \r
112                 Constructor : function( layout, args ){\r
113                         this[ 'Super' ]( layout, args );\r
114                         this._containerNode = X_Class_getPrivate( this.containerNode );\r
115                         this._containerXNode = this._containerNode.xnode[ 'className' ]( 'ScrollSlider' ).listen( X_EVENT_ANIME_END, this, X_UI_ScrollBox_onAnimeEnd );\r
116                         this.xnode[ 'className' ]( 'ScrollBox' );\r
117                 },\r
118                 \r
119                 creationComplete : function(){\r
120                         X.UI._Box.prototype.creationComplete.apply( this, arguments );\r
121                         this.scrollManager;\r
122                 },\r
123                 \r
124                 calculate : function(){\r
125                         this.lastScrollWidth  = this._containerNode.boxWidth;\r
126                         this.lastScrollHeight = this._containerNode.boxHeight;\r
127                         this.lastBoxWidth     = this.boxWidth;\r
128                         this.lastBoxHeight    = this.boxHeight;\r
129                         \r
130                         X.UI._Box.prototype.calculate.apply( this, arguments );\r
131                         \r
132                         // TODO root の layout_complete 後に。\r
133                         // TODO calculate 前に scroll の解放。\r
134                         \r
135                         if(\r
136                                         this.lastScrollWidth  !== this._containerNode.boxWidth ||\r
137                                         this.lastScrollHeight !== this._containerNode.boxHeight ||\r
138                                         this.lastBoxWidth    !== this.boxWidth    || this.lastBoxHeight    !== this.boxHeight\r
139                                 ){\r
140                                         X_UI_rootData[ 'listenOnce' ]( X.UI.Event.LAYOUT_COMPLETE, this, X_UI_ScrollBox_onLayoutComplete );\r
141                                 };\r
142                 },\r
143         \r
144                 scrollTo : function( x, y, opt_time, opt_easing, opt_release ){\r
145                         //if( this.scrollX === x && this.scrollY === y ) return;\r
146                         \r
147                         opt_time    = 0 <= opt_time ? opt_time : 0;\r
148                         opt_easing  = opt_easing || 'circular';\r
149                         opt_release = 0 <= opt_release ? opt_release : 300;\r
150         \r
151                         this.isInTransition = 0 < opt_time;\r
152         \r
153                         X_UI_ScrollBox_translate( this, x, y, opt_time, opt_easing, opt_release );\r
154                 },\r
155                 \r
156                 _remove : function(){\r
157                         X.UI._AbstractUINode.prototype._remove.apply( this, arguments );\r
158                         if( this.scrolling ){\r
159                                 // remove scroll\r
160                         };\r
161                 }\r
162                 \r
163         }\r
164 );\r
165 \r
166 function X_UI_ScrollBox_onLayoutBefore( e ){\r
167         //this._containerXNode.stop();\r
168 };\r
169 \r
170 function X_UI_ScrollBox_onLayoutComplete( e ){\r
171         // scroll の停止、GPU の解除\r
172         var font = this.fontSize = this._containerXNode.call( 'fontSize' );\r
173         \r
174         this.maxScrollX = ( this.boxWidth  - this._containerNode.boxWidth ) * font | 0;\r
175         this.maxScrollY = ( this.boxHeight - this._containerNode.boxHeight ) * font | 0;\r
176 \r
177         this.hasHScroll = this.scrollXEnabled && this.maxScrollX < 0;\r
178         this.hasVScroll = this.scrollYEnabled && this.maxScrollY < 0;\r
179 \r
180         if( !this.hasHScroll ){\r
181                 this.maxScrollX  = 0;\r
182                 //this.scrollWidth = this.boxWidth;\r
183         };\r
184 \r
185         if( !this.hasVScroll ){\r
186                 this.maxScrollY   = 0;\r
187                 //this.scrollHeight = this.boxHeight;\r
188         };\r
189 \r
190         delete this.endTime;\r
191         delete this.directionX;\r
192         delete this.directionY;\r
193 \r
194         //this.wrapperOffset = this.xnodeWrapper[ 'offset' ]();\r
195 \r
196         //this[ 'dispatch' ]('refresh');\r
197 \r
198         X_UI_ScrollBox_resetPosition( this, 0 );\r
199 \r
200         if( this.hasHScroll || this.hasVScroll ){\r
201                 // scroll が必要。\r
202                 if( this.scrolling ){\r
203                         this.scrollTo( this.maxScrollX * this.scrollXPercent, this.maxScrollY * this.scrollYPercent, 100 );\r
204                 } else {\r
205                         // scroller 作る\r
206                         this[ 'listen' ]( X.UI.Event._POINTER_DOWN, this, X_UI_ScrollBox_onStart );\r
207                         X_UI_rootData[ 'listen' ]( X.UI.Event.LAYOUT_BEFORE, this, X_UI_ScrollBox_onLayoutBefore );\r
208                         \r
209                         this.scrollTo( this.maxScrollX * this.scrollXPercent, this.maxScrollY * this.scrollYPercent );\r
210                         this.scrolling = true;\r
211                 };\r
212         } else\r
213         // scroll 不要\r
214         if( this.scrolling ){\r
215                 // scroller 削除\r
216                 this[ 'unlisten' ]( X.UI.Event._POINTER_DOWN, this, X_UI_ScrollBox_onStart );\r
217                 X_UI_rootData[ 'unlisten' ]( X.UI.Event.LAYOUT_BEFORE,   this, X_UI_ScrollBox_onLayoutBefore );\r
218                 \r
219                 ( this.scrollX !== 0 || this.scrollY !== 0 ) && this.scrollTo( 0, 0 );\r
220                 \r
221                 delete this.scrolling;\r
222         };\r
223 };\r
224 \r
225                 function X_UI_ScrollBox_translate( that, x, y, opt_time, opt_easing, opt_release ){\r
226                         \r
227                         opt_time    = 0 <= opt_time ? opt_time : 0;\r
228                         opt_easing  = opt_easing === '' ? '' : opt_easing || 'circular';\r
229                         opt_release = 0 <= opt_release ? opt_release : 300;\r
230                         \r
231                         that._containerXNode.animate(\r
232                                 {\r
233                                         x : that.scrollX,\r
234                                         y : that.scrollY\r
235                                 },\r
236                                 {\r
237                                         x : x | 0,\r
238                                         y : y | 0\r
239                                 },\r
240                                 opt_time, opt_easing, opt_release\r
241                         );\r
242                         \r
243                         that.scrollX = x | 0;\r
244                         that.scrollY = y | 0;\r
245                         \r
246                         if( that.indicators ){\r
247                                 for( i = that.indicators.length; i--; ){\r
248                                         that.indicators[ i ].updatePosition();\r
249                                 };\r
250                         };\r
251                 };\r
252 \r
253 function X_UI_ScrollBox_onStart( e ){\r
254         var ret = X_Callback_NONE;\r
255 \r
256         // React to left mouse button only\r
257         if( e.pointerType === 'mouse' && e.button !== 0 ){\r
258                 return ret;\r
259         };\r
260         \r
261         if( !this.scrollEnabled || ( this.initiated && e.pointerType !== this.initiated ) ){\r
262                 return ret;\r
263         };\r
264 \r
265         this.initiated       = e.pointerType;\r
266         this.moved                   = false;\r
267         this.distX                   = 0;\r
268         this.distY                   = 0;\r
269         this.directionX      = 0;\r
270         this.directionY      = 0;\r
271         this.directionLocked = '';\r
272         this.startTime       = X_Timer_now();\r
273 \r
274         // スクロール中の停止\r
275         if( this.isInTransition || this.isAnimating ){\r
276                 this.isInTransition = this.isAnimating = false;\r
277                 this[ 'dispatch' ]( X.UI.Event.SCROLL_END );\r
278         };                      \r
279 \r
280         this.startX    = this.scrollX;\r
281         this.startY    = this.scrollY;\r
282         this.absStartX = this.scrollX;\r
283         this.absStartY = this.scrollY;\r
284         this.pointX    = e.pageX;\r
285         this.pointY    = e.pageY;\r
286         \r
287         this[ 'listen' ]( X.UI.Event._POINTER_MOVE, this, X_UI_ScrollBox_onMove );\r
288         this[ 'listen' ]( [ X.UI.Event._POINTER_UP, X.UI.Event._POINTER_CANCEL ], this, X_UI_ScrollBox_onEnd );\r
289 \r
290         return ret | X_Callback_PREVENT_DEFAULT;\r
291 };\r
292 \r
293 function X_UI_ScrollBox_onMove( e ){\r
294         var ret = X_Callback_NONE,\r
295                 deltaX, deltaY, timestamp,\r
296                 newX, newY,\r
297                 absDistX, absDistY;\r
298         // 規定以上の move でスクロール開始\r
299         \r
300         if( !this.scrollEnabled || e.pointerType !== this.initiated ){\r
301                 return ret;\r
302         };\r
303 \r
304         // gpu の用意\r
305         if( !this._containerXNode[ '_anime' ] ){\r
306                 //console.log( 'gpuレイヤーの用意 ' + e.pageY );\r
307                 //console.log( 'mov1 x:' + this.scrollX + ' y:' + this.scrollY );\r
308                 X_UI_ScrollBox_translate( this, this.scrollX, this.scrollY, 0, '', 300 );\r
309                 return ret;\r
310         };\r
311 \r
312         deltaX          = e.pageX - this.pointX;\r
313         deltaY          = e.pageY - this.pointY;\r
314         timestamp       = X_Timer_now();\r
315 \r
316         this.pointX     = e.pageX;\r
317         this.pointY     = e.pageY;\r
318 \r
319         this.distX      += deltaX;\r
320         this.distY      += deltaY;\r
321         absDistX        = Math.abs(this.distX);\r
322         absDistY        = Math.abs(this.distY);\r
323         \r
324         // We need to move at least 10 pixels for the scrolling to initiate\r
325         if( 300 < timestamp - this.endTime && ( absDistX < 10 && absDistY < 10 ) ){\r
326                 return ret;\r
327         };\r
328 \r
329         // If you are scrolling in one direction lock the other\r
330         if( !this.directionLocked ){\r
331                 if( absDistX > absDistY + this.directionLockThreshold ){\r
332                         this.directionLocked = 'h';             // lock horizontally\r
333                 } else\r
334                 if( absDistY >= absDistX + this.directionLockThreshold ){\r
335                         this.directionLocked = 'v';             // lock vertically\r
336                 } else {\r
337                         this.directionLocked = 'n';             // no lock\r
338                 };\r
339         };\r
340 \r
341         if( this.directionLocked === 'h' ){\r
342                 deltaY = 0;\r
343         } else\r
344         if( this.directionLocked === 'v' ){\r
345                 deltaX = 0;\r
346         };\r
347 \r
348         deltaX = this.hasHScroll ? deltaX : 0;\r
349         deltaY = this.hasVScroll ? deltaY : 0;\r
350 \r
351         if( !this.moved ){\r
352                 this[ 'dispatch' ]( X.UI.Event.SCROLL_BEFORE_MOVE );\r
353                 this.moved  = true;\r
354                 this.minusX = deltaX;\r
355                 this.minusY = deltaY;\r
356         } else {\r
357                 this[ 'dispatch' ]( X.UI.Event.SCROLL_MOVE );\r
358         };\r
359 \r
360         newX = this.scrollX + deltaX;// - this.minusX;\r
361         newY = this.scrollY + deltaY;// - this.minusY;\r
362 \r
363         // Slow down if outside of the boundaries\r
364         if( 0 < newX || newX < this.maxScrollX ){\r
365                 newX = this.bounceEnabled ? this.scrollX + ( deltaX ) / 3 : 0 < newX ? 0 : this.maxScrollX;\r
366         };\r
367         \r
368         if( 0 < newY || newY < this.maxScrollY ){\r
369                 //console.log( 'slow... ' + newY + ' ' + this.maxScrollY );\r
370                 newY = this.bounceEnabled ? this.scrollY + ( deltaY ) / 3 : 0 < newY ? 0 : this.maxScrollY;\r
371         };\r
372 \r
373         this.directionX = 0 < deltaX ? -1 : deltaX < 0 ? 1 : 0;\r
374         this.directionY = 0 < deltaY ? -1 : deltaY < 0 ? 1 : 0;\r
375 \r
376         //console.log( 'mov2 x:' + newX + ' y:' + newY );\r
377         X_UI_ScrollBox_translate( this, newX, newY, 0, '', 300 );\r
378 \r
379         if( 300 < timestamp - this.startTime ){\r
380                 this.startTime = timestamp;\r
381                 this.startX = this.scrollX;\r
382                 this.startY = this.scrollY;\r
383         };\r
384         // イベントの拘束\r
385         return ret | X_Callback_PREVENT_DEFAULT | X_Callback_MONOPOLY;\r
386 };\r
387 \r
388 function X_UI_ScrollBox_onEnd( e ){\r
389         var ret    = X_Callback_NONE,\r
390                 time   = 0,\r
391                 easing = '',\r
392                 newX, newY,\r
393                 momentumX, momentumY,\r
394                 duration, distanceX, distanceY;\r
395                                                 \r
396         this[ 'unlisten' ]( X.UI.Event._POINTER_MOVE, this, X_UI_ScrollBox_onMove );\r
397         this[ 'unlisten' ]( [ X.UI.Event._POINTER_UP, X.UI.Event._POINTER_CANCEL ], this, X_UI_ScrollBox_onEnd );\r
398         \r
399         if( !this.scrollEnabled || e.pointerType !== this.initiated ){\r
400                 return ret;\r
401         };\r
402 \r
403         delete this.isInTransition;\r
404         delete this.initiated;\r
405         this.endTime = X_Timer_now();                   \r
406 \r
407         duration  = this.endTime - this.startTime;\r
408         newX      = Math.round( this.scrollX );\r
409         newY      = Math.round( this.scrollY );\r
410         distanceX = Math.abs(newX - this.startX);\r
411         distanceY = Math.abs(newY - this.startY);\r
412 \r
413         // reset if we are outside of the boundaries\r
414         if( X_UI_ScrollBox_resetPosition( this, this.bounceTime ) ){\r
415                 return ret;\r
416         };\r
417 \r
418         // we scrolled less than 10 pixels\r
419         if( !this.moved ){\r
420                 // this[ 'dispatch' ]( X_EVENT_CANCELED );\r
421                 console.log( 'we scrolled less than 10 pixels' );\r
422                 return ret;\r
423         };\r
424 \r
425         // start momentum animation if needed\r
426         if( this.momentumEnabled && duration < 300 ){\r
427                 momentumX = this.hasHScroll ?\r
428                                                 X_UI_ScrollBox_momentum( this.scrollX, this.startX, duration, this.maxScrollX, this.bounceEnabled ? this.boxWidth  * this.fontSize : 0, this.deceleration ) :\r
429                                                 { destination: newX, duration: 0 };\r
430                 momentumY = this.hasVScroll   ?\r
431                                                 X_UI_ScrollBox_momentum( this.scrollY, this.startY, duration, this.maxScrollY, this.bounceEnabled ? this.boxHeight * this.fontSize : 0, this.deceleration ) :\r
432                                                 { destination: newY, duration: 0 };\r
433                 newX = momentumX.destination;\r
434                 newY = momentumY.destination;\r
435                 time = Math.max( momentumX.duration, momentumY.duration ) | 0;\r
436                 this.isInTransition = true;\r
437         } else {\r
438                 console.log( '慣性無し' );\r
439         };\r
440 \r
441         if( newX != this.scrollX || newY != this.scrollY ){\r
442                 // change easing function when scroller goes out of the boundaries\r
443                 if( 0 < newX || newX < this.maxScrollX || 0 < newY || newY < this.maxScrollY ){\r
444                         easing = 'quadratic';\r
445                 };\r
446 \r
447                 console.log( 'end2 x:' + newX + ' y:' + newY + ' t:' + time );\r
448                 this.scrollTo( newX, newY, time, easing, 1000 );\r
449                 return ret;\r
450         };\r
451 \r
452         console.log( 'end1 x:' + newX + ' y:' + newY );\r
453         this.scrollTo( newX, newY, 0, '', 1000 );       // ensures that the last position is rounded\r
454 \r
455         this[ 'dispatch' ]( X.UI.Event.SCROLL_END );\r
456         \r
457         return ret;\r
458 };\r
459 \r
460 function X_UI_ScrollBox_resetPosition( that, time ){\r
461         var x = that.scrollX,\r
462                 y = that.scrollY;\r
463 \r
464         time = time || 0;\r
465 \r
466         if( !that.hasHScroll || 0 < that.scrollX ){\r
467                 x = 0;\r
468         } else\r
469         if( that.scrollX < that.maxScrollX ){\r
470                 x = that.maxScrollX;\r
471         };\r
472 \r
473         if( !that.hasVScroll || 0 < that.scrollY ){\r
474                 y = 0;\r
475         } else\r
476         if( that.scrollY < that.maxScrollY ){\r
477                 y = that.maxScrollY;\r
478         };\r
479 \r
480         if( x === that.scrollX && y === that.scrollY ){\r
481                 console.log( 'no バウンド y:' + y + ' max:' + that.maxScrollY );\r
482                 return false;\r
483         };\r
484 \r
485         //console.log( 'バウンド!' );\r
486         //console.log( 'rese x:' + x + ' y:' + y );\r
487         that.scrollTo( x, y, time, that.bounceEasing, 1000 );\r
488 \r
489         return true;\r
490 };\r
491 \r
492 function X_UI_ScrollBox_onAnimeEnd( e ){\r
493         if( e.target !== this._containerXNode || !this.isInTransition ){\r
494                 return X_Callback_NONE;\r
495         };\r
496         if( !X_UI_ScrollBox_resetPosition( this, this.bounceTime ) ){\r
497                 this.isInTransition = false;\r
498                 this.dispatch( X.UI.Event.SCROLL_END );\r
499         };\r
500         return X_Callback_NONE;\r
501 };\r
502 \r
503 X.UI.ScrollBox = X.UI.ChromeBox.inherits(\r
504         'ScrollBox',\r
505         X_Class.SUPER_ACCESS,\r
506         X.UI._ScrollBox,\r
507         {\r
508                 Constructor : function(){\r
509                         var args = [\r
510                                                 0, // layout                    \r
511                                                 {\r
512                                                         name   : 'ScrollBox-Scroller',\r
513                                                         role   : 'container',\r
514                                                         width       : 'auto',\r
515                                                         minWidth    : '100%',\r
516                                                         height      : 'auto',\r
517                                                         minHeight   : '100%'\r
518                                                 }\r
519                                         ],\r
520                                 i    = arguments.length,\r
521                                 arg, layout;\r
522                         \r
523                         for( ; i; ){\r
524                                 arg = arguments[ --i ];\r
525                                 if( arg[ 'instanceOf' ] && arg[ 'instanceOf' ]( X.UI.Layout.Base ) ){\r
526                                         layout = arg;\r
527                                 } else {\r
528                                         args[ args.length ] = arg;\r
529                                 };\r
530                         };\r
531                         \r
532                         args[ 0 ] = X.UI.Layout.Vertical;\r
533                         \r
534                         X_Class_newPrivate(\r
535                                 this,\r
536                                 X.UI.Layout.Canvas,\r
537                                 [\r
538                                         {\r
539                                                 width  : '100%',\r
540                                                 height : '100%'\r
541                                         },\r
542                                         X.UI.VBox.apply( 0, args )\r
543                                 ]\r
544                         );\r
545                 },\r
546                 scrollX  : function(){\r
547                         \r
548                 },\r
549                 scrollY  : function(){\r
550                         \r
551                 },\r
552                 scrollWidth : function(){\r
553                         \r
554                 },\r
555                 scrollHeight : function(){\r
556                         \r
557                 },\r
558                 scrollTo : function( nodeOrX, y ){\r
559                         \r
560                 }\r
561         }\r
562 );