fMath for Java is a FREE solution to display and edit mathematics on web pages using Java components.

API Communication and settings


Javascript access to component
	// set the mathml for a component to display a formula
	var formulaSwf = getSWF('formulaId');
	formulaSwf.setMathML('<mrow>...</mrow>');
	
	// get the mathml string from a component
	var mathML = formulaSwf.getMathML();

	// set the LaTeX for a component to display a formula
	var formulaSwf = getSWF('formulaId');
	formulaSwf.setLaTeX('\\[ ds^2 = dx_1^2 + dx_2^2 + dx_3^2 - c^2 dt^2 \\]');
	
	// get the mathml string from a component
	var latex = formulaSwf.getLaTeX();
	
	//change default font
	formulaSwf.setMathMLFont("fraktur");

	//change default font size
	formulaSwf.setMathMLFontSize("40");

	//change default font color
	formulaSwf.setMathMLColor("blue");

	//change default background color
	formulaSwf.setMathMLBackground("#ddeeff");
	
	// get jpg base64 image from component, the second paramter is compression
	var base64String = formulaSwf.getBase64Image('JPG', 100);
	
	// get png base64 image from component
	var base64String = formulaSwf.getBase64Image('PNG');
	
	//hide the formula
	formulaSwf.hide();
	
	//show the formula
	formulaSwf.show();

Add Edit menu to right-click - Integration with MathML Editor

	- menuType=true - this will display flash right-click menu "Edit ..."
		When clicked will call the javascript method: editMathML( htmlId, mathml)
		Arguments passed: 
			- htmlId is his Id. After the editor edit the formula needs to know what object have called
			- mathml. The current mathml.
		

How to do that for each display type:
	1. MathML code inside HTML

		...	
		<span style="display:none;" menuType="true"
		...
	
	2. Object/Embed flash tag in HTML and loading the mathml by Javascript
	
		...
		<PARAM NAME="FlashVars" 
		VALUE="menuType=true">
		...		
		flashvars="menuType=true"
		...
		
	3. Object/Embed flash tag in HTML and loading the mathml by url request
	
		...
		<PARAM NAME="FlashVars" 
		VALUE="menuType=true">	
		...
		flashvars="menuType=true"
		...
		


Default settings

You can configure the default settings:
	- defaultColor - the default color to display the formula; Default is #000000 (black);
	- defaultBackground - the default background to display the formula;  Default is #ffffff (white);
		The color could be: #rgb or "aqua", "black", "blue", "fuchsia", "gray", "green", 
		"lime", "maroon", "navy", "olive", "purple", "red", "silver", "teal", "white", "yellow"
	
	- defaultSize - the default size to display the formula; Default size is 22;
	- defaultFont - the default font to display the formula. Default is "normal";
		The values could be one of: normal | bold | italic | bold-italic | double-struck | bold-fraktur | 
		script | bold-script | fraktur | sans-serif | bold-sans-serif | sans-serif-italic | 
		sans-serif-bold-italic | monospace | bold-double-struck | double-struck-italic | 
		double-struck-bold-italic | circle | bold-circle | circle-italic | circle-bold-italic 
		or a client installed font name
		

How to do that for each display type:
	1. MathML code inside HTML

		...	
		<span style="display:none;" defaultColor="#ff0000" defaultBackground="#dddddd"
		defaultSize="30" defaultFont="monospace"
		...
	
	2. Object/Embed flash tag in HTML and loading the mathml by Javascript
	
		...
		<PARAM NAME="FlashVars" 
		VALUE="defaultColor=#ff0000&defaultBackground=#dddddd&defaultSize=30&defaultFont=monospace">
		...		
		flashvars="defaultColor=#ff0000&defaultBackground=#dddddd&defaultSize=30&defaultFont=monospace"
		...
		
	3. Object/Embed flash tag in HTML and loading the mathml by url request
	
		...
		<PARAM NAME="FlashVars" 
		VALUE="defaultColor=#ff0000&defaultBackground=#dddddd&defaultSize=30&defaultFont=monospace">	
		...
		flashvars="defaultColor=#ff0000&defaultBackground=#dddddd&defaultSize=30&defaultFont=monospace"
		...
		

`


www.learn-math.info | www.apprendre-math.info | www.aprender-mat.info | www.invata-mate.info
Designed by Diana Alexandru
free components MathML flex GWT LaTeX Web Editor free plugin MathML flash math Mathematics Equation Widget MathML flash LaTeX Mathematics FREE Editor Java