Merge pull request #3 from nfi/cooja-messagelist-ui

Fixed more MessageListUI to respect visualized in Cooja
This commit is contained in:
Joakim Eriksson 2016-12-14 10:24:37 +01:00 committed by GitHub
commit fb0607f0f8
3 changed files with 11 additions and 13 deletions

View file

@ -63,8 +63,6 @@ import org.contikios.cooja.avrmote.interfaces.MicaZLED;
import org.contikios.cooja.avrmote.interfaces.MicaZRadio; import org.contikios.cooja.avrmote.interfaces.MicaZRadio;
import org.contikios.cooja.dialogs.CompileContiki; import org.contikios.cooja.dialogs.CompileContiki;
import org.contikios.cooja.dialogs.MessageList; 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.dialogs.MessageContainer;
import org.contikios.cooja.interfaces.Mote2MoteRelations; import org.contikios.cooja.interfaces.Mote2MoteRelations;
import org.contikios.cooja.interfaces.MoteAttributes; import org.contikios.cooja.interfaces.MoteAttributes;
@ -366,7 +364,7 @@ public class MicaZMoteType implements MoteType {
throw new MoteTypeCreationException("No identifier"); throw new MoteTypeCreationException("No identifier");
} }
final MessageList compilationOutput = visAvailable ? new MessageListUI() : new MessageListText(); final MessageList compilationOutput = MessageContainer.createMessageList(visAvailable);
if (getCompileCommands() != null) { if (getCompileCommands() != null) {
/* Handle multiple compilation commands one by one */ /* Handle multiple compilation commands one by one */

View file

@ -118,7 +118,7 @@ public abstract class AbstractMspMoteType extends MspMoteType {
throw new MoteTypeCreationException("No identifier"); throw new MoteTypeCreationException("No identifier");
} }
final MessageList compilationOutput = visAvailable ? new MessageListUI() : new MessageListText(); final MessageList compilationOutput = MessageContainer.createMessageList(visAvailable);
if (getCompileCommands() != null) { if (getCompileCommands() != null) {
/* Handle multiple compilation commands one by one */ /* Handle multiple compilation commands one by one */

View file

@ -127,7 +127,7 @@ public class CompileContiki {
/* TODO Fix me */ /* TODO Fix me */
final MessageList messageDialog; final MessageList messageDialog;
if (compilationOutput == null) { if (compilationOutput == null) {
messageDialog = new MessageListUI(); messageDialog = MessageContainer.createMessageList(true);
} else { } else {
messageDialog = compilationOutput; messageDialog = compilationOutput;
} }
@ -138,8 +138,8 @@ public class CompileContiki {
cmd += c + " "; cmd += c + " ";
} }
logger.info("> " + cmd); logger.info("> " + cmd);
messageDialog.addMessage("", MessageListUI.NORMAL); messageDialog.addMessage("", MessageList.NORMAL);
messageDialog.addMessage("> " + cmd, MessageListUI.NORMAL); messageDialog.addMessage("> " + cmd, MessageList.NORMAL);
} }
final Process compileProcess; final Process compileProcess;
@ -170,7 +170,7 @@ public class CompileContiki {
String readLine; String readLine;
while ((readLine = processNormal.readLine()) != null) { while ((readLine = processNormal.readLine()) != null) {
if (messageDialog != null) { if (messageDialog != null) {
messageDialog.addMessage(readLine, MessageListUI.NORMAL); messageDialog.addMessage(readLine, MessageList.NORMAL);
} }
} }
} catch (IOException e) { } catch (IOException e) {
@ -203,7 +203,7 @@ public class CompileContiki {
compileProcess.waitFor(); compileProcess.waitFor();
} catch (Exception e) { } catch (Exception e) {
messageDialog.addMessage(e.getMessage(), MessageList.ERROR); messageDialog.addMessage(e.getMessage(), MessageList.ERROR);
syncException.setCompilationOutput(new MessageListUI()); syncException.setCompilationOutput(MessageContainer.createMessageList(true));
syncException.fillInStackTrace(); syncException.fillInStackTrace();
return; return;
} }
@ -214,7 +214,7 @@ public class CompileContiki {
if (onFailure != null) { if (onFailure != null) {
onFailure.actionPerformed(null); onFailure.actionPerformed(null);
} }
syncException.setCompilationOutput(new MessageListUI()); syncException.setCompilationOutput(MessageContainer.createMessageList(true));
syncException.fillInStackTrace(); syncException.fillInStackTrace();
return; return;
} }
@ -232,13 +232,13 @@ public class CompileContiki {
if (onFailure != null) { if (onFailure != null) {
onFailure.actionPerformed(null); onFailure.actionPerformed(null);
} }
syncException.setCompilationOutput(new MessageListUI()); syncException.setCompilationOutput(MessageContainer.createMessageList(true));
syncException.fillInStackTrace(); syncException.fillInStackTrace();
return; return;
} }
messageDialog.addMessage("", MessageListUI.NORMAL); messageDialog.addMessage("", MessageList.NORMAL);
messageDialog.addMessage("Compilation succeded", MessageListUI.NORMAL); messageDialog.addMessage("Compilation succeded", MessageList.NORMAL);
if (onSuccess != null) { if (onSuccess != null) {
onSuccess.actionPerformed(null); onSuccess.actionPerformed(null);
} }