public MainWindow()
    {
        super(LOCALIZER.getString(L_APP_NAME));
        
        initializeLookAndFeel();
        
        pModel = new PresentationModel();
        pModel.setProperty(PRP_MODE, CMD_PHYSICS_MODE);
        
        Scene scene = null;
        
        // open a scene, if there is one assigned
        if (pModel.getProperty(PRP_CURRENT_FILE) != null)
        {
            SceneManager sceneManager = new SceneManager(pModel, this);
            File sceneFile = new File(pModel.getProperty(PRP_CURRENT_FILE));
            scene = sceneManager.loadScene(sceneFile);
            
            if (scene != null)
            {
                this.setTitle(LOCALIZER.getString(L_APP_NAME) +  " [" + sceneFile.getName() + "]");
            }
            else
            {
                pModel.setProperty(PRP_CURRENT_FILE, null);
            }
        }
        
        // sets the path to the used skin
        if (Configuration.getInstance().getProperty(PRP_SKIN) != null)
        {
            GuiUtil.setImageSourcePath(Configuration.getInstance().getProperty(PRP_SKIN));
        }
        
        // Free objects (if necessary) before this application ends
        this.addWindowListener(new WindowAdapter()
        {
            @Override
            public void windowClosing(WindowEvent e)
            {
                pModel.getPhysicsState().pause();
                MainWindow.this.dispose();
                Configuration.save();
            }
        });
        // handle full screen and windows mode
        this.addWindowStateListener(new WindowStateListener()
        {
            @Override
            public void windowStateChanged(WindowEvent e)
            {
                if ((MainWindow.this.getExtendedState() & MAXIMIZED_BOTH) != 0)
                {
                    pModel.setState(STG_MAXIMIZED, true);
                }
                else
                {
                    pModel.setState(STG_MAXIMIZED, false);
                }
            }
        });
        
        initializeWindow();
        
        // create a new scene, if there is not already one loaded
        if (scene == null)
        {
            scene = new Scene();
        }
        
        pModel.setScene(scene);
        
        pModel.setPhysicsState(new PhysicsConnector(pModel, 1000L / 30L, new PhysicsConnector.FinishedCallback()
        {
            @Override
            public void done()
            {
                pModel.fireSceneUpdated();
                renderer.pushScene(pModel.getScene());
            }
        }));
        
        
        initializeComponents();
        
        renderer = new Renderer(pModel, canvas);
        
        pModel.addStorageListener(this);
        
        
        this.setVisible(true);
    }