diff options
Diffstat (limited to 'Week11 Mandelbrot/src/fractals/MainWindow.java')
-rw-r--r-- | Week11 Mandelbrot/src/fractals/MainWindow.java | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/Week11 Mandelbrot/src/fractals/MainWindow.java b/Week11 Mandelbrot/src/fractals/MainWindow.java new file mode 100644 index 0000000..5c56b7f --- /dev/null +++ b/Week11 Mandelbrot/src/fractals/MainWindow.java @@ -0,0 +1,50 @@ +package fractals;
+
+
+
+import java.awt.Insets;
+
+import javax.swing.JFrame;
+
+/**
+ *
+ * @author Sjaak Smetsers
+ * @version 1.0, 14-03-2013
+ */
+
+/**
+ * creates a window to which a GridView panel is added
+ *
+ */
+public class MainWindow {
+ // the size of the window
+ public static final int WIDTH = 650, HEIGHT = 650;
+
+ // The grip panel
+ private GridView grid;
+
+ public MainWindow () {
+ JFrame mainFrame = new JFrame ("Mandelbrot");
+
+ mainFrame.setSize (WIDTH, HEIGHT);
+ mainFrame.setLocationRelativeTo(null);
+ mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ mainFrame.setResizable(false);
+ mainFrame.setVisible(true);
+
+ Insets insets = mainFrame.getInsets ();
+ grid = new GridView (WIDTH - insets.left - insets.right, HEIGHT - insets.top - insets.bottom);
+
+ mainFrame.add(grid);
+ mainFrame.pack();
+ }
+
+ /**
+ * A getter for the grid
+ * @return the grid
+ */
+ public Grid getGrid () {
+ return grid;
+ }
+
+}
|