Updated to match API changes in Beta3.

InvocationRegistration had a constructor called Registration. I wonder if
that was causing the compile error with beta2.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4104 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-05-09 23:03:47 +00:00
parent ff674f818f
commit e100ef4faf
39 changed files with 101 additions and 85 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
package com.threerings.io { package com.threerings.io {
import flash.util.ByteArray; import flash.utils.ByteArray;
public class ArrayMask public class ArrayMask
{ {
@@ -2,7 +2,7 @@ package com.threerings.io {
import flash.events.Event; import flash.events.Event;
import flash.util.ByteArray; import flash.utils.ByteArray;
public class FrameAvailableEvent extends Event public class FrameAvailableEvent extends Event
{ {
+2 -2
View File
@@ -5,8 +5,8 @@ import flash.events.ProgressEvent;
import flash.net.Socket; import flash.net.Socket;
import flash.util.ByteArray; import flash.utils.ByteArray;
import flash.util.Endian; import flash.utils.Endian;
import com.threerings.presents.Log; import com.threerings.presents.Log;
@@ -2,13 +2,13 @@ package com.threerings.io {
import flash.errors.IOError; import flash.errors.IOError;
import flash.util.ByteArray; import flash.utils.ByteArray;
import flash.util.IDataInput; import flash.utils.IDataInput;
import com.threerings.util.ClassUtil; import com.threerings.util.ClassUtil;
import com.threerings.util.SimpleMap; import com.threerings.util.SimpleMap;
import com.threerings.presents.Log; //import com.threerings.presents.Log;
public class ObjectInputStream public class ObjectInputStream
{ {
@@ -74,7 +74,7 @@ public class ObjectInputStream
Log.debug("Creating object sleeve..."); Log.debug("Creating object sleeve...");
var target :Object; var target :Object;
if (cmap.streamer === null) { if (cmap.streamer === null) {
var clazz :Class = flash.util.getClassByName(cmap.classname); var clazz :Class = ClassUtil.getClassByName(cmap.classname);
target = new clazz(); target = new clazz();
} else { } else {
@@ -1,9 +1,7 @@
package com.threerings.io { package com.threerings.io {
import flash.util.trace; import flash.utils.ByteArray;
import flash.utils.IDataOutput;
import flash.util.ByteArray;
import flash.util.IDataOutput;
import com.threerings.util.ClassUtil; import com.threerings.util.ClassUtil;
import com.threerings.util.SimpleMap; import com.threerings.util.SimpleMap;
+2 -4
View File
@@ -1,14 +1,12 @@
package com.threerings.io { package com.threerings.io {
import flash.util.trace; import flash.utils.ByteArray;
import flash.util.ByteArray;
import com.threerings.util.ClassUtil; import com.threerings.util.ClassUtil;
import com.threerings.util.SimpleMap; import com.threerings.util.SimpleMap;
import com.threerings.io.streamers.ArrayStreamer; import com.threerings.io.streamers.ArrayStreamer;
import com.threerings.io.streamers.ByteyStreamer; import com.threerings.io.streamers.ByteStreamer;
import com.threerings.io.streamers.ByteArrayStreamer; import com.threerings.io.streamers.ByteArrayStreamer;
import com.threerings.io.streamers.FloatStreamer; import com.threerings.io.streamers.FloatStreamer;
import com.threerings.io.streamers.IntegerStreamer; import com.threerings.io.streamers.IntegerStreamer;
@@ -1,6 +1,6 @@
package com.threerings.io.streamers { package com.threerings.io.streamers {
import flash.util.ByteArray; import flash.utils.ByteArray;
import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectInputStream;
import com.threerings.io.ObjectOutputStream; import com.threerings.io.ObjectOutputStream;
+25 -4
View File
@@ -1,10 +1,14 @@
package com.threerings.media.image { package com.threerings.media.image {
import flash.display.Bitmap;
import flash.display.BitmapData; import flash.display.BitmapData;
import flash.display.DisplayObject; import flash.display.DisplayObject;
import flash.display.Shape; import flash.display.Shape;
import flash.display.TextField;
import flash.geom.Point;
import flash.geom.Rectangle;
import flash.text.TextField;
import flash.text.TextLineMetrics; import flash.text.TextLineMetrics;
/** /**
@@ -13,16 +17,33 @@ import flash.text.TextLineMetrics;
public class ImageUtil public class ImageUtil
{ {
/** /**
* Create a Shape that will display an error message of the specified * Create a DisplayObject that will display an error message
* dimensions. * of the specified dimensions.
*/ */
public static function createErrorImage (width :int, height :int) :Shape public static function createErrorImage (width :int, height :int)
:DisplayObject
{ {
var shape :Shape = new Shape(); var shape :Shape = new Shape();
shape.graphics.beginBitmapFill(createErrorBitmap()); shape.graphics.beginBitmapFill(createErrorBitmap());
shape.graphics.drawRect(0, 0, width, height); shape.graphics.drawRect(0, 0, width, height);
shape.graphics.endFill(); shape.graphics.endFill();
return shape; return shape;
/*
// Alternate implementation that creates an actual Bitmap object
var src :BitmapData = createErrorBitmap();
var data :BitmapData = new BitmapData(width, height, false);
data.draw(src);
var rect :Rectangle = new Rectangle(0, 0, src.width, src.height);
for (var xx :int = 0; xx < width; xx += src.width) {
for (var yy :int = 0; yy < height; yy += src.height) {
if (xx != 0 || yy != 0) {
data.copyPixels(data, rect, new Point(xx, yy));
}
}
}
return new Bitmap(data);
*/
} }
/** /**
@@ -5,7 +5,7 @@ import flash.display.Stage;
import flash.events.EventDispatcher; import flash.events.EventDispatcher;
import flash.events.TimerEvent; import flash.events.TimerEvent;
import flash.util.Timer; import flash.utils.Timer;
import com.threerings.util.ObserverList; import com.threerings.util.ObserverList;
@@ -123,7 +123,7 @@ public class Client extends EventDispatcher
return _version; return _version;
} }
public function setVersion (version :String) public function setVersion (version :String) :void
{ {
_version = version; _version = version;
} }
@@ -270,7 +270,7 @@ public class Client extends EventDispatcher
return; return;
} }
var now :uint = flash.util.getTimer(); var now :uint = flash.utils.getTimer();
if (now - _comm.getLastWrite() > PingRequest.PING_INTERVAL) { if (now - _comm.getLastWrite() > PingRequest.PING_INTERVAL) {
_comm.postMessage(new PingRequest()); _comm.postMessage(new PingRequest());
} }
@@ -23,7 +23,7 @@ package com.threerings.presents.client {
import flash.events.Event; import flash.events.Event;
import flash.events.TimerEvent; import flash.events.TimerEvent;
import flash.util.Timer; import flash.utils.Timer;
import mx.collections.IList; import mx.collections.IList;
@@ -5,8 +5,8 @@ import flash.events.IOErrorEvent;
import flash.net.Socket; import flash.net.Socket;
import flash.util.ByteArray; import flash.utils.ByteArray;
import flash.util.Endian; import flash.utils.Endian;
import com.threerings.util.Util; import com.threerings.util.Util;
@@ -135,7 +135,7 @@ public class Communicator
*/ */
internal function updateWriteStamp () :void internal function updateWriteStamp () :void
{ {
_lastWrite = flash.util.getTimer(); _lastWrite = flash.utils.getTimer();
} }
/** /**
@@ -70,7 +70,8 @@ public class InvocationDirector
public function unregisterReceiver (receiverCode :String) :void public function unregisterReceiver (receiverCode :String) :void
{ {
// remove the receiver from the list // remove the receiver from the list
for (var iter :IViewCursor = _reclist.getCursor(); iter.moveNext(); ) { for (var iter :IViewCursor = _reclist.createCursor();
iter.moveNext(); ) {
var decoder :InvocationDecoder = var decoder :InvocationDecoder =
(iter.current as InvocationDecoder); (iter.current as InvocationDecoder);
if (decoder.getReceiverCode() === receiverCode) { if (decoder.getReceiverCode() === receiverCode) {
@@ -115,7 +116,8 @@ public class InvocationDirector
{ {
_clobj.startTransaction(); _clobj.startTransaction();
try { try {
for (var itr :IViewCursor = _reclist.getCursor(); itr.moveNext(); ) { for (var itr :IViewCursor = _reclist.createCursor();
itr.moveNext(); ) {
var decoder :InvocationDecoder = var decoder :InvocationDecoder =
(itr.current as InvocationDecoder); (itr.current as InvocationDecoder);
assignReceiverId(decoder); assignReceiverId(decoder);
@@ -24,7 +24,8 @@ public class InvocationRegistration
public var receiverId :int; public var receiverId :int;
/** Creates and initializes a registration instance. */ /** Creates and initializes a registration instance. */
public function Registration (receiverCode :String, receiverId :int) public function InvocationRegistration (
receiverCode :String, receiverId :int)
{ {
this.receiverCode = receiverCode; this.receiverCode = receiverCode;
this.receiverId = receiverId; this.receiverId = receiverId;
@@ -1,6 +1,6 @@
package com.threerings.presents.client { package com.threerings.presents.client {
import flash.util.describeType; import flash.utils.describeType;
import mx.collections.ArrayCollection; import mx.collections.ArrayCollection;
@@ -1,10 +1,10 @@
package com.threerings.presents.dobj { package com.threerings.presents.dobj {
import flash.util.StringBuilder;
import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectInputStream;
import com.threerings.io.ObjectOutputStream; import com.threerings.io.ObjectOutputStream;
import com.threerings.util.StringBuilder;
/** /**
* An attribute changed event is dispatched when a single attribute of a * An attribute changed event is dispatched when a single attribute of a
* distributed object has changed. It can also be constructed to request * distributed object has changed. It can also be constructed to request
@@ -21,14 +21,13 @@
package com.threerings.presents.dobj { package com.threerings.presents.dobj {
import flash.util.StringBuilder;
import mx.collections.IList; import mx.collections.IList;
import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectInputStream;
import com.threerings.io.ObjectOutputStream; import com.threerings.io.ObjectOutputStream;
import com.threerings.util.StreamableArrayList; import com.threerings.util.StreamableArrayList;
import com.threerings.util.StringBuilder;
/** /**
* Used to manage and submit groups of events on a collection of * Used to manage and submit groups of events on a collection of
@@ -1,12 +1,11 @@
package com.threerings.presents.dobj { package com.threerings.presents.dobj {
import flash.util.StringBuilder;
import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectInputStream;
import com.threerings.io.ObjectOutputStream; import com.threerings.io.ObjectOutputStream;
import com.threerings.io.Streamable; import com.threerings.io.Streamable;
import com.threerings.util.Comparable; import com.threerings.util.Comparable;
import com.threerings.util.StringBuilder;
import com.threerings.presents.Log; import com.threerings.presents.Log;
@@ -2,11 +2,10 @@ package com.threerings.presents.dobj {
import flash.events.EventDispatcher; import flash.events.EventDispatcher;
import flash.util.StringBuilder;
import mx.collections.ArrayCollection; import mx.collections.ArrayCollection;
import com.threerings.util.ClassUtil; import com.threerings.util.ClassUtil;
import com.threerings.util.StringBuilder;
import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectInputStream;
import com.threerings.io.ObjectOutputStream; import com.threerings.io.ObjectOutputStream;
@@ -258,7 +257,7 @@ public class DObject // extends EventDispatcher
/** /**
* Calls by derived instances when a set updater method was called. * Calls by derived instances when a set updater method was called.
*/ */
protected function requestEntryUpdate (name :String, entry :DSetEntry) protected function requestEntryUpdate (name :String, entry :DSetEntry) :void
{ {
// dispatch an entry updated event // dispatch an entry updated event
postEvent(new EntryUpdatedEvent(_oid, name, entry, null)); postEvent(new EntryUpdatedEvent(_oid, name, entry, null));
+2 -3
View File
@@ -1,12 +1,11 @@
package com.threerings.presents.dobj { package com.threerings.presents.dobj {
import flash.util.StringBuilder;
import mx.utils.ObjectUtil; import mx.utils.ObjectUtil;
import com.threerings.util.ArrayIterator;
import com.threerings.util.Equalable; import com.threerings.util.Equalable;
import com.threerings.util.Iterator; import com.threerings.util.Iterator;
import com.threerings.util.ArrayIterator; import com.threerings.util.StringBuilder;
import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectInputStream;
import com.threerings.io.ObjectOutputStream; import com.threerings.io.ObjectOutputStream;
@@ -1,10 +1,9 @@
package com.threerings.presents.dobj { package com.threerings.presents.dobj {
import flash.util.StringBuilder;
import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectInputStream;
import com.threerings.io.ObjectOutputStream; import com.threerings.io.ObjectOutputStream;
import com.threerings.util.StringBuilder;
/** /**
* An element updated event is dispatched when an element of an array * An element updated event is dispatched when an element of an array
@@ -1,10 +1,10 @@
package com.threerings.presents.dobj { package com.threerings.presents.dobj {
import flash.util.StringBuilder;
import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectInputStream;
import com.threerings.io.ObjectOutputStream; import com.threerings.io.ObjectOutputStream;
import com.threerings.util.StringBuilder;
import com.threerings.presents.Log; import com.threerings.presents.Log;
/** /**
@@ -1,10 +1,9 @@
package com.threerings.presents.dobj { package com.threerings.presents.dobj {
import flash.util.StringBuilder;
import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectInputStream;
import com.threerings.io.ObjectOutputStream; import com.threerings.io.ObjectOutputStream;
import com.threerings.util.StringBuilder;
import com.threerings.presents.Log; import com.threerings.presents.Log;
@@ -1,10 +1,10 @@
package com.threerings.presents.dobj { package com.threerings.presents.dobj {
import flash.util.StringBuilder;
import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectInputStream;
import com.threerings.io.ObjectOutputStream; import com.threerings.io.ObjectOutputStream;
import com.threerings.util.StringBuilder;
import com.threerings.presents.Log; import com.threerings.presents.Log;
/** /**
@@ -21,11 +21,11 @@
package com.threerings.presents.dobj { package com.threerings.presents.dobj {
import flash.util.StringBuilder;
import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectInputStream;
import com.threerings.io.ObjectOutputStream; import com.threerings.io.ObjectOutputStream;
import com.threerings.util.StringBuilder;
/** /**
* Used to dispatch an invocation notification from the server to a * Used to dispatch an invocation notification from the server to a
* client. * client.
@@ -21,11 +21,11 @@
package com.threerings.presents.dobj { package com.threerings.presents.dobj {
import flash.util.StringBuilder;
import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectInputStream;
import com.threerings.io.ObjectOutputStream; import com.threerings.io.ObjectOutputStream;
import com.threerings.util.StringBuilder;
/** /**
* Used to dispatch an invocation request from the client to the server. * Used to dispatch an invocation request from the client to the server.
* *
@@ -21,11 +21,11 @@
package com.threerings.presents.dobj { package com.threerings.presents.dobj {
import flash.util.StringBuilder;
import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectInputStream;
import com.threerings.io.ObjectOutputStream; import com.threerings.io.ObjectOutputStream;
import com.threerings.util.StringBuilder;
/** /**
* Used to dispatch an invocation response from the server to the client. * Used to dispatch an invocation response from the server to the client.
* *
@@ -1,10 +1,10 @@
package com.threerings.presents.dobj { package com.threerings.presents.dobj {
import flash.util.StringBuilder;
import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectInputStream;
import com.threerings.io.ObjectOutputStream; import com.threerings.io.ObjectOutputStream;
import com.threerings.util.StringBuilder;
/** /**
* A message event is used to dispatch a message to all subscribers of a * A message event is used to dispatch a message to all subscribers of a
* distributed object without actually changing any of the fields of the * distributed object without actually changing any of the fields of the
@@ -1,6 +1,6 @@
package com.threerings.presents.dobj { package com.threerings.presents.dobj {
import flash.util.StringBuilder; import com.threerings.util.StringBuilder;
import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectInputStream;
import com.threerings.io.ObjectOutputStream; import com.threerings.io.ObjectOutputStream;
@@ -1,10 +1,10 @@
package com.threerings.presents.dobj { package com.threerings.presents.dobj {
import flash.util.StringBuilder;
import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectInputStream;
import com.threerings.io.ObjectOutputStream; import com.threerings.io.ObjectOutputStream;
import com.threerings.util.StringBuilder;
/** /**
* An object added event is dispatched when an object is added to an * An object added event is dispatched when an object is added to an
* <code>OidList</code> attribute of a distributed object. It can also be * <code>OidList</code> attribute of a distributed object. It can also be
@@ -21,7 +21,7 @@
package com.threerings.presents.dobj { package com.threerings.presents.dobj {
import flash.util.StringBuilder; import com.threerings.util.StringBuilder;
/** /**
* An object destroyed event is dispatched when an object has been removed * An object destroyed event is dispatched when an object has been removed
@@ -21,7 +21,7 @@
package com.threerings.presents.dobj { package com.threerings.presents.dobj {
import flash.util.StringBuilder; import com.threerings.util.StringBuilder;
import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectInputStream;
import com.threerings.io.ObjectOutputStream; import com.threerings.io.ObjectOutputStream;
@@ -1,12 +1,12 @@
package com.threerings.presents.dobj { package com.threerings.presents.dobj {
import flash.util.StringBuilder;
import com.threerings.io.Streamable; import com.threerings.io.Streamable;
import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectInputStream;
import com.threerings.io.ObjectOutputStream; import com.threerings.io.ObjectOutputStream;
import com.threerings.util.StringBuilder;
import com.threerings.presents.Log; import com.threerings.presents.Log;
/** /**
@@ -1,8 +1,7 @@
package com.threerings.presents.net { package com.threerings.presents.net {
import flash.util.StringBuilder;
import com.threerings.util.Name; import com.threerings.util.Name;
import com.threerings.util.StringBuilder;
import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectInputStream;
import com.threerings.io.ObjectOutputStream; import com.threerings.io.ObjectOutputStream;
@@ -1,5 +1,7 @@
package com.threerings.presents.net { package com.threerings.presents.net {
import flash.utils.getTimer;
import com.threerings.io.ObjectOutputStream; import com.threerings.io.ObjectOutputStream;
public class PingRequest extends UpstreamMessage public class PingRequest extends UpstreamMessage
@@ -22,7 +24,7 @@ public class PingRequest extends UpstreamMessage
// documentation inherited // documentation inherited
public override function writeObject (out :ObjectOutputStream) :void public override function writeObject (out :ObjectOutputStream) :void
{ {
_packStamp = flash.util.getTimer(); _packStamp = getTimer();
super.writeObject(out); super.writeObject(out);
} }
@@ -1,5 +1,7 @@
package com.threerings.presents.net { package com.threerings.presents.net {
import flash.utils.getTimer;
import com.threerings.util.Long; import com.threerings.util.Long;
import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectInputStream;
@@ -30,7 +32,7 @@ public class PongResponse extends DownstreamMessage
public override function readObject (ins :ObjectInputStream) :void public override function readObject (ins :ObjectInputStream) :void
{ {
_unpackStamp = flash.util.getTimer(); _unpackStamp = getTimer();
super.readObject(ins); super.readObject(ins);
// TODO: Figure out how we're really going to cope with longs // TODO: Figure out how we're really going to cope with longs
@@ -21,9 +21,8 @@
package com.threerings.presents.net { package com.threerings.presents.net {
import flash.util.StringBuilder;
import com.threerings.util.Name; import com.threerings.util.Name;
import com.threerings.util.StringBuilder;
import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectInputStream;
import com.threerings.io.ObjectOutputStream; import com.threerings.io.ObjectOutputStream;
+9 -8
View File
@@ -1,17 +1,19 @@
package com.threerings.util { package com.threerings.util {
import flash.util.*; import flash.utils.describeType;
import flash.utils.getQualifiedClassName;
import flash.utils.getDefinitionByName;
public class ClassUtil public class ClassUtil
{ {
public static function getClassName (obj :Object) :String public static function getClassName (obj :Object) :String
{ {
return flash.util.getQualifiedClassName(obj).replace("::", "."); return getQualifiedClassName(obj).replace("::", ".");
} }
public static function shortClassName (obj :Object) :String public static function shortClassName (obj :Object) :String
{ {
var s :String = flash.util.getQualifiedClassName(obj); var s :String = getQualifiedClassName(obj);
var dex :int = s.lastIndexOf("."); var dex :int = s.lastIndexOf(".");
if (dex != -1) { if (dex != -1) {
s = s.substring(dex); s = s.substring(dex);
@@ -21,13 +23,13 @@ public class ClassUtil
public static function getClass (obj :Object) :Class public static function getClass (obj :Object) :Class
{ {
return flash.util.getClassByName(getClassName(obj)); return getClassByName(getClassName(obj));
} }
public static function getClassByName (cname :String) :Class public static function getClassByName (cname :String) :Class
{ {
// see also ApplicationDomain.currentDomain.getClass(cname) // see also ApplicationDomain.currentDomain.getClass(cname)
return flash.util.getClassByName(cname.replace("::", ".")); return (getDefinitionByName(cname.replace("::", ".")) as Class);
} }
public static function isFinal (type :Class) :Boolean public static function isFinal (type :Class) :Boolean
@@ -37,7 +39,7 @@ public class ClassUtil
} }
// TODO: there's currently no way to determine final from the class // TODO: there's currently no way to determine final from the class
//var attrs :XMLList = flash.util.describeType(type).elements("type"); //var attrs :XMLList = flash.utils.describeType(type).elements("type");
return false; return false;
} }
@@ -62,8 +64,7 @@ public class ClassUtil
} }
// ok, let's introspect on the class and see what we've got. // ok, let's introspect on the class and see what we've got.
var typeInfo :XMLList = var typeInfo :XMLList = describeType(srcClass).child("factory");
flash.util.describeType(srcClass).child("factory");
// See which classes we extend. // See which classes we extend.
var exts :XMLList = typeInfo.child("extends").attribute("type"); var exts :XMLList = typeInfo.child("extends").attribute("type");
@@ -21,8 +21,6 @@
package com.threerings.util { package com.threerings.util {
import flash.util.StringBuilder;
/** /**
* A message bundle provides an easy mechanism by which to obtain * A message bundle provides an easy mechanism by which to obtain
* translated message strings from a resource bundle. It uses the {@link * translated message strings from a resource bundle. It uses the {@link
+3 -2
View File
@@ -1,7 +1,8 @@
package com.threerings.util { package com.threerings.util {
import flash.util.ByteArray; import flash.utils.ByteArray;
import flash.util.StringBuilder;
import com.threerings.util.StringBuilder;
public class Util public class Util
{ {