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

📄 abstractshape.java

📁 svg gwt 监控软件 大的 大 发了佛法ffffffffff发的司法
💻 JAVA
字号:
package com.mc.svg.shape;

import java.awt.Point;

import org.w3c.dom.Document;
import org.w3c.dom.Element;

import com.mc.svg.script.Function;

public abstract class AbstractShape implements Shape {

	protected Element root = null;

	protected Element parent = null;

	protected String id = null;

	protected Document doc = null;

	public Element getElement() {
		return root;
	}

	public Document getDocument() {
		return doc;
	}

	public void setId(String str) {
		id = str;
		root.setAttribute("id", str);
	}

	public String getId() {
		return id;
	}

	public Element getParentElement() {
		return parent;
	}

	public void setLocation(int x, int y) {
		root.setAttribute("x", x + "");
		root.setAttribute("y", y + "");
	}

	public void setParentElement(Element e) {
		parent = e;
	}

	public void setDocument(Document doc) {
		this.doc = doc;

	}

	public Point getLocation() {
		String xStr = root.getAttribute("x");
		String yStr = root.getAttribute("y");

		int x = 0;
		int y = 0;
		try {
			x = Integer.parseInt(xStr);
			y = Integer.parseInt(yStr);
		} catch (Exception ex) {

		}

		return new Point(x, y);
	}

	public int getX() {
		String xStr = root.getAttribute("x");

		int x = 0;

		try {
			x = Integer.parseInt(xStr);

		} catch (Exception ex) {

		}
		return x;
	}

	public int getY() {

		String yStr = root.getAttribute("y");

		int y = 0;
		try {

			y = Integer.parseInt(yStr);
		} catch (Exception ex) {

		}

		return y;
	}

	public void addMouseOver(String functionName, String[] params) {

		String str = Function.functionDispose(functionName, params);

		root.setAttributeNS(null, "onmouseover", str);
	}

	public void addMouseOut(String functionName, String[] params) {
		String str = Function.functionDispose(functionName, params);

		root.setAttributeNS(null, "onmouseout", str);
	}

}

⌨️ 快捷键说明

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