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

📄 circle.java

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

import java.awt.Color;
import java.awt.Point;

import org.w3c.dom.Document;

import com.mc.svg.GenColor;
import com.mc.svg.SVGCanvas;
import com.mc.svg.shape.AbstractShape;

public class Circle extends AbstractShape {

	public Circle(Document doc) {
		this.doc = doc;
		root = doc.createElementNS(SVGCanvas.svgNS,"circle");
	}
	
	
	public void setRadius(int r) {
		root.setAttribute("r", r+"");
	}
	
	public void setCenterPoint(int x, int y) {
		root.setAttribute("cx", x + "");
		root.setAttribute("cy", y + "");
	}
	
	public void setFillColor(Color color) {
		String str = GenColor.genColor(color);

		root.setAttributeNS(null, "fill", str);
	}
	
	public Point getCenterPoint(){
		String cxStr = root.getAttribute("cx");
		String cyStr = root.getAttribute("cy");
		int cx = 0;
		int cy = 0;
		try {

			cx = Integer.parseInt(cxStr);
			cy = Integer.parseInt(cyStr);
		} catch (Exception ex) {

		}
		Point point = new Point(cx,cy);
		
		return point;
	}
	
	public void addAnimateMotion(AnimateMotion motion){
		root.appendChild(motion.getElement());
	}

	public int getRadius() {
		String widthStr = root.getAttribute("r");
		int width = 0;

		try {

			width = Integer.parseInt(widthStr);
		} catch (Exception ex) {

		}
		return width;
	}

}

⌨️ 快捷键说明

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