View Javadoc

1   /*
2    * Copyright 2002 - 2008 JEuclid, http://jeuclid.sf.net
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  /* $Id: ImageLoaderFactoryMathML.java,v cca61eec2241 2008/05/23 09:53:47 maxberger $ */
18  
19  package net.sourceforge.jeuclid.xmlgraphics;
20  
21  import net.sourceforge.jeuclid.Constants;
22  
23  import org.apache.xmlgraphics.image.loader.ImageFlavor;
24  import org.apache.xmlgraphics.image.loader.impl.AbstractImageLoaderFactory;
25  import org.apache.xmlgraphics.image.loader.spi.ImageLoader;
26  
27  /**
28   * @version $Revision: cca61eec2241 $
29   */
30  public class ImageLoaderFactoryMathML extends AbstractImageLoaderFactory {
31  
32      private static final ImageFlavor[] FLAVORS = new ImageFlavor[] { ImageFlavor.XML_DOM };
33  
34      private static final String[] MIMES = new String[] { Constants.MATHML_MIMETYPE };
35  
36      /**
37       * Default Constructor.
38       */
39      public ImageLoaderFactoryMathML() {
40          // Empty on purpose
41      }
42  
43      /** {@inheritDoc} */
44      public String[] getSupportedMIMETypes() {
45          return ImageLoaderFactoryMathML.MIMES.clone();
46      }
47  
48      /** {@inheritDoc} */
49      public ImageFlavor[] getSupportedFlavors(final String mime) {
50          return ImageLoaderFactoryMathML.FLAVORS.clone();
51      }
52  
53      /** {@inheritDoc} */
54      public ImageLoader newImageLoader(final ImageFlavor targetFlavor) {
55          return new ImageLoaderMathML(targetFlavor);
56      }
57  
58      /** {@inheritDoc} */
59      public int getUsagePenalty(final String mime, final ImageFlavor flavor) {
60          return 0;
61      }
62  
63      /** {@inheritDoc} */
64      public boolean isAvailable() {
65          return true;
66      }
67  
68  }