package com.vci.client.workflow.template; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.ComboBoxModel; import javax.swing.DefaultComboBoxModel; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JDialog; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; import javax.swing.border.EmptyBorder; import com.vci.client.LogonApplication; import com.vci.client.framework.rightConfig.object.WorkFlowObject; import com.vci.client.ui.exception.VCIException; import com.vci.client.workflow.delegate.ProcessCustomClientDelegate; import com.vci.client.workflow.template.object.ProcessCategoryObject; import com.vci.client.workflow.template.object.ProcessDefinitionObject; /** * This code was edited or generated using CloudGarden's Jigloo * SWT/Swing GUI Builder, which is free for non-commercial * use. If Jigloo is being used commercially (ie, by a corporation, * company or business for any purpose whatever) then you * should purchase a license for each developer using Jigloo. * Please visit www.cloudgarden.com for details. * Use of Jigloo implies acceptance of these licensing terms. * A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR * THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED * LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE. */ /** * 工作流配置页面 * @author liudi * * 2013-1-5 */ public class WorkFlowConfDialog extends JDialog { private final JPanel contentPanel = new JPanel(); private JLabel sysName; private JComboBox processtypeComb = new JComboBox(); private JComboBox tasktypeCmb = new JComboBox(); private JLabel taskTypeLab; private JLabel processTypeLab; private JTextField operatetypeTxt; private JLabel operatyTypeLab; private JButton temChoiceBtn; private JTextField procTemTxt; private JLabel processTemNameLab; private JTextField modelTxt; private JLabel modelClassName; private JComboBox sysComb; private ComboBoxModel processtypeCombModel = null; private ComboBoxModel tasktypeCmbModel = null; private ProcessDefinitionObject processDefinitionObject; TypeObject[] processObject = new TypeObject[6]; TypeObject[] taskObject = new TypeObject[6]; WorkFlowObject obj = new WorkFlowObject(); /** * Create the dialog. */ public WorkFlowConfDialog(WorkFlowObject obj) { super(LogonApplication.frame,true); initProcessTypeCombox("编码管理系统"); initTaskTypeCombox("编码管理系统"); this.obj = obj; init(); centerToScreen(); } private void init() { setSize(450, 400); getContentPane().setLayout(new BorderLayout()); contentPanel.setLayout(null); contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); getContentPane().add(contentPanel, BorderLayout.CENTER); sysName = new JLabel(); contentPanel.add(sysName); sysName.setText("系统名称:"); sysName.setBounds(86, 50, 80, 25); ComboBoxModel sysCombModel = new DefaultComboBoxModel( new String[] { "编码管理系统", "资源管理系统" }); sysComb = new JComboBox(); sysComb.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { String string = sysComb.getSelectedItem().toString(); initProcessTypeCombox(string); initTaskTypeCombox(string); } }); contentPanel.add(sysComb); sysComb.setModel(sysCombModel); sysComb.setBounds(177, 50, 120, 25); modelClassName = new JLabel(); contentPanel.add(modelClassName); modelClassName.setText("模块类名称:"); modelClassName.setBounds(86, 95, 80, 25); modelTxt = new JTextField(); contentPanel.add(modelTxt); modelTxt.setBounds(179, 95, 203, 25); operatyTypeLab = new JLabel(); contentPanel.add(operatyTypeLab); operatyTypeLab.setText("操作标识:"); operatyTypeLab.setBounds(86, 139, 80, 25); operatetypeTxt = new JTextField(); contentPanel.add(operatetypeTxt); operatetypeTxt.setBounds(179, 139, 121, 25); processTypeLab = new JLabel(); contentPanel.add(processTypeLab); processTypeLab.setBounds(86, 182, 80, 25); processTypeLab.setText("流程类型:"); taskTypeLab = new JLabel(); contentPanel.add(taskTypeLab); taskTypeLab.setText("任务箱类型:"); taskTypeLab.setBounds(86, 231, 80, 25); contentPanel.add(tasktypeCmb); tasktypeCmb.setBounds(181, 231, 123, 25); contentPanel.add(processtypeComb); processTemNameLab = new JLabel(); contentPanel.add(processTemNameLab); processTemNameLab.setText("流程模版名称:"); processTemNameLab.setBounds(87, 277, 90, 17); procTemTxt = new JTextField(); contentPanel.add(procTemTxt); procTemTxt.setBounds(183, 274, 146, 24); temChoiceBtn = new JButton(); temChoiceBtn.setText("选择"); contentPanel.add(temChoiceBtn); temChoiceBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { AssignProcessDialog dialog = new AssignProcessDialog(LogonApplication.frame); dialog.setVisible(true); if(dialog.isOk()) { processDefinitionObject = dialog.getProcessDefinitionObject(); procTemTxt.setText(processDefinitionObject.toString()); } } }); temChoiceBtn.setBounds(348, 274, 62, 24); processtypeComb.setBounds(181, 182, 116, 25); JPanel buttonPane = new JPanel(); buttonPane.setLayout(new FlowLayout(FlowLayout.CENTER)); getContentPane().add(buttonPane, BorderLayout.SOUTH); JButton okButton = new JButton("确定"); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { WorkFlowObject object = new WorkFlowObject(); if(obj!=null){ object = obj; object.setSysIdentify(sysComb.getSelectedItem().toString()); object.setOperateIdentify(operatetypeTxt.getText().trim()); TypeObject processType = (TypeObject) processtypeComb.getSelectedItem(); object.setProcessType(processType.getType()); TypeObject taskType = (TypeObject) tasktypeCmb.getSelectedItem(); object.setTaskType(taskType.getClassName()); ProcessCustomClientDelegate delSrv = new ProcessCustomClientDelegate(LogonApplication.getUserEntityObject()); ProcessCategoryObject[] processCategories; try { processCategories = delSrv.getProcessCategories("root"); for(int i =0;i screenSize.height) { componentSize.height = screenSize.height; } if (componentSize.width > screenSize.width) { componentSize.width = screenSize.width; } this.setLocation((screenSize.width - componentSize.width) / 2, (screenSize.height - componentSize.height) / 2); } public String getJbpmDeploymentId() { if(processDefinitionObject == null) { return ""; } return processDefinitionObject.getJbpmDeploymentId(); } }