reverted previous plugin name changes, instead build displayed names when menu is created

This commit is contained in:
Fredrik Osterlind 2012-06-11 15:31:39 +02:00
parent 37c407b177
commit 8947c7a3bb
20 changed files with 152 additions and 111 deletions

View File

@ -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;
@ -71,7 +74,7 @@ import se.sics.cooja.interfaces.Position;
*
* @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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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 {

View File

@ -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 {

View File

@ -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);

View File

@ -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);*/

View File

@ -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);

View File

@ -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 {

View File

@ -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;
@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -102,7 +102,7 @@ import se.sics.cooja.util.StringUtils;
*
* @author Fredrik Osterlind
*/
@ClassDescription("Radio messages...")
@ClassDescription("Radio messages")
@PluginType(PluginType.SIM_PLUGIN)
public class RadioLogger extends VisPlugin {
private static Logger logger = Logger.getLogger(RadioLogger.class);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;