public class LampStatePublisher extends Object
Modifier and Type | Field and Description |
---|---|
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 |
Modifier | Constructor and Description |
---|---|
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())
|
Modifier and Type | Method and Description |
---|---|
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
|
public static final String NAMESPACE
public static final String SLEEPING_ROOM_LIGHTING
public static final String LIVING_ROOM_LIGHTING
public static final String BATHROOM_LIGHTING
public static final String KITCHEN_LIGHTING
public static final String HOBBY_ROOM_LIGHTING
public static ContextPublisher myContextPublisher
public static ModuleContext myModuleContext
protected LampStatePublisher(ModuleContext context)
context
- public void publishContextEvent(LightSource lightSource)
lightSource
- public LampMap getLampMap()
public void changeLabelBackground(JLabel label, LightSource lightSource)
button
- lightSource
- Copyright © 2018 universAAL Consortium. All rights reserved.