edu.berkeley.io.context.home
Class LightWidget
java.lang.Object
context.arch.BaseObject
context.arch.widget.Widget
edu.berkeley.io.context.home.LightWidget
- All Implemented Interfaces:
- CommunicationsHandler, MessageHandler
- public class LightWidget
- extends Widget
- Author:
- newbergr
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)
|
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 |
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
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)
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