📄 flowinglinefunction.java
字号:
package com.mc.svg.script;
import java.awt.Color;
import com.mc.svg.GenColor;
public class FlowingLineFunction extends Function {
public FlowingLineFunction(Color color,Color flowingcolor){
super("flowinglinefunction");
setContext(color,flowingcolor);
}
public void setContext(Color color,Color flowingcolor){
String[] param = {"abc","id"};
setParams(param);
String strContext = "";
strContext = " rs = document.getElementById(id); \n";
strContext += " child = rs.firstChild; \n";
strContext += "tf = true; \n";
strContext += "if(abc== 20){ \n";
strContext += "while (child != null) { \n";
strContext += "if (tf == true) { \n";
strContext += "child.setAttribute('stroke', \""+GenColor.genColor(color)+"\"); \n";
strContext += "child = child.nextSibling; \n";
strContext += "tf = false; \n";
strContext += "} else { \n";
strContext += " child.setAttribute('stroke', \""+GenColor.genColor(flowingcolor)+"\"); \n";
strContext += " child = child.nextSibling; \n";
strContext += " tf = true; \n";
strContext += "} \n";
strContext += "} \n";
strContext += "}else{ \n";
strContext += " while (child != null) { \n";
strContext += " if (tf == true) { \n";
strContext += " child.setAttribute('stroke', \""+GenColor.genColor(flowingcolor)+"\"); \n";
strContext += " child = child.nextSibling; \n";
strContext += " tf = false; \n";
strContext += " } else { \n";
strContext += " child.setAttribute('stroke', \""+GenColor.genColor(color)+"\"); \n";
strContext += " child = child.nextSibling; \n";
strContext += " tf = true; \n";
strContext += " } \n";
strContext += " } \n";
strContext += "} \n";
addContent(strContext);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -