Commit b4fc0945 authored by Gwenael Cattez's avatar Gwenael Cattez
Browse files

Add GUI to Switch Mock component

parent a2a82fb2
......@@ -41,7 +41,6 @@
<dependency>
<groupId>org.ow2.frascati</groupId>
<artifactId>frascati-runtime-factory</artifactId>
<version>${frascati.version}</version>
<scope>test</scope>
</dependency>
......
......@@ -16,6 +16,12 @@
</properties>
<dependencies>
<dependency>
<groupId>org.ow2.frascati.demo</groupId>
<artifactId>common-onoffdevice</artifactId>
</dependency>
<dependency>
<groupId>org.ow2.frascati.demo</groupId>
<artifactId>common-homeautomation-interface</artifactId>
......@@ -35,7 +41,6 @@
<dependency>
<groupId>org.ow2.frascati</groupId>
<artifactId>frascati-runtime-factory</artifactId>
<version>${frascati.version}</version>
<scope>test</scope>
</dependency>
......
......@@ -32,17 +32,25 @@ import java.util.logging.Logger;
import org.osoa.sca.annotations.EagerInit;
import org.osoa.sca.annotations.Scope;
import org.ow2.frascati.demo.common.homeautomation.actuator.OnOffActuator;
import org.ow2.frascati.demo.common.onoffdevice.SwOnOffDevice;
/**
* Mock version of the Switch device, no action done except giving informations about the action perform
*/
@EagerInit
@Scope("COMPOSITE")
public class SwitchMock implements OnOffActuator
public class SwitchMock extends SwOnOffDevice implements OnOffActuator
{
private static final long serialVersionUID = 1L;
private static final Logger logger = Logger.getLogger(SwitchMock.class.getName());
public SwitchMock()
{
super("Mocked Switch");
}
/* (non-Javadoc)
* @see org.ow2.frascati.demo.common.homeautomation.actuator.OnOffActuator#acturatorOn()
*/
......@@ -59,4 +67,24 @@ public class SwitchMock implements OnOffActuator
logger.info("[SwitchMock] invoke method off");
}
/* (non-Javadoc)
* @see org.ow2.frascati.demo.common.onoffdevice.SwOnOffDevice#offAction()
*/
@Override
public Boolean offAction()
{
acturatorOff();
return null;
}
/* (non-Javadoc)
* @see org.ow2.frascati.demo.common.onoffdevice.SwOnOffDevice#onAction()
*/
@Override
public Boolean onAction()
{
acturatorOn();
return null;
}
}
......@@ -26,6 +26,12 @@
name="switch-mock">
<component name="switch-mock">
<property name="onText">switch on</property>
<property name="offText">switch off</property>
<property name="onIconPath">images/switch_on.png</property>
<property name="offIconPath">images/switch_off.png</property>
<service name="onoff-actuator">
<interface.java
interface="org.ow2.frascati.demo.common.homeautomation.actuator.OnOffActuator" />
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment