diff --git a/tools/cooja/java/se/sics/cooja/mantismote/MantisMote.java b/tools/cooja/java/se/sics/cooja/mantismote/MantisMote.java index d1bf70775..f745a193f 100644 --- a/tools/cooja/java/se/sics/cooja/mantismote/MantisMote.java +++ b/tools/cooja/java/se/sics/cooja/mantismote/MantisMote.java @@ -24,7 +24,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: MantisMote.java,v 1.1 2006/11/09 19:31:15 fros4943 Exp $ + * $Id: MantisMote.java,v 1.2 2007/01/09 10:02:16 fros4943 Exp $ */ package se.sics.cooja.mantismote; @@ -188,7 +188,7 @@ public class MantisMote implements Mote { } public boolean setConfigXML(Simulation simulation, - Collection configXML) { + Collection configXML, boolean visAvailable) { mySimulation = simulation; for (Element element : configXML) { @@ -201,7 +201,7 @@ public class MantisMote implements Mote { .getMoteInterfaces()); } else if (name.equals("interface_config")) { - Class moteInterfaceClass = GUI.currentGUI + Class moteInterfaceClass = simulation.getGUI() .tryLoadClass(this, MoteInterface.class, element.getText().trim()); if (moteInterfaceClass == null) { @@ -213,7 +213,7 @@ public class MantisMote implements Mote { MoteInterface moteInterface = myInterfaceHandler .getInterfaceOfType(moteInterfaceClass); if (moteInterface != null) - moteInterface.setConfigXML(element.getChildren()); + moteInterface.setConfigXML(element.getChildren(), visAvailable); else logger .warn("Can't restore configuration for non-existing interface: " diff --git a/tools/cooja/java/se/sics/cooja/mantismote/MantisMoteType.java b/tools/cooja/java/se/sics/cooja/mantismote/MantisMoteType.java index d273390ec..937588267 100644 --- a/tools/cooja/java/se/sics/cooja/mantismote/MantisMoteType.java +++ b/tools/cooja/java/se/sics/cooja/mantismote/MantisMoteType.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: MantisMoteType.java,v 1.1 2006/11/09 19:31:15 fros4943 Exp $ + * $Id: MantisMoteType.java,v 1.2 2007/01/09 10:02:16 fros4943 Exp $ */ package se.sics.cooja.mantismote; @@ -355,7 +355,8 @@ public class MantisMoteType implements MoteType { return new MantisMote(this, mySimulation); } - public boolean configureAndInit(JFrame parentFrame, Simulation simulation) { + public boolean configureAndInit(JFrame parentFrame, Simulation simulation, boolean visAvailable) { + if (!visAvailable) logger.fatal(">>>>>>> NOT IMPLEMENTED"); return MantisMoteTypeDialog.showDialog(parentFrame, simulation, this); } @@ -383,7 +384,7 @@ public class MantisMoteType implements MoteType { } public boolean setConfigXML(Simulation simulation, - Collection configXML) { + Collection configXML, boolean visAvailable) { mySimulation = simulation; for (Element element : configXML) { @@ -400,7 +401,7 @@ public class MantisMoteType implements MoteType { } } - boolean createdOK = configureAndInit(GUI.frame, simulation); + boolean createdOK = configureAndInit(GUI.frame, simulation, visAvailable); return createdOK; } diff --git a/tools/cooja/java/se/sics/cooja/mantismote/MantisMoteTypeDialog.java b/tools/cooja/java/se/sics/cooja/mantismote/MantisMoteTypeDialog.java index 33bd88d71..06e4d665d 100644 --- a/tools/cooja/java/se/sics/cooja/mantismote/MantisMoteTypeDialog.java +++ b/tools/cooja/java/se/sics/cooja/mantismote/MantisMoteTypeDialog.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: MantisMoteTypeDialog.java,v 1.1 2006/11/09 19:31:14 fros4943 Exp $ + * $Id: MantisMoteTypeDialog.java,v 1.2 2007/01/09 10:02:16 fros4943 Exp $ */ package se.sics.cooja.mantismote; @@ -156,12 +156,12 @@ public class MantisMoteTypeDialog extends JDialog { } // Load all mote interface classes - String[] moteInterfaces = GUI.currentGUI.getPlatformConfig().getStringArrayValue(MantisMoteType.class, "MOTE_INTERFACES"); + String[] moteInterfaces = simulation.getGUI().getPlatformConfig().getStringArrayValue(MantisMoteType.class, "MOTE_INTERFACES"); myDialog.moteInterfaceClasses = new Vector>(); for (String moteInterface : moteInterfaces) { try { Class newMoteInterfaceClass = - GUI.currentGUI.tryLoadClass(GUI.currentGUI, MoteInterface.class, moteInterface); + simulation.getGUI().tryLoadClass(simulation.getGUI(), MoteInterface.class, moteInterface); myDialog.moteInterfaceClasses.add(newMoteInterfaceClass); /*logger.info("Loaded Mantis mote interface: " + newMoteInterfaceClass);*/ } catch (Exception e) {