チェンジセット 3545

差分発生行の前後
無視リスト:
コミット日時:
2010/03/14 22:39:08 (2 年前)
コミッタ:
hkrn
ログメッセージ:

added gunyarapaint#moduleName and internal changes

ファイル:

凡例:

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

    r3544 r3545  
    2626import org.libspark.gunyarapaint.framework.events.UndoEvent; 
    2727import org.libspark.gunyarapaint.framework.modules.CanvasModuleContext; 
     28import org.libspark.gunyarapaint.framework.modules.CircleModule; 
    2829import org.libspark.gunyarapaint.framework.modules.DropperModule; 
     30import org.libspark.gunyarapaint.framework.modules.FloodFillModule; 
    2931import org.libspark.gunyarapaint.framework.modules.FreeHandModule; 
    3032import org.libspark.gunyarapaint.framework.modules.ICanvasModule; 
     33import org.libspark.gunyarapaint.framework.modules.LineModule; 
     34import org.libspark.gunyarapaint.framework.modules.PixelModule; 
    3135import org.libspark.nicopedia.Com; 
    3236 
     
    6973{ 
    7074    return m_module; 
     75} 
     76 
     77public function get moduleName():String 
     78{ 
     79    switch (m_module.name) { 
     80        case CircleModule.CIRCLE: 
     81            return "円描画ツール"; 
     82        case DropperModule.DROPPER: 
     83            return "スポイトツール"; 
     84        case FloodFillModule.FLOOD_FILL: 
     85            return "塗りつぶしツール"; 
     86        case FreeHandModule.FREE_HAND: 
     87            return "手書き(消しゴム)ツール"; 
     88        case LineModule.LINE: 
     89            return "直線ツール"; 
     90        case PixelModule.PIXEL: 
     91            return "ドットツール"; 
     92        default: 
     93            return "謎のツール"; 
     94    } 
    7195} 
    7296 
  • as3/gunyarapaint/branches/gunyarapaint/compat/src/org/libspark/gunyarapaint/controls/GPCanvas.as

    r3536 r3545  
    77     
    88    import mx.controls.Alert; 
     9    import mx.core.Application; 
    910    import mx.core.UIComponent; 
    1011     
     
    1617    internal class GPCanvas extends UIComponent 
    1718    { 
    18         public function GPCanvas(application:IApplication
     19        public function GPCanvas(
    1920        { 
    20             var rect:Rectangle = new Rectangle(0, 0, application.canvasWidth, application.canvasHeight); 
     21            var app:IApplication = IApplication(Application.application); 
     22            var rect:Rectangle = new Rectangle(0, 0, app.canvasWidth, app.canvasHeight); 
    2123            var transparent:TransparentBitmap = new TransparentBitmap(rect); 
    2224            m_auxLine = new AuxLineView(rect); 
    2325            m_auxPixel = new AuxPixelView(rect); 
    24             m_application = application; 
    2526            m_auxLine.visible = true; 
    2627            m_auxPixel.visible = false; 
    2728             
    2829            addChild(transparent); 
    29             addChild(application.canvasView); 
     30            addChild(app.canvasView); 
    3031            addChild(m_auxLine); 
    3132            addChild(m_auxPixel); 
     
    7576        private function onRemove(event:Event):void 
    7677        { 
    77             removeMouseEvents(m_application.canvasView); 
     78            var app:IApplication = IApplication(Application.application); 
     79            removeMouseEvents(app.canvasView); 
    7880            removeEventListener(Event.REMOVED_FROM_STAGE, onRemove); 
    7981        } 
     
    8183        private function onMouseDown(event:MouseEvent):void 
    8284        { 
    83             var cv:Sprite = m_application.canvasView; 
     85            var app:gunyarapaint = gunyarapaint(Application.application); 
     86            var cv:Sprite = app.canvasView; 
    8487            try { 
    85                 m_application.module.start(event.localX, event.localY); 
     88                app.module.start(event.localX, event.localY); 
    8689                cv.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove); 
    8790                cv.addEventListener(MouseEvent.MOUSE_UP, onMouseUp); 
     
    8992            } catch (e:Error) { 
    9093                removeMouseEvents(cv); 
    91                 Alert.show(e.message, e.name); 
     94                Alert.show(e.message, app.moduleName); 
    9295            } 
    9396        } 
     
    9598        private function onMouseMove(event:MouseEvent):void 
    9699        { 
    97             m_application.module.move(event.localX, event.localY); 
     100            var app:IApplication = IApplication(Application.application); 
     101            app.module.move(event.localX, event.localY); 
    98102        } 
    99103         
    100104        private function onMouseUp(event:MouseEvent):void 
    101105        { 
    102             removeMouseEvents(m_application.canvasView); 
    103             m_application.module.stop(event.localX, event.localY); 
     106            var app:IApplication = IApplication(Application.application); 
     107            removeMouseEvents(app.canvasView); 
     108            app.module.stop(event.localX, event.localY); 
    104109        } 
    105110         
    106111        private function onMouseOut(event:MouseEvent):void 
    107112        { 
    108             removeMouseEvents(m_application.canvasView); 
    109             m_application.module.interrupt(event.localX, event.localY); 
     113            var app:IApplication = IApplication(Application.application); 
     114            removeMouseEvents(app.canvasView); 
     115            app.module.interrupt(event.localX, event.localY); 
    110116        } 
    111117         
     
    119125        private var m_auxLine:AuxLineView; 
    120126        private var m_auxPixel:AuxPixelView; 
    121         private var m_application:IApplication; 
    122127    } 
    123128} 
  • as3/gunyarapaint/branches/gunyarapaint/compat/src/org/libspark/gunyarapaint/controls/GPCanvasWindowControl.as

    r3503 r3545  
    136136            m_canvasScale = 1; 
    137137             
    138             m_canvas = new GPCanvas(IApplication(Application.application)); 
     138            m_canvas = new GPCanvas(); 
    139139            m_canvasContainer.addChild(m_canvas); 
    140140            m_contentContainer.addChild(m_canvasContainer); 
  • as3/gunyarapaint/branches/gunyarapaint/compat/src/org/libspark/gunyarapaint/controls/GPLayerWindowControl.mxml

    r3508 r3545  
    1818            import org.libspark.gunyarapaint.utils.ComponentResizer; 
    1919            import org.libspark.gunyarapaint.framework.ui.IApplication; 
     20             
     21            private static const  NAME:String = "レイヤーツール"; 
    2022             
    2123            public function update():void 
     
    8688                    update(); 
    8789                } catch (e:Error) { 
    88                     Alert.show(e.message, e.name); 
     90                    Alert.show(e.message, NAME); 
    8991                } 
    9092            } 
     
    9698                    update(); 
    9799                } catch (e:Error) { 
    98                     Alert.show(e.message, e.name); 
     100                    Alert.show(e.message, NAME); 
    99101                } 
    100102            }