Exemplo n.º 1
0
  private synchronized void display(ExtSed sed) {

    manageAssociatedManagerWindows(sed);

    try {

      SpectrumContainer container =
          (SpectrumContainer) sed.getAttachment(IrisDisplayManager.FIT_MODEL);

      // There is no Sed attachment, so build a model manager and attach it.

      if (container == null) {
        if (buildAttachment(sed)) {
          return;
        }
      }

      // VAOPD-879: spectrum name must be identical with Sed name.
      if (container != null) {
        container.getSpectrum().setName(sed.getId());
      }

      // Now display the Sed.

      idm.display(sed, sed.getId());

      // and add its frame to the workspace.

      JInternalFrame frame = idm.getInternalFrame();

      // VAOPD-863
      frame.setTitle(sed.getId());

      if (container != null) {
        JFrame modelManagerFrame = container.getModelManager().getFrame();
        if (modelManagerFrame != null) {
          modelManagerFrame.setTitle(sed.getId());
        }
      }

      if (frame != currentFrame) {
        lastLocation = null;
        disposeCurrentFrame();
        currentFrame = frame;
        currentFrame.setDefaultCloseOperation(JInternalFrame.HIDE_ON_CLOSE);
        if (lastLocation != null) {
          currentFrame.setLocation(lastLocation);
        }
        frame.setTitle("Iris Visualizer");
        ws.addFrame(frame);
      }

    } catch (Exception ex) {
      LogEvent.getInstance().fire(this, new LogEntry("Error: " + ex.getMessage(), sed));
      Logger.getLogger("IrisVisualizer").log(Level.SEVERE, null, ex);
    }
  }
Exemplo n.º 2
0
 @Override
 public void init(IrisApplication app, IWorkspace workspace) {
   LogEvent.getInstance().add(this);
 }