/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package blok.shell;

import blok.interfaces.IUIController;
import java.awt.Point;
import java.util.ArrayList;
import org.jbox2d.dynamics.Body;

/**
 *
 * @author aluno
 */
public class UIController implements IUIController {

    UIController() {}

    @Override
    public boolean initialize() {
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                m_mainPanel = new MainPanel();
                m_mainWindow = new MainWindow(m_mainPanel);
                m_mainWindow.setVisible(true);
            }
        });

        return true;
    }
    
    @Override
    public void bodiesCreated(ArrayList<Point> bodies) {
        m_mainPanel.bodiesCreated(bodies);
    }

    @Override
    public void bodiesUpdated(ArrayList<Point> bodies) {
        m_mainPanel.bodiesUpdated(bodies);
    }

    @Override
    public void repaint() {
        m_mainPanel.repaint();
    }

    private MainWindow m_mainWindow;
    private MainPanel m_mainPanel;
}
