import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import java.awt.Image;
import javax.swing.JPanel;

public class DrawPanel extends JPanel
{
    private World w;

    public DrawPanel(World w_)
    {
        w = w_;
    }

    public void paintComponent(Graphics g)
    {
        super.paintComponent(g);
        Graphics2D g2 = (Graphics2D) g;

        BufferedImage bufferedImage = new BufferedImage(640, 480, BufferedImage.TYPE_INT_ARGB);
        Graphics2D g2d = bufferedImage.createGraphics();
        RenderingHints rh = new RenderingHints(
                 RenderingHints.KEY_ANTIALIASING,
                 RenderingHints.VALUE_ANTIALIAS_ON);
        g2d.setRenderingHints(rh);
        
        w.render(g2d);

        Image tmp = bufferedImage.getScaledInstance(1280, 960, Image.SCALE_SMOOTH);
        g2.drawImage(bufferedImage, 0, 0, 1280, 960, null);  

    }
}