condition.java
来自「jawe的最新版本,基于Java的图形化工作流编辑器。图形化工作流编辑器 。使用」· Java 代码 · 共 85 行
JAVA
85 行
package org.enhydra.shark.xpdl.elements;import org.enhydra.shark.xpdl.XMLAttribute;import org.enhydra.shark.xpdl.XMLComplexElement;import org.enhydra.shark.xpdl.XMLElement;import org.enhydra.shark.xpdl.XMLElementChangeInfo;import org.enhydra.shark.xpdl.XPDLConstants;/** * Represents coresponding element from XPDL schema. * * @author Sasa Bojanic */public class Condition extends XMLComplexElement { public Condition (Transition parent) { super(parent, false); } protected void fillStructure () { XMLAttribute attrType=new XMLAttribute(this,"Type", false,new String[] { XPDLConstants.CONDITION_TYPE_NONE, XPDLConstants.CONDITION_TYPE_CONDITION, XPDLConstants.CONDITION_TYPE_OTHERWISE, XPDLConstants.CONDITION_TYPE_EXCEPTION, XPDLConstants.CONDITION_TYPE_DEFAULTEXCEPTION }, 0); add(attrType); } public void makeAs (XMLElement el) { super.makeAs(el); setValue(el.toValue()); } public void setValue(String v) { if (isReadOnly) { throw new RuntimeException("Can't set the value of read only element!"); } boolean notify=false; String oldValue=value; if (!this.value.equals(v)) { notify=true; } this.value = v; if (notify && (notifyMainListeners || notifyListeners)) { XMLElementChangeInfo info=createInfo(oldValue, value, null, XMLElementChangeInfo.UPDATED); if (notifyListeners) { notifyListeners(info); } if (notifyMainListeners) { notifyMainListeners(info); } } } public XMLAttribute getTypeAttribute() { return (XMLAttribute)get("Type"); } public String getType () { return getTypeAttribute().toValue(); } public void setTypeNONE () { getTypeAttribute().setValue(XPDLConstants.CONDITION_TYPE_NONE); } public void setTypeCONDITION () { getTypeAttribute().setValue(XPDLConstants.CONDITION_TYPE_CONDITION); } public void setTypeOTHERWISE () { getTypeAttribute().setValue(XPDLConstants.CONDITION_TYPE_OTHERWISE); } public void setTypeEXCEPTION () { getTypeAttribute().setValue(XPDLConstants.CONDITION_TYPE_EXCEPTION); } public void setTypeDEFAULTEXCEPTION () { getTypeAttribute().setValue(XPDLConstants.CONDITION_TYPE_DEFAULTEXCEPTION); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?