public void actionPerformed(ActionEvent event) {
		if(event.getActionCommand().equals(ok.getActionCommand())){
			if(singleNodePosition == null) try {
				int num = Integer.parseInt(number.getText());
				if(num <= 0){
					throw new NumberFormatException();
				}
				AppConfig.getAppConfig().generateNodesDlgNumNodes = num;
				pf = new PercentualProgressDialog(this, this, "Creating new Nodes...");
				canceled = false;
				pf.init();
			}	catch(NumberFormatException nfE){
				Main.minorError("Please specify a correct number of nodes to generate. This number has to be an integer greater than zero.");
			} 
			else { // only for a single node
				readSelection();
				Node n = generateNode(singleNodePosition);
				n.finishInitializationWithDefaultModels(true);
				// redraw
				Tools.getGraphPanel().forceDrawInNextPaint();
				Tools.getGraphPanel().repaint();
				this.setVisible(false);
			}
		}
		else if(event.getActionCommand().equals(cancel.getActionCommand())){
			this.setVisible(false);
		}
	}