/** 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); }
/** * 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) { } }
/** * Returns {@link PetrinetViewer#getNodeSize() current node size} of current {@link * PetrinetViewer} * * @return */ public double getCurrentNodeSize() { return petrinetViewer.getNodeSize(); }
/** Returns the id of the currently displayed petrinet */ public int getCurrentPetrinetId() { return petrinetViewer.getCurrentId(); }
/** repaints the panel */ public void repaint() { petrinetViewer.repaint(); }