Renamed simulation visualizers to simulation visualizers, from simulation visualizer skins
This commit is contained in:
parent
13800cb7ec
commit
3286d62eca
|
@ -112,10 +112,10 @@ import se.sics.cooja.plugins.skins.TrafficVisualizerSkin;
|
||||||
import se.sics.cooja.plugins.skins.UDGMVisualizerSkin;
|
import se.sics.cooja.plugins.skins.UDGMVisualizerSkin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simulation visualizer supporting visualization skins.
|
* Simulation visualizer supporting different visualizers
|
||||||
* Motes are painted in the XY-plane, as seen from positive Z axis.
|
* Motes are painted in the XY-plane, as seen from positive Z axis.
|
||||||
*
|
*
|
||||||
* Supports drag-n-drop motes, right-click popup menu, and visualization skins.
|
* Supports drag-n-drop motes, right-click popup menu, and visualizers
|
||||||
*
|
*
|
||||||
* Observes the simulation and all mote positions.
|
* Observes the simulation and all mote positions.
|
||||||
*
|
*
|
||||||
|
@ -157,7 +157,7 @@ public class Visualizer extends VisPlugin {
|
||||||
private boolean moveConfirm;
|
private boolean moveConfirm;
|
||||||
private Cursor moveCursor = new Cursor(Cursor.MOVE_CURSOR);
|
private Cursor moveCursor = new Cursor(Cursor.MOVE_CURSOR);
|
||||||
|
|
||||||
/* Visualizer skins */
|
/* Visualizers */
|
||||||
private final JButton skinButton = new JButton("Select visualizer skins");
|
private final JButton skinButton = new JButton("Select visualizer skins");
|
||||||
private static ArrayList<Class<? extends VisualizerSkin>> visualizerSkins =
|
private static ArrayList<Class<? extends VisualizerSkin>> visualizerSkins =
|
||||||
new ArrayList<Class<? extends VisualizerSkin>>();
|
new ArrayList<Class<? extends VisualizerSkin>>();
|
||||||
|
@ -212,7 +212,7 @@ public class Visualizer extends VisPlugin {
|
||||||
for (String skinClass: skins) {
|
for (String skinClass: skins) {
|
||||||
Class<? extends VisualizerSkin> skin = gui.tryLoadClass(this, VisualizerSkin.class, skinClass);
|
Class<? extends VisualizerSkin> skin = gui.tryLoadClass(this, VisualizerSkin.class, skinClass);
|
||||||
if (registerVisualizerSkin(skin)) {
|
if (registerVisualizerSkin(skin)) {
|
||||||
logger.info("Registered external visualizer skin: " + skinClass);
|
logger.info("Registered external visualizer: " + skinClass);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -489,7 +489,7 @@ public class Visualizer extends VisPlugin {
|
||||||
private void generateAndActivateSkin(Class<? extends VisualizerSkin> skinClass) {
|
private void generateAndActivateSkin(Class<? extends VisualizerSkin> skinClass) {
|
||||||
for (VisualizerSkin skin: currentSkins) {
|
for (VisualizerSkin skin: currentSkins) {
|
||||||
if (skinClass == skin.getClass()) {
|
if (skinClass == skin.getClass()) {
|
||||||
logger.warn("Selected skin already active: " + skinClass);
|
logger.warn("Selected visualizer already active: " + skinClass);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -505,7 +505,7 @@ public class Visualizer extends VisPlugin {
|
||||||
e1.printStackTrace();
|
e1.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
skinButton.setText("Select visualizer skins " +
|
skinButton.setText("Select visualizer " +
|
||||||
"(" + currentSkins.size() + "/" + visualizerSkins.size() + ")");
|
"(" + currentSkins.size() + "/" + visualizerSkins.size() + ")");
|
||||||
repaint();
|
repaint();
|
||||||
}
|
}
|
||||||
|
@ -583,7 +583,6 @@ public class Visualizer extends VisPlugin {
|
||||||
|
|
||||||
private void handlePopupRequest(final int x, final int y) {
|
private void handlePopupRequest(final int x, final int y) {
|
||||||
JPopupMenu menu = new JPopupMenu();
|
JPopupMenu menu = new JPopupMenu();
|
||||||
menu.add(new JLabel("Select action:"));
|
|
||||||
|
|
||||||
/* Mote specific actions */
|
/* Mote specific actions */
|
||||||
final Mote[] motes = findMotesAtPosition(x, y);
|
final Mote[] motes = findMotesAtPosition(x, y);
|
||||||
|
@ -637,10 +636,10 @@ public class Visualizer extends VisPlugin {
|
||||||
|
|
||||||
/* Visualizer skin actions */
|
/* Visualizer skin actions */
|
||||||
menu.add(new JSeparator());
|
menu.add(new JSeparator());
|
||||||
JMenu skinMenu = new JMenu("Visualizer skins");
|
JMenu skinMenu = new JMenu("Visualizers");
|
||||||
populateSkinMenu(skinMenu);
|
populateSkinMenu(skinMenu);
|
||||||
menu.add(skinMenu);
|
menu.add(skinMenu);
|
||||||
makeSkinsDefaultAction.putValue(Action.NAME, "Make current skins default");
|
makeSkinsDefaultAction.putValue(Action.NAME, "Set default visualizers");
|
||||||
JMenuItem skinDefaultItem = new JMenuItem(makeSkinsDefaultAction);
|
JMenuItem skinDefaultItem = new JMenuItem(makeSkinsDefaultAction);
|
||||||
menu.add(skinDefaultItem);
|
menu.add(skinDefaultItem);
|
||||||
|
|
||||||
|
@ -695,13 +694,13 @@ public class Visualizer extends VisPlugin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (skinToDeactivate == null) {
|
if (skinToDeactivate == null) {
|
||||||
logger.fatal("Unknown visualizer skin to deactivate: " + skinClass);
|
logger.fatal("Unknown visualizer to deactivate: " + skinClass);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
skinToDeactivate.setInactive();
|
skinToDeactivate.setInactive();
|
||||||
repaint();
|
repaint();
|
||||||
currentSkins.remove(skinToDeactivate);
|
currentSkins.remove(skinToDeactivate);
|
||||||
skinButton.setText("Select visualizer skins " +
|
skinButton.setText("Select visualizers " +
|
||||||
"(" + currentSkins.size() + "/" + visualizerSkins.size() + ")");
|
"(" + currentSkins.size() + "/" + visualizerSkins.size() + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1229,7 +1228,7 @@ public class Visualizer extends VisPlugin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (wanted != null) {
|
if (wanted != null) {
|
||||||
logger.warn("Could not load skin: " + element.getText());
|
logger.warn("Could not load visualizer: " + element.getText());
|
||||||
}
|
}
|
||||||
} else if (element.getName().equals("viewport")) {
|
} else if (element.getName().equals("viewport")) {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue