package org.woehlke.simulation.evolution.view;

import javax.accessibility.Accessible;
import java.awt.*;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.awt.image.ImageObserver;
import java.io.Serializable;

/**
 * (C) 2006 - 2008 Thomas Woehlke.
 * http://thomas-woehlke.de/p/simulated-evolution/
 * @author Thomas Woehlke
 * Date: 04.02.2006
 * Time: 18:47:46
 */
public class AppMainFrame extends Frame implements ImageObserver,
        MenuContainer,
        Serializable,
        Accessible,
        WindowListener {

    private SimulatedEvolutionApplet exe;

    public AppMainFrame() {
        super("SimGen");
        exe = new SimulatedEvolutionApplet();
        exe.init();
        add("Center", exe);
        setBounds(100, 100, exe.getCanvasDimensions().getX() + 30, exe.getCanvasDimensions().getY() + 30);
        setVisible(true);
        toFront();
        addWindowListener(this);
    }

    public void windowOpened(WindowEvent e) {
        setBounds(100, 100, exe.getCanvasDimensions().getX() + 30, exe.getCanvasDimensions().getY() + 30);
        setVisible(true);
        toFront();
    }

    public void windowClosing(WindowEvent e) {
        System.exit(0);
    }

    public void windowClosed(WindowEvent e) {
        System.exit(0);
    }

    public void windowIconified(WindowEvent e) {

    }

    public void windowDeiconified(WindowEvent e) {
        setBounds(100, 100, exe.getCanvasDimensions().getX() + 30, exe.getCanvasDimensions().getY() + 30);
        setVisible(true);
        toFront();
    }

    public void windowActivated(WindowEvent e) {
        toFront();
    }

    public void windowDeactivated(WindowEvent e) {
    }
}

@@ -796,37 +796,32 @@
 ensions().getX()
- + 30
 , exe.getCanvasD
@@ -1029,37 +1029,32 @@
 ensions().getX()
- + 30
 , exe.getCanvasD
@@ -1454,21 +1454,16 @@
 ).getX()
- + 30
 , exe.ge

remove right border.