private void openFile() {
        if (simulator == null || !simulator.isAlive()) {
            NetObject.LATEST_ID = 0;
            canvas.getSelectionManager().removeSelectedFigures();
            FileManager handler = new FileManager();
            jFileChooser1 = new javax.swing.JFileChooser(defaultPath);
            int val = this.jFileChooser1.showOpenDialog(this);
            if (val == JFileChooser.APPROVE_OPTION) {
                File file = this.jFileChooser1.getSelectedFile();
                canvas.setFigures(handler.loadFile(file));


                this.setTitle(Global.petriNet.getLabel());
            }
            //to be removed test only
            // canvas.setFigures(handler.loadFile(new File("test.xml")));
            canvas.repaint();
            this.jTextArea1.setText("");
        }
    }