Top Description Fields Constructors Methods
uk.ac.ed.ph.snuggletex.jeuclid

public abstract Class SimpleMathMLImageSavingCallback

extends Object
implements MathMLImageSavingCallback
Class Inheritance
All Implemented Interfaces
uk.ac.ed.ph.snuggletex.jeuclid.MathMLImageSavingCallback
Imports
java.io.File, .OutputStream, net.sourceforge.jeuclid.MutableLayoutContext, net.sourceforge.jeuclid.context.LayoutContextImpl, net.sourceforge.jeuclid.context.Parameter

Partial convenience implementation of MathMLImageSavingCallback that assumes that the same Content Type will be used to produce each MathML image and restricts the number of configurable features somewhat.
Author
David McKain
Version
$Revision$

Field Summary

Modifier and TypeField and Description
private boolean
public static boolean
public static String
public static String
private String
private String
private final net.sourceforge.jeuclid.context.LayoutContextImpl

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
public String
public final String
getImageContentType(int mathmlCounter)

Implements uk.ac.ed.ph.snuggletex.jeuclid.MathMLImageSavingCallback.getImageContentType.

Implement to return the desired MIME type for the resulting image.

public abstract File
getImageOutputFile(int mathmlCounter)

Redeclares uk.ac.ed.ph.snuggletex.jeuclid.MathMLImageSavingCallback.getImageOutputFile.

Implement if you want the resulting image to be written to a File of your choice.

public abstract OutputStream
getImageOutputStream(int mathmlCounter)

Redeclares uk.ac.ed.ph.snuggletex.jeuclid.MathMLImageSavingCallback.getImageOutputStream.

Implement this if you want the resulting image to be written to an OutputStream of your choice.

public abstract String
getImageURL(int mathmlCounter)

Redeclares uk.ac.ed.ph.snuggletex.jeuclid.MathMLImageSavingCallback.getImageURL.

Implement to return the URL String that will be put into the img src attribute to refer to the image.

public final net.sourceforge.jeuclid.MutableLayoutContext
getLayoutContext(int mathmlCounter)

Implements uk.ac.ed.ph.snuggletex.jeuclid.MathMLImageSavingCallback.getLayoutContext.

Implement to fill in the JEuclid MutableLayoutContext specifying how you want to render this image.

public void
imageSavingSucceeded(Object imageFileOrOutputStream, int mathmlCounter, String contentType)

Implements uk.ac.ed.ph.snuggletex.jeuclid.MathMLImageSavingCallback.imageSavingSucceeded.

(A "do nothing" implementation for convenience.)

public boolean
public void
setAntiAliasing(boolean antiAliasing)

public void
setFontSize(String fontSize)

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

antiAliasingback to summary
private boolean antiAliasing
DEFAULT_ANTI_ALIASINGback to summary
public static boolean DEFAULT_ANTI_ALIASING
DEFAULT_CONTENT_TYPEback to summary
public static String DEFAULT_CONTENT_TYPE
DEFAULT_FONT_SIZEback to summary
public static String DEFAULT_FONT_SIZE
fontSizeback to summary
private String fontSize
imageContentTypeback to summary
private String imageContentType
layoutContextback to summary
private final net.sourceforge.jeuclid.context.LayoutContextImpl layoutContext

Constructor Detail

SimpleMathMLImageSavingCallbackback to summary
public SimpleMathMLImageSavingCallback()

Method Detail

getFontSizeback to summary
public String getFontSize()
getImageContentTypeback to summary
public String getImageContentType()
getImageContentTypeback to summary
public final String getImageContentType(int mathmlCounter)

Implements uk.ac.ed.ph.snuggletex.jeuclid.MathMLImageSavingCallback.getImageContentType.

Doc from uk.ac.ed.ph.snuggletex.jeuclid.MathMLImageSavingCallback.getImageContentType.

Implement to return the desired MIME type for the resulting image.

Consult 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...!

getImageOutputFileback to summary
public abstract File getImageOutputFile(int mathmlCounter)

Redeclares uk.ac.ed.ph.snuggletex.jeuclid.MathMLImageSavingCallback.getImageOutputFile.

Doc from uk.ac.ed.ph.snuggletex.jeuclid.MathMLImageSavingCallback.getImageOutputFile.

Implement if you want the resulting image to be written to a File of your choice. Return null if you want the image to be written to the result of getImageOutputStream(int) instead.

See Also
MathMLImageSavingCallback#getImageOutputFile(int)
getImageOutputStreamback to summary
public abstract OutputStream getImageOutputStream(int mathmlCounter)

Redeclares uk.ac.ed.ph.snuggletex.jeuclid.MathMLImageSavingCallback.getImageOutputStream.

Doc from uk.ac.ed.ph.snuggletex.jeuclid.MathMLImageSavingCallback.getImageOutputStream.

Implement this if you want the resulting image to be written to an OutputStream of your choice. The method getImageOutputFile(int) is checked first, so must return null in this case.

See Also
MathMLImageSavingCallback#getImageOutputStream(int)
getImageURLback to summary
public abstract String getImageURL(int mathmlCounter)

Redeclares uk.ac.ed.ph.snuggletex.jeuclid.MathMLImageSavingCallback.getImageURL.

Doc from uk.ac.ed.ph.snuggletex.jeuclid.MathMLImageSavingCallback.getImageURL.

Implement to return the URL String that will be put into the img src attribute to refer to the image.

See Also
MathMLImageSavingCallback#getImageURL(int)
getLayoutContextback to summary
public final net.sourceforge.jeuclid.MutableLayoutContext getLayoutContext(int mathmlCounter)

Implements uk.ac.ed.ph.snuggletex.jeuclid.MathMLImageSavingCallback.getLayoutContext.

Doc from uk.ac.ed.ph.snuggletex.jeuclid.MathMLImageSavingCallback.getLayoutContext.

Implement to fill in the JEuclid MutableLayoutContext specifying how you want to render this image.

imageSavingSucceededback to summary
public void imageSavingSucceeded(Object imageFileOrOutputStream, int mathmlCounter, String contentType)

Implements uk.ac.ed.ph.snuggletex.jeuclid.MathMLImageSavingCallback.imageSavingSucceeded.

(A "do nothing" implementation for convenience.)

See Also
MathMLImageSavingCallback#imageSavingSucceeded(Object, int, String)
isAntiAliasingback to summary
public boolean isAntiAliasing()
setAntiAliasingback to summary
public void setAntiAliasing(boolean antiAliasing)
setFontSizeback to summary
public void setFontSize(String fontSize)
setImageContentTypeback to summary
public void setImageContentType(String imageType)