Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
frascati
frascati
Commits
b4fc0945
Commit
b4fc0945
authored
Jul 26, 2012
by
Gwenael Cattez
Browse files
Add GUI to Switch Mock component
parent
a2a82fb2
Changes
4
Hide whitespace changes
Inline
Side-by-side
demo/common/common-homeautomation/common-homeautomation-light-mock/pom.xml
View file @
b4fc0945
...
...
@@ -41,7 +41,6 @@
<dependency>
<groupId>
org.ow2.frascati
</groupId>
<artifactId>
frascati-runtime-factory
</artifactId>
<version>
${frascati.version}
</version>
<scope>
test
</scope>
</dependency>
...
...
demo/common/common-homeautomation/common-homeautomation-switch-mock/pom.xml
View file @
b4fc0945
...
...
@@ -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>
...
...
demo/common/common-homeautomation/common-homeautomation-switch-mock/src/main/java/org/ow2/frascati/demo/common/homeautomation/SwitchMock.java
View file @
b4fc0945
...
...
@@ -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
;
}
}
demo/common/common-homeautomation/common-homeautomation-switch-mock/src/main/resources/switch-mock.composite
View file @
b4fc0945
...
...
@@ -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"
/>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment