チェンジセット 1561
- コミット日時:
- 2008/10/10 00:10:03 (3 年前)
- ファイル:
-
- ruby/jsplash/trunk/client2/demo_20081001.xml (更新) (1 diff)
- ruby/jsplash/trunk/client2/index.xml (更新) (1 diff)
- ruby/jsplash/trunk/client2/jsplash/objects.js (更新) (14 diffs)
- ruby/jsplash/trunk/client2/jsplash/player.js (更新) (5 diffs)
- ruby/jsplash/trunk/client2/jsplash/shaperenderer.js (更新) (1 diff)
- ruby/jsplash/trunk/client2/jsplash/tags.js (更新) (2 diffs)
- ruby/jsplash/trunk/client2/rocket_demo.xml (更新) (1 diff)
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
ruby/jsplash/trunk/client2/demo_20081001.xml
r1494 r1561 56 56 <p id="statusout"> </p> 57 57 <p>playing on javascript with JSplash</p> 58 <p id="sout">starting <em>JSplash Player 0. 2.2</em>...<br />-------------------------------------<br /></p>58 <p id="sout">starting <em>JSplash Player 0.4.8</em>...<br />-------------------------------------<br /></p> 59 59 <svg id="svgrt" xmlns="http://www.w3.org/2000/svg" style="width: 100px; height: 100px;"> 60 60 </svg> ruby/jsplash/trunk/client2/index.xml
r1536 r1561 54 54 <div id="progbar"><div> </div></div> 55 55 <p id="statusout"> </p> 56 <p id="sout"><em>JSplash Player</em> 0.4. 7<br />-------------------------------------<br /></p>56 <p id="sout"><em>JSplash Player</em> 0.4.8<br />-------------------------------------<br /></p> 57 57 <svg id="svgrt" xmlns="http://www.w3.org/2000/svg" style="width: 100px; height: 100px;"> 58 58 </svg> ruby/jsplash/trunk/client2/jsplash/objects.js
r1535 r1561 25 25 return func2; 26 26 } 27 28 //JSplash.ObjectInstance.makeClipId = function(o) { 29 // return "jsplash-cp-"+o.instance_uid; 30 //} 27 31 28 32 JSplash.ObjectInstance.prototype = { … … 157 161 158 162 if (old && old.appended) { 159 this.g.insertBefore(obj.g , old.g);160 this.g.removeChild(old.g );163 this.g.insertBefore(obj.getActiveViewElement(), old.getActiveViewElement()); 164 this.g.removeChild(old.getActiveViewElement()); 161 165 162 166 old.appended = false; … … 174 178 if (nxtd == 65536) { 175 179 console.warn("unknown case!"); 176 this.g.appendChild(obj.g );180 this.g.appendChild(obj.getActiveViewElement()); 177 181 } 178 182 else 179 this.g.insertBefore(obj.g , this.depthMap[nxtd].g);183 this.g.insertBefore(obj.getActiveViewElement(), this.depthMap[nxtd].getActiveViewElement()); 180 184 obj.appended = true; 181 185 } … … 185 189 186 190 placeObject: function(depth, oid, iname, clip_depth, replace_flg, inherit_transform) { 187 if (clip_depth) 188 this.clipMap[depth] = clip_depth; 191 this.clipMap[depth] = clip_depth || this.clipMap[depth]; 189 192 190 193 if (this.context.reachedFrame > this.context.frameC) { … … 229 232 if (inherit_transform) 230 233 inst.copyTransformFrom(replaced); 231 g_before = replaced.g ; /* to correct draw order*/234 g_before = replaced.getActiveViewElement(); /* to correct draw order*/ 232 235 } 233 236 234 237 inst.render(); 238 if (clip_depth) 239 inst.hide(); 235 240 236 241 if (!g_before) … … 250 255 if (this.taglist.length > JSplash.ObjectInstance.REMOVE_THRESH) 251 256 { 252 this.g.replaceChild(inst.g , g_before);257 this.g.replaceChild(inst.getActiveViewElement(), g_before); 253 258 replaced.appended = false; 254 259 } 255 260 else 256 this.g.insertBefore(inst.g , g_before);261 this.g.insertBefore(inst.getActiveViewElement(), g_before); 257 262 258 263 //} catch (e) { … … 278 283 if (this.taglist.length > JSplash.ObjectInstance.REMOVE_THRESH) 279 284 { 280 this.g.removeChild(replaced.g );285 this.g.removeChild(replaced.getActiveViewElement()); 281 286 replaced.appended = false; 282 287 } … … 297 302 if (depth == this.topDepths[this.topDepths.length-1]) 298 303 { 299 this.g.removeChild(obj.g );304 this.g.removeChild(obj.getActiveViewElement()); 300 305 obj.appended = false; 301 306 this.topDepths.pop(); … … 306 311 var d; 307 312 308 this.g.removeChild(o.g );313 this.g.removeChild(o.getActiveViewElement()); 309 314 o.appended = false; 310 315 … … 328 333 if (o) 329 334 { 330 335 //if (this.clipMap[depth]) 336 // this.applyAClip(depth, this.clipMap[depth], false); 331 337 delete this.clipMap[depth]; 332 338 // delete this.depthMap[depth]; … … 360 366 361 367 if (!skip_visual_change) 362 this. hideClippers();368 this.applyClippers(); 363 369 364 370 if (this.g && this.g.childNodes.length > 0 && !this.klass.isShapeObject) … … 371 377 372 378 hide: function() { 373 this.g.style.display = "none"; 374 }, 375 376 hideClippers: function() { 379 if (this.g) 380 this.g.style.display = "none"; 381 }, 382 383 applyClippers: function() { 384 // FIXME: waining for mask implementation... 385 386 /* 377 387 var cd, upto; 378 388 var i; … … 380 390 { 381 391 cd = cd - 0; 382 if (this.depthMap[cd]) 383 this.depthMap[cd].hide(); 384 } 385 }, 392 if (this.clipMap[cd] && this.depthMap[cd] && !this.depthMap[cd].sleeping) 393 this.applyAClip(cd, this.clipMap[cd], true); 394 } 395 */ 396 }, 397 /* 398 applyAClip: function(orgDepth, clipDepth, set_or_remove) { 399 var co = this.depthMap[orgDepth]; 400 }, 401 402 403 setClipper: function(depth, urn) { 404 var o = this.depthMap[depth]; 405 if (!o || !o.g) return; 406 407 }, 408 */ 409 410 getActiveViewElement: function() { 411 return this.g; 412 }, 413 386 414 387 415 rewind: function(deep) { … … 818 846 } 819 847 } 848 ruby/jsplash/trunk/client2/jsplash/player.js
r1535 r1561 13 13 JSplash.Player.prototype = { 14 14 initialize: function(swf, svg) { 15 JSplash.gPlayer = this; 15 16 16 17 this.executor = new JSplash.Executor(); … … 18 19 this.svg = svg; 19 20 JSplash.createFillDef(svg); 20 21 21 22 svg.style.width = swf.pxWidth + "px"; 22 23 svg.style.height = swf.pxHeight + "px"; … … 33 34 34 35 JSplash.SWFGlobals.setup(this); 35 this.doInitActions(); 36 this.stage.registerExecutor(this.executor); 37 }, 36 this.preprocessShapes(0); 37 }, 38 39 preprocessShapes: function(si) { 40 var ti, t; 41 var taglist = this.stage.taglist; 42 var tlen = taglist.length; 43 44 for (var i = 0;i < 500;i++) { 45 ti = si + i; 46 if (ti >= tlen) 47 break; 48 49 t = taglist[ti]; 50 if (t.tag == JSplash.tDefineSprite) 51 t.tag(t, this.stage); 52 53 } 54 55 if ((si+i) >= tlen) { 56 // finish 57 this.doInitActions(); 58 this.stage.registerExecutor(this.executor); 59 return; 60 } 61 62 63 // continue 64 JSplash.$next( this.preprocessShapes.bind(this, si+i) ); 65 }, 38 66 39 67 doInitActions: function() { … … 96 124 var swf = new JSplash.SWF(JSplash.swfdata); 97 125 var player = new JSplash.Player(swf, $('svgrt')); 98 JSplash.gPlayer = player;99 126 player.start(); 100 127 } … … 165 192 } 166 193 } 167 194 168 195 JSplash.$next( JSplash.initPlayer ); 169 196 } ruby/jsplash/trunk/client2/jsplash/shaperenderer.js
r1535 r1561 656 656 }, 657 657 658 buildSVG: function(g ) {659 if ( this.hitCount == 2) {658 buildSVG: function(g, force_cache) { 659 if (!this.pathCache && (this.hitCount == 2 || force_cache)) { 660 660 this.pathCache = new JSplash.ShapeRenderer.PathCache(); 661 661 this.do_cache = true; ruby/jsplash/trunk/client2/jsplash/tags.js
r1525 r1561 61 61 62 62 tDefineSprite: function(data, owner) { 63 JSplash.gPlayer.stage.registerObject(data.id, new JSplash.TagClass(data) ); 63 if (!JSplash.gPlayer.stage.fetchObject(data.id)) 64 JSplash.gPlayer.stage.registerObject(data.id, new JSplash.TagClass(data) ); 64 65 }, 65 66 … … 102 103 this.renderer = new JSplash.ShapeRenderer(data); 103 104 this.renderer.buildEdgeIndex(); 105 106 if (data.shape.length > 10) { // heavy shape? 107 var dmy_g = JSplash.$svg('g'); 108 this.renderer.buildSVG(dmy_g, true); 109 } 110 104 111 this.isShapeObject = true; 105 112 } ruby/jsplash/trunk/client2/rocket_demo.xml
r1536 r1561 56 56 <p id="statusout"> </p> 57 57 <p>playing on javascript with JSplash</p> 58 <p id="sout">starting <em>JSplash Player 0.4. 7</em>...<br />-------------------------------------<br /></p>58 <p id="sout">starting <em>JSplash Player 0.4.8</em>...<br />-------------------------------------<br /></p> 59 59 <svg id="svgrt" xmlns="http://www.w3.org/2000/svg" style="width: 100px; height: 100px;"> 60 60 </svg>

