public synchronized void setVisible(boolean value) {
		
		if (visible == value) return;
					
		if (value) {
			visible = value;
			if (graphics2D == null) {
				initialize();
			}
		} else {
			if (graphics2D != null) {
				try {
					buffer = this.getScreenshot();
				} catch (IllegalComponentStateException exception) {
					// failed to capture screenshot
					// probably just disposing of the panel
				}
				this.graphics2D.dispose();
				this.graphics2D = null;	
		
				/*this.getKeyListener().clear();
				this.getMouseListener().clear();
				this.getMouseMotionListener().clear();
				this.getWindowListener().clear();*/
				
				WindowManager.getInstance().unregister(this);
			}
			visible = value;
		}		
	}