Commit 7e196c62 authored by Valérie Maquil's avatar Valérie Maquil
Browse files

minor modifications

parent 35a6da49
Pipeline #608 skipped
......@@ -9,8 +9,8 @@ logger.event.configuration = logger.xml
# Properties for calibrating the interface
frameTitle = NUI Application
windowWidth = 1280
windowHeight = 800
windowWidth = 1920
windowHeight = 1080
fullScreen = false
font = Arial
fontSize = 13
......
......@@ -108,7 +108,7 @@ public class Scene extends Content {
try {
final Element imageNode = element.getChild(Externalization.IMAGE_NODE);
if (null != imageNode) {
if ((null != imageNode) && (imageNode.getText() != "")) {
scenery = new ImageIcon(ImageIO.read(new File(imageNode.getText())));
}
} catch (final NullPointerException npe) {
......@@ -123,7 +123,7 @@ public class Scene extends Content {
try {
final Element soundNode = element.getChild(Externalization.SOUND_NODE);
if (null != soundNode) {
if ((null != soundNode) && (soundNode.getText() != "")) {
final File audioFile = new File(soundNode.getText());
final AudioInputStream audioStream = AudioSystem.getAudioInputStream(audioFile);
final AudioFormat format = audioStream.getFormat();
......@@ -166,7 +166,9 @@ public class Scene extends Content {
@Override
public void paint(Graphics2D canvas) {
// canvas.drawImage(scenery, 0, 0, null);
scenery.paintIcon(null, canvas, 0, 0);
if (scenery != null) {
scenery.paintIcon(null, canvas, 0, 0);
}
if ((!triggered) && (audioClip != null)) {
audioClip.setFramePosition(0);
......
......@@ -43,6 +43,7 @@ public class StageManager extends TangibleContentManager {
private static final StageManager INSTANCE = new StageManager();
private static Map<String, Scene> scenes;
private static ScriptEngine scriptEngine;
ArrayList<Content> drawableContents = new ArrayList<>();
private StageManager() {
scriptEngine = new ScriptEngineManager().getEngineByName("js"); //$NON-NLS-1$
......@@ -78,7 +79,7 @@ public class StageManager extends TangibleContentManager {
/** {@inheritDoc} */
@Override
public Collection<Content> getDrawableContents() {
final ArrayList<Content> drawableContents = new ArrayList<>();
drawableContents.clear();
for (final Scene scene : scenes.values()) {
if (scene.evaluateTrigger()) {
......
......@@ -3,8 +3,8 @@
<scenes>
<scene>
<name>Background</name>
<image>assets/checkered_tablecloth.jpg</image>
<sound>assets/TempleBell.wav</sound>
<image></image>
<sound></sound>
<triggerCondition>Chicken > 200</triggerCondition>
<drawPriority>1</drawPriority>
</scene>
......@@ -41,7 +41,7 @@
<font>Arial-20</font>
<initialTranslation>
<x>0</x>
<y>120</y>
<y>0</y>
<z>0</z>
<state>ScreenCoordinates</state>
</initialTranslation>
......@@ -58,8 +58,8 @@
<z>0</z>
</centre>
<initialTranslation>
<x>-125</x>
<y>-125</y>
<x>0</x>
<y>50</y>
<z>0</z>
<state>ScreenCoordinates</state>
</initialTranslation>
......@@ -69,9 +69,11 @@
<lowerBound>0</lowerBound>
<upperBound>1000</upperBound>
<scale>1</scale>
<title>Beef</title>
<unit>gr</unit>
<title></title>
<unit></unit>
<rotateWithHandle>false</rotateWithHandle>
<style>3</style>
<colourscheme>0</colourscheme>
</corona>
</coronas>
<name>Beef</name>
......@@ -119,7 +121,7 @@
<font>Arial-20</font>
<initialTranslation>
<x>0</x>
<y>120</y>
<y>0</y>
<z>0</z>
<state>ScreenCoordinates</state>
</initialTranslation>
......@@ -136,8 +138,8 @@
<z>0</z>
</centre>
<initialTranslation>
<x>-125</x>
<y>-125</y>
<x>0</x>
<y>50</y>
<z>0</z>
<state>ScreenCoordinates</state>
</initialTranslation>
......@@ -147,9 +149,11 @@
<lowerBound>0</lowerBound>
<upperBound>1000</upperBound>
<scale>1</scale>
<title>Chicken</title>
<unit>gr</unit>
<title></title>
<unit></unit>
<rotateWithHandle>false</rotateWithHandle>
<style>3</style>
<colourscheme>1</colourscheme>
</corona>
</coronas>
<name>Chicken</name>
......@@ -157,9 +161,9 @@
<networkAdapter></networkAdapter>
<lowerBound>0</lowerBound>
<upperBound>1000</upperBound>
<lowerStopAngle>0</lowerStopAngle>
<upperStopAngle>6.28318530718</upperStopAngle>
<stepSize>10</stepSize>
<lowerStopAngle>0.5</lowerStopAngle>
<upperStopAngle>5.5</upperStopAngle>
<stepSize>50</stepSize>
<variable>
<name>Chicken</name>
<unit>gr</unit>
......@@ -197,7 +201,7 @@
<font>Arial-20</font>
<initialTranslation>
<x>0</x>
<y>120</y>
<y>0</y>
<z>0</z>
<state>ScreenCoordinates</state>
</initialTranslation>
......@@ -214,8 +218,8 @@
<z>0</z>
</centre>
<initialTranslation>
<x>-125</x>
<y>-125</y>
<x>0</x>
<y>50</y>
<z>0</z>
<state>ScreenCoordinates</state>
</initialTranslation>
......@@ -225,9 +229,11 @@
<lowerBound>0</lowerBound>
<upperBound>1000</upperBound>
<scale>1</scale>
<title>Fish</title>
<unit>gr</unit>
<title></title>
<unit></unit>
<rotateWithHandle>false</rotateWithHandle>
<style>3</style>
<colourscheme>2</colourscheme>
</corona>
</coronas>
<name>Fish</name>
......@@ -275,7 +281,7 @@
<font>Arial-20</font>
<initialTranslation>
<x>0</x>
<y>120</y>
<y>0</y>
<z>0</z>
<state>ScreenCoordinates</state>
</initialTranslation>
......@@ -292,8 +298,8 @@
<z>0</z>
</centre>
<initialTranslation>
<x>-125</x>
<y>-125</y>
<x>0</x>
<y>0</y>
<z>0</z>
<state>ScreenCoordinates</state>
</initialTranslation>
......@@ -306,6 +312,8 @@
<title>Eggs</title>
<unit>gr</unit>
<rotateWithHandle>false</rotateWithHandle>
<style>0</style>
<colourscheme>2</colourscheme>
</corona>
</coronas>
<name>Eggs</name>
......@@ -384,6 +392,7 @@
<title>Pineapple</title>
<unit>gr</unit>
<rotateWithHandle>false</rotateWithHandle>
<style>0</style>
</corona>
</coronas>
<name>Pineapple</name>
......@@ -462,6 +471,8 @@
<title>Apple</title>
<unit>gr</unit>
<rotateWithHandle>false</rotateWithHandle>
<style>3</style>
<colourscheme>2</colourscheme>
</corona>
</coronas>
<name>Apple</name>
......
Markdown is supported
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