// ----------------------------------------------------------
// DisplayPanel.java

package lab05;

import java.awt.*;
import javax.swing.*;
        
/**
 * The class that represents the center panel of the top
 * level frame, where the Queue is rendered.
 */

public class DisplayPanel extends JPanel {
    private Queue queue;

    public DisplayPanel (Queue queue) {
        super ();
        this.queue = queue;

        // Make the background a light blue...
        setBackground (new Color (0xD4, 0xEC, 0xFB));
    }

/**
 * Renders the center panel contents,
 * including the graphical representation of the Queue.
 */

    protected void paintComponent (Graphics g) {
        super.paintComponent (g);
        queue.render (g, getSize());
    }
}
 
