public void deleteSelectedElements() {
            for (Element element : selectedElements) {
                // Place
                if (element instanceof Place) {
                    ((PetriNet) getGraph()).deletePlace(((Place) element).getName());
                }
                // Transition
                if (element instanceof Transition) {
                    ((PetriNet) getGraph()).deleteTransition(((Transition) element).getName());
                }
                // Node
                if (element instanceof Node) {
                    ((PrecedenceGraph) getGraph()).deleteNode(((Node) element).getName());
                }
                // Place
                if (element instanceof Resource) {
                    ((PetriNet) getGraph()).deleteResource(((Resource) element).getName());
                }
                if (element instanceof Arc) {
                    ((PetriNet) getGraph()).deleteArc(((Arc) element).getName());
                }
            }
            selectedElements.clear();
            updateComponentList();
            resetForm();
            repaint();
        }