📄 svgpanel.java
字号:
package com.mc.svg.shape.basicshape;
import org.w3c.dom.Document;
import com.mc.svg.menu.Defs;
import com.mc.svg.script.Function;
import com.mc.svg.script.Script;
import com.mc.svg.shape.Panel;
public class SVGPanel extends Panel {
public SVGPanel(Document doc) {
this.doc = doc;
root = doc.getDocumentElement();
setViewBox(1024,700);
}
public void setViewBox(int width,int height){
root.setAttributeNS(null,"viewBox","0 0 "+width+" "+height);
}
//添加onload事件
public void onLoad(String functionName) {
String str = Function.functionDispose(functionName);
root.setAttributeNS(null, "onload", str);
}
public void setZoomAndPan(boolean tf) {
if (!tf) {
root.setAttributeNS(null, "zoomAndPan", "disable");
}
}
public void addScript(Script s) {
root.appendChild(s.getElement());
}
public void addDefs(Defs s) {
root.appendChild(s.getRoot());
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -