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

📄 manualnode.java

📁 OBPM是一个开源
💻 JAVA
字号:
//Source file: D:\\BILLFLOW\\src\\billflow\\Person.java

//Source file: E:\\billflow\\src\\billflow\\Person.java

package cn.myapps.core.workflow.element;

import java.awt.Color;
import java.awt.Graphics;
import java.util.Collection;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.Vector;

import cn.myapps.core.workflow.utility.CommonUtil;
import cn.myapps.core.workflow.utility.NameList;
import cn.myapps.core.workflow.utility.Sequence;

public class ManualNode extends Node {
	public String remaindertype;// 提醒类型 0为不提醒,1为到达后多少小时内提醒,2为提前多少小时提醒

	// 详见FlowType.java类

	public String beforetime;// 提前多少小时提醒

	public String namelist;// actor选择

	public String realnamelist; // 当前结点真正审核者,形如{U|admin;D-05-02|副总师;},“与”条件及代理人已转成具体处理人ID

	public String passcondition;// 审核通过条件 0->或 1->与 2->强制与

	// 3->自定义(与或混合)详见FlowType.java类

	public String exceedaction;// 超时处理类型

	// 0为不处理,1为自动流转,2为自动终止,3为自动回退,4为自动回退至指定结节详见FlowType.java类

	public String limittimecount;// 限定审核时间(如48小时)

	public boolean issetcurruser;// 流程转入时是否将writers强制设为当前用户

	/**
	 * 使用完整名, 如:11000|赛百威公司/开发部/部门经理 多项值之间使用分号隔开,
	 * 如:11000|赛百威公司/开发部/部门经理;12001|赛百威公司/市场部/部门经理
	 */
	// public String namelist;
	public String inputform;

	// 角色列表,使用完整名,多项值之间使用分号隔开,如:11000|赛百威公司/开发部/部门经理;12001|赛百威公司/市场部/部门经理
	// public String actorlist;
	// 人员列表,使用完整名,多项值之间使用分号隔开,如:11000|赛百威公司/开发部/周志军;12001|赛百威公司/市场部/刘永勤
	// public String personlist;
	/**
	 * @param owner
	 * @roseuid 3E0428DB0132
	 */
	private Vector temp = new Vector(); // 临时保存NodeActivity;

	public boolean isgather; // 是否聚合节点

	public boolean issplit; // 是否分散节点
	
	public NameList toNameList() {//经解释后的nameList对象
		NameList nameList = NameList.parser(this.namelist);
		return  nameList;
	}

	public ManualNode(FlowDiagram owner) {
		super(owner);
	}

	public void addNodeActivity(String name) {
		NodeActivity act = new NodeActivity(_owner);
		act.id = Sequence.getSequence();
		act.name = name;
		this.getSubelems().add(act);
	}

	// public String[] getIdList() {
	// if (namelist == null || namelist.trim().equals("")) {
	// return null;
	// }
	// String[] tmp = CommonUtil.split(namelist, ';');
	// String[] rtn = new String[tmp.length];
	// for (int i = 0; i < tmp.length; i++) {
	// rtn[i] = NameListUtil.getId(tmp[i]);
	// }
	//    
	//    
	// return rtn;
	// }

	// public String[] getShortNameList() {
	// if (namelist == null || namelist.trim().equals("")) {
	// return null;
	// }
	// String[] tmp = CommonUtil.split(namelist, ';');
	// String[] rtn = new String[tmp.length];
	// for (int i = 0; i < tmp.length; i++) {
	// NameNode node = new NameNode(tmp[i]);
	// rtn[i] = node.getShortName();
	// // rtn[i] = NameListUtil.getShortName(tmp[i]);
	// }
	// return rtn;
	// }

	public String getShortNameListStr() {
		String shortName = "";
		NameList nl = NameList.parser(namelist);

		Collection colls = nl.toCollection();
		if (colls != null) {
			Iterator iters = colls.iterator();
			while (iters.hasNext()) {
				String[] tmp = (String[]) iters.next();
				shortName = shortName + tmp[1] + ";";
			}
		}
		return shortName;
		// return CommonUtil.arrayToString(getShortNameList(), ';');
	}

