1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
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
38
39 public ImageLoaderFactoryMathML() {
40
41 }
42
43
44 public String[] getSupportedMIMETypes() {
45 return ImageLoaderFactoryMathML.MIMES.clone();
46 }
47
48
49 public ImageFlavor[] getSupportedFlavors(final String mime) {
50 return ImageLoaderFactoryMathML.FLAVORS.clone();
51 }
52
53
54 public ImageLoader newImageLoader(final ImageFlavor targetFlavor) {
55 return new ImageLoaderMathML(targetFlavor);
56 }
57
58
59 public int getUsagePenalty(final String mime, final ImageFlavor flavor) {
60 return 0;
61 }
62
63
64 public boolean isAvailable() {
65 return true;
66 }
67
68 }