package electrosphere.renderer.ui;

import java.util.HashMap;
import java.util.concurrent.CopyOnWriteArrayList;

/**
 *
 * @author amaterasu
 */
public class WidgetManager {
    
    
    
    CopyOnWriteArrayList<Widget> widgetList = new CopyOnWriteArrayList();
    
    public WidgetManager(){
        
    }
    
    public void registerWidget(Widget w){
        if(!widgetList.contains(w)){
            widgetList.add(w);
        }
    }
    
    public CopyOnWriteArrayList<Widget> getWidgetList(){
        return widgetList;
    }
    
    public void unregisterWidget(Widget w){
        if(widgetList.contains(w)){
            widgetList.remove(w);
        }
    }
    
}
