Commit 27cd51c7 authored by Marc Schiller's avatar Marc Schiller
Browse files

Merge remote-tracking branch 'origin/master' into nr/monitoring-model

parents ded77519 6db7cf65
...@@ -519,6 +519,9 @@ public class VisualizationTopologyView extends JFrame ...@@ -519,6 +519,9 @@ public class VisualizationTopologyView extends JFrame
* @version 1.0, 03.04.2012 * @version 1.0, 03.04.2012
*/ */
public static class VisualizationInjector { public static class VisualizationInjector {
private static boolean isActive = false;
protected static WorldPanel worldPanel; protected static WorldPanel worldPanel;
public static ComponentVisManager visManager; public static ComponentVisManager visManager;
...@@ -588,6 +591,7 @@ public class VisualizationTopologyView extends JFrame ...@@ -588,6 +591,7 @@ public class VisualizationTopologyView extends JFrame
VisualizationInjector.visManager = visManager; VisualizationInjector.visManager = visManager;
VisualizationInjector.WORLD_X = WORLD_X; VisualizationInjector.WORLD_X = WORLD_X;
VisualizationInjector.WORLD_Y = WORLD_Y; VisualizationInjector.WORLD_Y = WORLD_Y;
VisualizationInjector.isActive = true;
for (VisInfo visInfo : components) { for (VisInfo visInfo : components) {
visManager.addComponent(visInfo); visManager.addComponent(visInfo);
...@@ -599,6 +603,14 @@ public class VisualizationTopologyView extends JFrame ...@@ -599,6 +603,14 @@ public class VisualizationTopologyView extends JFrame
setupAWTEventListener(); setupAWTEventListener();
} }
/**
* True if this component is active at all (can be used)
* @return
*/
public static boolean isActive() {
return isActive;
}
public static VisualizationTopologyView getTopologyView() { public static VisualizationTopologyView getTopologyView() {
return view; return view;
} }
...@@ -800,6 +812,9 @@ public class VisualizationTopologyView extends JFrame ...@@ -800,6 +812,9 @@ public class VisualizationTopologyView extends JFrame
* @param comp * @param comp
*/ */
public static void injectComponent(VisualizationComponent comp) { public static void injectComponent(VisualizationComponent comp) {
if (!isActive()) {
return;
}
visManager.addComponent(comp); visManager.addComponent(comp);
} }
......
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