⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 panel1.java

📁 基于web的数学公式编辑器
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
			{ // 为上标分配坐标
				Node childnode;
				String msupsx, msupsy;
				int msupx1, msupx2, msupy1, msupy2;
				if (issmallsize == 0)
				{
					childnode = node.getFirstChild();
					setxy(childnode, originx, originy);
					issup = 1;
					issmallsize = 1;
					msupsx = ((Element) childnode).getAttribute("x2");
					msupsy = ((Element) childnode).getAttribute("y1");
					msupx1 = Integer.parseInt(msupsx);
					msupy1 = Integer.parseInt(msupsy);
					fontsize = fontsize2 - reducesize;
					setFontSize(fontsize);
					repaint();
					childnode = node.getLastChild(); // 上标部分
					setxy(childnode, originx, originy);
					repaint();
					msupsy = ((Element) childnode).getAttribute("y2");
					msupy2 = Integer.parseInt(msupsy);
					msupsx = ((Element) childnode).getAttribute("x1");
					msupx2 = Integer.parseInt(msupsx);
					movenodexy(childnode, msupx1 - msupx2, msupy1 - msupy2 + 5);
					fontsize = fontsize2;
					setFontSize(fontsize);
					repaint();
					issup = 0;
					setissmallsize();
				}
				else
				{
					childnode = node.getFirstChild();
					setxy(childnode, originx, originy);
					msupsx = ((Element) childnode).getAttribute("x2");
					msupsy = ((Element) childnode).getAttribute("y1");
					msupx1 = Integer.parseInt(msupsx);
					msupy1 = Integer.parseInt(msupsy);
					childnode = node.getLastChild(); // 上标部分
					setxy(childnode, originx, originy);
					msupsy = ((Element) childnode).getAttribute("y2");
					msupy2 = Integer.parseInt(msupsy);
					msupsx = ((Element) childnode).getAttribute("x1");
					msupx2 = Integer.parseInt(msupsx);
					movenodexy(childnode, msupx1 - msupx2, msupy1 - msupy2 + 5);
				}
			}
			else if (node.getNodeName() == "msub")
			{
				Node childnode;
				String msubsx, msubsy;
				int msubx1, msubx2, msuby1, msuby2;
				if (issmallsize == 0)
				{
					childnode = node.getFirstChild();
					setxy(childnode, originx, originy);
					issub = 1;
					issmallsize = 1;
					msubsx = ((Element) childnode).getAttribute("x2");
					msubsy = ((Element) childnode).getAttribute("y2");
					msubx1 = Integer.parseInt(msubsx);
					msuby1 = Integer.parseInt(msubsy);
					fontsize = fontsize2 - reducesize;
					setFontSize(fontsize);
					repaint();
					childnode = node.getLastChild(); // 下标部分
					setxy(childnode, originx, originy);
					msubsy = ((Element) childnode).getAttribute("y1");
					msuby2 = Integer.parseInt(msubsy);
					msubsx = ((Element) childnode).getAttribute("x1");
					msubx2 = Integer.parseInt(msubsx);
					movenodexy(childnode, msubx1 - msubx2, msuby1 - msuby2 - 5);
					setFontSize(fontsize2);
					repaint();
					issub = 0;
					setissmallsize();
				}
				else
				{
					childnode = node.getFirstChild();
					setxy(childnode, originx, originy);
					msubsx = ((Element) childnode).getAttribute("x2");
					msubsy = ((Element) childnode).getAttribute("y2");
					msubx1 = Integer.parseInt(msubsx);
					msuby1 = Integer.parseInt(msubsy);
					childnode = node.getLastChild(); // 下标部分
					setxy(childnode, originx, originy);
					msubsy = ((Element) childnode).getAttribute("y1");
					msuby2 = Integer.parseInt(msubsy);
					msubsx = ((Element) childnode).getAttribute("x1");
					msubx2 = Integer.parseInt(msubsx);
					movenodexy(childnode, msubx1 - msubx2, msuby1 - msuby2 - 5);
				}
			}
			else if (node.getNodeName() == "msubsup")
			{
				Node childnode;
				String msubsx, msubsy;
				String msupsx, msupsy;
				String msubsupsx, msubsupsy;
				int msubx1, msubx2, msuby1, msuby2;
				int msupx1, msupx2, msupy1, msupy2;
				int msubsupx1, msubsupy1;
				if (issmallsize == 0)
				{
					childnode = node.getFirstChild();
					setxy(childnode, originx, originy);
					issubsup = 1;
					issmallsize = 1;
					msubsx = ((Element) childnode).getAttribute("x2");
					msubsy = ((Element) childnode).getAttribute("y2");
					msubx1 = Integer.parseInt(msubsx);
					msuby1 = Integer.parseInt(msubsy);
					msupsy = ((Element) childnode).getAttribute("y1");
					msupx1 = msubx1;
					msupy1 = Integer.parseInt(msupsy);
					fontsize = fontsize2 - reducesize;
					setFontSize(fontsize);
					repaint();
					childnode = node.getLastChild(); // 上标部分
					setxy(childnode, originx, originy);
					msupsy = ((Element) childnode).getAttribute("y2");
					msupy2 = Integer.parseInt(msupsy);
					msupsx = ((Element) childnode).getAttribute("x1");
					msupx2 = Integer.parseInt(msupsx);
					movenodexy(childnode, msupx1 - msupx2, msupy1 - msupy2 + 5);
					childnode = node.getFirstChild().getNextSibling(); // 下标部分
					setxy(childnode, originx, originy);
					msubsy = ((Element) childnode).getAttribute("y1");
					msuby2 = Integer.parseInt(msubsy);
					msubsx = ((Element) childnode).getAttribute("x1");
					msubx2 = Integer.parseInt(msubsx);
					movenodexy(childnode, msubx1 - msubx2, msuby1 - msuby2 - 5);
					setFontSize(fontsize2);
					repaint();
					issubsup = 0;
					setissmallsize();
				}
				else
				{
					childnode = node.getFirstChild();
					setxy(childnode, originx, originy);
					msubsx = ((Element) childnode).getAttribute("x2");
					msubsy = ((Element) childnode).getAttribute("y2");
					msubx1 = Integer.parseInt(msubsx);
					msuby1 = Integer.parseInt(msubsy);
					msupsy = ((Element) childnode).getAttribute("y1");
					msupx1 = msubx1;
					msupy1 = Integer.parseInt(msupsy);
					childnode = node.getLastChild(); // 上标部分
					setxy(childnode, originx, originy);
					msupsy = ((Element) childnode).getAttribute("y2");
					msupy2 = Integer.parseInt(msupsy);
					msupsx = ((Element) childnode).getAttribute("x1");
					msupx2 = Integer.parseInt(msupsx);
					movenodexy(childnode, msupx1 - msupx2, msupy1 - msupy2 + 5);
					childnode = node.getFirstChild().getNextSibling(); // 下标部分
					setxy(childnode, originx, originy);
					msubsy = ((Element) childnode).getAttribute("y1");
					msuby2 = Integer.parseInt(msubsy);
					msubsx = ((Element) childnode).getAttribute("x1");
					msubx2 = Integer.parseInt(msubsx);
					movenodexy(childnode, msubx1 - msubx2, msuby1 - msuby2 - 5);
				}
			}
			else if (node.getNodeName() == "mintsubsup")
			{
				Node childnode;
				String msubsx, msubsy;
				String msupsx, msupsy;
				String msubsupsx, msubsupsy;
				int msubx1, msubx2, msuby1, msuby2;
				int msupx1, msupx2, msupy1, msupy2;
				int msubsupx1, msubsupy1;
				if (issmallsize == 0)
				{
					childnode = node.getFirstChild();
					setxy(childnode, originx, originy);
					issubsup = 1;
					issmallsize = 1;
					msubsx = ((Element) childnode).getAttribute("x2");
					msubsy = ((Element) childnode).getAttribute("y2");
					msubx1 = Integer.parseInt(msubsx);
					msuby1 = Integer.parseInt(msubsy);
					msupsy = ((Element) childnode).getAttribute("y1");
					msupx1 = msubx1;
					msupy1 = Integer.parseInt(msupsy);
					fontsize = fontsize2 - reducesize;
					setFontSize(fontsize);
					repaint();
					childnode = node.getLastChild(); // 上标部分
					setxy(childnode, originx, originy);
					msupsy = ((Element) childnode).getAttribute("y2");
					msupy2 = Integer.parseInt(msupsy);
					msupsx = ((Element) childnode).getAttribute("x1");
					msupx2 = Integer.parseInt(msupsx);
					movenodexy(childnode, msupx1 - msupx2, msupy1 - msupy2 + 5);
					childnode = node.getFirstChild().getNextSibling(); // 下标部分
					setxy(childnode, originx, originy);
					msubsy = ((Element) childnode).getAttribute("y1");
					msuby2 = Integer.parseInt(msubsy);
					msubsx = ((Element) childnode).getAttribute("x1");
					msubx2 = Integer.parseInt(msubsx);
					movenodexy(childnode, msubx1 - msubx2, msuby1 - msuby2 - 5);
					setFontSize(fontsize2);
					repaint();
					issubsup = 0;
					setissmallsize();
				}
				else
				{
					childnode = node.getFirstChild();
					setxy(childnode, originx, originy);
					msubsx = ((Element) childnode).getAttribute("x2");
					msubsy = ((Element) childnode).getAttribute("y2");
					msubx1 = Integer.parseInt(msubsx);
					msuby1 = Integer.parseInt(msubsy);
					msupsy = ((Element) childnode).getAttribute("y1");
					msupx1 = msubx1;
					msupy1 = Integer.parseInt(msupsy);
					childnode = node.getLastChild(); // 上标部分
					setxy(childnode, originx, originy);
					msupsy = ((Element) childnode).getAttribute("y2");
					msupy2 = Integer.parseInt(msupsy);
					msupsx = ((Element) childnode).getAttribute("x1");
					msupx2 = Integer.parseInt(msupsx);
					movenodexy(childnode, msupx1 - msupx2, msupy1 - msupy2 + 5);
					childnode = node.getFirstChild().getNextSibling(); // 下标部分
					setxy(childnode, originx, originy);
					msubsy = ((Element) childnode).getAttribute("y1");
					msuby2 = Integer.parseInt(msubsy);
					msubsx = ((Element) childnode).getAttribute("x1");
					msubx2 = Integer.parseInt(msubsx);
					movenodexy(childnode, msubx1 - msubx2, msuby1 - msuby2 - 5);
				}
			}
			else if (node.getNodeName() == "mroot")
			{ // 求多次根
				if (issmallsize == 0)
				{
					String sx2, sy2, sy3, sy4;
					int x2, y2, y3, y4;
					Node childnode = node.getLastChild();
					fontsize = fontsize2 - reducesize;
					setFontSize(fontsize);
					repaint();
					isroot = 1;
					setissmallsize();
					setxy(childnode, originx, originy);
					setFontSize(fontsize2);
					repaint();
					sx2 = ((Element) childnode).getAttribute("x2");
					x2 = Integer.parseInt(sx2);
					sy2 = ((Element) childnode).getAttribute("y2");
					y2 = Integer.parseInt(sy2);
					isroot = 0;
					setissmallsize();
					childnode = node.getFirstChild();
					setxy(childnode, x2 + 5, originy);
					sy3 = ((Element) childnode).getAttribute("y1");
					y3 = Integer.parseInt(sy3);
					sy4 = ((Element) childnode).getAttribute("y2");
					y4 = Integer.parseInt(sy4);
					int endy = y4 - (int) (0.3 * (y4 - y3));
					movenodexy(node.getLastChild(), 0, endy - y2);
				}
				else
				{
					Node childnode = node.getLastChild();
					fontsize = fontsize2 - reducesize;
					setFontSize(fontsize);
					repaint();
					setxy(childnode, originx, originy);
					String sx2;
					int x2;
					sx2 = ((Element) childnode).getAttribute("x2");
					x2 = Integer.parseInt(sx2);
					childnode = node.getFirstChild();
					setxy(childnode, x2 + 5, originy);
				}
			}
			else if (node.getNodeName() == "munder")
			{ // 为下限分配坐标
				Node childnode;
				String msubsx, msubsy;
				int msubx1, msubx2, msuby1, msuby2;
				if (issmallsize == 0)
				{
					childnode = node.getFirstChild();
					setxy(childnode, originx, originy);
					isunder = 1;
					issmallsize = 1;
					msubsx = ((Element) childnode).getAttribute("x2");
					msubsy = ((Element) childnode).getAttribute("y2");
					msubx1 = Integer.parseInt(msubsx);
					msuby1 = Integer.parseInt(msubsy);
					fontsize = fontsize2 - reducesize;
					setFontSize(fontsize);
					repaint();
					childnode = node.getLastChild(); // 下标部分
					setxy(childnode, originx, originy);
					msubsy = ((Element) childnode).getAttribute("y1");
					msuby2 = Integer.parseInt(msubsy);
					msubsx = ((Element) childnode).getAttribute("x1");
					msubx2 = Integer.parseInt(msubsx);
					movenodexy(childnode, 0, msuby1 - msuby2);
					setFontSize(fontsize2);
					repaint();
					isunder = 0;
					setissmallsize();
				}
				else
				{
					childnode = node.getFirstChild();
					setxy(childnode, originx, originy);
					msubsx = ((Element) childnode).getAttribute("x2");
					msubsy = ((Element) childnode).getAttribute("y2");
					msubx1 = Integer.parseInt(msubsx);
					msuby1 = Integer.parseInt(msubsy);
					childnode = node.getLastChild(); // 下标部分
					setxy(childnode, originx, originy);
					msubsy = ((Element) childnode).getAttribute("y1");
					msuby2 = Integer.parseInt(msubsy);
					msubsx = ((Element) childnode).getAttribute("x1");
					msubx2 = Integer.parseInt(msubsx);
					movenodexy(childnode, 0, msuby1 - msuby2);
				}
			}
			else if (node.getNodeName() == "mover")
			{ // 为上限分配坐标
				Node childnode;
				String msupsx, msupsy;
				int msupx1, msupx2, msupy1, msupy2;
				if (issmallsize == 0)
				{
					childnode = node.getFirstChild();
					setxy(childnode, originx, originy);
					isover = 1;
					issmallsize = 1;
					msupsx = ((Element) childnode).getAttribute("x2");
					msupsy = ((Element) childnode).getAttribute("y1");
					msupx1 = Integer.parseInt(msupsx);
					msupy1 = Integer.parseInt(msupsy);
					fontsize = fontsize2 - reducesize;
					setFontSize(fontsize);
					repaint();
					childnode = node.getLastChild(); // 上限部分
					setxy(childnode, originx, originy);
					repaint();
					msupsy = ((Element) childnode).getAttribute("y2");
					msupy2 = Integer.parseInt(msupsy);
					msupsx = ((Element) childnode).getAttribute("x1");
					msupx2 = Integer.parseInt(msupsx);
					movenodexy(childnode, 0, msupy1 - msupy2);
					fontsize = fontsize2;
					setFontSize(fontsize);
					repaint();
					isover = 0;
					setissmallsize();
				}
				else
				{
					childnode = node.getFirstChild();
					setxy(childnode, originx, originy);
					msupsx = ((Element) childnode).getAttribute("x2");
					msupsy = ((Element) childnode).getAttribute("y1");
					msupx1 = Integer.parseInt(msupsx);
					msupy1 = Integer.parseInt(msupsy);
					childnode = node.getLastChild(); // 上限部分
					setxy(childnode, originx, originy);
					msupsy = ((Element) childnode).getAttribute("y2");
					msupy2 = Integer.parseInt(msupsy);
					msupsx = ((Element) childnode).getAttribute("x1");
					msupx2 = Integer.parseInt(msupsx);
					movenodexy(childnode, 0, msupy1 - msupy2);
				}
			}
			else if (node.getNodeName() == "munderover")
			{
				Node childnode;
				String msubsx, msubsy;
				String msupsx, msupsy;
				String msubsupsx, msubsupsy;
				int msubx1, msubx2, msuby1, msuby2;
				int msupx1, msupx2, msupy1, msupy2;
				int msubsupx1, msubsupy1;
				if (issmallsize == 0)
				{
					childnode = node.getFirstChild();
					setxy(childnode, originx, originy);
					isunderover = 1;
					issmallsize = 1;
					msubsx = ((Element) childnode).getAttribute("x2");
					msubsy = ((Element) childnode).getAttribute("y2");
					msubx1 = Integer.parseInt(msubsx);
					msuby1 = Integer.parseInt(msubsy);
					msupsy = ((Element) childnode).getAttribute("y1");
					msupx1 = msubx1;
					msupy1 = Integer.parseInt(msupsy);
					fontsize = fontsize2 - reducesize;
					setFontSize(fontsize);
					repaint();
					childnode = node.getLastChild(); // 上限部分
					setxy(childnode, originx, originy);
					msupsy = ((Element) childnode).getAttribute("y2");
					msupy2 = Integer.parseInt(msupsy);
					msupsx = ((Element) childnode).getAttribute("x1");
					msupx2 = Integer.parseInt(msupsx);
					movenodexy(childnode, 0, msupy1 - msupy2);
					childnode = node.getFirstChild().getNextSibling(); // 下标部分
					setxy(childnode, originx, originy);
					msubsy = ((Element) childnode).getAttribute("y1");
					msuby2 = Integer.parseInt(msubsy);
					msubsx = ((Element) childnode).getAttribute("x1");
					msubx2 = Integer.parseInt(msubsx);
					movenodexy(childnode, 0, msuby1 - msuby2);
					setFontSize(fontsize2);
					repaint();
					isunderover = 0;
					setissmallsize();
				}
				else
				{
					childnode = node.getFirstChild();

⌨️ 快捷键说明

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