public class NoteMaker extends Mod implements GeneralMod
Note
mod
attached. This mod is generally attached to a context, but this is not
required.Constructor and Description |
---|
NoteMaker(StyleOptions styleOptions)
JSON-driven constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
allowedStyle(StyleDesc style)
Test if this mod's style options are compatible with particular style
settings.
|
JSONLiteral |
encode(EncodeControl control)
Encode this mod for transmission or persistence.
|
void |
makenote(User from,
OptString into,
int left,
int top,
int width,
int height,
String text,
StyleDesc style)
Message handler for the 'makenote' message.
|
attachTo, clone, context, ensureHolding, ensureInContext, ensureReachable, ensureSameContext, ensureSameUser, holder, isEphemeral, markAsChanged, markAsEphemeral, object
@JSONMethod(value="styles") public NoteMaker(StyleOptions styleOptions)
styleOptions
- Style options permitted in notes created by this
mod.public boolean allowedStyle(StyleDesc style)
style
- The style to test.public JSONLiteral encode(EncodeControl control)
@JSONMethod(value={"into","left","top","width","height","text","?style"}) public void makenote(User from, OptString into, int left, int top, int width, int height, String text, StyleDesc style) throws MessageHandlerException
This is a request from a client to create a new note. If the creation operation is successful, a 'make' message will be broadcast to the context, describing the new note object.
recv: { to:REF, op:"makeNote", into:optREF,
left:INT, top:INT, width:INT,
height:INT, text:STR,
style:optSTYLE }
send: { to:intoREF, op:"make", ... }
from
- The user who sent the message.into
- Container into which the new note object should be placed
(optional, defaults to the context).left
- X coordinate of new object relative to container.top
- Y coordinate of new object relative to container.width
- Width of note display.height
- Height of note display.text
- The text to show.style
- Style information for 'text' (optional, defaults to
unstyled text).MessageHandlerException
- if 'from' is not in the same context as
this mod or if invalid style information is provided or if the
proposed container is not valid.Copyright © 2017. All rights reserved.