edu.berkeley.io.context.museum
Class VisitorDisplayWidget

java.lang.Object
  extended bycontext.arch.BaseObject
      extended bycontext.arch.widget.Widget
          extended byedu.berkeley.io.context.museum.VisitorDisplayWidget
All Implemented Interfaces:
CommunicationsHandler, MessageHandler

public class VisitorDisplayWidget
extends Widget

Location value is 'logical' location, i.e. which painting you're near. Like the number code visitors use in mobile museum tour guides today.

Author:
newbergr

Field Summary
static java.lang.String CONTENT_ID
           
static java.lang.String NONE
           
static java.lang.String SET_CONTENT_ID
           
static java.lang.String VISITOR_DISPLAY_SERVICE
           
 
Fields inherited from class context.arch.widget.Widget
attributes, attributeTypes, callbacks, CLASS, constantAttributes, constantAttributesTypes, CurrentOffset, DEBUG, DEFAULT_PORT, PUT_DATA, PUT_DATA_REPLY, QUERY, QUERY_ATTRIBUTES, QUERY_ATTRIBUTES_REPLY, QUERY_CALLBACKS, QUERY_CALLBACKS_REPLY, QUERY_CONSTANT_ATTRIBUTES, QUERY_CONSTANT_ATTRIBUTES_REPLY, QUERY_REPLY, QUERY_SERVICES, QUERY_SERVICES_REPLY, QUERY_VERSION, QUERY_VERSION_REPLY, services, SPACER, storage, subscribers, TIMESTAMP, UPDATE, UPDATE_AND_QUERY, UPDATE_AND_QUERY_REPLY, VERSION, VERSION_NUMBER, WIDGET_TYPE
 
Fields inherited from class context.arch.BaseObject
BASEOBJECT_TYPE, communications, DISABLE_PORT, discoverer, EXIT_OK, gFrame, handlers, ID, parser, PING, PING_REPLY, QUERY_DESCRIPTION, QUERY_DESCRIPTION_REPLY, serviceHandlers
 
Constructor Summary
VisitorDisplayWidget(java.lang.String userId, int port, boolean storageFlag)
           
 
Method Summary
protected  Attributes initAttributes()
          Sets the attributes for the widget
protected  Callbacks initCallbacks()
          Sets the callbacks for the widget
protected  Attributes initConstantAttributes()
          Sets the constant attributes for the widget
protected  Services initServices()
          Sets the services for the widget
protected  Attributes queryGenerator()
          This abstract method is called when the widget wants to get the latest generator info.
 void setContentId(java.lang.String newContentId)
          Sets the content id for the device; presumably the device will then retrieve content to display based on the id.
 void setLocation(java.lang.String newLocationName)
           
 void update()
           
 
Methods inherited from class context.arch.widget.Widget
addSubscriber, canHandle, canHandle, executeService, getAttributeType, getCurrentTime, getNewOffset, getNewOffsetNoDelay, getSubscribersDescription, getType, getUserDescription, getWidgetDescription, handleIndependentReply, isAttribute, isCallback, notify, processCallbackReply, putData, queryAttributes, queryCallbacks, queryConstantAttributes, queryServices, queryWidget, removeSubscriber, retrieveData, runUserMethod, runWidgetMethod, sendToSubscribers, setAttribute, setAttributes, setCallbacks, setConstantAttributes, setId, setNonConstantAttributes, setServices, setSubscribers, store, store, updateWidgetInformation
 
Methods inherited from class context.arch.BaseObject
activateDisplay, askInterpreter, deactivateDisplay, debugprintln, decodeData, discovererQuery, discovererQuery, discovererRegistration, discovererRegistration, discovererSendSubscription, discovererSubscribe, discovererSubscriptionNotification, discovererUnregistration, discovererUpdate, encodeData, executeAsynchronousWidgetService, executeSynchronousWidgetService, findDiscoverer, findDiscoverer, findDiscoverer, getComponentDescription, getDescription, getHostAddress, getHostName, getId, getId, getLease, getListOfHandlers, getLocationAddress, getPort, getVersion, getVersion, getWidgetAttributes, getWidgetCallbacks, getWidgetConstantAttributes, getWidgetServices, independentUserRequest, leaseEndNotified, pingComponent, pingComponent, pollWidget, println, putDataInWidget, queryVersion, quit, retrieveDataFrom, retrieveDataFrom, returnPing, runComponentMethod, runMethod, serviceResult, setAllDebug, setDiscoverer, setDisplay, setDisplay, setDisplayName, setDisplayTitle, setLease, setLocationAddress, setVersion, subscribeTo, unsubscribeFrom, updateAndPollWidget, userCallback, userRequest, userRequest, userRequest, userRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NONE

public static final java.lang.String NONE
See Also:
Constant Field Values

CONTENT_ID

public static final java.lang.String CONTENT_ID
See Also:
Constant Field Values

VISITOR_DISPLAY_SERVICE

public static final java.lang.String VISITOR_DISPLAY_SERVICE
See Also:
Constant Field Values

SET_CONTENT_ID

public static final java.lang.String SET_CONTENT_ID
See Also:
Constant Field Values
Constructor Detail

VisitorDisplayWidget

public VisitorDisplayWidget(java.lang.String userId,
                            int port,
                            boolean storageFlag)
Method Detail

setContentId

public void setContentId(java.lang.String newContentId)
Sets the content id for the device; presumably the device will then retrieve content to display based on the id. triggers an UPDATE callback.

Parameters:
newContentId -

setLocation

public void setLocation(java.lang.String newLocationName)

update

public void update()

initAttributes

protected Attributes initAttributes()
Description copied from class: Widget
Sets the attributes for the widget

Specified by:
initAttributes in class Widget

initCallbacks

protected Callbacks initCallbacks()
Description copied from class: Widget
Sets the callbacks for the widget

Specified by:
initCallbacks in class Widget

initConstantAttributes

protected Attributes initConstantAttributes()
Description copied from class: Widget
Sets the constant attributes for the widget

Specified by:
initConstantAttributes in class Widget

initServices

protected Services initServices()
Description copied from class: Widget
Sets the services for the widget

Specified by:
initServices in class Widget

queryGenerator

protected Attributes queryGenerator()
Description copied from class: Widget
This abstract method is called when the widget wants to get the latest generator info.

Specified by:
queryGenerator in class Widget
Returns:
AttributeNameValues containing the latest generator information