|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.universAAL.samples.sensor.simulator.LampStatePublisher
public class LampStatePublisher
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 |
---|
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
Constructor Detail |
---|
protected LampStatePublisher(ModuleContext context)
context
- Method Detail |
---|
public void publishContextEvent(LightSource lightSource)
lightSource
- public LampMap getLampMap()
public void changeLabelBackground(JLabel label, LightSource lightSource)
button
- lightSource
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |