|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.samskivert.swing.Controller
com.threerings.crowd.client.PlaceController
public abstract class PlaceController
Controls the user interface that is used to display a place. When the client moves to a new place, the appropriate place controller is constructed and requested to create and display the user interface for that place.
| Nested Class Summary | |
|---|---|
static class |
PlaceController.DelegateOp
Used to call methods in delegates. |
| Nested classes/interfaces inherited from class com.samskivert.swing.Controller |
|---|
Controller.ActionInvoker |
| Field Summary | |
|---|---|
protected PlaceConfig |
_config
A reference to our place configuration. |
protected CrowdContext |
_ctx
A reference to the active client context. |
protected ArrayList<PlaceControllerDelegate> |
_delegates
A list of the delegates in use by this controller. |
protected PlaceObject |
_plobj
A reference to the place object for which we're controlling a user interface. |
protected PlaceView |
_view
A reference to the root user interface component. |
| Fields inherited from class com.samskivert.swing.Controller |
|---|
DISPATCHER |
| Constructor Summary | |
|---|---|
PlaceController()
|
|
| Method Summary | |
|---|---|
protected void |
addDelegate(PlaceControllerDelegate delegate)
Adds the supplied delegate to the list for this controller. |
protected void |
applyToDelegates(PlaceController.DelegateOp op)
Applies the supplied operation to the registered delegates. |
protected PlaceView |
createPlaceView()
Deprecated. Use createPlaceView(CrowdContext). |
protected PlaceView |
createPlaceView(CrowdContext ctx)
Creates the user interface that will be used to display this place. |
protected void |
didInit()
Derived classes can override this and perform any post-initialization processing they might need. |
void |
didLeavePlace(PlaceObject plobj)
This is called by the location director when we are leaving this place and need to clean up after ourselves and shutdown. |
PlaceConfig |
getPlaceConfig()
Returns the PlaceConfig associated with this place. |
PlaceView |
getPlaceView()
Returns a reference to the place view associated with this controller. |
boolean |
handleAction(ActionEvent action)
Handles basic place controller action events. |
void |
init(CrowdContext ctx,
PlaceConfig config)
Initializes this place controller with a reference to the context that they can use to access client services and to the configuration record for this place. |
void |
mayLeavePlace(PlaceObject plobj)
Called before a request is submitted to the server to leave the current place. |
void |
willEnterPlace(PlaceObject plobj)
This is called by the location director once the place object has been fetched. |
| Methods inherited from class com.samskivert.swing.Controller |
|---|
actionPerformed, configureAction, createActionButton, generateArguments, handleAction, handleAction, handleAction, postAction, postAction, postAction, setControlledPanel, wasAdded, wasRemoved |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected CrowdContext _ctx
protected PlaceConfig _config
protected PlaceObject _plobj
protected PlaceView _view
protected ArrayList<PlaceControllerDelegate> _delegates
| Constructor Detail |
|---|
public PlaceController()
| Method Detail |
|---|
public void init(CrowdContext ctx,
PlaceConfig config)
ctx - the client context.config - the place configuration for this place.protected void didInit()
super.didInit().
public PlaceView getPlaceView()
init(com.threerings.crowd.util.CrowdContext, com.threerings.crowd.data.PlaceConfig).
public PlaceConfig getPlaceConfig()
PlaceConfig associated with this place.
protected PlaceView createPlaceView(CrowdContext ctx)
ctx - a reference to the CrowdContext associated with this controller.@Deprecated protected PlaceView createPlaceView()
createPlaceView(CrowdContext).
public void willEnterPlace(PlaceObject plobj)
PlaceViewUtil.dispatchWillEnterPlace(java.lang.Object, com.threerings.crowd.data.PlaceObject). Derived classes can override this and perform
any other starting up that they need to do
public void mayLeavePlace(PlaceObject plobj)
didLeavePlace(com.threerings.crowd.data.PlaceObject) is finally called.
The request to leave may be rejected, but if a place controller needs to flush any
information to the place manager before it leaves, it should so do here. This is the only
place in which the controller is guaranteed to be able to communicate to the place manager,
as by the time didLeavePlace(com.threerings.crowd.data.PlaceObject) is called, the place manager may have already been
destroyed.
public void didLeavePlace(PlaceObject plobj)
super.didLeavePlace) and perform any necessary cleanup.
public boolean handleAction(ActionEvent action)
super.handleAction for events they don't specifically handle.
handleAction in class Controllerprotected void addDelegate(PlaceControllerDelegate delegate)
protected void applyToDelegates(PlaceController.DelegateOp op)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||