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

📄 luafunctionparse.java

📁 JGraph扩展应用。自定义Renderer,自定义视图View实现自定义工作流控件
💻 JAVA
字号:
/**
 * 
 */
package flow.graph.gui.graph.lua.code;

import java.util.Vector;

import org.jgraph.graph.DefaultGraphCell;

import flow.graph.gui.graph.FlowGraphConstants;
import flow.graph.gui.graph.cell.bpel.Function;
import flow.graph.gui.graph.cell.bpel.Functions;
import flow.graph.gui.graph.lua.GraphTemplateCell;
import flow.graph.gui.graph.lua.xml.TemplateConstants;

/**
 * @author Administrator
 *
 */
public class LuaFunctionParse {
	private String codeString = "";
	
	public LuaFunctionParse(DefaultGraphCell cell){
		if(cell != null){
			if(cell instanceof GraphTemplateCell){
				if(FlowGraphConstants.getTemplateType(cell.getAttributes()) != null){
					if(FlowGraphConstants.getTemplateType(cell.getAttributes()).equals(TemplateConstants.MODEL_TEMPLATE)){
						if(FlowGraphConstants.getBpelFunctions(cell.getAttributes()) != null){
							Functions functions = (Functions)FlowGraphConstants.getBpelFunctions(cell.getAttributes());
							if(functions.getFunctions() != null){
								for(int i=0;i<functions.getFunctions().size();i++){
									Function function = (Function)functions.getFunctions().get(i);
									codeString += "\n-- function "+function.getName()+"("+function.getParameter()+")\n";
									if(function.getDiscription().length() > 0){
										//System.out.println("len="+function.getDiscription().length());
										Vector v = Function.getMutileStr(function.getDiscription(), 30);
										if(v != null){
											for(int j=0;j<v.size();j++){
												codeString += "-- "+v.get(j).toString()+"\n";
											}
										}
									}
									codeString += "\nfunction "+function.getName()+"("+function.getParameter()+")\n";
									codeString += function.getBody()+"\n";
									codeString += "end\n";
								}
							}
						}
					}
				}
			}
		}
	}
	
	public String getCode(){
		return codeString;
	}
}

⌨️ 快捷键说明

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