	public String getFormatShortNameListStr() {
		String str = getShortNameListStr();
		StringBuffer rtn = new StringBuffer();
		int pos = 0;
		while (pos <= str.length()) {
			if (pos + 10 > str.length()) {
				rtn.append(str.substring(pos, str.length()));
			} else {
				rtn.append(str.substring(pos, pos + 10));
				rtn.append('\n');
			}
			pos += 10;
		}
		return rtn.toString();
	}

	/**
	 * @param g
	 * @roseuid 3E043760021D
	 */
	public void paint(Graphics g) {
		if (_img == null) {
			_img = _owner.getImageResource("actor.gif");
		}

		// Call All Sub Elements PAINT METHOD.
		// 保存当前背景颜色...
		Color old = this.bgcolor;
		if (_owner.isCurrentToEdit(this)) {
			bgcolor = DEF_CURREDITCOLOR;
		}

		if (_owner.isCurrentSelected(this)) {
			bgcolor = DEF_SELECTEDCOLOR;
		}

		for (Enumeration e = _subelems.elements(); e.hasMoreElements();) {
			Object te = e.nextElement();
			if (te instanceof PaintElement) {
				PaintElement se = (PaintElement) te;
				se.paint(g);
			}
		}

		// Fill background
		resize();
		g.setColor(bgcolor);
		g.fillRect(this.x, this.y, this.width, this.height);

		// Draw Image
		g.drawImage(_img, _imgrect.x, _imgrect.y, _imgrect.width,
				_imgrect.height, null, this._owner);

		if (this.name != null) {
			java.awt.FontMetrics fm = _owner.getFontMetrics(font);
			int tx = (int) (_txtrect.x + (_txtrect.width - fm.stringWidth(name)) / 2);
			int ty = (int) (_txtrect.y + 2 * _txtrect.height);
			if (this._iscurrent) {
				g.drawImage(_owner.getImageResource("current.gif"), _txtrect.x,
						_txtrect.y, _txtrect.width + 30, 10 + _txtrect.height,
						null, this._owner);
			} else {
				g.drawImage(_owner.getImageResource("background.gif"),
						_txtrect.x, _txtrect.y, _txtrect.width + 30,
						10 + _txtrect.height, null, this._owner);

			}
			g.setColor(java.awt.Color.black);
			g.drawString(name, tx + 13 + this.name.length(), ty - 10);
		}

		// 恢复当前背景颜色
		this.bgcolor = old;
	}

	public void showTips(Graphics g) {
		StringBuffer tips = new StringBuffer();

		String shortname = getFormatShortNameListStr();
		if (shortname != null && !shortname.trim().equals("")
				&& !shortname.trim().equals("null")) {
			tips.append(CommonUtil.foldString("操作者:" + shortname, 20));
			// tips.append(shortname);
			tips.append("\n");
		}
		drawTips(g, tips.toString());

	}

	public static void main(String[] args) {
		FlowDiagram fd = new FlowDiagram();
		ManualNode g = new ManualNode(fd);
		// g.namelist =
		// "P1000|赛百威公司/开发部/周志军;A1000|赛百威公司/开发部/部门经理;A1000|赛百威公司/开发部/部门经理;A1000|赛百威公司/开发部/部门经理;A1000|赛百威公司/开发部/部门经理;A1000|赛百威公司/开发部/部门经理";
		g.namelist = "P1000|赛百威公司";// /开发部/周志军;A1000|赛百威公司/开发部/部门经理;A1000|赛百威公司/开发部/部门经理;A1000|赛百威公司/开发部/部门经理;A1000|赛百威公司/开发部/部门经理;A1000|赛百威公司/开发部/部门经理";
		String str = g.getFormatShortNameListStr();
		System.out.println("str->" + str);
	}
}

⌨️ 快捷键说明

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