mirror of
https://github.com/oliverschmidt/contiki.git
synced 2025-02-26 16:29:23 +00:00
renamed variable
This commit is contained in:
parent
e64093c72f
commit
5c91174fd4
@ -24,7 +24,7 @@
|
|||||||
* (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: EventListener.java,v 1.6 2008/01/08 12:19:25 fros4943 Exp $
|
* $Id: EventListener.java,v 1.7 2008/02/07 10:47:56 fros4943 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.sics.cooja.plugins;
|
package se.sics.cooja.plugins;
|
||||||
@ -147,43 +147,43 @@ public class EventListener extends VisPlugin {
|
|||||||
mySimulation = simulationToControl;
|
mySimulation = simulationToControl;
|
||||||
myPlugin = this;
|
myPlugin = this;
|
||||||
|
|
||||||
// Create selectable interfaces list (only supports Contiki mote types)
|
/* Create selectable interfaces list (only supports Contiki mote types) */
|
||||||
Vector<Class<? extends MoteInterface>> allMoteTypes = new Vector<Class<? extends MoteInterface>>();
|
Vector<Class<? extends MoteInterface>> allInterfaces = new Vector<Class<? extends MoteInterface>>();
|
||||||
Vector<Class<? extends MoteInterface>> allMoteTypesDups = new Vector<Class<? extends MoteInterface>>();
|
Vector<Class<? extends MoteInterface>> allInterfacesDups = new Vector<Class<? extends MoteInterface>>();
|
||||||
|
|
||||||
// Add standard interfaces
|
// Add standard interfaces
|
||||||
allMoteTypesDups.add(Button.class);
|
allInterfacesDups.add(Button.class);
|
||||||
allMoteTypesDups.add(LED.class);
|
allInterfacesDups.add(LED.class);
|
||||||
allMoteTypesDups.add(Log.class);
|
allInterfacesDups.add(Log.class);
|
||||||
allMoteTypesDups.add(PIR.class);
|
allInterfacesDups.add(PIR.class);
|
||||||
allMoteTypesDups.add(Position.class);
|
allInterfacesDups.add(Position.class);
|
||||||
allMoteTypesDups.add(Radio.class);
|
allInterfacesDups.add(Radio.class);
|
||||||
|
|
||||||
for (MoteType moteType : simulationToControl.getMoteTypes()) {
|
for (MoteType moteType : simulationToControl.getMoteTypes()) {
|
||||||
if (moteType instanceof ContikiMoteType) {
|
if (moteType instanceof ContikiMoteType) {
|
||||||
allMoteTypesDups.addAll(((ContikiMoteType) moteType)
|
allInterfacesDups.addAll(((ContikiMoteType) moteType)
|
||||||
.getMoteInterfaces());
|
.getMoteInterfaces());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Class<? extends MoteInterface> moteTypeClass : allMoteTypesDups) {
|
for (Class<? extends MoteInterface> moteTypeClass : allInterfacesDups) {
|
||||||
if (!allMoteTypes.contains(moteTypeClass)) {
|
if (!allInterfaces.contains(moteTypeClass)) {
|
||||||
allMoteTypes.add(moteTypeClass);
|
allInterfaces.add(moteTypeClass);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
interfacePanel = new JPanel();
|
interfacePanel = new JPanel();
|
||||||
interfacePanel.setLayout(new BoxLayout(interfacePanel, BoxLayout.Y_AXIS));
|
interfacePanel.setLayout(new BoxLayout(interfacePanel, BoxLayout.Y_AXIS));
|
||||||
interfacePanel.setBorder(BorderFactory.createEmptyBorder(10, 5, 10, 5));
|
interfacePanel.setBorder(BorderFactory.createEmptyBorder(10, 5, 10, 5));
|
||||||
for (Class<? extends MoteInterface> moteTypeClass : allMoteTypes) {
|
for (Class<? extends MoteInterface> interfaceClass : allInterfaces) {
|
||||||
JCheckBox checkBox = new JCheckBox(GUI.getDescriptionOf(moteTypeClass),
|
JCheckBox checkBox = new JCheckBox(GUI.getDescriptionOf(interfaceClass),
|
||||||
false);
|
false);
|
||||||
checkBox.setToolTipText(moteTypeClass.getName());
|
checkBox.setToolTipText(interfaceClass.getName());
|
||||||
checkBox.putClientProperty("interface_class", moteTypeClass);
|
checkBox.putClientProperty("interface_class", interfaceClass);
|
||||||
checkBox.addActionListener(interfaceCheckBoxListener);
|
checkBox.addActionListener(interfaceCheckBoxListener);
|
||||||
|
|
||||||
interfacePanel.add(checkBox);
|
interfacePanel.add(checkBox);
|
||||||
}
|
}
|
||||||
if (allMoteTypes.isEmpty()) {
|
if (allInterfaces.isEmpty()) {
|
||||||
interfacePanel.add(new JLabel("No used interface classes detected"));
|
interfacePanel.add(new JLabel("No used interface classes detected"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user