package boundary;

import controller.BuilderNewLevelCtrl;
import controller.ExitCtrl;
import javax.swing.GroupLayout.Alignment;
import javax.swing.GroupLayout;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.LayoutStyle.ComponentPlacement;
import model.BuilderModel;

public class BuilderMainMenuView extends JPanel {
  BuilderApplication app;
  BuilderModel model;

  public BuilderMainMenuView(BuilderApplication app, BuilderModel model) {
    this.app = app;
    this.model = model;

    JButton btnNew = new JButton("New");
    btnNew.addActionListener(new BuilderNewLevelCtrl(app, model));

    JButton btnOpen = new JButton("Open");

    JButton btnQuit = new JButton("Quit");
    btnQuit.addActionListener(new ExitCtrl());

    GroupLayout groupLayout = new GroupLayout(this);
    groupLayout.setHorizontalGroup(
      groupLayout.createParallelGroup(Alignment.LEADING)
        .addGroup(Alignment.TRAILING, groupLayout.createSequentialGroup()
          .addGap(234)
          .addGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
            .addComponent(btnQuit, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 468, Short.MAX_VALUE)
            .addComponent(btnOpen, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 468, Short.MAX_VALUE)
            .addComponent(btnNew, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
          .addGap(276))
    );
    groupLayout.setVerticalGroup(
      groupLayout.createParallelGroup(Alignment.LEADING)
        .addGroup(groupLayout.createSequentialGroup()
          .addGap(65)
          .addComponent(btnNew, GroupLayout.PREFERRED_SIZE, 20, Short.MAX_VALUE)
          .addPreferredGap(ComponentPlacement.RELATED)
          .addComponent(btnOpen, GroupLayout.PREFERRED_SIZE, 20, Short.MAX_VALUE)
          .addPreferredGap(ComponentPlacement.RELATED)
          .addComponent(btnQuit, GroupLayout.PREFERRED_SIZE, 20, Short.MAX_VALUE)
          .addGap(80))
    );
    setLayout(groupLayout);
  }
}

@@ -94,37 +94,80 @@
 java
-x.swing.GroupLayout.Alignment
+.awt.Component;%0Aimport java.awt.GridBagLayout;%0Aimport java.awt.Dimension
 ;%0Aim
@@ -183,21 +183,19 @@
 x.swing.
-Group
+Box
 Layout;%0A
@@ -242,19 +242,19 @@
 .swing.J
-Pan
+Lab
 el;%0Aimpo
@@ -272,67 +272,142 @@
 ing.
-LayoutStyle.ComponentPlacement;%0Aimport model.BuilderModel;%0A
+JPanel;%0Aimport model.BuilderModel;%0A%0A/**%0A * PlayerMainMenuView for the player application%0A *%0A * @author Cem Unsal & Maurizio Vitale%0A */
 %0Apub
@@ -625,1487 +625,1613 @@
 el;%0A
+    
 %0A    
-JButton btnNew = new JButton(%22New%22);%0A    btnNew.addActionListener(new BuilderNewLevelCtrl(app, model
+setMinimumSize(new Dimension(600,480));%0A    setPreferredSize(new Dimension(600, 480
 ));%0A
-%0A
     
-JButton btnOpen = new JButton(%22Open%22);%0A%0A    JButton btnQuit = new JButton(%22Quit%22);%0A    btnQuit.addActionListener(new ExitCtrl());%0A%0A    GroupLayout groupLayout = new GroupLayout(this);%0A    groupLayout.setHorizontalGroup(%0A      groupLayout.createParallelGroup(Alignment.LEADING)%0A        .addGroup(Alignment.TRAILING, groupLayout.createSequentialGroup()%0A          .addGap(234)%0A          .addGroup(groupLayout.createParallelGroup(Alignment.TRAILING)%0A            .addComponent(btnQuit, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 468, Short.MAX_VALUE)
+//Make Layout GridBagLayout%0A    GridBagLayout gridBagLayout = new GridBagLayout();%0A    setLayout(gridBagLayout);%0A    //Add ContentPanel in center%0A    JPanel panelContent = new JPanel();%0A    panelContent.setBorder(null);%0A    panelContent.setSize(300,500);%0A    panelContent.setLayout(new BoxLayout(panelContent, BoxLayout.Y_AXIS));%0A    add(panelContent);%0A    //Add Labels and Buttons to center ContentPanel%0A    JLabel lblBuilder = new JLabel(%22%5Cu262D Builder%22);%0A    lblBuilder.setAlignmentX(Component.CENTER_ALIGNMENT);%0A    lblBuilder.setAlignmentY(Component.CENTER_ALIGNMENT);%0A    panelContent.add(lblBuilder);
 %0A    
+%0A
     
-    .addComponent(btnOpen, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 468, Short.MAX_VALUE)%0A            .addComponent(btnNew, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))%0A          .addGap(276))%0A    );%0A    groupLayout.setVerticalGroup(%0A      groupLayout.createParallelGroup(Alignment.LEADING)%0A        .addGroup(groupLayout.createSequentialGroup()%0A          .addGap(65)
+JButton btnNewLevel = new JButton(%22New Level%22);%0A    btnNewLevel.addActionListener(new BuilderNewLevelCtrl(app, model));%0A    btnNewLevel.setAlignmentX(Component.CENTER_ALIGNMENT);%0A    btnNewLevel.setAlignmentY(Component.CENTER_ALIGNMENT);%0A    panelContent.add(btnNewLevel);%0A%0A    JButton btnOpen = new JButton(%22Open Level%22);%0A    btnOpen.addActionListener(new BuilderNewLevelCtrl(app, model));%0A    btnOpen.setAlignmentX(Component.CENTER_ALIGNMENT);%0A    btnOpen.setAlignmentY(Component.CENTER_ALIGNMENT);%0A    panelContent.add(btnOpen);
 %0A    
+%0A
     
-  .addComponent(btnNew, GroupLayout.PREFERRED_SIZE, 20, Short.MAX_VALUE)%0A          .addPreferredGap(ComponentPlacement.RELATED)%0A          .addComponent(btnOpen, GroupLayout.PREFERRED_SIZE, 20, Short.MAX_VALUE)%0A          .addPreferredGap(ComponentPlacement.RELATED)%0A          .addComponent(btnQuit, GroupLayout.PREFERRED_SIZE, 20, Short.MAX_VALUE)%0A          .addGap(80))%0A    );%0A    setLayout(groupLayout
+JButton btnQuitBuilder = new JButton(%22Quit Builder%22);%0A    btnQuitBuilder.addActionListener(new ExitCtrl());%0A    btnQuitBuilder.addActionListener(new BuilderNewLevelCtrl(app, model));%0A    btnQuitBuilder.setAlignmentX(Component.CENTER_ALIGNMENT);%0A    btnQuitBuilder.setAlignmentY(Component.CENTER_ALIGNMENT);%0A    panelContent.add(btnQuitBuilder
 );%0A
+%0A
   %7D%0A

Fix BuilderMainMenuView to be scalable