com.threerings.chat
Class ChatOverlay

java.lang.Object
  extended by com.threerings.chat.ChatOverlay
All Implemented Interfaces:
com.threerings.crowd.chat.client.ChatDisplay
Direct Known Subclasses:
SubtitleChatOverlay

public abstract class ChatOverlay
extends Object
implements com.threerings.crowd.chat.client.ChatDisplay

An abstract class that represents a chat display that can be overlayed upon another component.


Nested Class Summary
static interface ChatOverlay.InfoProvider
          An interface for providing information about what is under the overlay.
 
Field Summary
protected  com.threerings.crowd.util.CrowdContext _ctx
          The light of our life.
protected  boolean _dimmed
          Whether the chat glyphs are dimmed or not.
protected  ChatLogic _logic
          Contains all of our customizations.
protected  ChatOverlay.InfoProvider _provider
          The source of hints to how we layout the overlay.
protected  VirtualMediaPanel _target
          The component in which we are being displayed.
 
Constructor Summary
protected ChatOverlay(com.threerings.crowd.util.CrowdContext ctx, ChatLogic logic)
          Construct a chat overlay.
 
Method Summary
 void added(VirtualMediaPanel target)
          Indicates that the target component was added to the widget hier.
 VirtualMediaPanel getTarget()
          Returns the media panel on which this chat overlay is operating.
protected  boolean isShowing()
          Returns true if this chat overlay is showing and should therefore update its display accordingly.
abstract  void layout()
          Layout the chat overlay inside the previously configured target component.
 void newPlaceEntered(ChatOverlay.InfoProvider provider)
          Callback from the target that the place has changed and we are to now talk to the new info provider.
 void placeExited()
          A callback indicating that we've left the place and should stop talking to a particular infoprovider.
 void removed()
          Indicates that the target component was removed from the widget hier.
 void setDimmed(boolean dimmed)
          Set the dimmed mode of the currently displaying glyphs.
 void setVisible(boolean visible)
          Causes the chat overlay to make itself visible or invisible.
 void speakerDeparted(Name speaker)
          Should be called when a speaker departs the chat area to allow the overlay to clean up.
 void viewDidScroll(int dx, int dy)
          Called if our containing media panel scrolled its view.
protected  String xlate(String message)
          Translates a string using the general client message bundle.
protected  String xlate(String bundle, String message)
          Translates a string using the specified bundle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.threerings.crowd.chat.client.ChatDisplay
clear, displayMessage
 

Field Detail

_ctx

protected com.threerings.crowd.util.CrowdContext _ctx
The light of our life.


_logic

protected ChatLogic _logic
Contains all of our customizations.


_target

protected VirtualMediaPanel _target
The component in which we are being displayed.


_provider

protected ChatOverlay.InfoProvider _provider
The source of hints to how we layout the overlay.


_dimmed

protected boolean _dimmed
Whether the chat glyphs are dimmed or not.

Constructor Detail

ChatOverlay

protected ChatOverlay(com.threerings.crowd.util.CrowdContext ctx,
                      ChatLogic logic)
Construct a chat overlay.

Method Detail

setVisible

public void setVisible(boolean visible)
Causes the chat overlay to make itself visible or invisible.


setDimmed

public void setDimmed(boolean dimmed)
Set the dimmed mode of the currently displaying glyphs.


added

public void added(VirtualMediaPanel target)
Indicates that the target component was added to the widget hier. Should be called when we wish to start displaying chat.


layout

public abstract void layout()
Layout the chat overlay inside the previously configured target component. Should be called if our component changes size.


removed

public void removed()
Indicates that the target component was removed from the widget hier. Should be called when we no longer wish to paint chat.


newPlaceEntered

public void newPlaceEntered(ChatOverlay.InfoProvider provider)
Callback from the target that the place has changed and we are to now talk to the new info provider.


placeExited

public void placeExited()
A callback indicating that we've left the place and should stop talking to a particular infoprovider.


getTarget

public VirtualMediaPanel getTarget()
Returns the media panel on which this chat overlay is operating.


speakerDeparted

public void speakerDeparted(Name speaker)
Should be called when a speaker departs the chat area to allow the overlay to clean up.


viewDidScroll

public void viewDidScroll(int dx,
                          int dy)
Called if our containing media panel scrolled its view.


isShowing

protected boolean isShowing()
Returns true if this chat overlay is showing and should therefore update its display accordingly.


xlate

protected String xlate(String message)
Translates a string using the general client message bundle.


xlate

protected String xlate(String bundle,
                       String message)
Translates a string using the specified bundle.