チェンジセット 3588

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

separated a form as FormController?

ファイル:

凡例:

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

    r3585 r3588  
    6767            private var initLayerWindowPos:Point; 
    6868            private var initToolController:Point; 
     69            private var initFormController:Point; 
    6970             
    7071            public const ALERT_TITLE:String = 'お絵カキコ'; 
     
    155156                layerController.move(initLayerWindowPos.x, initLayerWindowPos.y); 
    156157                toolController.move(initToolController.x, initToolController.y); 
     158                formController.move(initFormController.x, initFormController.y); 
    157159                canvasController.width = initCanvasWindow.width; 
    158160                canvasController.height = initCanvasWindow.height; 
     
    264266                PopUpManager.addPopUp(layerController, this); 
    265267                PopUpManager.addPopUp(toolController, this); 
     268                PopUpManager.addPopUp(formController, this); 
    266269                initCanvasWindow = new Rectangle(canvasController.x, canvasController.y, canvasController.width, canvasController.height); 
    267270                initPenDetailWindowPos = new Point(penController.x, penController.y); 
    268271                initLayerWindowPos = new Point(layerController.x, layerController.y); 
    269272                initToolController = new Point(toolController.x, toolController.y); 
     273                initFormController = new Point(formController.x, formController.y); 
    270274                 
    271275                if (parameters['postUrl'] && parameters['cookie'] && parameters['magic'] && parameters['redirectUrl']) { 
     
    490494    </mx:ArrayCollection> 
    491495    <mx:Image source="@Embed('./gunyara-paint_logo.png')" alpha="0.5" right="10" bottom="10"/> 
    492     <ui:ToolController id="toolController" left="10" y="10" title="補助ツール" /> 
    493     <ui:PenController id="penController" x="10" y="218" layout="absolute" title="ペン" height="450" /> 
    494     <ui:CanvasController id="canvasController" x="146" y="218" width="379" height="410" layout="absolute" title="キャンバス" /> 
    495     <ui:LayerController x="533" y="218" layout="absolute" title="レイヤー" id="layerController" height="312" /> 
     496    <ui:FormController id="formController" title="投稿フォーム"  x="10" y="10" height="169" width="486"/> 
     497    <ui:ToolController id="toolController" left="504" y="10" title="補助ツール" /> 
     498    <ui:PenController id="penController" x="10" y="223" layout="absolute" title="ペン" height="450" /> 
     499    <ui:CanvasController id="canvasController" x="146" y="223" width="379" height="410" layout="absolute" title="キャンバス" /> 
     500    <ui:LayerController x="533" y="223" layout="absolute" title="レイヤー" id="layerController" height="312" /> 
    496501    <mx:Label id="versionLabel" text="ver.2009090902" right="10" bottom="10" alpha="0.5"/> 
    497502</mx:Application> 
  • as3/gunyarapaint/branches/gunyarapaint/compat/src/org/libspark/gunyarapaint/ui/v1/ToolController.mxml

    r3585 r3588  
    11<?xml version="1.0" encoding="utf-8"?> 
    2 <mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="720" height="200" initialize="onInitialize()" removedFromStage="onRemove()"> 
     2<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="300" height="205" initialize="onInitialize()" removedFromStage="onRemove()"> 
    33    <mx:Script> 
    44        <![CDATA[ 
    5             import mx.controls.Alert; 
    65            import mx.core.Application; 
    76            import mx.events.FlexEvent; 
     
    1413            import org.libspark.gunyarapaint.framework.events.UndoEvent; 
    1514            import org.libspark.gunyarapaint.framework.ui.IApplication; 
    16             import org.libspark.nicopedia.Com; 
    1715             
    1816            public function setRotate(value:Number):void 
     
    133131                // w.password = gpCanvas.logger.password; 
    134132            } 
    135              
    136             // TODO: もう本当に汚い… これのスコープを短くする。 
    137             private var baseImg:BitmapData; 
    138              
    139             private function getBaseImgHandler(com:Com):void 
    140             { 
    141                 baseImg = Bitmap(com.content).bitmapData; 
    142                 /* 
    143                 if (parameters['baseImgInfoUrl']) { 
    144                     new Com().sendGetUrlRequest(parameters['baseImgInfoUrl'], getBaseImgInfoHandler); 
    145                 } else { 
    146                     // 画像のサイズがそのままwidth/height 
    147                     // このロジックは通らなくなっているはずだが、移行措置のため残してある。 
    148                     // 消してもよい。 
    149                     baseImgToCanvas(baseImg.width, baseImg.height, parameters['undoBufferSize'], null); 
    150                 } 
    151                 */ 
    152             } 
    153              
    154             private function getBaseImgInfoHandler(com:Com):void 
    155             { 
    156                 var info:Object = com.jsonObject; 
    157                 if (!info) { 
    158                     info = {'width': baseImg.width, 'height': baseImg.height}; 
    159                 } 
    160                 //baseImgToCanvas(info['width'], info['height'], parameters['undoBufferSize'], info); 
    161             } 
    162              
    163             private function baseImgToCanvas(width:uint, height:uint, undoBufferSize:uint, baseInfo:Object):void 
    164             { 
    165                 /* 
    166                 _logger = GPLogger.createForDraw(width, height, undoBufferSize, 
    167                 baseImg, baseInfo); 
    168                 canvasWindow.logger = _logger; 
    169                 */ 
    170                 enabled = true; 
    171             } 
    172              
    173             private function commCompleteHandler(com:Com):void 
    174             { 
    175                 try { 
    176                     if (com.errStr) { 
    177                         // error 
    178                         Alert.show(com.errStr, Application.application.ALERT_TITLE); 
    179                     } 
    180                     else if (com.data.toString() != '') { 
    181                         Alert.show(com.data.toString(), Application.application.ALERT_TITLE); 
    182                     } 
    183                     else { 
    184                         // redirect 
    185                         //Com.redirect(redirectUrl); 
    186                         return; 
    187                     } 
    188                 } 
    189                 catch (e:Error) { 
    190                     Alert.show('何かしらのエラーが起きました…再投稿お願いいたします。', Application.application.ALERT_TITLE); 
    191                 } 
    192                 Application.application.alertOnUnload(true); 
    193             } 
    194              
    195             private function postOekakiButtonHandler(evt:Event):void 
    196             { 
    197                 if (titleTextInput.text == '') { 
    198                     Alert.show('絵のタイトルが空です。', Application.application.ALERT_TITLE); 
    199                 } 
    200                 else if (messageTextArea.text == '') { 
    201                     Alert.show('書き込みが空です。', Application.application.ALERT_TITLE); 
    202                 } 
    203                 else if (Application.application.commitCount == 0) { 
    204                     Alert.show('絵が描かれていません。お絵かきしてください。', Application.application.ALERT_TITLE); 
    205                 } 
    206                 else { 
    207                     try { 
    208                         Application.application.alertOnUnload(false); 
    209                         /* 
    210                         var com:Com = new Com(); 
    211                         com.postOekaki(this, 
    212                             parameters['postUrl'], 
    213                             parameters['magic'], 
    214                             parameters['cookie'], 
    215                             fromTextInput.text, 
    216                             titleTextInput.text, 
    217                             messageTextArea.text, 
    218                             watchlistCheckBox.selected, 
    219                             oekakiId, 
    220                             new ByteArray(), //_logger.dataForPost, 
    221                             commCompleteHandler 
    222                         ); 
    223                         */ 
    224                     } 
    225                     catch (e:Error) { 
    226                         Application.application.alertOnUnload(true); 
    227                         Alert.show(e.message, Application.application.ALERT_TITLE); 
    228                     } 
    229                 } 
    230             } 
    231133        ]]> 
    232134    </mx:Script> 
    233     <mx:Label x="12" y="7" text="投稿者名"/> 
    234     <mx:TextInput id="fromTextInput" x="55" y="3" maxChars="32" fontSize="14" focusThickness="0"/> 
    235     <mx:Label x="2" y="36" text="絵のタイトル"/> 
    236     <mx:TextInput id="titleTextInput" x="55" y="32" maxChars="32" fontSize="14" focusThickness="0" width="406"/> 
    237     <mx:CheckBox id="watchlistCheckBox" x="223" y="7" label="ウォッチリストに登録"/> 
    238     <mx:Label x="10" y="76" text="書き込み"/> 
    239     <mx:TextArea id="messageTextArea" x="55" y="61" width="406" height="61" fontSize="14" focusThickness="0"> 
    240         <mx:text></mx:text> 
    241     </mx:TextArea> 
    242     <mx:Button id="rotateResetButton" y="63" label="角度" width="29" paddingLeft="0" paddingRight="0" paddingTop="0" paddingBottom="0" height="17" right="204" buttonDown="setRotate(0)"/> 
    243     <mx:Button id="zoomResetButton" y="81" label="拡大" width="29" paddingLeft="0" paddingRight="0" paddingTop="0" paddingBottom="0" height="17" right="204" buttonDown="setZoom(1)"/> 
    244     <mx:Button id="horizontalMirrorButton" x="117" y="128" label="全レイヤー左右反転" width="120" paddingLeft="0" paddingRight="0" paddingTop="0" paddingBottom="0" height="17" buttonDown="IApplication(Application.application).module.horizontalMirror(Painter.ALL_LAYERS)"/> 
    245     <mx:Button id="verticalMirrorButton" x="245" y="128" label="全レイヤー上下反転" width="120" paddingLeft="0" paddingRight="0" paddingTop="0" paddingBottom="0" height="17" buttonDown="IApplication(Application.application).module.verticalMirror(Painter.ALL_LAYERS)"/> 
    246     <mx:HSlider id="canvasRotate" y="62" width="152" minimum="-180" maximum="180" snapInterval="5" value="0"  right="49" showDataTip="false" change="setRotate(event.value)" thumbDrag="setRotate(event.value)"/> 
    247     <mx:HSlider id="canvasZoom" y="79" width="152" minimum="-4" maximum="19" snapInterval="0.1" value="1"  right="49" showDataTip="false" change="setZoom(event.value)" thumbDrag="setZoom(event.value)"/> 
    248     <mx:TextInput id="canvasRotateValue" y="66" width="32" height="17" right="18" fontSize="8" textAlign="right" text="0" restrict="0-9" maxChars="4" enter="onChangeCanvasRotate(event)"/> 
    249     <mx:Label y="66" text="°" right="0"/> 
    250     <mx:TextInput id="canvasZoomValue" y="83" width="32" height="17" right="18" fontSize="8" textAlign="right" text="100" restrict="0-9" maxChars="6" enter="onChangeCanvasZoom(event)"/> 
    251     <mx:Label y="83" text="%" right="0"/> 
    252      
    253     <mx:Label y="4" text="補助線" right="199"/> 
    254     <mx:NumericStepper id="additionalNumberStepper" y="4" value="4" minimum="2" maximum="16" stepSize="1" right="143" height="18" fontSize="8" change="onChangeAuxDivideCount(event)"/> 
    255     <mx:CheckBox id="additionalBoxCheckBox" y="2" label="縦横" right="8" fontSize="9" height="18" change="onChangeAuxBoxVisible(event)"/> 
    256     <mx:CheckBox id="additionalSkewCheckBox" y="18" label="斜め" right="9" fontSize="9" height="18" change="onChangeAuxSkewVisible(event)"/> 
    257     <mx:Button id="postOekakiButton" x="353" y="7" label="お絵カキコする!" fillAlphas="[1.0, 1.0, 1.0, 1.0]" fillColors="[#FFFFFF, #FF9999, #FFFFFF, #FFCCCC]" enabled="false" buttonDown="postOekakiButtonHandler(event)"/> 
    258     <mx:Button id="undoButton" y="38" label="アンドゥ" enabled="false" paddingLeft="3" paddingRight="3" right="89" buttonDown="IApplication(Application.application).module.undo()"/> 
    259     <mx:Button id="redoButton" y="38" label="リドゥ" enabled="false" paddingLeft="3" paddingRight="3" right="12" buttonDown="IApplication(Application.application).module.redo()"/> 
    260     <mx:Button id="windowsResetButton" x="10" y="128" label="ウィンドウ初期状態" width="99" paddingLeft="0" paddingRight="0" paddingTop="0" paddingBottom="0" height="17" buttonDown="Application.application.resetWindowsPosition()"/> 
    261     <mx:Button id="passwordButton" x="373" y="128" label="ふっかつのじゅもん" width="99" paddingLeft="0" paddingRight="0" paddingTop="0" paddingBottom="0" height="17" buttonDown="onLoad(event)"/> 
    262     <mx:Button id="logPlayButton" y="105" label="ログプレイ" visible="false" right="99"/> 
    263     <mx:Button id="checkPngButton" y="105" label="同一check" visible="false" right="10"/> 
    264     <mx:ComboBox y="4" id="additionalTypeComboBox" right="66" width="70" fontSize="8" height="18" selectedIndex="0" change="onChangeAuxType(event)"> 
    265         <mx:ArrayCollection id="auxTypes"> 
    266             <mx:Object label="分割" data="0" /> 
    267             <mx:Object label="px単位" data="1" /> 
    268         </mx:ArrayCollection> 
    269     </mx:ComboBox> 
     135    <mx:Canvas x="10" y="0" height="163" width="260"> 
     136        <mx:Button id="rotateResetButton" y="63" label="角度" width="29" paddingLeft="0" paddingRight="0" paddingTop="0" paddingBottom="0" height="17" right="204" buttonDown="setRotate(0)"/> 
     137        <mx:Button id="zoomResetButton" y="81" label="拡大" width="29" paddingLeft="0" paddingRight="0" paddingTop="0" paddingBottom="0" height="17" right="204" buttonDown="setZoom(1)"/> 
     138        <mx:HSlider id="canvasRotate" y="62" width="152" minimum="-180" maximum="180" snapInterval="5" value="0"  right="49" showDataTip="false" change="setRotate(event.value)" thumbDrag="setRotate(event.value)"/> 
     139        <mx:HSlider id="canvasZoom" y="79" width="152" minimum="-4" maximum="19" snapInterval="0.1" value="1"  right="49" showDataTip="false" change="setZoom(event.value)" thumbDrag="setZoom(event.value)"/> 
     140        <mx:TextInput id="canvasRotateValue" y="66" width="32" height="17" right="18" fontSize="8" textAlign="right" text="0" restrict="0-9" maxChars="4" enter="onChangeCanvasRotate(event)"/> 
     141        <mx:Label y="66" text="°" right="0"/> 
     142        <mx:TextInput id="canvasZoomValue" y="83" width="32" height="17" right="18" fontSize="8" textAlign="right" text="100" restrict="0-9" maxChars="6" enter="onChangeCanvasZoom(event)"/> 
     143        <mx:Label y="83" text="%" right="0"/> 
     144        <mx:Label y="4" text="補助線" right="199"/> 
     145        <mx:NumericStepper id="additionalNumberStepper" y="4" value="4" minimum="2" maximum="16" stepSize="1" right="143" height="18" fontSize="8" change="onChangeAuxDivideCount(event)"/> 
     146        <mx:CheckBox id="additionalBoxCheckBox" y="2" label="縦横" right="8" fontSize="9" height="18" change="onChangeAuxBoxVisible(event)"/> 
     147        <mx:CheckBox id="additionalSkewCheckBox" y="18" label="斜め" right="9" fontSize="9" height="18" change="onChangeAuxSkewVisible(event)"/> 
     148        <mx:Button id="undoButton" y="38" label="アンドゥ" enabled="false" paddingLeft="3" paddingRight="3" right="89" buttonDown="IApplication(Application.application).module.undo()"/> 
     149        <mx:Button id="redoButton" y="38" label="リドゥ" enabled="false" paddingLeft="3" paddingRight="3" right="12" buttonDown="IApplication(Application.application).module.redo()"/> 
     150        <mx:Button id="logPlayButton" y="105" label="ログプレイ" visible="false" right="99"/> 
     151        <mx:Button id="checkPngButton" y="105" label="同一check" visible="false" right="10"/> 
     152        <mx:ComboBox y="4" id="additionalTypeComboBox" right="66" width="70" fontSize="8" height="18" selectedIndex="0" change="onChangeAuxType(event)"> 
     153            <mx:ArrayCollection id="auxTypes"> 
     154                <mx:Object label="分割" data="0" /> 
     155                <mx:Object label="px単位" data="1" /> 
     156            </mx:ArrayCollection> 
     157        </mx:ComboBox> 
     158        <mx:Button id="windowsResetButton" x="146" y="136" label="ウィンドウ初期状態" width="104" paddingLeft="0" paddingRight="0" paddingTop="0" paddingBottom="0" height="17" buttonDown="Application.application.resetWindowsPosition()"/> 
     159        <mx:Button id="horizontalMirrorButton" x="10" y="111" label="全レイヤー左右反転" width="120" paddingLeft="0" paddingRight="0" paddingTop="0" paddingBottom="0" height="17" buttonDown="IApplication(Application.application).module.horizontalMirror(Painter.ALL_LAYERS)"/> 
     160        <mx:Button id="verticalMirrorButton" x="10" y="136" label="全レイヤー上下反転" width="120" paddingLeft="0" paddingRight="0" paddingTop="0" paddingBottom="0" height="17" buttonDown="IApplication(Application.application).module.verticalMirror(Painter.ALL_LAYERS)"/> 
     161        <mx:Button id="passwordButton" x="146" y="111" label="ふっかつのじゅもん" width="104" paddingLeft="0" paddingRight="0" paddingTop="0" paddingBottom="0" height="17" buttonDown="onLoad(event)"/> 
     162    </mx:Canvas> 
    270163</mx:TitleWindow>