|
@@ -1,5 +1,6 @@
|
|
|
import javax.swing.*;
|
|
|
import java.awt.*;
|
|
|
+import java.awt.event.*;
|
|
|
import java.awt.event.WindowAdapter;
|
|
|
import java.awt.event.WindowEvent;
|
|
|
import java.io.*;
|
|
@@ -8,11 +9,24 @@ import java.lang.Throwable;
|
|
|
public class Main
|
|
|
{
|
|
|
public static Model model;
|
|
|
+ public static Gallery gallery;
|
|
|
+ static class myAdapter extends ComponentAdapter
|
|
|
+ {
|
|
|
+ public void componentResized(ComponentEvent ce)
|
|
|
+ {
|
|
|
+ boolean temp = model.getLayout();
|
|
|
+ model.switchLayout(!temp);
|
|
|
+ model.switchLayout(temp);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ public static myAdapter listener;
|
|
|
|
|
|
public static void main(String[] args)
|
|
|
{
|
|
|
JFrame window = new JFrame("Fotag!");
|
|
|
model = new Model();
|
|
|
+ listener = new myAdapter();
|
|
|
+ window.addComponentListener(listener);
|
|
|
|
|
|
try
|
|
|
{
|
|
@@ -23,7 +37,7 @@ public class Main
|
|
|
}
|
|
|
catch (Exception e) {System.out.println("Playing baseball");}
|
|
|
|
|
|
- Gallery gallery = new Gallery(model);
|
|
|
+ gallery = new Gallery(model);
|
|
|
Controls controls = new Controls(model);
|
|
|
model.notifyObservers();
|
|
|
|
|
@@ -38,7 +52,7 @@ public class Main
|
|
|
|
|
|
// Setup the frame to do frame things
|
|
|
window.setPreferredSize(new Dimension(1280,720));
|
|
|
- window.setMinimumSize(new Dimension(320, 180));
|
|
|
+ window.setMinimumSize(new Dimension(400, 475));
|
|
|
window.pack();
|
|
|
//window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
|
|