com.threerings.crowd.client
Class LocationAdapter

java.lang.Object
  extended by com.threerings.crowd.client.LocationAdapter
All Implemented Interfaces:
LocationObserver

public class LocationAdapter
extends Object
implements LocationObserver

The location adapter makes life easier for a class that really only cares about one or two of the location observer callbacks and doesn't want to provide empty implementations of the others. One can either extend location adapter, or create an anonymous instance that overrides the desired callback(s). Note that the location adapter defaults to ratifying any location change.

See Also:
LocationObserver

Constructor Summary
LocationAdapter()
           
 
Method Summary
 void locationChangeFailed(int placeId, String reason)
          This is called on all location observers when a location change request is rejected by the server or fails for some other reason.
 void locationDidChange(PlaceObject place)
          Called when we have switched to a new location.
 boolean locationMayChange(int placeId)
          Called when someone has requested that we switch to a new location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocationAdapter

public LocationAdapter()
Method Detail

locationMayChange

public boolean locationMayChange(int placeId)
Description copied from interface: LocationObserver
Called when someone has requested that we switch to a new location. An observer may choose to veto the location change request for some reason or other.

Specified by:
locationMayChange in interface LocationObserver
Returns:
true if it's OK for the location to change, false if the change request should be aborted.

locationDidChange

public void locationDidChange(PlaceObject place)
Description copied from interface: LocationObserver
Called when we have switched to a new location.

Specified by:
locationDidChange in interface LocationObserver
Parameters:
place - the place object that represents the new location or null if we have switched to no location.

locationChangeFailed

public void locationChangeFailed(int placeId,
                                 String reason)
Description copied from interface: LocationObserver
This is called on all location observers when a location change request is rejected by the server or fails for some other reason.

Specified by:
locationChangeFailed in interface LocationObserver
Parameters:
placeId - the place id to which we attempted to relocate, but failed.
reason - the reason code that explains why the location change request was rejected or otherwise failed.