+
+ public static void getOrCreateViewer(String windowName, GraphDrawable graphDrawable) {
+ JViewer viewer = VIEWER_MAP.get(windowName);
+ if(viewer == null) {
+ viewer = new JViewer(graphDrawable);
+ viewer.setTitle(windowName);
+ viewer.windowName = windowName;
+ VIEWER_MAP.put(windowName, viewer);
+ viewer.toFront();
+ }
+ else {
+ viewer.updateDrawable(graphDrawable);
+ viewer.toFront();
+ }
+ }
+
+ @Override
+ public void dispose() {
+ if(windowName != null)
+ VIEWER_MAP.remove(windowName);
+ super.dispose();
+ }