public abstract class SimpleMathMLImageSavingCallback extends java.lang.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.| 限定符和类型 | 字段和说明 |
|---|---|
static boolean |
DEFAULT_ANTI_ALIASING |
static java.lang.String |
DEFAULT_CONTENT_TYPE |
static java.lang.String |
DEFAULT_FONT_SIZE |
| 构造器和说明 |
|---|
SimpleMathMLImageSavingCallback() |
| 限定符和类型 | 方法和说明 |
|---|---|
java.lang.String |
getFontSize() |
java.lang.String |
getImageContentType() |
java.lang.String |
getImageContentType(int mathmlCounter)
Implement to return the desired MIME type for the resulting image.
|
abstract java.io.File |
getImageOutputFile(int mathmlCounter)
Implement if you want the resulting image to be written to a
File of your choice. |
abstract java.io.OutputStream |
getImageOutputStream(int mathmlCounter)
Implement this if you want the resulting image to be written to an
OutputStream of
your choice. |
abstract java.lang.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(java.lang.Object imageFileOrOutputStream,
int mathmlCounter,
java.lang.String contentType)
(A "do nothing" implementation for convenience.)
|
boolean |
isAntiAliasing() |
void |
setAntiAliasing(boolean antiAliasing) |
void |
setFontSize(java.lang.String fontSize) |
void |
setImageContentType(java.lang.String imageType) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitimageSavingFailedpublic static java.lang.String DEFAULT_FONT_SIZE
public static java.lang.String DEFAULT_CONTENT_TYPE
public static boolean DEFAULT_ANTI_ALIASING
public java.lang.String getFontSize()
public void setFontSize(java.lang.String fontSize)
public boolean isAntiAliasing()
public void setAntiAliasing(boolean antiAliasing)
public java.lang.String getImageContentType()
public void setImageContentType(java.lang.String imageType)
public final java.lang.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 在接口中 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 在接口中 MathMLImageSavingCallbackmathmlCounter - identifies the position of the image within the document being processed,
which can be used to ensure unique file names.public abstract java.io.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 在接口中 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 java.io.OutputStream getImageOutputStream(int mathmlCounter)
MathMLImageSavingCallbackOutputStream of
your choice. The method MathMLImageSavingCallback.getImageOutputFile(int) is checked first, so must return
null in this case.getImageOutputStream 在接口中 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 java.lang.String getImageURL(int mathmlCounter)
MathMLImageSavingCallbackimg src
attribute to refer to the image.getImageURL 在接口中 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(java.lang.Object imageFileOrOutputStream,
int mathmlCounter,
java.lang.String contentType)
imageSavingSucceeded 在接口中 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)