チェンジセット 2708

差分発生行の前後
無視リスト:
コミット日時:
2009/05/24 23:02:24 (3 年前)
コミッタ:
uwi
ログメッセージ:

キャストの修正
OAuthアイコン

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • air/TLife/trunk/bin/initial/config.xml

    r2651 r2708  
    153153  <timeout>10000</timeout> 
    154154  <autorelogininterval>60000</autorelogininterval> 
     155  <urlshortening> 
     156    <policy>smart</policy> 
     157    <services>tinyurl.com</services> 
     158  </urlshortening> 
    155159  <log> 
    156160    <level>DEBUG</level> 
  • air/TLife/trunk/src/Main.mxml

    r2669 r2708  
    1 <?xml version="1.0" encoding="utf-8"?> 
     1<?xml version="1.0" encoding="utf-8"?> 
    22<mx:WindowedApplication 
    33        xmlns:mx="http://www.adobe.com/2006/mxml" 
     
    8181                                // アイコンの設定 
    8282                                NativeApplication.nativeApplication.icon.bitmaps = [ 
    83                                         (new icon_16() as BitmapAsset).bitmapData, 
    84                                         (new icon_32() as BitmapAsset).bitmapData, 
    85                                         (new icon_48() as BitmapAsset).bitmapData, 
    86                                         (new icon_128() as BitmapAsset).bitmapData 
     83                                        BitmapAsset(new icon_16()).bitmapData, 
     84                                        BitmapAsset(new icon_32()).bitmapData, 
     85                                        BitmapAsset(new icon_48()).bitmapData, 
     86                                        BitmapAsset(new icon_128()).bitmapData 
    8787                                ]; 
    8888                                if (NativeApplication.supportsSystemTrayIcon) { 
    89                                         systemtrayicon = NativeApplication.nativeApplication.icon as SystemTrayIcon
     89                                        systemtrayicon = SystemTrayIcon(NativeApplication.nativeApplication.icon)
    9090                                        systemtrayicon.tooltip = "TLife"; 
    9191                                } 
    9292                                if (NativeApplication.supportsDockIcon) { 
    93                                         dockicon = NativeApplication.nativeApplication.icon as DockIcon
     93                                        dockicon = DockIcon(NativeApplication.nativeApplication.icon)
    9494                                } 
    9595                                 
     
    126126                                 
    127127                                // postvalidatorの設定 
    128                                 postvalidator.required = false; 
    129                                 postvalidator.maxLength = CommonData.LIMLEN_POST; 
    130                                 postvalidator.tooLongError = "長すぎですよー"; 
     128                                //postvalidator.required = false; 
     129                                //postvalidator.maxLength = CommonData.LIMLEN_POST; 
     130                                //postvalidator.tooLongError = "長すぎですよー"; 
     131        MainStatusBar(statusBar).setStateOAuth(0); 
    131132                                 
    132133                                new MainThread().start(); 
     
    176177                        } 
    177178                         
    178                       private static const EVENT_CHARLEFT : Event = new Event("charleft"); 
     179//                    private static const EVENT_CHARLEFT : Event = new Event("charleft"); 
    179180                         
    180181                        public function changeCharLeft() : void 
     
    193194          // StringValidator用 
    194195          // XXX ときどきrepaintしないと元の色に戻らない場合がある。バグ? 
    195           postarea.dispatchEvent(EVENT_CHARLEFT); 
     196//          postarea.dispatchEvent(EVENT_CHARLEFT); 
    196197        }); 
    197198                        } 
     
    361362                                // XXX too dangerous! 
    362363                                // TextArea.textField 
    363                                 var pos : int = (friendpost.getChildAt(2) as IUITextField).getCharIndexAtPoint(event.localX, event.localY); 
     364                                var pos : int = IUITextField(friendpost.getChildAt(2)).getCharIndexAtPoint(event.localX, event.localY); 
    364365                                if (pos == CommonData.prevpos_friendpost || pos == -1) return; 
    365366                                CommonData.prevpos_friendpost = pos; 
     
    386387                                // XXX too dangerous! 
    387388                                // Text.textField 
    388                                 var pos : int = (replypost.getChildAt(0) as IUITextField).getCharIndexAtPoint(event.localX, event.localY); 
     389                                var pos : int = IUITextField(replypost.getChildAt(0)).getCharIndexAtPoint(event.localX, event.localY); 
    389390                                if (pos == CommonData.prevpos_replypost || pos == -1) return; 
    390391                                CommonData.prevpos_replypost = pos; 
     
    509510        </mx:VBox> 
    510511         
    511        <mx:StringValidator id="postvalidator" source="{postarea}" property="text" triggerEvent="charleft" /
     512<!--   <mx:StringValidator id="postvalidator" source="{postarea}" property="text" triggerEvent="charleft" />--
    512513         
    513514  <mx:Style> 
  • air/TLife/trunk/src/uwi/migemo/AIRMigemo.as

    r2634 r2708  
    9494        if (ar != null) { 
    9595          for each(x in ar) { 
    96             ar2 = (x.value as String).split("|"); 
     96            ar2 = String(x.value).split("|"); 
    9797            for each(x2 in ar2){ 
    9898              ret.push(x2); 
  • air/TLife/trunk/src/uwi/migemo/SocialIMEAPIThread.as

    r2634 r2708  
    5252                { 
    5353                        for (var i : int = 0; i < pe.numThreads; i++) { 
    54                                 var ult : URLLoaderThread = pe.getThreadAt(i) as URLLoaderThread
     54                                var ult : URLLoaderThread = URLLoaderThread(pe.getThreadAt(i))
    5555                                var src : String = ult.loader.data.replace(/([\*\+\.\?\{\}\(\)\[\]\^\$\-\|\/\\])/g, "\\$1"); 
    5656                                var regexpstr : String = ""; 
  • air/TLife/trunk/src/uwi/search/Searcher.as

    r2669 r2708  
    9090            if (val is Array) { 
    9191              if (option.word) { 
    92                 for each(q in val as Array) { 
     92                for each(q in val) { 
    9393                  if ((q.flag == "-") == (segs.indexOf(q.value) != -1)) { 
    9494                    found = false; 
     
    9797                } 
    9898              }else{ 
    99                 for each(q in val as Array) { 
     99                for each(q in val) { 
    100100                  if ((q.flag == "-") == (targ.indexOf(q.value) != -1)) { 
    101101                    found = false; 
     
    108108                found = false; 
    109109                for (var seg : String in segs) { 
    110                   if ((val as RegExp).test(seg)) { 
     110                  if (RegExp(val).test(seg)) { 
    111111                    found = true; 
    112112                    break; 
     
    114114                } 
    115115              }else{ 
    116                 found = (val as RegExp).test(targ); 
     116                found = RegExp(val).test(targ); 
    117117              } 
    118118            }else { 
     
    124124            if (option.idfullMatch == true) { 
    125125              // 完全一致 
    126               found = (val as Array).indexOf(targ) != -1; 
     126              found = val.indexOf(targ) != -1; 
    127127            }else { 
    128128              found = false; 
  • air/TLife/trunk/src/uwi/thread/FollowingCheckThread.as

    r2634 r2708  
    5858    private function onSelectComplete() : void 
    5959    { 
    60       var arprotected : Array = (pe.getThreadAt(0) as DBSelectThread).Result.data; 
    61       var arfollowing : Array = (pe.getThreadAt(1) as DBSelectThread).Result.data; 
     60      var arprotected : Array = DBSelectThread(pe.getThreadAt(0)).Result.data; 
     61      var arfollowing : Array = DBSelectThread(pe.getThreadAt(1)).Result.data; 
    6262       
    6363      if (arprotected == null) { 
  • air/TLife/trunk/src/uwi/thread/LinkResolveThread.as

    r2634 r2708  
    102102      var decodeds : Array = [dst]; 
    103103      for (var i : int = 0; i < pe.numThreads; i++) { 
    104         var uet : URLExpandThread = pe.getThreadAt(i) as URLExpandThread
     104        var uet : URLExpandThread = URLExpandThread(pe.getThreadAt(i))
    105105        if(uet.expanded != null){ 
    106106          decodeds.push("<a href=\"" + uet.expanded + "\">" + uet.expanded + "</a>"); 
  • air/TLife/trunk/src/uwi/thread/MainThread.as

    r2669 r2708  
    1 package uwi.thread { 
     1package uwi.thread { 
    22  import flash.desktop.NativeApplication; 
    33  import flash.display.NativeWindow; 
     
    3333  import uwi.twitter.TwitterFriendsInfoGetThread; 
    3434  import uwi.twitter.TwitterMobileLogoutThread; 
     35  import uwi.twitter.TwitterOAuthAccessThread; 
    3536  import uwi.ui.multipletabbar.MultipleTabBarDragEventThread; 
    3637  import uwi.util.CommonData; 
     
    6465      CommonData.searcher = new Searcher(); 
    6566      CommonData.cache_protectedpostid = { }; 
    66       CommonData.state_oauth = 0; 
    6767       
    6868      // configxmlの読み込み 
     
    134134      new TabBarEventThread().start(); 
    135135      new ContextMenuItemEventThread().start(); 
     136      /* 
    136137      new IncrementalSearchThread().start(); 
    137138      new PostEventThread().start(); 
     
    147148      }else{ 
    148149        new InitialMovementThread().start(); 
    149       } 
     150        // OAuth 
     151        // 現状では正しく認証されているか確認する術はない 
     152        CommonData.state_oauth = (CommonData.configxml.login.oauth_token != "" && CommonData.configxml.login.oauth_token_secret != "") 
     153          ? 1 : 0; 
     154      } 
     155      */ 
    150156    } 
    151157     
  • air/TLife/trunk/src/uwi/thread/NotifyNewThread.as

    r2669 r2708  
    212212      var ret : Number = Screen.mainScreen.visibleBounds.bottom; 
    213213      for (var bobj : Object in CommonData.balloons) { 
    214         var b : Balloon = bobj as Balloon
     214        var b : Balloon = Balloon(bobj)
    215215        var y : Number = b.baseY - Balloon.MAXHEIGHT - Balloon.MARGINY; 
    216216        if (y < ret) { 
  • air/TLife/trunk/src/uwi/thread/PostThread.as

    r2653 r2708  
    3939    { 
    4040      postedtext = postarea.text; 
    41        
    42       if (postedtext.length > CommonData.LIMLEN_POST) { 
    43         return; 
    44       } 
    45       if (postedtext.length == 0) { 
    46         return; 
    47       } 
    48        
    49       var footer : String = CommonData.configxml.footer; 
    50       if (footer != "") footer = " " + footer; 
    51       postedtext += footer; 
    5241       
    5342      // ポスト直前に短縮する 
     
    119108      var prev : int = 0; 
    120109      for (var i : int = 0; i < gpe.numThreads; i++) { 
    121         var ust : URLShortenThread = (gpe.getThreadAt(i) as ParallelExecutor).getThreadAt(0) as URLShortenThread
     110        var ust : URLShortenThread = URLShortenThread(ParallelExecutor(gpe.getThreadAt(i)).getThreadAt(0))
    122111        postedtext += origtext.substring(prev, hrefs[i].index) + ust.shortened; 
    123112        prev = hrefs[i].index + hrefs[i].href.length; 
     
    125114      postedtext += origtext.substring(prev); 
    126115       
     116      postarea.text = postedtext; 
     117      Application.application.changeCharLeft(); 
     118       
    127119      post(); 
    128120    } 
    129121     
     122    private static const PTN_REPLYONLY : RegExp = /^. ?(@[A-Za-z0-9]+ )+ *$/; 
     123     
    130124    private function post() : void 
    131125    { 
     126      if (postedtext.length == 0) { 
     127        return; 
     128      } 
     129       
     130      if (PTN_REPLYONLY.test(postedtext)) { 
     131        return; 
     132      } 
     133       
     134      var footer : String = CommonData.configxml.footer; 
     135      if (footer != "") footer = " " + footer; 
     136      postedtext += footer; 
     137       
     138      if (postedtext.length > CommonData.LIMLEN_VALID) { 
     139        return; 
     140      } 
     141       
    132142      // TODO 複数reply時のin_reply_to_status_idのとりかた 
    133143      var param : Object = { }; 
  • air/TLife/trunk/src/uwi/thread/StatusGetBaseThread.as

    r2634 r2708  
    7979      if(response){ 
    8080        for (var i : int = 0; i < pe.numThreads; i++) { 
    81           var ult : URLLoaderThread = pe.getThreadAt(i) as URLLoaderThread
     81          var ult : URLLoaderThread = URLLoaderThread(pe.getThreadAt(i))
    8282          event(ult.loader, HTTPStatusEvent.HTTP_RESPONSE_STATUS, onResponseStatus); 
    8383        } 
     
    112112      Logger.debug("StatusGetBaseThread status : " + e.status); 
    113113      if (e.status != 200) { 
    114         (e.currentTarget as URLLoader).close(); 
     114        URLLoader(e.currentTarget).close(); 
    115115      } 
    116116      next(waitProgresses); 
  • air/TLife/trunk/src/uwi/thread/event/ContextMenuItemEventThread.as

    r2669 r2708  
    1 package uwi.thread.event 
     1package uwi.thread.event 
    22{ 
    33  import flash.display.DisplayObject; 
     
    2424  import uwi.thread.ReloadThread; 
    2525  import uwi.twitter.TwitterAPI; 
     26  import uwi.twitter.TwitterOAuthRequestThread; 
    2627  import uwi.twitter.TwitterScrapeThread; 
    2728  import uwi.ui.answer.Answer; 
     
    5960    private var item_ruletab : ContextMenuItem; 
    6061     
     62    private var item_oauthlogin : ContextMenuItem; 
     63    private var item_oauthlogout : ContextMenuItem; 
     64     
    6165    private var friendpost : TextArea = Application.application.friendpost; 
    6266    private var datagrid : DataGridEx = Application.application.datagrid; 
     
    109113      tabbar.contextMenu = tbcm; 
    110114       
    111       var ui : UITextField = friendpost.getChildAt(2) as UITextField
     115      var ui : UITextField = UITextField(friendpost.getChildAt(2))
    112116      var cm : ContextMenu = new ContextMenu(); 
    113117      cm.clipboardMenu = true; 
    114118      ui.contextMenu = cm; 
     119       
     120      item_oauthlogin = new ContextMenuItem("OAuthログイン"); 
     121      item_oauthlogout = new ContextMenuItem("OAuthログアウト"); 
     122       
     123      var oacm : ContextMenu = new ContextMenu(); 
     124      oacm.customItems.push(item_oauthlogin); 
     125      oacm.customItems.push(item_oauthlogout); 
     126      CommonData.mainstatusbar.oauthimage.contextMenu = oacm; 
    115127       
    116128//      friendpost.contextMenu = tbcm; 
     
    136148      item_deltab = null; 
    137149      item_ruletab = null; 
     150       
     151      item_oauthlogin = null; 
     152      item_oauthlogout = null; 
    138153    } 
    139154     
     
    158173      event(item_deltab, ContextMenuEvent.MENU_ITEM_SELECT, onDeleteTab); 
    159174      event(item_ruletab, ContextMenuEvent.MENU_ITEM_SELECT, onRuleTab); 
     175       
     176      event(item_oauthlogin, ContextMenuEvent.MENU_ITEM_SELECT, onOAuthLogin); 
     177      event(item_oauthlogout, ContextMenuEvent.MENU_ITEM_SELECT, onOAuthLogout); 
    160178    }  
    161179     
     
    367385    private function onCreateTab(e : ContextMenuEvent) : void 
    368386    { 
    369       var tb : TabBar = e.mouseTarget.parent as TabBar
     387      var tb : TabBar = TabBar(e.mouseTarget.parent)
    370388      var srclabel : String = tb.itemToLabel(e.mouseTarget); 
    371389      var ind : int = tabbar.titles.source.indexOf(srclabel); 
     
    394412        }; 
    395413      } 
    396       var main : DisplayObject = Application.application as DisplayObject
     414      var main : DisplayObject = DisplayObject(Application.application)
    397415      PopUpManager.addPopUp(ans, main, false); 
    398416      ans.x = main.width / 2 - ans.width / 2; 
     
    404422    private function onDupTab(e : ContextMenuEvent) : void 
    405423    { 
    406       var tb : TabBar = e.mouseTarget.parent as TabBar
     424      var tb : TabBar = TabBar(e.mouseTarget.parent)
    407425      var srclabel : String = tb.itemToLabel(e.mouseTarget); 
    408426      var newlabel : String = Utility.addAvoidingOverlap(tabbar.titles, newlabel); 
     
    415433    private function onRenameTab(e : ContextMenuEvent) : void 
    416434    { 
    417       var tb : TabBar = e.mouseTarget.parent as TabBar
     435      var tb : TabBar = TabBar(e.mouseTarget.parent)
    418436      var oldtabname : String = tb.itemToLabel(e.mouseTarget); 
    419437      var ans : Answer = new Answer(); 
     
    435453        CommonData.tabmap[newtabname] = val; 
    436454      } 
    437       var main : DisplayObject = Application.application as DisplayObject
     455      var main : DisplayObject = DisplayObject(Application.application)
    438456      PopUpManager.addPopUp(ans, main, false); 
    439457      ans.x = main.width / 2 - ans.width / 2; 
     
    446464    { 
    447465      if(tabbar.titles.length > 1){ 
    448         var tb : TabBar = e.mouseTarget.parent as TabBar
     466        var tb : TabBar = TabBar(e.mouseTarget.parent)
    449467        var label : String = tb.itemToLabel(e.mouseTarget); 
    450468        var index : int = tabbar.titles.getItemIndex(label); 
     
    476494    { 
    477495      if (CommonData.tabconfig == null) { 
    478         var tb : TabBar = e.mouseTarget.parent as TabBar
     496        var tb : TabBar = TabBar(e.mouseTarget.parent)
    479497        CommonData.tabconfig = new TabConfig(); 
    480498        CommonData.tabconfig.initialtabname = tb.itemToLabel(e.mouseTarget); 
     
    484502        CommonData.tabconfig.orderToFront(); 
    485503      } 
     504      next(run); 
     505    } 
     506     
     507    private function onOAuthLogin(e : ContextMenuEvent) : void 
     508    { 
     509      new TwitterOAuthRequestThread().start(); 
     510      next(run); 
     511    } 
     512     
     513    private function onOAuthLogout(e : ContextMenuEvent) : void 
     514    { 
     515      CommonData.configxml.login.oauth_token = ""; 
     516      CommonData.configxml.login.oauth_token_secret = ""; 
     517      CommonData.mainstatusbar.setStateOAuth(0); 
    486518      next(run); 
    487519    } 
  • air/TLife/trunk/src/uwi/thread/event/DataGridEventThread.as

    r2669 r2708  
    8181    private function onRightClick(e : MouseEvent) : void 
    8282    { 
    83       var ir : IListItemRenderer = e.target as IListItemRenderer
     83      var ir : IListItemRenderer = IListItemRenderer(e.target)
    8484      if (ir != null) { 
    8585        datagrid.selectedIndex = datagrid.itemRendererToIndex(ir); 
     
    9999      if (CommonData.keybinds.jumptopostarea == code) { 
    100100        Application.application.postarea.setFocus(); 
     101        e.preventDefault(); 
    101102        next(waitEvents); 
    102103        return; 
  • air/TLife/trunk/src/uwi/thread/event/DataGridRoutineThread.as

    r2669 r2708  
    9393          var posterid : String = timeline[i].posterid; 
    9494          for (var j : uint = 0; j < datagrid.columnCount;j++){ 
    95             var ir : DataGridItemRenderer = datagrid.rowcolToItemRenderer(i, j) as DataGridItemRenderer
     95            var ir : DataGridItemRenderer = DataGridItemRenderer(datagrid.rowcolToItemRenderer(i, j))
    9696            if (ir == null) continue; 
    9797            if(i != index && posterid == obj.posterid){ 
  • air/TLife/trunk/src/uwi/thread/event/IncrementalSearchThread.as

    r2669 r2708  
    6565    protected override function run() : void  
    6666    {  
    67       event(Application.application as DisplayObject, KeyboardEvent.KEY_DOWN, onKeyDown); 
     67      event(DisplayObject(Application.application), KeyboardEvent.KEY_DOWN, onKeyDown); 
    6868      if(timeoutManager != null)event(timeoutManager, TimerEvent.TIMER, onTimeout); 
    6969    }  
  • air/TLife/trunk/src/uwi/thread/event/PostEventThread.as

    r2669 r2708  
    5050    public function PostEventThread()  
    5151    { 
    52       uict = new UserIDCompleteThread(postarea, Application.application as Container); 
     52      uict = new UserIDCompleteThread(postarea, Container(Application.application)); 
    5353      downatpostarea = false; 
    5454      upatpostarea = false; 
     
    8282//      e.stopPropagation(); 
    8383       
     84      if (e.altKey == true) { 
     85        e.preventDefault(); 
     86      } 
     87 
    8488      // \rが文字数にカウントされない現象の改善(1行目の改行には反映されていない様子) 
    8589      if (e.keyCode == Keyboard.ENTER && (e.controlKey == true || e.altKey == true)) { 
    8690        e.preventDefault(); 
    8791        postarea.TextField.replaceSelectedText("\n"); 
    88         trace("にゃー"); 
    8992        postarea.TextField.dispatchEvent(EVENT_CHANGE); 
    9093      } 
  • air/TLife/trunk/src/uwi/thread/event/TabBarEventThread.as

    r2669 r2708  
    6666      var len : int = mtb.titles.length; 
    6767      for (var i : int = 0; i < len; i++) { 
    68         var title : String = mtb.titles.getItemAt(i) as String
     68        var title : String = String(mtb.titles.getItemAt(i))
    6969        var btn : Button = mtb.getTab(i); 
    7070        btn.setStyle("fontWeight", CommonData.tabmap[title].highlighted ? "bold" : "normal"); 
  • air/TLife/trunk/src/uwi/tinysegmenter/TinySegmenter.as

    r2634 r2708  
    7676    { 
    7777      for (var i : Object in chartype) { 
    78         if (str.match(i as RegExp)) { 
     78        if (str.match(RegExp(i))) { 
    7979          return chartype[i]; 
    8080        } 
  • air/TLife/trunk/src/uwi/twitter/TwitterDirectMessageGetThread.as

    r2634 r2708  
    5252       
    5353      for (var i : int = 0; i < pe.numThreads; i++) { 
    54         var dms : XML = XML((pe.getThreadAt(i) as URLLoaderThread).loader.data); 
     54        var dms : XML = XML(URLLoaderThread(pe.getThreadAt(i)).loader.data); 
    5555        for each(var dm : XML in dms.direct_message) { 
    5656          // "Sun Mar 08 00:03:44 +0000 2009" 
     
    7777      // リンク解決 
    7878      for (var i : int = 0; i < pelrt.numThreads;i++){ 
    79         statuses[i].content = (pelrt.getThreadAt(i) as LinkResolveThread).dst; 
     79        statuses[i].content = LinkResolveThread(pelrt.getThreadAt(i)).dst; 
    8080      } 
    8181       
  • air/TLife/trunk/src/uwi/twitter/TwitterFriendsInfoGetThread.as

    r2634 r2708  
    9696       
    9797      for (var i : int = 0; i < pe.numThreads; i++) { 
    98         var users : Array = JSON.decode((pe.getThreadAt(i) as URLLoaderThread).loader.data) as Array
     98        var users : Array = JSON.decode(URLLoaderThread(pe.getThreadAt(i)).loader.data)
    9999        for each (var user : Object in users) { 
    100100//          trace(ObjectUtil.toString(user)); 
  • air/TLife/trunk/src/uwi/twitter/TwitterOAuthAccessThread.as

    r2653 r2708  
    1 package uwi.twitter  
     1package uwi.twitter  
    22{ 
    33  import flash.events.Event; 
     
    1818  /** 
    1919   * OAuth認証のaccessフェイズ 
    20    * 認証が通っているかの確認も行える? 
     20   * 認証が通っているかの確認は行えない 
    2121   * @author Uwi 
    2222   */ 
     
    5959      var param : Object = Utility.paramToObject(ult.loader.data); 
    6060      if (param.oauth_token) { 
     61        // 成功時tokenを入れ替える 
    6162        CommonData.configxml.login.oauth_token = param.oauth_token; 
    6263        CommonData.configxml.login.oauth_token_secret = param.oauth_token_secret; 
    63         CommonData.state_oauth = 1
     64        CommonData.mainstatusbar.setStateOAuth(1)
    6465        Logger.debug("token : " + CommonData.configxml.login.oauth_token); 
    6566      }else { 
    66         CommonData.state_oauth = 0
     67        CommonData.mainstatusbar.setStateOAuth(0)
    6768      } 
    68        
    69       // 現状めんどくさいので勝手に終了させる 
    70 //      Application.application.exit(); 
    7169    } 
    7270     
  • air/TLife/trunk/src/uwi/twitter/TwitterOAuthRequestThread.as

    r2653 r2708  
    1 package uwi.twitter  
     1package uwi.twitter  
    22{ 
    33  import com.hurlant.crypto.Crypto; 
     
    3939       
    4040      if (CommonData.state_oauth == 2) return; 
    41       CommonData.state_oauth = 2
     41      CommonData.mainstatusbar.setStateOAuth(2)
    4242       
    4343      var oreq : OAuthRequest = new OAuthRequest("post", "http://twitter.com/oauth/request_token", null, CommonData.CONSUMER); 
  • air/TLife/trunk/src/uwi/twitter/TwitterScrapeThread.as

    r2634 r2708  
    6666       
    6767      // スクレイピング 
    68       pagedata = StatusScraper.scrapePageData((pe.getThreadAt(0) as URLLoaderThread).loader.data); 
     68      pagedata = StatusScraper.scrapePageData(URLLoaderThread(pe.getThreadAt(0)).loader.data); 
    6969      statuses = new Vector.<Status>(); 
    7070      for (var i : int = 0; i < pe.numThreads;i++){ 
    71         var ret : Object = StatusScraper.scrape((pe.getThreadAt(i) as URLLoaderThread).loader.data, _posterid != null && _posterid != "REPLIES"); 
     71        var ret : Object = StatusScraper.scrape(URLLoaderThread(pe.getThreadAt(i)).loader.data, _posterid != null && _posterid != "REPLIES"); 
    7272        if(ret.code == 0)statuses = statuses.concat(ret.statuses); 
    7373      } 
     
    8888      // リンク解決 
    8989      for (var i : int = 0; i < pelrt.numThreads;i++){ 
    90         statuses[i].content = (pelrt.getThreadAt(i) as LinkResolveThread).dst; 
     90        statuses[i].content = LinkResolveThread(pelrt.getThreadAt(i)).dst; 
    9191      } 
    9292       
  • air/TLife/trunk/src/uwi/twitter/TwitterTimelineGetThread.as

    r2634 r2708  
    7070       
    7171      for (var i : int = 0; i < pe.numThreads; i++) { 
    72         var timeline : Array = JSON.decode((pe.getThreadAt(i) as URLLoaderThread).loader.data); 
     72        var timeline : Array = JSON.decode(URLLoaderThread(pe.getThreadAt(i)).loader.data); 
    7373        for each(var status : Object in timeline) { 
    7474          // "Sun Mar 08 00:03:44 +0000 2009" 
     
    9494      // リンク解決 
    9595      for (var i : int = 0; i < pelrt.numThreads;i++){ 
    96         statuses[i].content = (pelrt.getThreadAt(i) as LinkResolveThread).dst; 
     96        statuses[i].content = LinkResolveThread(pelrt.getThreadAt(i)).dst; 
    9797      } 
    9898       
  • air/TLife/trunk/src/uwi/ui/DataGridEx.as

    r2650 r2708  
    3939      for (var j : int = 0; j < columnCount;j++){ 
    4040        var ir : TimelineRenderer = rowcolToItemRenderer(index, j) as TimelineRenderer; 
    41         if (!(ir is TimelineRenderer)) continue; 
    42         ir.validateFast(); 
     41        if (ir != null)ir.validateFast(); 
    4342      } 
    4443    } 
  • air/TLife/trunk/src/uwi/ui/ImageEx.as

    r2634 r2708  
    2323      var val : Object = _cache[url]; 
    2424      if (val) { 
    25         super.load(new Bitmap(val as BitmapData)); 
     25        super.load(new Bitmap(BitmapData(val))); 
    2626      }else { 
    2727        super.load(url); 
  • air/TLife/trunk/src/uwi/ui/TextAreaEditor.mxml

    r2634 r2708  
    2929      { 
    3030        data[dataField] = area.text; 
    31         (owner as DataGrid).destroyItemEditor(); 
    32         (owner as DataGrid).dataProvider.refresh(); 
     31        DataGrid(owner).destroyItemEditor(); 
     32        DataGrid(owner).dataProvider.refresh(); 
    3333      } 
    3434       
  • air/TLife/trunk/src/uwi/ui/TimelineRenderer.as

    r2650 r2708  
    3131    public function validateFast() : void 
    3232    { 
    33       var datagrid : DataGridEx = owner as DataGridEx
     33      var datagrid : DataGridEx = DataGridEx(owner)
    3434      var index : int = datagrid.ItemRendererToIndex(this); 
    3535      if (index < 0 || index >= datagrid.dataProvider.length)return; 
  • air/TLife/trunk/src/uwi/ui/complete/CompleteThread.as

    r2634 r2708  
    5353    { 
    5454      if (targ is TextArea) { 
    55         tf = targ.getChildAt(2) as IUITextField
     55        tf = IUITextField(targ.getChildAt(2))
    5656      } else if (targ is TextInput) { 
    57         tf = targ.getChildAt(1) as IUITextField
     57        tf = IUITextField(targ.getChildAt(1))
    5858      } else if (targ is ComboBoxEx) { 
    59         tf = (targ as ComboBoxEx).TextInput_.getChildAt(1) as IUITextField
     59        tf = IUITextField(ComboBoxEx(targ).TextInput_.getChildAt(1))
    6060      } 
    6161       
  • air/TLife/trunk/src/uwi/ui/mainmenu/MainMenu.mxml

    r2669 r2708  
    1414    <mx:VBox> 
    1515      <mx:Button id="dbsearch" label="DB検索" width="100%" /> 
     16      <mx:Button id="friendlist" label="friendリスト" width="100%" /> 
    1617      <mx:Button id="relogin" label="再ログイン" width="100%" /> 
     18      <mx:Button id="cleardbmemory" label="オンメモリDBクリア" width="100%" /> 
     19    </mx:VBox> 
     20    <mx:VBox> 
    1721      <mx:Button id="oauth" label="OAuth認証" width="100%" /> 
    1822      <mx:Button id="config" label="設定" width="100%" /> 
    19     </mx:VBox> 
    20     <mx:VBox> 
    2123      <mx:Button id="checkupdate" label="更新チェック" width="100%" /> 
    22       <mx:Button id="cleardbmemory" label="オンメモリDBクリア" width="100%" /> 
    2324      <mx:Button id="about" label="About" width="100%" click="PopUpManager.removePopUp(this)" /> 
    2425    </mx:VBox> 
  • air/TLife/trunk/src/uwi/ui/mainmenu/MainMenuEventThread.as

    r2669 r2708  
    66  import net.jirox.AirAutoUpdater; 
    77  import org.libspark.thread.Thread; 
    8     import uwi.db.DBExcite; 
    9     import uwi.thread.InitialMovementThread; 
    10     import uwi.twitter.TwitterOAuthRequestThread; 
    11     import uwi.ui.dbsearch.DBSearchWindow; 
     8  import uwi.db.DBExcite; 
     9  import uwi.thread.InitialMovementThread; 
     10  import uwi.twitter.TwitterOAuthRequestThread; 
     11  import uwi.ui.dbsearch.DBSearchWindow; 
    1212  import uwi.ui.globalconfig.GlobalConfig; 
     13  import uwi.ui.friends.Friends; 
    1314  import uwi.util.CommonData; 
    1415   
     
    3435      event(mainmenu.checkupdate, MouseEvent.CLICK, onCheckUpdateClick); 
    3536      event(mainmenu.cleardbmemory, MouseEvent.CLICK, onClearDBMemoryClick); 
     37      event(mainmenu.friendlist, MouseEvent.CLICK, onFriendListClick); 
    3638    } 
    3739     
     
    8688      DBExcite.excite(true); 
    8789    } 
     90     
     91    private function onFriendListClick(e : MouseEvent) : void 
     92    { 
     93      PopUpManager.removePopUp(mainmenu); 
     94      if (CommonData.friendlist == null) { 
     95        CommonData.friendlist = new Friends(); 
     96        CommonData.friendlist.open(true); 
     97      }else { 
     98        CommonData.friendlist.restore(); 
     99        CommonData.friendlist.orderToFront(); 
     100      } 
     101    } 
     102     
    88103  } 
    89104   
  • air/TLife/trunk/src/uwi/ui/mainstatusbar/MainStatusBar.mxml

    r2634 r2708  
    1 <?xml version="1.0" encoding="utf-8"?> 
     1<?xml version="1.0" encoding="utf-8"?> 
    22<mx:HBox width="100%" height="20" xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="onLoad()" horizontalGap="2" paddingTop="2" paddingBottom="2" verticalAlign="middle">  
    33  <mx:Label id="sbar" text="{status}" width="100%" height="100%" /> 
     
    55  <mx:Button id="searchbtn" label="検索" click="createSearch()" /> 
    66  <mx:Button id="menubtn" label="メニュー" click="popupMenu()" /> 
     7  <mx:Image id="oauthimage" height="20" /> 
    78  <mx:Spacer width="20" /> 
    89 
     
    7879      } 
    7980       
     81      [Embed("../../../../res/icon/oauth.png")] private var oauth_valid : Class; 
     82      [Embed("../../../../res/icon/oauthg.png")] private var oauth_invalid : Class; 
     83       
     84      public function setStateOAuth(state : int) : void 
     85      { 
     86        CommonData.state_oauth = state; 
     87        switch(state) { 
     88          case 0: oauthimage.data = new oauth_invalid(); break; 
     89          case 1: oauthimage.data = new oauth_valid(); break; 
     90          default: break; 
     91        } 
     92        return; 
     93      } 
     94       
    8095      ]]> 
    8196  </mx:Script> 
  • air/TLife/trunk/src/uwi/ui/multipletabbar/MultipleTabBar.as

    r2669 r2708  
    9090    internal function select(e : ItemClickEvent) : void 
    9191    { 
    92       var targ : TabBar = e.currentTarget as TabBar
     92      var targ : TabBar = TabBar(e.currentTarget)
    9393      // for eachでもいいかも 
    9494      for (var i : int = 0, sum : int = 0; i < tablist.length && tablist[i] != targ; i++, sum += tablist[i].numChildren); 
     
    117117        sum -= tabbar.numChildren; 
    118118        if (sum < 0) { 
    119           return tabbar.getChildAt(sum + tabbar.numChildren) as Button
     119          return Button(tabbar.getChildAt(sum + tabbar.numChildren))
    120120          break; 
    121121        } 
     
    129129        return null; 
    130130      }else{ 
    131         return titles.getItemAt(selectedIndex) as String
     131        return String(titles.getItemAt(selectedIndex))
    132132      } 
    133133    } 
  • air/TLife/trunk/src/uwi/ui/multipletabbar/MultipleTabBarDragEventThread.as

    r2634 r2708  
    4040    { 
    4141      if (e.target is Tab) { 
    42         var tb : TabBar = e.target.parent as TabBar
     42        var tb : TabBar = TabBar(e.target.parent)
    4343        fromind = mtb.titles.getItemIndex(tb.itemToLabel(e.target)); 
    4444        Mouse.cursor = MouseCursor.HAND; 
     
    5555       
    5656      if (e.target is Tab) { 
    57         var tb : TabBar = e.target.parent as TabBar
     57        var tb : TabBar = TabBar(e.target.parent)
    5858        var toind : int = mtb.titles.getItemIndex(tb.itemToLabel(e.target)); 
    5959        Logger.debug("MutipleTabBarDragEventThread " + fromind + "->" + toind); 
  • air/TLife/trunk/src/uwi/ui/tabconfig/TabConfig.mxml

    r2634 r2708  
    199199          curtabname = tabdg.selectedItem.tabname; 
    200200          for (var i : int = 0; i < temprules.length; i++) { 
    201             var rule : TabRule = temprules[i] as TabRule
     201            var rule : TabRule = TabRule(temprules[i])
    202202            if (rule.tabname == curtabname){ 
    203203              reqs.addItem( {  
  • air/TLife/trunk/src/uwi/ui/tabconfig/TabConfigEventThread.as

    r2669 r2708  
    183183    { 
    184184      if(e.dataField == "tabname"){ 
    185         var newtabname : String = (tc.tabdg.itemEditorInstance as TextInput).text; 
     185        var newtabname : String = TextInput(tc.tabdg.itemEditorInstance).text; 
    186186        var oldtabname : String = tc.tabdg.selectedItem.tabname; 
    187187        if(newtabname != oldtabname){ 
     
    211211    private function onTabDGItemFocusIn(e : DataGridEvent) : void 
    212212    { 
    213       var dg : DataGrid = e.currentTarget as DataGrid
     213      var dg : DataGrid = DataGrid(e.currentTarget)
    214214      if (dg.itemEditorInstance && dg.itemEditorInstance is ComboBox) { 
    215215        var col:DataGridColumn = e.currentTarget.columns[e.columnIndex]; 
    216         var editor:ComboBox = dg.itemEditorInstance as ComboBox
     216        var editor:ComboBox = ComboBox(dg.itemEditorInstance)
    217217        var cell:Object = dg.selectedItem.hasOwnProperty(col.dataField) ? dg.selectedItem[col.dataField] : ""; 
    218218         
     
    231231    private function onRegDGItemFocusIn(e : DataGridEvent) : void 
    232232    { 
    233       var dg : DataGrid = e.currentTarget as DataGrid
     233      var dg : DataGrid = DataGrid(e.currentTarget)
    234234      if (dg.itemEditorInstance && dg.itemEditorInstance is ComboBox) { 
    235235        var col:DataGridColumn = e.currentTarget.columns[e.columnIndex]; 
    236         var editor:ComboBox = dg.itemEditorInstance as ComboBox
     236        var editor:ComboBox = ComboBox(dg.itemEditorInstance)
    237237        var cell:Object = dg.selectedItem.hasOwnProperty(col.dataField) ? dg.selectedItem[col.dataField] : ""; 
    238238         
  • air/TLife/trunk/src/uwi/util/CommonData.as

    r2669 r2708  
    2727  import uwi.ui.dbsearch.DBSearchWindow; 
    2828  import uwi.ui.mainstatusbar.MainStatusBar; 
     29  import uwi.ui.friends.Friends; 
    2930  import uwi.ui.*; 
    3031   
     
    131132    public static var searchwindow : SearchWindow = null; 
    132133    public static var dbsearchwindow : DBSearchWindow = null; 
     134    public static var friendlist : Friends = null; 
    133135     
    134136    public static var tfmt_timelines : Array; 
  • air/TLife/trunk/src/uwi/util/StatusUtility.as

    r2634 r2708  
    114114    { 
    115115      var res : Object = PTN_REPLY.exec(content); 
    116       if (res == null) return ""; 
    117       return res[1] as String; 
     116      return res ? res[1] : ""; 
    118117    } 
    119118     
  • air/TLife/trunk/src/uwi/wassr/WassrTimelineGetThread.as

    r2634 r2708  
    7979       
    8080      for (var i : int = 0; i < pe.numThreads; i++) { 
    81         var timeline : XML = XML((pe.getThreadAt(i) as URLLoaderThread).loader.data); 
     81        var timeline : XML = XML(URLLoaderThread(pe.getThreadAt(i)).loader.data); 
    8282        for each(var status : XML in timeline.status) { 
    8383          var s : Status = new Status(status.id, status.user.screen_name, status.user_login_id, status.html, status.reply_message, new Date(status.epoch), status.user.profile_image_url, false); 
     
    9898      // リンク解決 
    9999      for (var i : int = 0; i < pelrt.numThreads;i++){ 
    100         statuses[i].content = (pelrt.getThreadAt(i) as LinkResolveThread).dst; 
     100        statuses[i].content = LinkResolveThread(pelrt.getThreadAt(i)).dst; 
    101101      } 
    102102