<commit_before>package net.liquidpineapple.pang.gui;

import lombok.extern.slf4j.Slf4j;
import net.liquidpineapple.pang.InputHandler;
import net.liquidpineapple.pang.screens.Level;
import net.liquidpineapple.pang.screens.Screen;

import javax.swing.*;
import java.awt.*;
import java.io.IOException;

/**
 * @author <NAME><<EMAIL>>
 * @date 2016/09/06.
 */
@Slf4j
public class Board extends JPanel {

    private final int boardWidth;
    private final int boardHeight;
    private Timer timer;
    private Screen currentScreen;


    public Board(int boardWidth, int boardHeight) throws IOException {
        super();
        this.boardWidth = boardWidth;
        this.boardHeight = boardHeight;
        setFocusable(true);
        requestFocus();
        addKeyListener(new InputHandler());
        init();
    }

    private void init() throws IOException {
        setFocusable(true);
        setBackground(Color.BLACK);

        currentScreen = Level.createFromXML("src/main/resources/levels/level1.xml");
//        currentScreen = new MainMenu();
    }

    public void changeScreen(Screen screen){
        currentScreen = screen;
        this.repaint();
    }


    @Override
    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        doDrawing(g);
        Toolkit.getDefaultToolkit().sync();
    }

    private void doDrawing(Graphics g) {
        Graphics2D g2d = (Graphics2D) g;
        currentScreen.doDrawing(g2d, this);
    }

    public void doUpdate() {<commit_msg>Fixed mouselistener, fixes #51<commit_after>package net.liquidpineapple.pang.gui;

import lombok.extern.slf4j.Slf4j;
import net.liquidpineapple.pang.InputHandler;
import net.liquidpineapple.pang.screens.Level;
import net.liquidpineapple.pang.screens.MainMenu;
import net.liquidpineapple.pang.screens.Screen;

import javax.swing.*;
import java.awt.*;
import java.io.IOException;

/**
 * @author <NAME><<EMAIL>>
 * @date 2016/09/06.
 */
@Slf4j
public class Board extends JPanel {

    private final int boardWidth;
    private final int boardHeight;
    private Timer timer;
    private Screen currentScreen;


    public Board(int boardWidth, int boardHeight) throws IOException {
        super();
        this.boardWidth = boardWidth;
        this.boardHeight = boardHeight;
        setFocusable(true);
        requestFocus();
        addKeyListener(new InputHandler());
        addMouseListener(new InputHandler());
        init();
    }

    private void init() throws IOException {
        setFocusable(true);
        setBackground(Color.BLACK);

       // currentScreen = Level.createFromXML("src/main/resources/levels/level1.xml");
        currentScreen = new MainMenu();
    }

    public void changeScreen(Screen screen){
        currentScreen = screen;
        this.repaint();
    }


    @Override
    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        doDrawing(g);
        Toolkit.getDefaultToolkit().sync();
    }

    private void doDrawing(Graphics g) {
        Graphics2D g2d = (Graphics2D) g;
        currentScreen.doDrawing(g2d, this);
    }

    public void doUpdate() {
{'fraction_non_alphanumeric': 0.10752, 'fraction_numerical': 0.01088, 'mean_word_length': 2.956962025316456, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '5391402', 'n_tokens_mistral': 973, 'n_tokens_neox': 905, 'n_words': 201}