田源
2025-01-15 78fa1f005a9ec2581611e53d7eba8efeacb4df6e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package com.vci.client.workflow.task;
 
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
 
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
 
import com.vci.client.workflow.delegate.ProcessCustomClientDelegate;
import com.vci.corba.common.VCIError;
 
public class ViewFinishImagePanel extends JPanel {
 
    private String taskName;
    private String deployID;
 
    public ViewFinishImagePanel(String processDefinitionId) {
        this(processDefinitionId, null);
    }
 
    public ViewFinishImagePanel(String deployID, String taskName) {
        this.deployID = deployID;
        this.taskName = taskName;
 
        initUI();
        initData();
    }
 
    private void initData() {
        ProcessCustomClientDelegate processCustomClientDelegate = new ProcessCustomClientDelegate();
        try {
            byte[] processChart = processCustomClientDelegate.getFlowImageByDeployID(deployID);
 
            InputStream buffin = new ByteArrayInputStream(processChart, 0, processChart.length);
            BufferedImage bi = ImageIO.read(buffin);
            ImageIcon icon = new ImageIcon(bi);
            flowChartLabel.setIcon(icon);
        } catch (IOException e) {
            e.printStackTrace();
        } catch (VCIError e) {
            e.printStackTrace();
        }
    }
 
    private void initUI() {
        setBackground(Color.WHITE);
        setLayout(new BorderLayout(0, 0));
        JScrollPane scrollPane = new JScrollPane();
        scrollPane.setBackground(Color.WHITE);
        add(scrollPane);
 
        JPanel panel = new JPanel();
        panel.setBackground(Color.WHITE);
        scrollPane.setViewportView(panel);
        panel.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5));
 
        flowChartLabel = new JLabel();
        panel.add(flowChartLabel);
        flowChartLabel.setBackground(Color.WHITE);
    }
 
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    private JLabel flowChartLabel;
 
}