@Override
    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        setPreferredSize(new Dimension(getMaxWidth(), getMaxHeight()));
        //draw separation line
        if (!nodeProcess.isEmpty()) {
            int len = nodeProcess.size();
            int x = 0, y = 0;
            for (int i = 0; i < len - 1; i++) {
                x = nodeProcess.get(i).getPoints()[1].x + (nodeProcess.get(i + 1).getPoints()[0].x - nodeProcess.get(i).getPoints()[1].x) / 2;
                y = getSize().height;
                Graphics2D g2d = (Graphics2D) g;
                g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
                Line2D line2d = new Line2D.Double(new Point(x, 0), new Point(x, y));
                g2d.setColor(Color.gray);
                g2d.draw(line2d);
            }
        }
        //draw lines bewteen nodes
        for (Node node : nodes) {
            ArrayList<Node> postNodes = node.getPostNodes();
            if (!postNodes.isEmpty()) {
                points1 = node.getPoints();
                for (Node pnode : postNodes) {
                    points2 = pnode.getPoints();
                    if (points1[1] != null && points2[0] != null) {
                        Graphics2D g2d = (Graphics2D) g;
                        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
                        Line2D line2d = new Line2D.Double(points1[1], points2[0]);
                        g2d.setColor(Color.black);
                        g2d.draw(line2d);
                    }
                }
            }
        }
    }