diff --git a/tools/cooja/java/se/sics/cooja/interfaces/Battery.java b/tools/cooja/java/se/sics/cooja/interfaces/Battery.java index eb66adbc4..1d631cd32 100644 --- a/tools/cooja/java/se/sics/cooja/interfaces/Battery.java +++ b/tools/cooja/java/se/sics/cooja/interfaces/Battery.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: Battery.java,v 1.3 2006/09/26 13:08:05 fros4943 Exp $ + * $Id: Battery.java,v 1.4 2007/01/09 10:02:44 fros4943 Exp $ */ package se.sics.cooja.interfaces; @@ -285,7 +285,7 @@ public class Battery extends MoteInterface implements PassiveMoteInterface { return config; } - public void setConfigXML(Collection configXML) { + public void setConfigXML(Collection configXML, boolean visAvailable) { for (Element element : configXML) { if (element.getName().equals("infinite")) { hasInfiniteEnergy = Boolean.parseBoolean(element.getText()); diff --git a/tools/cooja/java/se/sics/cooja/interfaces/Position.java b/tools/cooja/java/se/sics/cooja/interfaces/Position.java index c0bd536cb..bc4496c96 100644 --- a/tools/cooja/java/se/sics/cooja/interfaces/Position.java +++ b/tools/cooja/java/se/sics/cooja/interfaces/Position.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: Position.java,v 1.1 2006/08/21 12:12:59 fros4943 Exp $ + * $Id: Position.java,v 1.2 2007/01/09 10:02:44 fros4943 Exp $ */ package se.sics.cooja.interfaces; @@ -211,7 +211,7 @@ public class Position extends MoteInterface { return config; } - public void setConfigXML(Collection configXML) { + public void setConfigXML(Collection configXML, boolean visAvailable) { double x = 0, y = 0, z = 0; for (Element element : configXML) { diff --git a/tools/cooja/java/se/sics/cooja/motes/DisturberMote.java b/tools/cooja/java/se/sics/cooja/motes/DisturberMote.java index aee692bdb..1d5d0a109 100644 --- a/tools/cooja/java/se/sics/cooja/motes/DisturberMote.java +++ b/tools/cooja/java/se/sics/cooja/motes/DisturberMote.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: DisturberMote.java,v 1.1 2006/12/07 14:25:22 fros4943 Exp $ + * $Id: DisturberMote.java,v 1.2 2007/01/09 10:01:14 fros4943 Exp $ */ package se.sics.cooja.motes; @@ -190,7 +190,7 @@ public class DisturberMote implements Mote { } public boolean setConfigXML(Simulation simulation, - Collection configXML) { + Collection configXML, boolean visAvailable) { // Set initial configuration mySim = simulation; @@ -208,7 +208,7 @@ public class DisturberMote implements Mote { if (name.equals("motetype_identifier")) { myType = simulation.getMoteType(element.getText()); } else if (name.equals("interface_config")) { - Class moteInterfaceClass = GUI.currentGUI + Class moteInterfaceClass = simulation.getGUI() .tryLoadClass(this, MoteInterface.class, element.getText().trim()); if (moteInterfaceClass == null) { @@ -218,7 +218,7 @@ public class DisturberMote implements Mote { MoteInterface moteInterface = myInterfaceHandler .getInterfaceOfType(moteInterfaceClass); - moteInterface.setConfigXML(element.getChildren()); + moteInterface.setConfigXML(element.getChildren(), visAvailable); } } diff --git a/tools/cooja/java/se/sics/cooja/motes/DisturberMoteType.java b/tools/cooja/java/se/sics/cooja/motes/DisturberMoteType.java index 5ed3848a4..9ff9968d5 100644 --- a/tools/cooja/java/se/sics/cooja/motes/DisturberMoteType.java +++ b/tools/cooja/java/se/sics/cooja/motes/DisturberMoteType.java @@ -75,7 +75,7 @@ public class DisturberMoteType implements MoteType { return new DisturberMote(this, simulation); } - public boolean configureAndInit(JFrame parentFrame, Simulation simulation) { + public boolean configureAndInit(JFrame parentFrame, Simulation simulation, boolean visAvailable) { if (identifier == null) { // Create unique identifier @@ -225,7 +225,7 @@ public class DisturberMoteType implements MoteType { } public boolean setConfigXML(Simulation simulation, - Collection configXML) { + Collection configXML, boolean visAvailable) { for (Element element : configXML) { moteInterfaces = new Vector>(); /* TV */ mySimulation = simulation; /* TV */ @@ -237,7 +237,7 @@ public class DisturberMoteType implements MoteType { } else if (name.equals("description")) { description = element.getText(); } else if (name.equals("moteinterface")) { /* TV */ - Class moteInterfaceClass = GUI.currentGUI + Class moteInterfaceClass = simulation.getGUI() .tryLoadClass(this, MoteInterface.class, element.getText().trim()); if (moteInterfaceClass == null) { @@ -250,7 +250,7 @@ public class DisturberMoteType 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/motes/DisturberRadio.java b/tools/cooja/java/se/sics/cooja/motes/DisturberRadio.java index 4849b4b75..7fbf36e67 100644 --- a/tools/cooja/java/se/sics/cooja/motes/DisturberRadio.java +++ b/tools/cooja/java/se/sics/cooja/motes/DisturberRadio.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: DisturberRadio.java,v 1.1 2006/12/07 14:25:22 fros4943 Exp $ + * $Id: DisturberRadio.java,v 1.2 2007/01/09 10:01:14 fros4943 Exp $ */ package se.sics.cooja.motes; @@ -242,7 +242,7 @@ public class DisturberRadio extends Radio { return config; } - public void setConfigXML(Collection configXML) { + public void setConfigXML(Collection configXML, boolean visAvailable) { for (Element element : configXML) { String name = element.getName(); diff --git a/tools/cooja/java/se/sics/cooja/motes/DummyMote.java b/tools/cooja/java/se/sics/cooja/motes/DummyMote.java index 751d8c226..f2dc01a0e 100644 --- a/tools/cooja/java/se/sics/cooja/motes/DummyMote.java +++ b/tools/cooja/java/se/sics/cooja/motes/DummyMote.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: DummyMote.java,v 1.2 2006/09/26 13:08:05 fros4943 Exp $ + * $Id: DummyMote.java,v 1.3 2007/01/09 10:01:14 fros4943 Exp $ */ package se.sics.cooja.motes; @@ -183,7 +183,7 @@ public class DummyMote implements Mote { } public boolean setConfigXML(Simulation simulation, - Collection configXML) { + Collection configXML, boolean visAvailable) { mySim = simulation; myMemory = new SectionMoteMemory(new Properties()); myInterfaceHandler = new MoteInterfaceHandler(); @@ -195,7 +195,7 @@ public class DummyMote implements Mote { if (name.equals("motetype_identifier")) { myType = simulation.getMoteType(element.getText()); } else if (name.equals("interface_config")) { - Class moteInterfaceClass = GUI.currentGUI + Class moteInterfaceClass = simulation.getGUI() .tryLoadClass(this, MoteInterface.class, element.getText().trim()); if (moteInterfaceClass == null) { @@ -205,7 +205,7 @@ public class DummyMote implements Mote { MoteInterface moteInterface = myInterfaceHandler .getInterfaceOfType(moteInterfaceClass); - moteInterface.setConfigXML(element.getChildren()); + moteInterface.setConfigXML(element.getChildren(), visAvailable); } } diff --git a/tools/cooja/java/se/sics/cooja/motes/DummyMoteType.java b/tools/cooja/java/se/sics/cooja/motes/DummyMoteType.java index 99f4f13e7..6bd58a566 100644 --- a/tools/cooja/java/se/sics/cooja/motes/DummyMoteType.java +++ b/tools/cooja/java/se/sics/cooja/motes/DummyMoteType.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: DummyMoteType.java,v 1.1 2006/08/21 12:13:12 fros4943 Exp $ + * $Id: DummyMoteType.java,v 1.2 2007/01/09 10:01:14 fros4943 Exp $ */ package se.sics.cooja.motes; @@ -60,7 +60,7 @@ public class DummyMoteType implements MoteType { return new DummyMote(this, simulation); } - public boolean configureAndInit(JFrame parentFrame, Simulation simulation) { + public boolean configureAndInit(JFrame parentFrame, Simulation simulation, boolean visAvailable) { if (identifier == null) { // Create unique identifier @@ -138,7 +138,7 @@ public class DummyMoteType implements MoteType { return config; } - public boolean setConfigXML(Simulation simulation, Collection configXML) { + public boolean setConfigXML(Simulation simulation, Collection configXML, boolean visAvailable) { for (Element element : configXML) { String name = element.getName(); @@ -151,7 +151,7 @@ public class DummyMoteType implements MoteType { } } - boolean createdOK = configureAndInit(GUI.frame, simulation); + boolean createdOK = configureAndInit(GUI.frame, simulation, visAvailable); return createdOK; }