Esempio n. 1
0
  /** Makes the pane display empty space (in case no petrinet is selected) */
  public void displayEmpty() {

    if (petrinetViewer != null) {
      petrinetViewer.removeFrom(petrinetPanel);
      SimulationPane.getInstance().setSimulationPaneDisable();
    }
    petrinetPanel.setBorder(PETRINET_BORDER);
  }
Esempio n. 2
0
  /**
   * 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) {
    }
  }
Esempio n. 3
0
  /**
   * Returns {@link PetrinetViewer#getNodeSize() current node size} of current {@link
   * PetrinetViewer}
   *
   * @return
   */
  public double getCurrentNodeSize() {

    return petrinetViewer.getNodeSize();
  }
Esempio n. 4
0
  /** Returns the id of the currently displayed petrinet */
  public int getCurrentPetrinetId() {

    return petrinetViewer.getCurrentId();
  }
Esempio n. 5
0
  /** repaints the panel */
  public void repaint() {

    petrinetViewer.repaint();
  }