org.universAAL.samples.sensor.simulator
Class LampStatePublisher

Package class diagram package LampStatePublisher
java.lang.Object
  extended by org.universAAL.samples.sensor.simulator.LampStatePublisher

public class LampStatePublisher
extends Object

LampStatePublisher class publishes lamp state to universAAL Context Bus


Field Summary
static String BATHROOM_LIGHTING
           
static String HOBBY_ROOM_LIGHTING
           
static String KITCHEN_LIGHTING
           
static String LIVING_ROOM_LIGHTING
           
static ContextPublisher myContextPublisher
           
static ModuleContext myModuleContext
           
static String NAMESPACE
           
static String SLEEPING_ROOM_LIGHTING
           
 
Constructor Summary
protected LampStatePublisher(ModuleContext context)
          Constructor 5 light sources are inserted for testing purposes We're setting ContextEventPattern[] directly in the constructor It could be moved to separate method just like in LocationContextPublisher class (method getPermanentSubscription())
 
Method Summary
 void changeLabelBackground(JLabel label, LightSource lightSource)
          Check lightSource brightness and change button color accordingly (yellow for ON or white for OFF)
 LampMap getLampMap()
          lampMap getter method
 void publishContextEvent(LightSource lightSource)
          Publishes context event that has lightSource as a subject and it's brightness as a predicate For testing purposes we set brightness to 0 or to 100, create new ContextEvent and publish it
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAMESPACE

public static final String NAMESPACE
See Also:
Constant Field Values

SLEEPING_ROOM_LIGHTING

public static final String SLEEPING_ROOM_LIGHTING
See Also:
Constant Field Values

LIVING_ROOM_LIGHTING

public static final String LIVING_ROOM_LIGHTING
See Also:
Constant Field Values

BATHROOM_LIGHTING

public static final String BATHROOM_LIGHTING
See Also:
Constant Field Values

KITCHEN_LIGHTING

public static final String KITCHEN_LIGHTING
See Also:
Constant Field Values

HOBBY_ROOM_LIGHTING

public static final String HOBBY_ROOM_LIGHTING
See Also:
Constant Field Values

myContextPublisher

public static ContextPublisher myContextPublisher

myModuleContext

public static ModuleContext myModuleContext
Constructor Detail

LampStatePublisher

protected LampStatePublisher(ModuleContext context)
Constructor 5 light sources are inserted for testing purposes We're setting ContextEventPattern[] directly in the constructor It could be moved to separate method just like in LocationContextPublisher class (method getPermanentSubscription())

Parameters:
context -
Method Detail

publishContextEvent

public void publishContextEvent(LightSource lightSource)
Publishes context event that has lightSource as a subject and it's brightness as a predicate For testing purposes we set brightness to 0 or to 100, create new ContextEvent and publish it

Parameters:
lightSource -

getLampMap

public LampMap getLampMap()
lampMap getter method

Returns:

changeLabelBackground

public void changeLabelBackground(JLabel label,
                                  LightSource lightSource)
Check lightSource brightness and change button color accordingly (yellow for ON or white for OFF)

Parameters:
button -
lightSource -


Copyright © 2014 universAAL Consortium. All Rights Reserved.