/Users/petercappello/NetBeansProjects/56-2014/56-2014-4-AdaptableZapem/src/View.java |
import java.awt.Graphics;
import java.awt.Image;
import javax.swing.JPanel;
View is a JPanel that displays the current positions of the Game Critters.
@author
public class View extends JPanel
{
private final Game game;
private final Image image;
Constructs a View for a game & its Image.
@param
@param
public View( Game game, Image image )
{
this.game = game;
this.image = image;
}
Paints the Image of the Game being displayed.
@param
@Override
public void paintComponent( Graphics graphics )
{
super.paintComponent( graphics );
graphics.drawImage( image, 0, 0, Game.IMAGE_SIZE, Game.IMAGE_SIZE, this );
}
}