/* * Moonlight|3D Copyright (C) 2005 The Moonlight|3D team * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Created on Oct 21, 2005 */ package ml.backend.renderer; /** * \package ml.backend.renderer * * The management for the render engine plugisn resides here. * Access to render engines goes through here. * * This package is part of the core program. */ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import ml.core.helper.PropertyContainer; /** * A manager for all supported render engines. * * @author gregor */ public class Manager { private static ArrayList renderEngines; static { renderEngines=new ArrayList(); } /** * Register a new rendering engine. * * @param engine the engine to register. */ public static void addRenderEngine(RenderEngine engine) { renderEngines.add(engine); } /** * Find the render engine interface for the engine with the given name * and return it. * * @param name the name of the engine to unregister * @return the RenderEngine instance that has been unregistered or null if it was not found */ public static RenderEngine getRenderEngine(String name) { for(int i=0;i getRenderEngines() { ArrayList engineList=new ArrayList(); for(int i=0;i rendererProperties; public Manager() { rendererProperties=new HashMap(); for(RenderEngine engine : renderEngines) { rendererProperties.put(engine.getName(), engine.getProperties()); } } public PropertyContainer getProperties(String engineName) { return rendererProperties.get(engineName); } }