View Javadoc

1   /*
2    * Created on Jul 24, 2005. Copyright 1999-2006 Faculty of Mathematics, Physics
3    * and Informatics, Comenius University, Bratislava. This file is protected by
4    * the Mozilla Public License version 1.1 (the "License"); you may not use this
5    * file except in compliance with the License. You may obtain a copy of the
6    * License at http://euromath2.sourceforge.net/license.html Unless required by
7    * applicable law or agreed to in writing, software distributed under the
8    * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
9    * OF ANY KIND, either express or implied. See the License for the specific
10   * language governing permissions and limitations under the License.
11   */
12  package sk.uniba.euromath.editor;
13  import java.util.Map;
14  
15  /***
16   * <p>
17   * Produces renderer instances. Must be equal only to factory with same class.
18   * <code>hashCode()</code> must be implemented correctly aswell, to reflect
19   * this behaviour. In case of singleton factory, default Object's
20   * <code>equals()</code> and <code>hashCode()</code> is the correct
21   * implementation thus it is not needed to be overriden.
22   * </p>
23   * @author Martin Vysny
24   */
25  public interface IRendererFactory {
26  	/***
27  	 * ID of extension point for renderer factory instances.
28  	 */
29  	public static final String EXTENSION_POINT_ID = "sk.uniba.euromath.IRendererFactory"; //$NON-NLS-1$
30  	/***
31  	 * Produces an instance of renderer denoted by given ID.
32  	 * @param id id of the renderer.
33  	 * @return renderer instance.
34  	 * @throws EditorException if error occurs during renderer creation.
35  	 * @throws IllegalArgumentException if id is not known.
36  	 */
37  	public IRenderer produce(final String id) throws EditorException;
38  	/***
39  	 * Returns map that maps ID of an renderer to the information about that
40  	 * renderer.
41  	 * @return maps ID to info about the renderer. Factory should compute this
42  	 * map only once - it won't get modified.
43  	 * @throws EditorException if problem occurs.
44  	 */
45  	public Map<String, RendererInfo> getSupportedRenderers()
46  			throws EditorException;
47  }