public abstract class SimpleMathMLImageSavingCallback extends Object implements MathMLImageSavingCallback
MathMLImageSavingCallback that
assumes that the same Content Type will be used to produce each MathML image and
restricts the number of configurable features somewhat.| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEFAULT_ANTI_ALIASING |
static String |
DEFAULT_CONTENT_TYPE |
static String |
DEFAULT_FONT_SIZE |
| Constructor and Description |
|---|
SimpleMathMLImageSavingCallback() |
| Modifier and Type | Method and Description |
|---|---|
String |
getFontSize() |
String |
getImageContentType() |
String |
getImageContentType(int mathmlCounter)
Implement to return the desired MIME type for the resulting image.
|
abstract File |
getImageOutputFile(int mathmlCounter)
Implement if you want the resulting image to be written to a
File of your choice. |
abstract OutputStream |
getImageOutputStream(int mathmlCounter)
Implement this if you want the resulting image to be written to an
OutputStream of
your choice. |
abstract String |
getImageURL(int mathmlCounter)
Implement to return the URL String that will be put into the
img src
attribute to refer to the image. |
net.sourceforge.jeuclid.MutableLayoutContext |
getLayoutContext(int mathmlCounter)
Implement to fill in the JEuclid
MutableLayoutContext specifying how you want to
render this image. |
void |
imageSavingSucceeded(Object imageFileOrOutputStream,
int mathmlCounter,
String contentType)
(A "do nothing" implementation for convenience.)
|
boolean |
isAntiAliasing() |
void |
setAntiAliasing(boolean antiAliasing) |
void |
setFontSize(String fontSize) |
void |
setImageContentType(String imageType) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitimageSavingFailedpublic static String DEFAULT_FONT_SIZE
public static String DEFAULT_CONTENT_TYPE
public static boolean DEFAULT_ANTI_ALIASING
public String getFontSize()
public void setFontSize(String fontSize)
public boolean isAntiAliasing()
public void setAntiAliasing(boolean antiAliasing)
public String getImageContentType()
public void setImageContentType(String imageType)
public final String getImageContentType(int mathmlCounter)
MathMLImageSavingCallbackConsult the JEuclid documentation for what is supported; you may need to add additional libraries for certain MIME types.
SnuggleTeX contains everything required to support PNG. Note that conversion to GIF does not generally work well so should be avoided...!
getImageContentType in interface MathMLImageSavingCallbackmathmlCounter - identifies the position of the image within the document being processed,
which can be used to ensure unique file names.public final net.sourceforge.jeuclid.MutableLayoutContext getLayoutContext(int mathmlCounter)
MathMLImageSavingCallbackMutableLayoutContext specifying how you want to
render this image.getLayoutContext in interface MathMLImageSavingCallbackmathmlCounter - identifies the position of the image within the document being processed,
which can be used to ensure unique file names.public abstract File getImageOutputFile(int mathmlCounter)
MathMLImageSavingCallbackFile of your choice.
Return null if you want the image to be written to the result of
MathMLImageSavingCallback.getImageOutputStream(int) instead.getImageOutputFile in interface MathMLImageSavingCallbackmathmlCounter - identifies the position of the image within the document being processed,
which can be used to ensure unique file names.MathMLImageSavingCallback.getImageOutputFile(int)public abstract OutputStream getImageOutputStream(int mathmlCounter)
MathMLImageSavingCallbackOutputStream of
your choice. The method MathMLImageSavingCallback.getImageOutputFile(int) is checked first, so must return
null in this case.getImageOutputStream in interface MathMLImageSavingCallbackmathmlCounter - identifies the position of the image within the document being processed,
which can be used to ensure unique file names.MathMLImageSavingCallback.getImageOutputStream(int)public abstract String getImageURL(int mathmlCounter)
MathMLImageSavingCallbackimg src
attribute to refer to the image.getImageURL in interface MathMLImageSavingCallbackmathmlCounter - identifies the position of the image within the document being processed,
which can be used to ensure unique file names.MathMLImageSavingCallback.getImageURL(int)public void imageSavingSucceeded(Object imageFileOrOutputStream, int mathmlCounter, String contentType)
imageSavingSucceeded in interface MathMLImageSavingCallbackimageFileOrOutputStream - File or OutputStream writtenmathmlCounter - identifies the position of the image within the document being processed,
which can be used to ensure unique file names.contentType - content type of the saved image FileMathMLImageSavingCallback.imageSavingSucceeded(Object, int, String)Copyright © 2008–2026 The University of Edinburgh. All rights reserved.