edu.berkeley.io.context.home
Class LightWidget

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

public class LightWidget
extends Widget

Author:
newbergr

Field Summary
static java.lang.String INTENSITY
           
static java.lang.String SET_INTENSITY
           
static java.lang.String SET_INTENSITY_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
LightWidget(java.lang.String location, int port, boolean storageFlag)
           
LightWidget(java.lang.String location, int port, java.lang.String id, boolean storageFlag)
           
 
Method Summary
protected  Attributes initAttributes()
          Sets the attributes for the widget
protected  Callbacks initCallbacks()
          This method implements the abstract method Widget.setCallbacks().
protected  Attributes initConstantAttributes()
          Sets the constant attributes for the widget
protected  Services initServices()
          This method implements the abstract method Widget.setServices().
protected  Attributes queryGenerator()
          This method returns an empty AttributeNameValues object.
 void setIntensity(float intensity)
           
 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

INTENSITY

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

SET_INTENSITY

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

SET_INTENSITY_SERVICE

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

LightWidget

public LightWidget(java.lang.String location,
                   int port,
                   boolean storageFlag)

LightWidget

public LightWidget(java.lang.String location,
                   int port,
                   java.lang.String id,
                   boolean storageFlag)
Method Detail

setIntensity

public void setIntensity(float intensity)

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

initConstantAttributes

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

Specified by:
initConstantAttributes in class Widget
See Also:
context.arch.widget.Widget#setConstantAttributes()

initCallbacks

protected Callbacks initCallbacks()
This method implements the abstract method Widget.setCallbacks(). It defines the callbacks for the widget as: UPDATE with the attributes TIMESTAMP, TEMPERATURE, UNITS, LOCATION

Specified by:
initCallbacks in class Widget
Returns:
the Callbacks used by this widget

initServices

protected Services initServices()
This method implements the abstract method Widget.setServices(). It currently has no services and returns an empty Services object.

Specified by:
initServices in class Widget
Returns:
the Services provided by this widget

queryGenerator

protected Attributes queryGenerator()
This method returns an empty AttributeNameValues object. The temperature sensor can not be polled.

Specified by:
queryGenerator in class Widget
Returns:
empty AttributeNameValues