dotCode = UMLGraphWriter.specToDot( javaSpec );
	private void generateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_generateButtonActionPerformed		if ("generate".equals( evt.getActionCommand() )) {			// Fail if no filename specified			if (filenameField.getText().equals("")) {				JOptionPane.showMessageDialog( this, "No output filename specified", "Error",						JOptionPane.ERROR_MESSAGE );			} else { // 'Normal' case				String dotCode = null;				String javaSpec = null;								ArrayList classes = new ArrayList();				int i;				int[] selected = classList.getSelectedIndices();				if (selected.length == 0) {					JOptionPane.showMessageDialog( this, "No classes selected", "Error",							JOptionPane.ERROR_MESSAGE );				} else {					// Get the selected classes					for (i = 0; i < selected.length; i++) {						//System.err.println( (String)(classList.getModel().getElementAt( selected[i] ) ) );						classes.add( selectedDomain.getClass(								(String)(classList.getModel().getElementAt( selected[i] ) ) ) );					}					// START DEBUG					for ( Iterator it = classes.iterator(); it.hasNext(); ) {						metamodel.Class umlclass = (metamodel.Class) it.next();//						System.err.println( umlclass.getName() );//						System.err.println( umlclass.dumpUMLGraph(false) );					}					// STOP DEBUG                  					dotCode = ClassWriter.dumpUMLGraph( selectedDomain, classes );					System.err.println(dotCode);					try {						DotWriter.dotToPNG( dotCode, filenameField.getText() );						JOptionPane.showMessageDialog( this, "Diagram generated successfully.", "Success!",								JOptionPane.INFORMATION_MESSAGE );					} catch (IOException ioe) {						JOptionPane.showMessageDialog( this, ioe.toString(), "Error",								JOptionPane.ERROR_MESSAGE );					}					this.dispose();				}			}		}	}//GEN-LAST:event_generateButtonActionPerformed