<commit_before>package view;

import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseMotionAdapter;

import javax.swing.JPanel;

import model.AbstractTile;
import model.Board;
import model.Piece;

/**
 * @author dfontana
 * @author Heineman
 */
public class BoardView extends JPanel{
	private static final long serialVersionUID = 1L;
	Board b;
	
	/** Double Buffering technique requires an offscreen image. */
	Image offscreenImage;
	Graphics offscreenGraphics;
	Graphics canvasGraphics;
	
	public BoardView(Board b){
		setPreferredSize(new Dimension(384, 384));
		this.b = b;
		this.paint(); //Initial painting of board from file
	}
	
	/**
	 * Redraw recreates everything offscreen. Notice how there is an offscreen image and graphics.
	 * It even paints all shapes to the offscreen graphics supplied to the paintShape object
	 * 		-> It is believed that the offscreenGraphics is an object stored within the offscreenImage<commit_msg>Corrected paint to repaint<commit_after>package view;

import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseMotionAdapter;

import javax.swing.JPanel;

import model.AbstractTile;
import model.Board;
import model.Piece;

/**
 * @author dfontana
 * @author Heineman
 */
public class BoardView extends JPanel{
	private static final long serialVersionUID = 1L;
	Board b;
	
	/** Double Buffering technique requires an offscreen image. */
	Image offscreenImage;
	Graphics offscreenGraphics;
	Graphics canvasGraphics;
	
	public BoardView(Board b){
		setPreferredSize(new Dimension(384, 384));
		this.b = b;
		repaint(); //Initial painting of board from file
	}
	
	/**
	 * Redraw recreates everything offscreen. Notice how there is an offscreen image and graphics.
	 * It even paints all shapes to the offscreen graphics supplied to the paintShape object
	 * 		-> It is believed that the offscreenGraphics is an object stored within the offscreenImage
{'fraction_non_alphanumeric': 0.07861328125, 'fraction_numerical': 0.0068359375, 'mean_word_length': 4.522911051212938, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5770327', 'n_tokens_mistral': 613, 'n_tokens_neox': 571, 'n_words': 212}