Index: trunk/src/org/apollo/meldex/WavSample.java
===================================================================
--- trunk/src/org/apollo/meldex/WavSample.java	(revision 1006)
+++ trunk/src/org/apollo/meldex/WavSample.java	(revision 1102)
@@ -8,7 +8,7 @@
 import javax.sound.sampled.AudioInputStream;
 import javax.sound.sampled.AudioSystem;
-import javax.swing.JOptionPane;
-
-@SuppressWarnings("unchecked") // code in java 1.4
+
+import org.expeditee.gio.EcosystemManager;
+
 public class WavSample
 {
@@ -68,5 +68,5 @@
 	}
 	catch (Exception ex) {
-	    JOptionPane.showMessageDialog(null, "Exception occurred creating sample.\n\n" + ex);
+	    EcosystemManager.getGraphicsManager().showDialog("Exception", "Exception occurred creating sample.\n\n" + ex);
 	    return false;
 	}
@@ -90,5 +90,5 @@
 	    }
 	    catch (Exception ex) {
-		JOptionPane.showMessageDialog(null, "Exception occurred reloading sample.\n\n" + ex);
+	    EcosystemManager.getGraphicsManager().showDialog("Exception", "Exception occurred reloading sample.\n\n" + ex);
 		return false;
 	    }
@@ -101,5 +101,5 @@
 	    }
 	    catch (Exception ex) {
-		JOptionPane.showMessageDialog(null, "Exception occurred resetting audio stream.\n\n" + ex);
+	    EcosystemManager.getGraphicsManager().showDialog("Exception", "Exception occurred resetting audio stream.\n\n" + ex);
 		return false;
 	    }
@@ -172,5 +172,5 @@
 	if (format.getSampleSizeInBits() == 8) {
 	    if (format.getEncoding().equals(AudioFormat.Encoding.PCM_SIGNED)) {
-		JOptionPane.showMessageDialog(null, "Oops! Internal Error: Unexpected audio format (signed 8-bit).");
+	    EcosystemManager.getGraphicsManager().showDialog("Exception", "Oops! Internal Error: Unexpected audio format (signed 8-bit).");
 		return null;
 	    }
@@ -178,5 +178,5 @@
 	if (format.getSampleSizeInBits() == 16) {
 	    if (format.getEncoding().equals(AudioFormat.Encoding.PCM_UNSIGNED)) {
-		JOptionPane.showMessageDialog(null, "Oops! Internal Error: Unexpected audio format (unsigned 16-bit).");
+	    EcosystemManager.getGraphicsManager().showDialog("Exception", "Oops! Internal Error: Unexpected audio format (unsigned 16-bit).");
 		return null;
 	    }
@@ -188,5 +188,5 @@
 
 	// Create a new list to store the standardised sample values
-	ArrayList stdTemp = new ArrayList();
+	ArrayList<Integer> stdTemp = new ArrayList<Integer>();
 
 	// Simply pick values from the sample at the frequency specified
@@ -218,36 +218,36 @@
 
 
-    private static ArrayList toStandardEndian(AudioFormat format, ArrayList inData)
-    {
-	// Endian details do not apply to 8-bit samples, so no conversion needed
-	if (format.getSampleSizeInBits() == 8) {
-	    return inData;
-	}
-
-	// Create a new list to store the results
-	ArrayList outData = new ArrayList();
-
-	// Simply convert each number in the sample to the endian form for the current system
-	for (int i = 0; i < inData.size(); i += 2) {
-
-	    int MSB, LSB;
-	    if (format.isBigEndian()) {
-		MSB = ((Integer) inData.get(i)).intValue();    // First byte is MSB (high order)
-		LSB = ((Integer) inData.get(i+1)).intValue();  // Second byte is LSB (low order)
-	    }
-	    else {
-		LSB = ((Integer) inData.get(i)).intValue();    // First byte is LSB (low order)
-		MSB = ((Integer) inData.get(i+1)).intValue();  // Second byte is MSB (high order)
-	    }
-
-	    int val = (MSB << 8) + (LSB & 255);
-	    outData.add(new Integer(val));
-	}
-
-	return outData;
-    }
-
-
-    private static ArrayList toUnsignedValues(AudioFormat format, ArrayList inData)
+    private static ArrayList<Integer> toStandardEndian(AudioFormat format, ArrayList<Integer> inData)
+    {
+		// Endian details do not apply to 8-bit samples, so no conversion needed
+		if (format.getSampleSizeInBits() == 8) {
+		    return inData;
+		}
+	
+		// Create a new list to store the results
+		ArrayList<Integer> outData = new ArrayList<Integer>();
+	
+		// Simply convert each number in the sample to the endian form for the current system
+		for (int i = 0; i < inData.size(); i += 2) {
+	
+		    int MSB, LSB;
+		    if (format.isBigEndian()) {
+			MSB = ((Integer) inData.get(i)).intValue();    // First byte is MSB (high order)
+			LSB = ((Integer) inData.get(i+1)).intValue();  // Second byte is LSB (low order)
+		    }
+		    else {
+			LSB = ((Integer) inData.get(i)).intValue();    // First byte is LSB (low order)
+			MSB = ((Integer) inData.get(i+1)).intValue();  // Second byte is MSB (high order)
+		    }
+	
+		    int val = (MSB << 8) + (LSB & 255);
+		    outData.add(new Integer(val));
+		}
+	
+		return outData;
+    }
+
+
+    private static ArrayList<Integer> toUnsignedValues(AudioFormat format, ArrayList<Integer> inData)
     {
 	// PCM_UNSIGNED samples are what we want, so no conversion needed
@@ -257,5 +257,5 @@
 
 	// Create a new list to store the results
-	ArrayList outData = new ArrayList();
+	ArrayList<Integer> outData = new ArrayList<Integer>();
 
 	// Simply convert each signed number in the sample to an unsigned value
@@ -275,5 +275,5 @@
 
 
-    private static ArrayList to8bit(AudioFormat format, ArrayList inData)
+    private static ArrayList<Integer> to8bit(AudioFormat format, ArrayList<Integer> inData)
     {
 	// 8-bit data is what we want, so no conversion necessary
@@ -283,5 +283,5 @@
 
 	// Create a new list to store the results
-	ArrayList outData = new ArrayList();
+	ArrayList<Integer> outData = new ArrayList<Integer>();
 
 	// Simply reduce each value in the sample to an 8-bit value
@@ -298,5 +298,5 @@
 
 
-    private static ArrayList toMono(AudioFormat format, ArrayList inData)
+    private static ArrayList<Integer> toMono(AudioFormat format, ArrayList<Integer> inData)
     {
 	// Mono-channel data is what we want, so no conversion necessary
@@ -306,5 +306,5 @@
 
 	// Create a new list to store the results
-	ArrayList outData = new ArrayList();
+	ArrayList<Integer> outData = new ArrayList<Integer>();
 
 	// Simply average all of the channels for each frame
@@ -362,10 +362,10 @@
 	try {
 	    if (AudioSystem.write(audioData, AudioFileFormat.Type.WAVE, outFile) == -1) {
-		JOptionPane.showMessageDialog(null, "Problem occurred writing to file.");
+	    EcosystemManager.getGraphicsManager().showDialog("Exception", "Problem occurred writing to file.");
 		return false;
 	    }
 	}
 	catch (Exception ex) {
-	    JOptionPane.showMessageDialog(null, "Exception occurred saving file.\n\n" + ex);
+	    EcosystemManager.getGraphicsManager().showDialog("Exception", "Exception occurred saving file.\n\n" + ex);
 	    return false;
 	}
