Commit eaad0237 authored by Björn Richerzhagen's avatar Björn Richerzhagen Committed by Jose Ignacio Monreal Bailey
Browse files

Allow multiple NodeInfoVis (through custom name)

parent fbd64f3f
......@@ -43,6 +43,7 @@ import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.CopyOnWriteArrayList;
......@@ -387,7 +388,7 @@ public class VisualizationTopologyView extends JFrame
*/
protected class WorldPanel extends JLayeredPane {
protected HashMap<INodeID, VisNodeInformation> nodeInformation = new HashMap<INodeID, VisNodeInformation>();
protected ConcurrentHashMap<INodeID, VisNodeInformation> nodeInformation = new ConcurrentHashMap<INodeID, VisNodeInformation>();
protected final static int PADDING = 16;
......
......@@ -62,18 +62,22 @@ public class NodeInfoComponentVis extends JComponent
protected Collection<NodeVis> nodes = new LinkedList<>();
private JMenu menu = new JMenu("Node Information");
private JMenu menu = new JMenu("Node Info");
protected boolean[] activeLayers = null;
boolean hideInactiveNodes = false;
private final String name;
public <T extends HostComponent> NodeInfoComponentVis(
final Class<T> componentClass) {
setBounds(0, 0, VisualizationInjector.getWorldX(),
VisualizationInjector.getWorldY());
setOpaque(true);
setVisible(true);
this.name = componentClass.getSimpleName();
menu.setText("Info: "+name);
Event.scheduleWithDelay(1 * Time.MICROSECOND, new EventHandler() {
@Override
......@@ -312,7 +316,7 @@ public class NodeInfoComponentVis extends JComponent
@Override
public String getDisplayName() {
return "Node Information";
return "Info: "+name;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment