import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.geom.Line2D;
import java.awt.image.BufferedImage;
import java.util.Observable;

import javax.swing.*;


/**
 *	TemporalView provides a View corresponding to the Observer Pattern (MVC ?!).
 *	It uses the SignalPanel class to draw a temporal representation of the model's buffer.
 *
 */
public class TemporalView extends JPanel implements View {
    
	
	/**
     * Implementation of view's method.
     * 
     * 
     * The update method is called when a change occurs in the model (theSound).
     * @param Observable o   			The sound model.
     * @param Object     dataChanged 	Is a boolean indicating if the model has been modified.
     * @Override
     */
    public void update(Observable o, Object dataChanged) {
    	
		// Retrieving the sound model
		Sound s = (Sound) o;
		// Retrieving the sound buffer
		Double[] data = s.getData();
		
		
		if( (boolean) dataChanged) {
			this.drawData(data);
		}
    }

    /**
     * Build a TemporalView.
     * @param int h	Height of the panel.
     * @param int w Width of the panel.
     * @param Sound s The sound to be displayed.
     */
    public TemporalView(int h, int w){

    	height = h;
    	width = w;
    	
    }
    
    /**
     * Main method of this class.
     * Draws the waveform.
     * @param	Double	buffer	the data array to be plotted
     */
    public void drawData(Double[] buffer) {
    	
    	// Data display settings
    	g2.setColor(Color.WHITE);
    	g2.clearRect( 0, 0, width, height);
    	
    	// run through the buffer
    	for(int i = 0 ; i < buffer.length ; i++) {
    		double prevPoint = (double) buffer[i];
    		// MEMENTO : Line2D.Double( x1, y1, x2, y2)
    		// Previous point = (x1,y1) & Current point = (x2,y2)
    		g2.draw( new Line2D.Double(
    				buffer.length - i ,
    				currentPoint + height/2 ,
    				buffer.length - (i+1),
    				prevPoint + height/2
    				));
    		
    		System.out.println("Buffer = "+ buffer[i]);
    		currentPoint = prevPoint;
    		
    	}
    	repaint();
    }

    
    @Override
    protected void paintComponent(Graphics g) {
    	// calling mother's method
    	super.paintComponent(g);
    	
		if(bufferedImage == null){
    		init();
    	}
		// ( Image, x, y, theOberserver )
    	g.drawImage(bufferedImage, 0, 0, this);
    }
    
    /**
     * Defines the fundamentals aspects settings
     * Helper method
     * 
     * 
     */
    private void init(){
    	// size settings
    	width = getWidth();
    	height = getHeight();
    	
    	// image settings :
    	// 8 bit
    	// Alpha Red Green Blue
    	bufferedImage = new BufferedImage( width, height, BufferedImage.TYPE_INT_ARGB);
    	
    	g2 = bufferedImage.createGraphics();
    	g2.setBackground(Color.black);
    	
    	g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                RenderingHints.VALUE_ANTIALIAS_ON);
    }
    
    // the waveform display
    //private SignalPanel signalPanel;

    // Panel visual settings
    private int height;
    private int width;
    
    // Used to draw the sound
    private BufferedImage bufferedImage;
    public Graphics2D g2;
    
    // Memorizing the y1 point (c.f drawData() )
    private double currentPoint;
    
}

@@ -1,24 +1,50 @@
+package framework.views;%0A%0A
 import java.awt.Color;%0Ai
@@ -247,16 +247,41 @@
 ing.*;%0A%0A
+import framework.Sound;%0A%0A
 %0A/**%0A *%09
@@ -517,14 +517,9 @@
 w %7B%0A
-    %0A%09
+%0A
 %0A%09/*
@@ -562,33 +562,31 @@
 thod.%0A     *
- 
 %0A     *
- 
 %0A     * The 
@@ -882,22 +882,17 @@
 nged) %7B%0A
-    %09
 %0A
+
 %09%09// Ret
@@ -1002,21 +1002,17 @@
 Data();%0A
-%09%09%0A%09%09
+%0A
 %0A%09%09if( (
@@ -1322,25 +1322,16 @@
  w;%0A
-    %09
 %0A
+
     %7D%0A
-    
 %0A
+
     
@@ -1504,22 +1504,17 @@
 ffer) %7B%0A
-    %09
 %0A
+
     %09// 
@@ -1607,22 +1607,17 @@
 eight);%0A
-    %09
 %0A
+
     %09// 
@@ -2010,23 +2010,17 @@
 %09%09%09%09));%0A
-    %09%09
 %0A
+
     %09%09Sy
@@ -2097,15 +2097,9 @@
 nt;%0A
-    %09%09
 %0A
+
     
@@ -2124,21 +2124,17 @@
 %0A    %7D%0A%0A
-    
 %0A
+
     @Ove
@@ -2249,22 +2249,17 @@
 ent(g);%0A
-    %09
 %0A
+
 %09%09if(buf
@@ -2383,29 +2383,25 @@
 his);%0A    %7D%0A
-    
 %0A
+
     /**%0A    
@@ -2476,17 +2476,15 @@
    *
- 
 %0A     *
- 
 %0A   
@@ -2587,22 +2587,17 @@
 ight();%0A
-    %09
 %0A
+
     %09// 
@@ -2741,22 +2741,17 @@
 _ARGB);%0A
-    %09
 %0A
+
     %09g2 
@@ -2824,14 +2824,9 @@
 k);%0A
-    %09
 %0A
+
     
@@ -2937,21 +2937,17 @@
 ;%0A    %7D%0A
-    
 %0A
+
     // t
@@ -3082,21 +3082,17 @@
  width;%0A
-    
 %0A
+
     // U
@@ -3180,21 +3180,17 @@
 s2D g2;%0A
-    
 %0A
+
     // M
@@ -3263,15 +3263,11 @@
 tPoint;%0A
-    
 %0A%7D%0A

Add package to TemporalView and Sound import.