チェンジセット 3615

差分発生行の前後
無視リスト:
コミット日時:
2010/03/27 19:44:41 (3 年前)
コミッタ:
hkrn
ログメッセージ:

followed framework changes

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • as3/gunyarapaint/branches/gunyarapaint/compat/src/gunyarapaint.mxml

    r3607 r3615  
    133133            { 
    134134                return m_recorder.height; 
    135             } 
    136              
    137             public function get canvasView():Sprite 
    138             { 
    139                 return m_recorder.view; 
    140135            } 
    141136             
  • as3/gunyarapaint/branches/gunyarapaint/compat/src/org/libspark/gunyarapaint/ui/v1/Canvas.as

    r3605 r3615  
    1414    import org.libspark.gunyarapaint.framework.AuxLineView; 
    1515    import org.libspark.gunyarapaint.framework.AuxPixelView; 
     16    import org.libspark.gunyarapaint.framework.LayerBitmapCollection; 
    1617    import org.libspark.gunyarapaint.framework.TransparentBitmap; 
    1718    import org.libspark.gunyarapaint.framework.modules.DropperModule; 
     
    3334            // 透明画像、キャンバス本体、補助線(直線および斜線)の順番に追加される 
    3435            addChild(transparent); 
    35             addChild(app.canvasView); 
     36            app.layers.setView(this); 
    3637            addChild(m_auxLine); 
    3738            addChild(m_auxPixel); 
     
    105106        { 
    106107            var app:IApplication = IApplication(Application.application); 
    107             removeMouseEvents(app.canvasView); 
     108            app.layers.removeView(this); 
    108109            removeEventListener(Event.REMOVED_FROM_STAGE, onRemove); 
    109110            var dispatcher:IEventDispatcher = IEventDispatcher(app); 
     
    115116        { 
    116117            var app:gunyarapaint = gunyarapaint(Application.application); 
    117             var cv:Sprite = app.canvasView
     118            var layers:LayerBitmapCollection = app.layers
    118119            try { 
    119120                // 例えば非表示あるいはロック状態のあるレイヤーに対して描写を行うと例外が送出されるので、 
    120121                // 必ず try/catch で囲む必要がある 
    121122                app.module.start(event.localX, event.localY); 
    122                 cv.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove); 
    123                 cv.addEventListener(MouseEvent.MOUSE_UP, onMouseUp); 
    124                 cv.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut); 
     123                layers.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove); 
     124                layers.addEventListener(MouseEvent.MOUSE_UP, onMouseUp); 
     125                layers.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut); 
    125126            } catch (e:Error) { 
    126                 removeMouseEvents(cv); 
     127                removeMouseEvents(layers); 
    127128                Alert.show(e.message, app.moduleName); 
    128129            } 
     
    138139        { 
    139140            var app:IApplication = IApplication(Application.application); 
    140             removeMouseEvents(app.canvasView); 
     141            removeMouseEvents(app.layers); 
    141142            app.module.stop(event.localX, event.localY); 
    142143        } 
     
    145146        { 
    146147            var app:IApplication = IApplication(Application.application); 
    147             removeMouseEvents(app.canvasView); 
     148            removeMouseEvents(app.layers); 
    148149            app.module.interrupt(event.localX, event.localY); 
    149150        } 
     
    155156        } 
    156157         
    157         private function removeMouseEvents(cv:Sprite):void 
     158        private function removeMouseEvents(layers:LayerBitmapCollection):void 
    158159        { 
    159             cv.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove); 
    160             cv.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp); 
    161             cv.removeEventListener(MouseEvent.MOUSE_OUT, onMouseOut); 
     160            layers.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove); 
     161            layers.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp); 
     162            layers.removeEventListener(MouseEvent.MOUSE_OUT, onMouseOut); 
    162163        } 
    163164         
  • as3/gunyarapaint/branches/gunyarapaint/test/src/org/libspark/gunyarapaint/framework/PainterTest.as

    r3605 r3615  
    11package org.libspark.gunyarapaint.framework 
    22{ 
     3    import flash.display.Bitmap; 
    34    import flash.display.BitmapData; 
    45    import flash.display.BlendMode; 
     
    8283            // その為、上に現在のレイヤーが、下に描写バッファが入る 
    8384            cc.startDrawingSession(); 
    84             child = cc.view.getChildAt(0); 
     85            child = cc.layers.view.getChildAt(0); 
    8586            Assert.assertTrue(child is Sprite); 
    8687            var sprite:Sprite = Sprite(child); 
    87             Assert.assertTrue(sprite.getChildAt(0) is LayerBitmap); 
     88            Assert.assertTrue(sprite.getChildAt(0) is Bitmap); 
    8889            Assert.assertTrue(sprite.getChildAt(1) is Shape); 
    8990            // 描写セッションが終了すると一時 Sprite が削除され、現在のレイヤーに戻される 
    9091            cc.stopDrawingSession(); 
    91             child = cc.view.getChildAt(0); 
    92             Assert.assertTrue(child is LayerBitmap); 
     92            child = cc.layers.view.getChildAt(0); 
     93            Assert.assertTrue(child is Bitmap); 
    9394        } 
    9495