diff --git a/tools/cooja/apps/avrora/src/se/sics/cooja/avrmote/MicaZMoteType.java b/tools/cooja/apps/avrora/src/se/sics/cooja/avrmote/MicaZMoteType.java index 88030e895..afbafb5b1 100644 --- a/tools/cooja/apps/avrora/src/se/sics/cooja/avrmote/MicaZMoteType.java +++ b/tools/cooja/apps/avrora/src/se/sics/cooja/avrmote/MicaZMoteType.java @@ -37,6 +37,7 @@ import java.awt.Dimension; import java.io.File; import java.util.ArrayList; import java.util.Collection; + import javax.swing.BorderFactory; import javax.swing.Box; import javax.swing.BoxLayout; @@ -44,8 +45,10 @@ import javax.swing.Icon; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextArea; + import org.apache.log4j.Logger; import org.jdom.Element; + import se.sics.cooja.AbstractionLevelDescription; import se.sics.cooja.ClassDescription; import se.sics.cooja.GUI; @@ -68,10 +71,10 @@ import se.sics.cooja.interfaces.Position; /** * AVR-based MicaZ mote types emulated in Avrora. - * + * * @author Joakim Eriksson, Fredrik Osterlind */ -@ClassDescription("MicaZ mote...") +@ClassDescription("MicaZ mote") @AbstractionLevelDescription("Emulated level") public class MicaZMoteType implements MoteType { private static Logger logger = Logger.getLogger(MicaZMoteType.class); diff --git a/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/ESBMoteType.java b/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/ESBMoteType.java index 98585648a..e04bca85f 100644 --- a/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/ESBMoteType.java +++ b/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/ESBMoteType.java @@ -31,13 +31,25 @@ package se.sics.cooja.mspmote; -import java.awt.*; +import java.awt.Container; +import java.awt.Image; +import java.awt.MediaTracker; +import java.awt.Toolkit; import java.io.File; import java.net.URL; -import javax.swing.*; + +import javax.swing.Icon; +import javax.swing.ImageIcon; +import javax.swing.JOptionPane; import org.apache.log4j.Logger; -import se.sics.cooja.*; + +import se.sics.cooja.AbstractionLevelDescription; +import se.sics.cooja.ClassDescription; +import se.sics.cooja.GUI; +import se.sics.cooja.MoteInterface; +import se.sics.cooja.MoteType; +import se.sics.cooja.Simulation; import se.sics.cooja.dialogs.CompileContiki; import se.sics.cooja.dialogs.MessageList; import se.sics.cooja.dialogs.MessageList.MessageContainer; @@ -53,7 +65,7 @@ import se.sics.cooja.mspmote.interfaces.MspMoteID; import se.sics.cooja.mspmote.interfaces.MspSerial; import se.sics.cooja.mspmote.interfaces.TR1001Radio; -@ClassDescription("ESB mote...") +@ClassDescription("ESB mote") @AbstractionLevelDescription("Emulated level") public class ESBMoteType extends MspMoteType { private static Logger logger = Logger.getLogger(ESBMoteType.class); @@ -209,7 +221,7 @@ public class ESBMoteType extends MspMoteType { return new File(parentDir, sourceNoExtension + ".esb"); } - + protected String getTargetName() { return "esb"; } diff --git a/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/Exp5438MoteType.java b/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/Exp5438MoteType.java index 1fb93492c..2cb52bffa 100644 --- a/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/Exp5438MoteType.java +++ b/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/Exp5438MoteType.java @@ -56,13 +56,13 @@ import se.sics.cooja.interfaces.MoteAttributes; import se.sics.cooja.interfaces.Position; import se.sics.cooja.interfaces.RimeAddress; import se.sics.cooja.mspmote.interfaces.Exp5438LED; +import se.sics.cooja.mspmote.interfaces.Msp802154Radio; import se.sics.cooja.mspmote.interfaces.MspClock; import se.sics.cooja.mspmote.interfaces.MspDebugOutput; import se.sics.cooja.mspmote.interfaces.MspMoteID; -import se.sics.cooja.mspmote.interfaces.Msp802154Radio; import se.sics.cooja.mspmote.interfaces.UsciA1Serial; -@ClassDescription("EXP430F5438 mote...") +@ClassDescription("EXP430F5438 mote") @AbstractionLevelDescription("Emulated level") public class Exp5438MoteType extends MspMoteType { private static Logger logger = Logger.getLogger(Exp5438MoteType.class); @@ -190,7 +190,7 @@ public class Exp5438MoteType extends MspMoteType { MspMoteID.class, Msp802154Radio.class, UsciA1Serial.class, - Exp5438LED.class, + Exp5438LED.class, /*Exp5438LCD.class,*/ /* TODO */ MspDebugOutput.class }; @@ -202,7 +202,7 @@ public class Exp5438MoteType extends MspMoteType { return new File(parentDir, sourceNoExtension + ".exp5438"); } - + protected String getTargetName() { return "exp5438"; } diff --git a/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/SkyMoteType.java b/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/SkyMoteType.java index 9640ecb58..6afdae7d8 100644 --- a/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/SkyMoteType.java +++ b/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/SkyMoteType.java @@ -58,18 +58,18 @@ import se.sics.cooja.interfaces.Mote2MoteRelations; import se.sics.cooja.interfaces.MoteAttributes; import se.sics.cooja.interfaces.Position; import se.sics.cooja.interfaces.RimeAddress; +import se.sics.cooja.mspmote.interfaces.Msp802154Radio; import se.sics.cooja.mspmote.interfaces.MspClock; import se.sics.cooja.mspmote.interfaces.MspDebugOutput; import se.sics.cooja.mspmote.interfaces.MspMoteID; +import se.sics.cooja.mspmote.interfaces.MspSerial; import se.sics.cooja.mspmote.interfaces.SkyButton; -import se.sics.cooja.mspmote.interfaces.Msp802154Radio; import se.sics.cooja.mspmote.interfaces.SkyCoffeeFilesystem; import se.sics.cooja.mspmote.interfaces.SkyFlash; import se.sics.cooja.mspmote.interfaces.SkyLED; -import se.sics.cooja.mspmote.interfaces.MspSerial; import se.sics.cooja.mspmote.interfaces.SkyTemperature; -@ClassDescription("Sky mote...") +@ClassDescription("Sky mote") @AbstractionLevelDescription("Emulated level") public class SkyMoteType extends MspMoteType { private static Logger logger = Logger.getLogger(SkyMoteType.class); @@ -229,7 +229,7 @@ public class SkyMoteType extends MspMoteType { return new File(parentDir, sourceNoExtension + ".sky"); } - + protected String getTargetName() { return "sky"; } diff --git a/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/TyndallMoteType.java b/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/TyndallMoteType.java index 2a7b399e8..7bac0f5ac 100644 --- a/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/TyndallMoteType.java +++ b/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/TyndallMoteType.java @@ -55,14 +55,14 @@ import se.sics.cooja.interfaces.Mote2MoteRelations; import se.sics.cooja.interfaces.MoteAttributes; import se.sics.cooja.interfaces.Position; import se.sics.cooja.interfaces.RimeAddress; +import se.sics.cooja.mspmote.interfaces.Msp802154Radio; import se.sics.cooja.mspmote.interfaces.MspClock; import se.sics.cooja.mspmote.interfaces.MspDebugOutput; import se.sics.cooja.mspmote.interfaces.MspMoteID; -import se.sics.cooja.mspmote.interfaces.Msp802154Radio; import se.sics.cooja.mspmote.interfaces.TyndallLED; import se.sics.cooja.mspmote.interfaces.UsciA0Serial; -@ClassDescription("Tyndall mote...") +@ClassDescription("Tyndall mote") @AbstractionLevelDescription("Emulated level") public class TyndallMoteType extends MspMoteType { private static Logger logger = Logger.getLogger(TyndallMoteType.class); @@ -201,7 +201,7 @@ public class TyndallMoteType extends MspMoteType { return new File(parentDir, sourceNoExtension + ".tyndall"); } - + protected String getTargetName() { return "tyndall"; } diff --git a/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/WismoteMoteType.java b/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/WismoteMoteType.java index 0d4fe72e5..61659d1f2 100644 --- a/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/WismoteMoteType.java +++ b/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/WismoteMoteType.java @@ -45,7 +45,7 @@ import se.sics.cooja.mspmote.interfaces.MspDefaultSerial; import se.sics.cooja.mspmote.interfaces.MspLED; import se.sics.cooja.mspmote.interfaces.MspMoteID; -@ClassDescription("Wismote mote...") +@ClassDescription("Wismote mote") @AbstractionLevelDescription("Emulated level") public class WismoteMoteType extends AbstractMspMoteType { diff --git a/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/Z1MoteType.java b/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/Z1MoteType.java index b5a7fdef5..7e1ab8510 100644 --- a/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/Z1MoteType.java +++ b/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/Z1MoteType.java @@ -46,7 +46,7 @@ import se.sics.cooja.mspmote.interfaces.MspDefaultSerial; import se.sics.cooja.mspmote.interfaces.MspLED; import se.sics.cooja.mspmote.interfaces.MspMoteID; -@ClassDescription("Z1 mote...") +@ClassDescription("Z1 mote") @AbstractionLevelDescription("Emulated level") public class Z1MoteType extends AbstractMspMoteType { diff --git a/tools/cooja/apps/powertracker/java/PowerTracker.java b/tools/cooja/apps/powertracker/java/PowerTracker.java index 2ac9f69e1..f67df3baa 100644 --- a/tools/cooja/apps/powertracker/java/PowerTracker.java +++ b/tools/cooja/apps/powertracker/java/PowerTracker.java @@ -69,7 +69,7 @@ import se.sics.cooja.interfaces.Radio; * * @author Fredrik Osterlind, Adam Dunkels */ -@ClassDescription("Mote radio duty cycle...") +@ClassDescription("Mote radio duty cycle") @PluginType(PluginType.SIM_PLUGIN) public class PowerTracker extends VisPlugin { private static Logger logger = Logger.getLogger(PowerTracker.class); diff --git a/tools/cooja/java/se/sics/cooja/GUI.java b/tools/cooja/java/se/sics/cooja/GUI.java index bd0985e17..f23b3dce0 100644 --- a/tools/cooja/java/se/sics/cooja/GUI.java +++ b/tools/cooja/java/se/sics/cooja/GUI.java @@ -829,7 +829,7 @@ public class GUI extends Observable { } String description = GUI.getDescriptionOf(moteTypeClass); - menuItem = new JMenuItem(description); + menuItem = new JMenuItem(description + "..."); menuItem.setActionCommand("create mote type"); menuItem.putClientProperty("class", moteTypeClass); /* menuItem.setToolTipText(abstractionLevelDescription);*/ diff --git a/tools/cooja/java/se/sics/cooja/contikimote/ContikiMoteType.java b/tools/cooja/java/se/sics/cooja/contikimote/ContikiMoteType.java index 7c59a81f4..bc9358bfe 100644 --- a/tools/cooja/java/se/sics/cooja/contikimote/ContikiMoteType.java +++ b/tools/cooja/java/se/sics/cooja/contikimote/ContikiMoteType.java @@ -90,7 +90,7 @@ import se.sics.cooja.util.StringUtils; * * @author Fredrik Osterlind */ -@ClassDescription("Cooja mote...") +@ClassDescription("Cooja mote") @AbstractionLevelDescription("OS level") public class ContikiMoteType implements MoteType { private static Logger logger = Logger.getLogger(ContikiMoteType.class); diff --git a/tools/cooja/java/se/sics/cooja/motes/ImportAppMoteType.java b/tools/cooja/java/se/sics/cooja/motes/ImportAppMoteType.java index bc850f624..98a0f22f3 100644 --- a/tools/cooja/java/se/sics/cooja/motes/ImportAppMoteType.java +++ b/tools/cooja/java/se/sics/cooja/motes/ImportAppMoteType.java @@ -40,7 +40,9 @@ import java.net.URL; import java.net.URLClassLoader; import java.util.ArrayList; import java.util.Collection; + import org.jdom.Element; + import se.sics.cooja.AbstractionLevelDescription; import se.sics.cooja.ClassDescription; import se.sics.cooja.Mote; @@ -52,7 +54,7 @@ import se.sics.cooja.util.ArrayUtils; /** * @author Fredrik Osterlind */ -@ClassDescription("Import Java mote...") +@ClassDescription("Import Java mote") @AbstractionLevelDescription("Application level") public class ImportAppMoteType extends AbstractApplicationMoteType { @@ -109,7 +111,7 @@ public class ImportAppMoteType extends AbstractApplicationMoteType { } public boolean configureAndInit(Container parentContainer, - Simulation simulation, boolean visAvailable) + Simulation simulation, boolean visAvailable) throws MoteTypeCreationException { this.simulation = simulation; @@ -256,7 +258,7 @@ public class ImportAppMoteType extends AbstractApplicationMoteType { public boolean isTestSubclass(Class type) { return type.isAssignableFrom(testClass); } - + public Class getTestClass() { return testClass; } diff --git a/tools/cooja/java/se/sics/cooja/plugins/BufferListener.java b/tools/cooja/java/se/sics/cooja/plugins/BufferListener.java index 794d0a0c9..6508da8ba 100644 --- a/tools/cooja/java/se/sics/cooja/plugins/BufferListener.java +++ b/tools/cooja/java/se/sics/cooja/plugins/BufferListener.java @@ -107,7 +107,7 @@ import se.sics.cooja.util.StringUtils; /** * @author Fredrik Osterlind, Niclas Finne */ -@ClassDescription("Buffer view...") +@ClassDescription("Buffer view") @PluginType(PluginType.SIM_PLUGIN) public class BufferListener extends VisPlugin { private static final long serialVersionUID = 1L; @@ -132,7 +132,7 @@ public class BufferListener extends VisPlugin { final static int MAX_BUFFER_SIZE = 128; - private static ArrayList> bufferParsers = + private static ArrayList> bufferParsers = new ArrayList>(); static { registerBufferParser(ByteArrayParser.class); @@ -148,7 +148,7 @@ public class BufferListener extends VisPlugin { /* TODO Hide identical lines? */ - private static ArrayList> bufferTypes = + private static ArrayList> bufferTypes = new ArrayList>(); static { registerBufferType(PacketbufBuffer.class); @@ -787,7 +787,7 @@ public class BufferListener extends VisPlugin { private void updateTitle() { if (buffer != null) { String status = buffer.getStatusString(); - setTitle("Buffer Listener - " + + setTitle("Buffer Listener - " + ((status!=null)?status:GUI.getDescriptionOf(buffer)) + " " + "- " + memoryMonitors.size() + " buffers on " + motes.size() + " motes"); } @@ -872,7 +872,7 @@ public class BufferListener extends VisPlugin { repaintTimeColumn(); } else if ("parser".equals(name)) { String parserClassname = element.getText(); - Class parserClass = + Class parserClass = simulation.getGUI().tryLoadClass(this, Parser.class, parserClassname); if (parserClass == null) { logger.warn("Could not create buffer parser: could not find class: " + parserClassname); @@ -960,7 +960,7 @@ public class BufferListener extends VisPlugin { return; } } - }); + }); } public static class BufferAccess { @@ -1271,7 +1271,7 @@ public class BufferListener extends VisPlugin { @SuppressWarnings("unchecked") public void actionPerformed(ActionEvent e) { Class bpClass = - (Class) + (Class) ((JMenuItem) e.getSource()).getClientProperty("CLASS"); setParser(bpClass); } @@ -1291,7 +1291,7 @@ public class BufferListener extends VisPlugin { @SuppressWarnings("unchecked") public void actionPerformed(ActionEvent e) { Class btClass = - (Class) + (Class) ((JMenuItem) e.getSource()).getClientProperty("CLASS"); Buffer b = createBufferInstance(btClass); @@ -1610,7 +1610,7 @@ public class BufferListener extends VisPlugin { public static class PrintableCharactersParser extends StringParser { public String parseString(BufferAccess ba) { /* TODO Diff? */ - return new String(ba.mem).replaceAll("[^\\p{Print}]", ""); + return new String(ba.mem).replaceAll("[^\\p{Print}]", ""); } } @@ -1692,7 +1692,7 @@ public class BufferListener extends VisPlugin { if (diff != null && diff[x]) { red = true; } - int v = (int)0xff&ba.mem[x]; + int v = 0xff&ba.mem[x]; int h = Math.min(v/16, 15); /* crop */ if (red) { g.setColor(Color.RED); diff --git a/tools/cooja/java/se/sics/cooja/plugins/EventListener.java b/tools/cooja/java/se/sics/cooja/plugins/EventListener.java index 8fec46392..b1919470f 100644 --- a/tools/cooja/java/se/sics/cooja/plugins/EventListener.java +++ b/tools/cooja/java/se/sics/cooja/plugins/EventListener.java @@ -30,16 +30,42 @@ package se.sics.cooja.plugins; import java.awt.Component; -import java.awt.event.*; -import java.util.*; -import javax.swing.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.Collection; +import java.util.Observable; +import java.util.Observer; +import java.util.Vector; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.BorderFactory; +import javax.swing.BoxLayout; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.SwingUtilities; + import org.apache.log4j.Logger; import org.jdom.Element; -import se.sics.cooja.*; -import se.sics.cooja.GUI.PluginConstructionException; +import se.sics.cooja.ClassDescription; +import se.sics.cooja.GUI; +import se.sics.cooja.Mote; +import se.sics.cooja.MoteInterface; +import se.sics.cooja.MoteType; +import se.sics.cooja.PluginType; +import se.sics.cooja.Simulation; +import se.sics.cooja.VisPlugin; import se.sics.cooja.contikimote.ContikiMoteType; -import se.sics.cooja.interfaces.*; +import se.sics.cooja.interfaces.Button; +import se.sics.cooja.interfaces.LED; +import se.sics.cooja.interfaces.Log; +import se.sics.cooja.interfaces.PIR; +import se.sics.cooja.interfaces.Position; +import se.sics.cooja.interfaces.Radio; /** * Allows a user to observe several different parts of the simulator, stopping a @@ -47,7 +73,7 @@ import se.sics.cooja.interfaces.*; * * @author Fredrik Osterlind */ -@ClassDescription("Breakpoints...") +@ClassDescription("Breakpoints") @PluginType(PluginType.SIM_PLUGIN) public class EventListener extends VisPlugin { private static final long serialVersionUID = 1L; @@ -113,7 +139,7 @@ public class EventListener extends VisPlugin { + myParent.mySimulation.getSimulationTime(), new AbstractAction( "View interface visualizer") { public void actionPerformed(ActionEvent e) { - MoteInterfaceViewer plugin = + MoteInterfaceViewer plugin = (MoteInterfaceViewer) mySimulation.getGUI().tryStartPlugin( MoteInterfaceViewer.class, mySimulation.getGUI(), mySimulation, myMote); plugin.setSelectedInterface(GUI.getDescriptionOf(moteInterface.getClass())); diff --git a/tools/cooja/java/se/sics/cooja/plugins/LogListener.java b/tools/cooja/java/se/sics/cooja/plugins/LogListener.java index 4813e33d5..d5c2db387 100644 --- a/tools/cooja/java/se/sics/cooja/plugins/LogListener.java +++ b/tools/cooja/java/se/sics/cooja/plugins/LogListener.java @@ -103,7 +103,7 @@ import se.sics.cooja.util.ArrayQueue; * * @author Fredrik Osterlind, Niclas Finne */ -@ClassDescription("Mote output...") +@ClassDescription("Mote output") @PluginType(PluginType.SIM_STANDARD_PLUGIN) public class LogListener extends VisPlugin implements HasQuickHelp { private static final long serialVersionUID = 3294595371354857261L; @@ -132,7 +132,7 @@ public class LogListener extends VisPlugin implements HasQuickHelp { private ArrayQueue logs = new ArrayQueue(); private Simulation simulation; - + private JTextField filterTextField = null; private JLabel filterLabel = new JLabel("Filter: "); private Color filterTextFieldBackground; @@ -208,18 +208,18 @@ public class LogListener extends VisPlugin implements HasQuickHelp { menuBar.add(editMenu); menuBar.add(showMenu); this.setJMenuBar(menuBar); - + editMenu.add(new JMenuItem(copyAllAction)); editMenu.add(new JMenuItem(copyAllMessagesAction)); editMenu.add(new JMenuItem(copyAction)); editMenu.addSeparator(); editMenu.add(new JMenuItem(clearAction)); - - + + fileMenu.add(new JMenuItem(saveAction)); appendCheckBox = new JCheckBoxMenuItem(appendAction); fileMenu.add(appendCheckBox); - + colorCheckbox = new JCheckBoxMenuItem("Mote-specific coloring"); showMenu.add(colorCheckbox); colorCheckbox.addActionListener(new ActionListener() { @@ -400,7 +400,7 @@ public class LogListener extends VisPlugin implements HasQuickHelp { adjuster.packColumns(); /* Popup menu */ - + JPopupMenu popupMenu = new JPopupMenu(); /* JMenu copyClipboard = new JMenu("Copy to clipboard"); @@ -543,7 +543,7 @@ public class LogListener extends VisPlugin implements HasQuickHelp { updateTitle(); pack(); - + /* XXX HACK: here we set the position and size of the window when it appears on a blank simulation screen. */ this.setLocation(400, 160); this.setSize(gui.getDesktopPane().getWidth() - 400, 240); diff --git a/tools/cooja/java/se/sics/cooja/plugins/Notes.java b/tools/cooja/java/se/sics/cooja/plugins/Notes.java index 942e10e22..3d131eaa6 100644 --- a/tools/cooja/java/se/sics/cooja/plugins/Notes.java +++ b/tools/cooja/java/se/sics/cooja/plugins/Notes.java @@ -56,7 +56,7 @@ import se.sics.cooja.PluginType; import se.sics.cooja.Simulation; import se.sics.cooja.VisPlugin; -@ClassDescription("Notes...") +@ClassDescription("Notes") @PluginType(PluginType.SIM_STANDARD_PLUGIN) public class Notes extends VisPlugin { private static final long serialVersionUID = 1L; @@ -85,7 +85,7 @@ public class Notes extends VisPlugin { public void mousePressed(MouseEvent e) { if (e.isPopupTrigger()) { popup.show(Notes.this, e.getX(), e.getY()); - } + } } public void mouseReleased(MouseEvent e) { if (e.isPopupTrigger()) { @@ -109,11 +109,11 @@ public class Notes extends VisPlugin { public String getNotes() { return notes.getText(); } - + public void setNotes(String text) { this.notes.setText(text); } - + private void setDecorationsVisible(boolean visible) { if (!(Notes.this.getUI() instanceof BasicInternalFrameUI)) { return; @@ -124,7 +124,7 @@ public class Notes extends VisPlugin { ui.getNorthPane().setPreferredSize(null); } else { ui.getNorthPane().setPreferredSize(new Dimension(0,0)); - } + } Notes.this.revalidate(); SwingUtilities.invokeLater(new Runnable() { @@ -135,7 +135,7 @@ public class Notes extends VisPlugin { decorationsVisible = visible; } - + public Collection getConfigXML() { ArrayList config = new ArrayList(); Element element; diff --git a/tools/cooja/java/se/sics/cooja/plugins/RadioLogger.java b/tools/cooja/java/se/sics/cooja/plugins/RadioLogger.java index c5cd4f345..421159c6e 100644 --- a/tools/cooja/java/se/sics/cooja/plugins/RadioLogger.java +++ b/tools/cooja/java/se/sics/cooja/plugins/RadioLogger.java @@ -102,8 +102,8 @@ import se.sics.cooja.util.StringUtils; * * @author Fredrik Osterlind */ -@ClassDescription("Radio messages...") -@PluginType(PluginType.SIM_PLUGIN) +@ClassDescription("Radio messages") +@PluginType(PluginType.SIM_PLUGIN) public class RadioLogger extends VisPlugin { private static Logger logger = Logger.getLogger(RadioLogger.class); private static final long serialVersionUID = -6927091711697081353L; @@ -115,7 +115,7 @@ public class RadioLogger extends VisPlugin { private JSplitPane splitPane; private JTextPane verboseBox = null; - + private final static String[] COLUMN_NAMES = { "Time", "From", @@ -139,7 +139,7 @@ public class RadioLogger extends VisPlugin { public RadioLogger(final Simulation simulationToControl, final GUI gui) { super("Radio messages", gui); setLayout(new BorderLayout()); - + simulation = simulationToControl; radioMedium = simulation.getRadioMedium(); @@ -149,14 +149,14 @@ public class RadioLogger extends VisPlugin { JMenu editMenu = new JMenu("Edit"); JMenu analyzerMenu = new JMenu("Analyzer"); JMenu payloadMenu = new JMenu("Payload"); - + menuBar.add(fileMenu); menuBar.add(editMenu); menuBar.add(analyzerMenu); menuBar.add(payloadMenu); - + this.setJMenuBar(menuBar); - + ArrayList lowpanAnalyzers = new ArrayList(); lowpanAnalyzers.add(new IEEE802154Analyzer(false)); lowpanAnalyzers.add(new IPHCPacketAnalyzer()); @@ -297,7 +297,7 @@ public class RadioLogger extends VisPlugin { public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_SPACE) { showInAllAction.actionPerformed(null); - } else if (e.getKeyCode() == KeyEvent.VK_F && + } else if (e.getKeyCode() == KeyEvent.VK_F && (e.getModifiers() & KeyEvent.CTRL_MASK) != 0) { searchField.setVisible(true); searchField.requestFocus(); @@ -333,14 +333,14 @@ public class RadioLogger extends VisPlugin { editMenu.add(new JMenuItem(copyAction)); editMenu.add(new JSeparator()); editMenu.add(new JMenuItem(clearAction)); - + payloadMenu.add(new JMenuItem(aliasAction)); - + fileMenu.add(new JMenuItem(saveAction)); - + JPopupMenu popupMenu = new JPopupMenu(); - + JMenu focusMenu = new JMenu("Show in"); focusMenu.add(new JMenuItem(showInAllAction)); focusMenu.addSeparator(); @@ -349,7 +349,7 @@ public class RadioLogger extends VisPlugin { popupMenu.add(focusMenu); //a group of radio button menu items - + ButtonGroup group = new ButtonGroup(); JRadioButtonMenuItem rbMenuItem = new JRadioButtonMenuItem( createAnalyzerAction("No Analyzer", "none", null, true)); @@ -366,7 +366,7 @@ public class RadioLogger extends VisPlugin { group.add(rbMenuItem); analyzerMenu.add(rbMenuItem); - + /* Load additional analyzers specified by projects (cooja.config) */ String[] projectAnalyzerSuites = gui.getProjectConfig().getStringArrayValue(RadioLogger.class, "ANALYZERS"); @@ -389,17 +389,17 @@ public class RadioLogger extends VisPlugin { } } } - + dataTable.setComponentPopupMenu(popupMenu); dataTable.setFillsViewportHeight(true); verboseBox = new JTextPane(); - verboseBox.setContentType("text/html"); + verboseBox.setContentType("text/html"); verboseBox.setEditable(false); verboseBox.setComponentPopupMenu(popupMenu); /* Search text field */ - searchField.setVisible(false); + searchField.setVisible(false); searchField.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_ENTER) { @@ -413,14 +413,14 @@ public class RadioLogger extends VisPlugin { } } }); - + splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, new JScrollPane(dataTable), new JScrollPane(verboseBox)); splitPane.setOneTouchExpandable(true); splitPane.setDividerLocation(150); add(BorderLayout.NORTH, searchField); add(BorderLayout.CENTER, splitPane); - + TableColumnAdjuster adjuster = new TableColumnAdjuster(dataTable); adjuster.setDynamicAdjustment(true); adjuster.packColumns(); @@ -455,7 +455,7 @@ public class RadioLogger extends VisPlugin { dataTable.scrollRectToVisible(dataTable.getCellRect(dataTable.getRowCount() - 1, 0, true)); } setTitle("Radio messages: " + dataTable.getRowCount() + " messages seen"); - } + } }); } }); @@ -476,7 +476,7 @@ public class RadioLogger extends VisPlugin { if (row < 0) { row = 0; } - + if (!reverse) { row++; } else { @@ -502,10 +502,10 @@ public class RadioLogger extends VisPlugin { } searchField.setBackground(Color.RED); } - + /** * Selects a logged radio packet close to the given time. - * + * * @param time Start time */ public void trySelectTime(final long time) { @@ -520,9 +520,9 @@ public class RadioLogger extends VisPlugin { return; } } - }); + }); } - + private void prepareDataString(RadioConnectionLog conn) { byte[] data; if (conn.packet == null) { @@ -564,7 +564,7 @@ public class RadioLogger extends VisPlugin { conn.data = data.length + ": 0x" + StringUtils.toHex(data, 4); } } - + private boolean analyzePacket(PacketAnalyzer.Packet packet, StringBuffer brief, StringBuffer verbose) { if (analyzers == null) return false; try { @@ -688,7 +688,7 @@ public class RadioLogger extends VisPlugin { } return true; } - + private class RadioConnectionLog { long startTime; long endTime; @@ -697,7 +697,7 @@ public class RadioLogger extends VisPlugin { String data = null; String tooltip = null; - + public String toString() { if (data == null) { RadioLogger.this.prepareDataString(this); @@ -765,7 +765,7 @@ public class RadioLogger extends VisPlugin { } } }; - + private Action copyAction = new AbstractAction("Copy selected") { private static final long serialVersionUID = 8412062977916108054L; @@ -786,7 +786,7 @@ public class RadioLogger extends VisPlugin { clipboard.setContents(stringSelection, null); } }; - + private Action copyAllAction = new AbstractAction("Copy all") { private static final long serialVersionUID = 1905586689441157304L; @@ -805,7 +805,7 @@ public class RadioLogger extends VisPlugin { clipboard.setContents(stringSelection, null); } }; - + private Action saveAction = new AbstractAction("Save to file...") { private static final long serialVersionUID = -3942984643211482179L; @@ -865,7 +865,7 @@ public class RadioLogger extends VisPlugin { if (!(p instanceof TimeLine)) { continue; } - + /* Select simulation time */ TimeLine plugin = (TimeLine) p; plugin.trySelectTime(time); @@ -885,7 +885,7 @@ public class RadioLogger extends VisPlugin { if (!(p instanceof LogListener)) { continue; } - + /* Select simulation time */ LogListener plugin = (LogListener) p; plugin.trySelectTime(time); @@ -918,7 +918,7 @@ public class RadioLogger extends VisPlugin { } String alias = (String) JOptionPane.showInputDialog( - GUI.getTopParentContainer(), + GUI.getTopParentContainer(), "Enter alias for all packets with identical payload.\n" + "An empty string removes the current alias.\n\n" + connections.get(selectedRow).data + "\n", @@ -940,7 +940,7 @@ public class RadioLogger extends VisPlugin { /* Remove current alias */ if (alias.equals("")) { aliases.remove(connections.get(selectedRow).data); - + /* Should be null if empty */ if (aliases.isEmpty()) { aliases = null; @@ -954,7 +954,7 @@ public class RadioLogger extends VisPlugin { repaint(); } }; - + public String getConnectionsString() { StringBuilder sb = new StringBuilder(); RadioConnectionLog[] cs = connections.toArray(new RadioConnectionLog[0]); @@ -963,7 +963,7 @@ public class RadioLogger extends VisPlugin { } return sb.toString(); }; - + public void saveConnectionsToFile(String fileName) { StringUtils.saveToFile(new File(fileName), getConnectionsString()); }; diff --git a/tools/cooja/java/se/sics/cooja/plugins/ScriptRunner.java b/tools/cooja/java/se/sics/cooja/plugins/ScriptRunner.java index 96dc544fd..93e5e7fb4 100644 --- a/tools/cooja/java/se/sics/cooja/plugins/ScriptRunner.java +++ b/tools/cooja/java/se/sics/cooja/plugins/ScriptRunner.java @@ -87,7 +87,7 @@ import se.sics.cooja.VisPlugin; import se.sics.cooja.dialogs.MessageList; import se.sics.cooja.util.StringUtils; -@ClassDescription("Simulation script editor...") +@ClassDescription("Simulation script editor") @PluginType(PluginType.SIM_PLUGIN) public class ScriptRunner extends VisPlugin { private static final long serialVersionUID = 7614358340336799109L; diff --git a/tools/cooja/java/se/sics/cooja/plugins/SimControl.java b/tools/cooja/java/se/sics/cooja/plugins/SimControl.java index 483acdf6b..309bda1b4 100644 --- a/tools/cooja/java/se/sics/cooja/plugins/SimControl.java +++ b/tools/cooja/java/se/sics/cooja/plugins/SimControl.java @@ -63,7 +63,7 @@ import se.sics.cooja.VisPlugin; * * @author Fredrik Osterlind */ -@ClassDescription("Simulation control...") +@ClassDescription("Simulation control") @PluginType(PluginType.SIM_STANDARD_PLUGIN) public class SimControl extends VisPlugin implements HasQuickHelp { private static final int LABEL_UPDATE_INTERVAL = 150; diff --git a/tools/cooja/java/se/sics/cooja/plugins/TimeLine.java b/tools/cooja/java/se/sics/cooja/plugins/TimeLine.java index b70db5093..a392bc948 100644 --- a/tools/cooja/java/se/sics/cooja/plugins/TimeLine.java +++ b/tools/cooja/java/se/sics/cooja/plugins/TimeLine.java @@ -56,7 +56,6 @@ import java.util.Observer; import javax.swing.AbstractAction; import javax.swing.Action; import javax.swing.Box; -import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JCheckBoxMenuItem; import javax.swing.JComboBox; @@ -70,7 +69,6 @@ import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JPopupMenu; import javax.swing.JScrollPane; -import javax.swing.JSeparator; import javax.swing.JSlider; import javax.swing.JSplitPane; import javax.swing.JToolTip; @@ -107,7 +105,7 @@ import se.sics.cooja.motes.AbstractEmulatedMote; * * @author Fredrik Osterlind */ -@ClassDescription("Timeline...") +@ClassDescription("Timeline") @PluginType(PluginType.SIM_STANDARD_PLUGIN) public class TimeLine extends VisPlugin implements HasQuickHelp { private static final long serialVersionUID = -883154261246961973L; @@ -177,16 +175,16 @@ public class TimeLine extends VisPlugin implements HasQuickHelp { JMenu eventsMenu = new JMenu("Events"); JMenu viewMenu = new JMenu("View"); JMenu zoomMenu = new JMenu("Zoom"); - + menuBar.add(fileMenu); menuBar.add(editMenu); menuBar.add(viewMenu); menuBar.add(zoomMenu); menuBar.add(eventsMenu); menuBar.add(motesMenu); - + this.setJMenuBar(menuBar); - + motesMenu.add(new JMenuItem(addMoteAction)); zoomMenu.add(new JMenuItem(zoomInAction)); zoomMenu.add(new JMenuItem(zoomOutAction)); @@ -203,7 +201,7 @@ public class TimeLine extends VisPlugin implements HasQuickHelp { return radioChannels; } }); - + fileMenu.add(new JMenuItem(saveDataAction)); fileMenu.add(new JMenuItem(statisticsAction)); editMenu.add(new JMenuItem(clearAction)); @@ -270,14 +268,14 @@ public class TimeLine extends VisPlugin implements HasQuickHelp { } }); eventsMenu.add(eventCheckBox); - + /* Box: events to observe */ - + eventCheckboxes = Box.createVerticalBox(); /* eventCheckboxes.add(new JButton(addMoteAction)); eventCheckboxes.add(new JSeparator()); - + JCheckBox eventCheckBox; eventCheckBox = createEventCheckbox("Radio RX/TX", "Show radio transmissions, receptions, and collisions"); eventCheckBox.setSelected(showRadioRXTX); @@ -347,7 +345,7 @@ public class TimeLine extends VisPlugin implements HasQuickHelp { JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); timelineScrollPane.getHorizontalScrollBar().setUnitIncrement(50); - + timelineMoteRuler = new MoteRuler(); timelineScrollPane.setRowHeaderView(timelineMoteRuler); timelineScrollPane.setBackground(Color.WHITE); @@ -420,7 +418,7 @@ public class TimeLine extends VisPlugin implements HasQuickHelp { timer.start(); } }); - + /* XXX HACK: here we set the position and size of the window when it appears on a blank simulation screen. */ this.setLocation(0, gui.getDesktopPane().getHeight() - 166); this.setSize(gui.getDesktopPane().getWidth(), 166); @@ -2513,5 +2511,5 @@ public class TimeLine extends VisPlugin implements HasQuickHelp { "
Shows LED state: red, green, and blue. (Assumes all mote types have exactly three LEDs.)" + "

Watchpoints" + "
Shows triggered watchpoints, currently only supported by MSPSim-based motes. To add watchpoints, use the Msp Code Watcher plugin."; - } + } } diff --git a/tools/cooja/java/se/sics/cooja/plugins/Visualizer.java b/tools/cooja/java/se/sics/cooja/plugins/Visualizer.java index 320942fef..b95d8ac50 100644 --- a/tools/cooja/java/se/sics/cooja/plugins/Visualizer.java +++ b/tools/cooja/java/se/sics/cooja/plugins/Visualizer.java @@ -128,7 +128,7 @@ import se.sics.cooja.plugins.skins.UDGMVisualizerSkin; * @see UDGMVisualizerSkin * @author Fredrik Osterlind */ -@ClassDescription("Network...") +@ClassDescription("Network") @PluginType(PluginType.SIM_STANDARD_PLUGIN) public class Visualizer extends VisPlugin implements HasQuickHelp { private static final long serialVersionUID = 1L;