package com.vci.client.workflow.task; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.EventQueue; import java.awt.Toolkit; import javax.swing.JDialog; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import com.vci.client.LogonApplication; import com.vci.client.ui.swing.VCISwingUtil; import com.vci.client.ui.swing.components.VCIJTabbedPane; import com.vci.client.workflow.delegate.ProcessCustomClientDelegate; import com.vci.corba.common.VCIError; import com.vci.corba.workflow.data.FlowApproveHistoryInfo; import com.vci.corba.workflow.data.FlowTaskInfo; import com.vci.corba.workflow.data.ProcessTaskInfo; /** * 已办窗口 * * @author Administrator * */ public class DoneProcessDialog extends JDialog { private static final long serialVersionUID = 4239328464693862083L; private JTable table; private HistoryTableModel historyTableModel; private FlowTaskInfo flowHistoryTaskInfo; String finishFlag = ""; private ProcessTaskInfo frocessTaskInfo; public DoneProcessDialog(FlowTaskInfo flowHistoryTaskInfo, ProcessTaskInfo frocessTaskInfo,String finishFlag) { super(LogonApplication.frame, "已完成流程", true); this.flowHistoryTaskInfo = flowHistoryTaskInfo; this.finishFlag = finishFlag; this.frocessTaskInfo = frocessTaskInfo; initUI(); EventQueue.invokeLater(new Runnable() { public void run() { try { initData(); } catch (Exception e) { e.printStackTrace(); } } }); } private void initData() { ProcessCustomClientDelegate processCustomClientDelegate = new ProcessCustomClientDelegate(LogonApplication.getUserEntityObject()); FlowApproveHistoryInfo[] historyActivity; try { historyActivity = processCustomClientDelegate.getHistoryActivityByProInsId(flowHistoryTaskInfo.executionId); historyTableModel.setData(historyActivity); } catch (VCIError e) { e.printStackTrace(); } } // private RMDataPanelForFlowData flowDataPanel = new RMDataPanelForFlowData(false, this); private void initUI() { setTitle("流程已办查看"); setSize(780, 600); centerToScreen(); getContentPane().setLayout(new BorderLayout()); JPanel panel = new JPanel(); getContentPane().add(panel, BorderLayout.CENTER); panel.setLayout(new BorderLayout()); VCIJTabbedPane tabbedPane = new VCIJTabbedPane(VCIJTabbedPane.TOP); panel.add(tabbedPane, BorderLayout.CENTER); //查看流程数据 // flowDataPanel.setInfo(frocessTaskInfo); // tabbedPane.addTab("流程数据", null, flowDataPanel, null); // flowDataPanel.init(flowHistoryTaskInfo,true); JPanel historyPanel = new JPanel(); tabbedPane.addTab("审核过程", null, historyPanel, null); historyPanel.setLayout(new BorderLayout(0, 0)); JScrollPane scrollPane = new JScrollPane(); historyPanel.add(scrollPane, BorderLayout.CENTER); historyTableModel = new HistoryTableModel(); table = new JTable(historyTableModel); table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); table.setShowGrid(true); scrollPane.setViewportView(table); table.setRowHeight(25); historyTableModel = new HistoryTableModel(); table.setModel(historyTableModel); table.getTableHeader().setFont(VCISwingUtil.FONT_DEFAULT); table.getColumnModel().getColumn(0).setPreferredWidth(150); table.getColumnModel().getColumn(1).setPreferredWidth(150); table.getColumnModel().getColumn(2).setPreferredWidth(150); table.getColumnModel().getColumn(3).setPreferredWidth(150); table.getColumnModel().getColumn(4).setPreferredWidth(150); table.getColumnModel().getColumn(5).setPreferredWidth(250); //查看流程结束后的流程图. if("完成".equals(finishFlag)){ ProcessCustomClientDelegate processCustomClientDelegate = new ProcessCustomClientDelegate(LogonApplication.getUserEntityObject()); try { String jbpmDeploymentId = processCustomClientDelegate.getDepolymentID(flowHistoryTaskInfo.executionId); ViewFinishImagePanel viewPanel = new ViewFinishImagePanel(flowHistoryTaskInfo.executionId,""); tabbedPane.addTab("查看流程图", null, viewPanel, null); } catch (VCIError e) { e.printStackTrace(); } }else{ ViewExecutionImagePanel viewPanel = new ViewExecutionImagePanel(flowHistoryTaskInfo.executionId, flowHistoryTaskInfo.name); tabbedPane.addTab("查看流程图", null, viewPanel, null); } } /** * 居中屏幕 */ private void centerToScreen() { Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension componentSize = this.getSize(); if (componentSize.height > screenSize.height) { componentSize.height = screenSize.height; } if (componentSize.width > screenSize.width) { componentSize.width = screenSize.width; } setLocation((screenSize.width - componentSize.width) / 2, (screenSize.height - componentSize.height) / 2); } private void closeDialog(){ this.dispose(); } }