标签:style blog color strong cti io
package custom.gef.editor.model; import custom.gef.editor.model.connection.MessageFromModel; import custom.gef.editor.model.connection.MessageToModel; import custom.gef.editor.model.port.PortGuideModel; import custom.gef.editor.model.port.PortOperationModel; public class XmlHeadFactory { public final static String HEAD_ERROR="ERROR_HEAD"; //connection model XML head public final static String HEAD_CONNECTION="Connection"; //public final static String HEAD_FOUND=HEAD_CONNECTION+"FoundModel"; public final static String HEAD_CONNECTIONFROM=HEAD_CONNECTION+"From"; public final static String HEAD_CONNECTIONTO=HEAD_CONNECTION+"To"; //port model XML head public final static String HEAD_PORT="Port"; public final static String HEAD_PORTOPERATION=HEAD_PORT+"OperationModel"; public final static String HEAD_PORTGUIDE =HEAD_PORT+"GuideModel"; public static String getModelXMLHead(ElementModel model){ if(model instanceof ConnectionElementModel) return getConnectioModelXMLHead(model); else if(model instanceof PortElementModel) return getPortModelXMLHead(model); return HEAD_ERROR; } public static String getConnectioModelXMLHead(ElementModel model){ /*if(model instanceof FoundModel){ return HEAD_FOUND; } else */if(model instanceof MessageFromModel){ return HEAD_CONNECTIONFROM; } else if(model instanceof MessageToModel){ return HEAD_CONNECTIONTO; } return HEAD_ERROR; } public static String getPortModelXMLHead(ElementModel model){ if(model instanceof PortOperationModel){ return HEAD_PORTOPERATION; } else if(model instanceof PortGuideModel){ return HEAD_PORTGUIDE; } return HEAD_ERROR; } }
7.9 XmlHeadFactory,用来产生与模型对应的xmlhead,布布扣,bubuko.com
7.9 XmlHeadFactory,用来产生与模型对应的xmlhead
标签:style blog color strong cti io
原文地址:http://www.cnblogs.com/liyuhui20093357/p/3833794.html