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

public class Main
{
  public static void main(String[] args)
  {
    JFrame window = new JFrame("Paint, but worse");
    Model model = new Model();
    Handler handler = new Handler(model);
    View view = new View(model, handler);
    Menubar menubar = new Menubar(model, handler);
    Sidepane sidepane = new Sidepane(model, handler);
    Controls controls = new Controls(model, handler);
    model.notifyObservers();
    
    // create a layout panel to hold the views
    JPanel mainpanel = new JPanel(new BorderLayout(0, 0));
    window.getContentPane().add(mainpanel);
    mainpanel.add(view, BorderLayout.CENTER);
    mainpanel.add(menubar, BorderLayout.PAGE_START);
    mainpanel.add(sidepane, BorderLayout.LINE_START);
    mainpanel.add(controls, BorderLayout.PAGE_END);
    model.setSideColour(Color.cyan);
    model.setControlColour(Color.gray);

    // Setup the frame to do frame things
    window.setPreferredSize(new Dimension(1280,720));
    window.setMinimumSize(new Dimension(320, 180));
    window.pack();
    window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    window.setVisible(true);
  }
}
