/**
   * Replaces the current PetrinetViewer so the new Petrinet is displayed. All Listeners are
   * attacked to the new Petrinet
   */
  public void displayPetrinet(int petrinetId, String title) {

    if (title != null) {
      setBorderTitle(title);
    }

    try {
      Layout<INode, IArc> layout =
          EngineAdapter.getPetrinetManipulation().getJungLayout(petrinetId);
      if (petrinetViewer != null) {
        petrinetViewer.removeFrom(petrinetPanel);
      }
      petrinetViewer = new PetrinetViewer(layout, petrinetId, null);
      double nodeSize = EngineAdapter.getPetrinetManipulation().getNodeSize(petrinetId);
      petrinetViewer.setNodeSize(nodeSize);
      petrinetViewer.addTo(petrinetPanel);
      MainWindow.getInstance().repaint();
      SimulationPane.getInstance().setSimulationPaneEnable();
    } catch (EngineException e) {
    }
  }