mathmlstring.java

来自「基于web的数学公式编辑器」· Java 代码 · 共 56 行

JAVA
56
字号

package webmath;

import org.w3c.dom.*;

public class MathmlString
{

	Panel1 panel1;

	MathmlString(Panel1 panel1)
	{

		this.panel1 = panel1;
	}

	public String getmathmlcode()
	{

		String math;
		math = panel1.getXML(panel1.root);
		return math;
	}

	public void setNameSpace(String nameSpace)
	{

		panel1.nameSpace = nameSpace;
	}

	void deletenodeattributes()
	{

		deleteattribute(panel1.root);
	}

	void deleteattribute(Node node)
	{

		if (node.getNodeType() == Node.ELEMENT_NODE)
		{
			((Element) node).removeAttribute("x1");
			((Element) node).removeAttribute("x2");
			((Element) node).removeAttribute("y1");
			((Element) node).removeAttribute("y2");
			((Element) node).removeAttribute("baseliney");
		}
		NodeList nodes = node.getChildNodes();
		for (int i = 0; i < nodes.getLength(); i++)
		{
			Node childnode = nodes.item(i);
			deleteattribute(childnode);
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?