org.jdesktop.wonderland.common.cell.messages
Class CellClientComponentMessage

java.lang.Object
  extended by org.jdesktop.wonderland.common.messages.Message
      extended by org.jdesktop.wonderland.common.cell.messages.CellMessage
          extended by org.jdesktop.wonderland.common.cell.messages.CellClientComponentMessage
All Implemented Interfaces:
java.io.Serializable

public class CellClientComponentMessage
extends CellMessage

A message class to either add or remove a component to/from the cell, given either the components client-side state or the client-side cell component class name.

This message can be used under two circumstances: to instruction the client to add/remove a component to/from cell, or as an event message sent back to the client who are listening for changes to the components on the client cell.

Author:
Jordan Slott
See Also:
Serialized Form

Nested Class Summary
static class CellClientComponentMessage.ComponentAction
           
 
Constructor Summary
CellClientComponentMessage(CellID cellID, java.lang.String className)
          Constructor that takes the client-side component class name and leaves the client state null.
CellClientComponentMessage(CellID cellID, java.lang.String className, CellComponentClientState clientState)
          Constructor that takes the client state (used to add a component)
 
Method Summary
 java.lang.String getCellComponentClientClassName()
          Returns the comonent's client-side class name, this can never be null.
 CellComponentClientState getCellComponentClientState()
          Returns the component's client state, or null if not set.
 CellClientComponentMessage.ComponentAction getComponentAction()
          Returns the type of component action, either ADD or REMOVE
static CellClientComponentMessage newAddMessage(CellID cellID, java.lang.String className, CellComponentClientState clientState)
          Creates a new ADD component message given the cell id and cell component client state object.
static CellClientComponentMessage newRemoveMessage(CellID cellID, java.lang.String className)
          Creates a new REMOVE component message given the cell id and cell component client state object.
 
Methods inherited from class org.jdesktop.wonderland.common.cell.messages.CellMessage
getCellID, getSenderID, setCellID, setSenderID
 
Methods inherited from class org.jdesktop.wonderland.common.messages.Message
getMessageID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CellClientComponentMessage

public CellClientComponentMessage(CellID cellID,
                                  java.lang.String className,
                                  CellComponentClientState clientState)
Constructor that takes the client state (used to add a component)

Parameters:
cellID - The unique ID of the cell
clientState - The cell component client state

CellClientComponentMessage

public CellClientComponentMessage(CellID cellID,
                                  java.lang.String className)
Constructor that takes the client-side component class name and leaves the client state null. (used to remove a component)

Parameters:
cellID - The unique ID of the cell
className - The class name of the client-side component
Method Detail

getComponentAction

public CellClientComponentMessage.ComponentAction getComponentAction()
Returns the type of component action, either ADD or REMOVE

Returns:
Either ADD or REMOVE

getCellComponentClientState

public CellComponentClientState getCellComponentClientState()
Returns the component's client state, or null if not set.

Returns:
The cell component client state, possibly null

getCellComponentClientClassName

public java.lang.String getCellComponentClientClassName()
Returns the comonent's client-side class name, this can never be null.

Returns:
The cell component client class name

newAddMessage

public static CellClientComponentMessage newAddMessage(CellID cellID,
                                                       java.lang.String className,
                                                       CellComponentClientState clientState)
Creates a new ADD component message given the cell id and cell component client state object.

Parameters:
cellID - The unique ID of the cell
className - The cell component class name
clientState - The cell component client state
Returns:
A new CellClientComponentMessage class

newRemoveMessage

public static CellClientComponentMessage newRemoveMessage(CellID cellID,
                                                          java.lang.String className)
Creates a new REMOVE component message given the cell id and cell component client state object.

Parameters:
cellID - The unique ID of the cell
className - The cell component class name
Returns:
A new CellClientComponentMessage class


Open Wonderland - http://openwonderland.org