|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.elkoserver.server.context.Mod
org.elkoserver.server.context.mods.TalkPrefs
public class TalkPrefs
Mod to hold a user's current chat text display style settings. This is used
to allow text chat to be conducted with user-configurable styled text. It
operates in conjunction with TalkOptions and Chat mods that
should be attached to the context the user is in.
This mod gets attached to a user, but note that it is not normally attached
to the user record in the object database. It does not persist, but instead
is attached dynamically by the TalkOptions mod.
| Constructor Summary | |
|---|---|
TalkPrefs(StyleDesc style)
JSON-driven constructor. |
|
| Method Summary | |
|---|---|
JSONLiteral |
encode(EncodeControl control)
Encode this mod for transmission or persistence. |
void |
objectIsComplete()
Upon completion of the user object to which this mod attached, grab the next set of available style choices from the context's TalkOptions mod. |
void |
style(User from,
OptString color,
OptString backgroundColor,
OptString icon,
OptString textStyle)
Message handler for the 'style' message. |
| Methods inherited from class org.elkoserver.server.context.Mod |
|---|
attachTo, clone, context, ensureHolding, ensureInContext, ensureReachable, ensureSameContext, ensureSameUser, holder, isEphemeral, markAsChanged, markAsEphemeral, object |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
@JSONMethod(value="style") public TalkPrefs(StyleDesc style)
objectIsComplete() method) by choosing, in a round-robin fashion, from
the style options available in in the context's TalkOptions mod.
style - The StyleDesc associated with the chat text of the
user to whom this mod is attached.| Method Detail |
|---|
public JSONLiteral encode(EncodeControl control)
encode in interface Encodablecontrol - Encode control determining what flavor of encoding
should be done.
public void objectIsComplete()
TalkOptions mod.
Application code should not call this method.
objectIsComplete in interface ObjectCompletionWatcher
@JSONMethod(value={"color","backgroundColor","icon","textStyle"})
public void style(User from,
OptString color,
OptString backgroundColor,
OptString icon,
OptString textStyle)
throws MessageHandlerException
This is a request from a client to change one or more of the style attributes. If the change operation is successful, a corresponding 'style' message is broadcast to the context.
recv: { to:REF, op:"style", color:optSTR,
backgroundColor:optSTR, icon:optSTR,
textStyle:optSTR }
send: { to:REF, op:"style", color:optSTR,
backgroundColor:optSTR, icon:optSTR,
textStyle:optSTR }
from - The user who sent the message.color - New text color value (optional).backgroundColor - New background color value (optional).icon - New icon URL string (optional).textStyle - New typeface/style info (optional).
MessageHandlerException - if 'from' is not in the same user this
mod is attached to.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||