org.malai.ui
Class UIManager

java.lang.Object
  extended by org.malai.ui.UIManager
All Implemented Interfaces:
java.awt.event.WindowFocusListener, java.util.EventListener

public final class UIManager
extends java.lang.Object
implements java.awt.event.WindowFocusListener

A UI manager registers all the UIs of the applications in order to manage some technical aspects such as cleaning pending events of a UI losing the focus.

This file is part of Malai.
Copyright (c) 2009-2012 Arnaud BLOUIN

Malai is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Malai is distributed without any warranty; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

07/22/2011

Since:
0.2
Version:
0.2
Author:
Arnaud BLOUIN

Field Summary
static UIManager INSTANCE
          The singleton instance.
private  java.util.Set<UI> uiRegistered
          The UI registered.
 
Constructor Summary
private UIManager()
          Creates the register.
 
Method Summary
private  void clearUIEvents(UI ui)
          Clears the events in process of the instruments of the given UI.
 void registerUI(UI ui)
          Registers the given UI.
 void unregisterUI(UI ui)
          Unregisters the given UI.
 void windowGainedFocus(java.awt.event.WindowEvent e)
           
 void windowLostFocus(java.awt.event.WindowEvent e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final UIManager INSTANCE
The singleton instance.


uiRegistered

private java.util.Set<UI> uiRegistered
The UI registered.

Constructor Detail

UIManager

private UIManager()
Creates the register.

Since:
0.2
Method Detail

registerUI

public void registerUI(UI ui)
Registers the given UI.

Parameters:
ui - The UI to register. Nothing is done if null.
Since:
0.2

unregisterUI

public void unregisterUI(UI ui)
Unregisters the given UI.

Parameters:
ui - The UI to unregister.
Since:
0.2

windowGainedFocus

public void windowGainedFocus(java.awt.event.WindowEvent e)
Specified by:
windowGainedFocus in interface java.awt.event.WindowFocusListener

windowLostFocus

public void windowLostFocus(java.awt.event.WindowEvent e)
Specified by:
windowLostFocus in interface java.awt.event.WindowFocusListener

clearUIEvents

private void clearUIEvents(UI ui)
Clears the events in process of the instruments of the given UI.

Parameters:
ui - The UI to clear.
Since:
0.2