チェンジセット 2133: as3/AIRUtils
- コミット日時:
- 2009/01/09 01:20:05 (3 年前)
- ファイル:
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
as3/AIRUtils/trunk/src/org/ngsdev/airUtils/LocalText.as
r2101 r2133 25 25 import flash.events.EventDispatcher; 26 26 import flash.errors.IllegalOperationError; 27 /** 28 * ローカルのテキストを読み書きするだけのクラス 29 * @author Atsushi Nagase 30 * @playerversion AIR 1.0 31 */ 27 32 public class LocalText extends EventDispatcher { 33 /** 34 * @private 35 */ 28 36 public function LocalText() { 29 37 throw new IllegalOperationError("LocalText class cannot be instantiated."); 30 38 } 39 /** 40 * データを書き込む 41 * @param fname 書き込むファイル名 42 * @param strd 書き込むデータ 43 * @playerversion AIR 1.0 44 */ 31 45 public static function write(fname:String,strd:*):void { 32 46 var file:File = File.applicationStorageDirectory.resolvePath(fname); … … 36 50 stream.close(); 37 51 } 52 /** 53 * データを読み込む 54 * @param fname 読み込むファイル名 55 * @return 読み込んだ文字列 56 * @playerversion AIR 1.0 57 */ 38 58 public static function read(fname:String):String { 39 59 var file:File = File.applicationStorageDirectory.resolvePath(fname); as3/AIRUtils/trunk/src/org/ngsdev/airUtils/WindowPosition.as
r2122 r2133 24 24 import flash.geom.Rectangle; 25 25 import flash.errors.IllegalOperationError; 26 /** 27 * NativeWindowの座標/サイズを記憶するクラス 28 * @author Atsushi Nagase 29 * @playerversion AIR 1.0 30 */ 26 31 public class WindowPosition extends EventDispatcher { 27 32 public static var filename:String = "window.txt"; 33 /** 34 * @private 35 */ 28 36 public function WindowPosition() { 29 37 throw new IllegalOperationError("WindowPosition class cannot be instantiated."); 30 38 } 39 /** 40 * 座標/サイズを記憶する 41 * @param w 対象のNativeWindow 42 * @param fn 保存するファイル名 43 * @playerversion AIR 1.0 44 */ 31 45 public static function save(w:NativeWindow,fn:String=""):void { 32 46 LocalText.write(fn||filename,[w.x,w.y,w.width,w.height].join(",")); 33 47 } 48 /** 49 * 座標/サイズを復元する 50 * @param w 対象のNativeWindow 51 * @param fn ロードするファイル名 52 * @return NativeWinddowのboundsプロパティーにセットしたRectangleインスタンス 53 * @playerversion AIR 1.0 54 */ 34 55 public static function restore(w:NativeWindow,fn:String=""):Rectangle { 35 56 var pos:Array = LocalText.read(fn||filename).split(",");

