This commit is contained in:
fros4943 2008-02-12 15:03:22 +00:00
parent 6c8151b449
commit 773736a6ca

View File

@ -1,7 +1,7 @@
/* /*
* Copyright (c) 2006, Swedish Institute of Computer Science. All rights * Copyright (c) 2006, Swedish Institute of Computer Science. All rights
* reserved. * reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright notice,
@ -12,7 +12,7 @@
* Institute nor the names of its contributors may be used to endorse or promote * Institute nor the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written * products derived from this software without specific prior written
* permission. * permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND ANY * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@ -23,14 +23,14 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* $Id: MoteType.java,v 1.7 2007/05/10 17:00:03 fros4943 Exp $ * $Id: MoteType.java,v 1.8 2008/02/12 15:03:22 fros4943 Exp $
*/ */
package se.sics.cooja; package se.sics.cooja;
import java.awt.Container;
import java.util.Collection; import java.util.Collection;
import javax.swing.JFrame;
import javax.swing.JPanel; import javax.swing.JPanel;
import org.jdom.Element; import org.jdom.Element;
@ -42,24 +42,24 @@ import se.sics.cooja.dialogs.MessageList;
* mote of that type is initialized, which hardware peripherals each mote has * mote of that type is initialized, which hardware peripherals each mote has
* etc. * etc.
* Every simulated motes must belong to a mote type. * Every simulated motes must belong to a mote type.
* *
* A mote type may also hold the connection to an underlying simulation * A mote type may also hold the connection to an underlying simulation
* framework, such as a compiled Contiki system. * framework, such as a compiled Contiki system.
* *
* @author Fredrik Osterlind * @author Fredrik Osterlind
*/ */
public interface MoteType { public interface MoteType {
/** /**
* Returns the mote type description. * Returns the mote type description.
* *
* @return Description * @return Description
*/ */
public String getDescription(); public String getDescription();
/** /**
* Sets the mote type description. * Sets the mote type description.
* *
* @param description * @param description
* New description * New description
*/ */
@ -67,14 +67,14 @@ public interface MoteType {
/** /**
* Returns the mote type identifier. * Returns the mote type identifier.
* *
* @return Mote type identifier * @return Mote type identifier
*/ */
public String getIdentifier(); public String getIdentifier();
/** /**
* Sets the mote type identifier. * Sets the mote type identifier.
* *
* @param identifier * @param identifier
* New identifier * New identifier
*/ */
@ -82,21 +82,21 @@ public interface MoteType {
/** /**
* Returns a panel with interesting data for this mote type. * Returns a panel with interesting data for this mote type.
* *
* @return Mote type visualizer * @return Mote type visualizer
*/ */
public JPanel getTypeVisualizer(); public JPanel getTypeVisualizer();
/** /**
* Returns this mote type's project configuration. * Returns this mote type's project configuration.
* *
* @return Project configuration * @return Project configuration
*/ */
public ProjectConfig getConfig(); public ProjectConfig getConfig();
/** /**
* Generates a mote of this mote type. * Generates a mote of this mote type.
* *
* @param simulation * @param simulation
* Simulation that will contain mote * Simulation that will contain mote
* @return New mote * @return New mote
@ -108,25 +108,25 @@ public interface MoteType {
* called from the simulator when a new mote type is created. It may simply * called from the simulator when a new mote type is created. It may simply
* confirm that all settings are valid and return true, or display a dialog * confirm that all settings are valid and return true, or display a dialog
* allowing a user to manually configure the mote type. * allowing a user to manually configure the mote type.
* *
* This method need normally only be run once per mote type! * This method need normally only be run once per mote type!
* *
* @param parentFrame * @param parentContainer
* Parent frame or null * Parent container. May be null if not visualized.
* @param simulation * @param simulation
* Simulation holding (or that should hold) mote type * Simulation holding (or that should hold) mote type
* @param visAvailable * @param visAvailable
* True if this method is allowed to show a visualizer * True if this method is allowed to show a visualizer
* @return True if mote type has valid settings and is ready to be used * @return True if mote type has valid settings and is ready to be used
*/ */
public boolean configureAndInit(JFrame parentFrame, Simulation simulation, public boolean configureAndInit(Container parentContainer, Simulation simulation,
boolean visAvailable) throws MoteTypeCreationException; boolean visAvailable) throws MoteTypeCreationException;
/** /**
* Returns XML elements representing the current config of this mote type. * Returns XML elements representing the current config of this mote type.
* This is fetched by the simulator for example when saving a simulation * This is fetched by the simulator for example when saving a simulation
* configuration file. For example a Contiki base directory may be saved. * configuration file. For example a Contiki base directory may be saved.
* *
* @see #setConfigXML(Simulation, Collection, boolean) * @see #setConfigXML(Simulation, Collection, boolean)
* @return XML elements representing the current mote type's config * @return XML elements representing the current mote type's config
*/ */
@ -137,7 +137,7 @@ public interface MoteType {
* Observe that this method is responsible for restoring the configuration * Observe that this method is responsible for restoring the configuration
* depending on the given arguments. This may include recompiling and loading * depending on the given arguments. This may include recompiling and loading
* libraries. * libraries.
* *
* @see #getConfigXML() * @see #getConfigXML()
* @param simulation * @param simulation
* Simulation that will hold the mote type * Simulation that will hold the mote type