From a02481bc992841eadcb6fca68812a7ab72c9aa15 Mon Sep 17 00:00:00 2001 From: Niclas Finne Date: Wed, 14 Dec 2016 10:10:25 +0100 Subject: [PATCH] Fixed more MessageListUI to respect visualized in Cooja --- .../contikios/cooja/avrmote/MicaZMoteType.java | 4 +--- .../cooja/mspmote/AbstractMspMoteType.java | 2 +- .../cooja/dialogs/CompileContiki.java | 18 +++++++++--------- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/tools/cooja/apps/avrora/src/org/contikios/cooja/avrmote/MicaZMoteType.java b/tools/cooja/apps/avrora/src/org/contikios/cooja/avrmote/MicaZMoteType.java index 9499aafe9..5e1300cd3 100644 --- a/tools/cooja/apps/avrora/src/org/contikios/cooja/avrmote/MicaZMoteType.java +++ b/tools/cooja/apps/avrora/src/org/contikios/cooja/avrmote/MicaZMoteType.java @@ -63,8 +63,6 @@ import org.contikios.cooja.avrmote.interfaces.MicaZLED; import org.contikios.cooja.avrmote.interfaces.MicaZRadio; import org.contikios.cooja.dialogs.CompileContiki; import org.contikios.cooja.dialogs.MessageList; -import org.contikios.cooja.dialogs.MessageListText; -import org.contikios.cooja.dialogs.MessageListUI; import org.contikios.cooja.dialogs.MessageContainer; import org.contikios.cooja.interfaces.Mote2MoteRelations; import org.contikios.cooja.interfaces.MoteAttributes; @@ -366,7 +364,7 @@ public class MicaZMoteType implements MoteType { throw new MoteTypeCreationException("No identifier"); } - final MessageList compilationOutput = visAvailable ? new MessageListUI() : new MessageListText(); + final MessageList compilationOutput = MessageContainer.createMessageList(visAvailable); if (getCompileCommands() != null) { /* Handle multiple compilation commands one by one */ diff --git a/tools/cooja/apps/mspsim/src/org/contikios/cooja/mspmote/AbstractMspMoteType.java b/tools/cooja/apps/mspsim/src/org/contikios/cooja/mspmote/AbstractMspMoteType.java index d03c0dfa1..eddfe94af 100644 --- a/tools/cooja/apps/mspsim/src/org/contikios/cooja/mspmote/AbstractMspMoteType.java +++ b/tools/cooja/apps/mspsim/src/org/contikios/cooja/mspmote/AbstractMspMoteType.java @@ -118,7 +118,7 @@ public abstract class AbstractMspMoteType extends MspMoteType { throw new MoteTypeCreationException("No identifier"); } - final MessageList compilationOutput = visAvailable ? new MessageListUI() : new MessageListText(); + final MessageList compilationOutput = MessageContainer.createMessageList(visAvailable); if (getCompileCommands() != null) { /* Handle multiple compilation commands one by one */ diff --git a/tools/cooja/java/org/contikios/cooja/dialogs/CompileContiki.java b/tools/cooja/java/org/contikios/cooja/dialogs/CompileContiki.java index 702024d13..823b561f6 100644 --- a/tools/cooja/java/org/contikios/cooja/dialogs/CompileContiki.java +++ b/tools/cooja/java/org/contikios/cooja/dialogs/CompileContiki.java @@ -127,7 +127,7 @@ public class CompileContiki { /* TODO Fix me */ final MessageList messageDialog; if (compilationOutput == null) { - messageDialog = new MessageListUI(); + messageDialog = MessageContainer.createMessageList(true); } else { messageDialog = compilationOutput; } @@ -138,8 +138,8 @@ public class CompileContiki { cmd += c + " "; } logger.info("> " + cmd); - messageDialog.addMessage("", MessageListUI.NORMAL); - messageDialog.addMessage("> " + cmd, MessageListUI.NORMAL); + messageDialog.addMessage("", MessageList.NORMAL); + messageDialog.addMessage("> " + cmd, MessageList.NORMAL); } final Process compileProcess; @@ -170,7 +170,7 @@ public class CompileContiki { String readLine; while ((readLine = processNormal.readLine()) != null) { if (messageDialog != null) { - messageDialog.addMessage(readLine, MessageListUI.NORMAL); + messageDialog.addMessage(readLine, MessageList.NORMAL); } } } catch (IOException e) { @@ -203,7 +203,7 @@ public class CompileContiki { compileProcess.waitFor(); } catch (Exception e) { messageDialog.addMessage(e.getMessage(), MessageList.ERROR); - syncException.setCompilationOutput(new MessageListUI()); + syncException.setCompilationOutput(MessageContainer.createMessageList(true)); syncException.fillInStackTrace(); return; } @@ -214,7 +214,7 @@ public class CompileContiki { if (onFailure != null) { onFailure.actionPerformed(null); } - syncException.setCompilationOutput(new MessageListUI()); + syncException.setCompilationOutput(MessageContainer.createMessageList(true)); syncException.fillInStackTrace(); return; } @@ -232,13 +232,13 @@ public class CompileContiki { if (onFailure != null) { onFailure.actionPerformed(null); } - syncException.setCompilationOutput(new MessageListUI()); + syncException.setCompilationOutput(MessageContainer.createMessageList(true)); syncException.fillInStackTrace(); return; } - messageDialog.addMessage("", MessageListUI.NORMAL); - messageDialog.addMessage("Compilation succeded", MessageListUI.NORMAL); + messageDialog.addMessage("", MessageList.NORMAL); + messageDialog.addMessage("Compilation succeded", MessageList.NORMAL); if (onSuccess != null) { onSuccess.actionPerformed(null); }