Added code to handle displaying the user interface for a place once we

have actually entered the place. It's not tied to a particular UI toolkit
and this requires coordination between the client implementation and the
place implementation, but that seems better than the alternative of tying
the Parlor code to Swing or similar.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@408 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2001-10-09 17:20:03 +00:00
parent 61a2c30859
commit c9dfd6ef45
3 changed files with 29 additions and 4 deletions
@@ -1,5 +1,5 @@
// //
// $Id: PlaceController.java,v 1.2 2001/10/06 00:24:46 mdb Exp $ // $Id: PlaceController.java,v 1.3 2001/10/09 17:20:03 mdb Exp $
package com.threerings.cocktail.party.client; package com.threerings.cocktail.party.client;
@@ -58,9 +58,11 @@ public abstract class PlaceController
*/ */
public void willEnterPlace (PlaceObject plobj) public void willEnterPlace (PlaceObject plobj)
{ {
// let the UI hierarchy know that we've got our place
if (_view != null ) { if (_view != null ) {
// let the UI hierarchy know that we've got our place
PlaceViewUtil.dispatchWillEnterPlace(_view, plobj); PlaceViewUtil.dispatchWillEnterPlace(_view, plobj);
// and display the user interface
_ctx.setPlaceView(_view);
} }
} }
@@ -1,11 +1,12 @@
// //
// $Id: CrowdContext.java,v 1.4 2001/10/01 22:14:55 mdb Exp $ // $Id: CrowdContext.java,v 1.5 2001/10/09 17:20:03 mdb Exp $
package com.threerings.cocktail.party.util; package com.threerings.cocktail.party.util;
import com.threerings.cocktail.cher.util.CherContext; import com.threerings.cocktail.cher.util.CherContext;
import com.threerings.cocktail.party.client.LocationDirector; import com.threerings.cocktail.party.client.LocationDirector;
import com.threerings.cocktail.party.client.OccupantManager; import com.threerings.cocktail.party.client.OccupantManager;
import com.threerings.cocktail.party.client.PlaceView;
/** /**
* The party context provides access to the various managers, etc. that * The party context provides access to the various managers, etc. that
@@ -22,4 +23,21 @@ public interface PartyContext extends CherContext
* Returns a reference to the occupant manager. * Returns a reference to the occupant manager.
*/ */
public OccupantManager getOccupantManager (); public OccupantManager getOccupantManager ();
/**
* When the client enters a new place, the location director creates a
* place controller which then creates a place view to visualize the
* place for the user. The place view created by the place controller
* will be passed to this function to actually display it in whatever
* user interface is provided for the user. We don't require any
* particular user interface toolkit, so it is expected that the place
* view implementation will coordinate with the client implementation
* so that the client can display the view provided by the place
* controller.
*
* <p> Though the place view is created before we enter the place, it
* won't be displayed (via a call to this function) until we have
* fully entered the place and are ready for user interaction.
*/
public void setPlaceView (PlaceView view);
} }
@@ -1,5 +1,5 @@
// //
// $Id: TestClient.java,v 1.4 2001/10/01 22:14:55 mdb Exp $ // $Id: TestClient.java,v 1.5 2001/10/09 17:20:03 mdb Exp $
package com.threerings.cocktail.party.client.test; package com.threerings.cocktail.party.client.test;
@@ -121,6 +121,11 @@ public class TestClient
{ {
return _occmgr; return _occmgr;
} }
public void setPlaceView (PlaceView view)
{
// nothing to do because we don't create views
}
} }
protected Config _config; protected Config _config;