    private void paintNode(Graphics2D g, Node network, Node node, BufferedImage icon, boolean selected, boolean rendered, Node connectionOutput, Port hoverInputPort, boolean hoverOutput) {
        Rectangle r = nodeRect(node);
        String outputType = node.getOutputType();
        if (selected) {
            g.setColor(Color.WHITE);
            g.fillRect(r.x, r.y, NODE_WIDTH, NODE_HEIGHT);
        }
        g.setColor(portTypeColor(outputType));
        if (selected) {
            g.fillRect(r.x + 2, r.y + 2, NODE_WIDTH - 4, NODE_HEIGHT - 4);
        } else {
            g.fillRect(r.x, r.y, NODE_WIDTH, NODE_HEIGHT);
        }
        if (rendered) {
            g.setColor(Color.WHITE);
            GeneralPath gp = new GeneralPath();
            gp.moveTo(r.x + NODE_WIDTH - 2, r.y + NODE_HEIGHT - 20);
            gp.lineTo(r.x + NODE_WIDTH - 2, r.y + NODE_HEIGHT - 2);
            gp.lineTo(r.x + NODE_WIDTH - 20, r.y + NODE_HEIGHT - 2);
            g.fill(gp);
        }
        g.setColor(Color.WHITE);
        int portX = 0;
        for (Port input : node.getInputs()) {
            if (hoverInputPort == input) {
                g.setColor(PORT_HOVER_COLOR);
            } else {
                g.setColor(portTypeColor(input.getType()));
            }
            int portHeight = PORT_HEIGHT;
            if (connectionOutput != null) {
                if (connectionOutput.getOutputType().equals(input.getType())) {
                    portHeight = PORT_HEIGHT * 2;
                } else {
                    portHeight = 1;
                }
            }
            if (isPublished(network, node, input)) {
                Point2D topLeft = inverseViewTransformPoint(new Point(4, 0));
                g.setColor(portTypeColor(input.getType()));
                g.setStroke(CONNECTION_STROKE);
                paintConnectionLine(g, (int) topLeft.getX(), (int) topLeft.getY(), r.x + portX + 4, r.y - 2);
            }
            g.fillRect(r.x + portX, r.y - portHeight, PORT_WIDTH, portHeight);
            portX += PORT_WIDTH + PORT_SPACING;
        }
        if (hoverOutput && connectionOutput == null) {
            g.setColor(PORT_HOVER_COLOR);
        } else {
            g.setColor(portTypeColor(outputType));
        }
        g.fillRect(r.x, r.y + NODE_HEIGHT, PORT_WIDTH, PORT_HEIGHT);
        g.drawImage(icon, r.x + NODE_PADDING, r.y + NODE_PADDING, NODE_ICON_SIZE, NODE_ICON_SIZE, null);
        g.setColor(Color.WHITE);
        g.setFont(Theme.NETWORK_FONT);
        g.drawString(getShortenedName(node.getName(), 7), r.x + NODE_ICON_SIZE + NODE_PADDING * 2 + 2, r.y + 22);
    }

    private void paintNode(Graphics2D g, Node network, Node node, BufferedImage icon, boolean selected, boolean rendered, Node connectionOutput, Port hoverInputPort, boolean hoverOutput) {
        Rectangle r = nodeRect(node);
        String outputType = node.getOutputType();
        if (selected) {
            g.setColor(Color.WHITE);
            g.fillRect(r.x, r.y, NODE_WIDTH, NODE_HEIGHT);
        }
        g.setColor(portTypeColor(outputType));
        if (selected) {
            g.fillRect(r.x + 2, r.y + 2, NODE_WIDTH - 4, NODE_HEIGHT - 4);
        } else {
            g.fillRect(r.x, r.y, NODE_WIDTH, NODE_HEIGHT);
        }
        if (rendered) {
            g.setColor(Color.WHITE);
            GeneralPath gp = new GeneralPath();
            gp.moveTo(r.x + NODE_WIDTH - 2, r.y + NODE_HEIGHT - 20);
            gp.lineTo(r.x + NODE_WIDTH - 2, r.y + NODE_HEIGHT - 2);
            gp.lineTo(r.x + NODE_WIDTH - 20, r.y + NODE_HEIGHT - 2);
            g.fill(gp);
        }
        g.setColor(Color.WHITE);
        int portX = 0;
        for (Port input : node.getInputs()) {
            if (hoverInputPort == input) {
                g.setColor(PORT_HOVER_COLOR);
            } else {
                g.setColor(portTypeColor(input.getType()));
            }
            int portHeight = PORT_HEIGHT;
            if (connectionOutput != null) {
                String connectionOutputType = connectionOutput.getOutputType();
                String inputType = input.getType();
                if (connectionOutputType.equals(inputType) || inputType.equals(Port.TYPE_LIST)) {
                    portHeight = PORT_HEIGHT * 2;
                } else if (TypeConversions.canBeConverted(connectionOutputType, inputType)) {
                    portHeight = PORT_HEIGHT - 1;
                } else {
                    portHeight = 1;
                }
            }
            if (isPublished(network, node, input)) {
                Point2D topLeft = inverseViewTransformPoint(new Point(4, 0));
                g.setColor(portTypeColor(input.getType()));
                g.setStroke(CONNECTION_STROKE);
                paintConnectionLine(g, (int) topLeft.getX(), (int) topLeft.getY(), r.x + portX + 4, r.y - 2);
            }
            g.fillRect(r.x + portX, r.y - portHeight, PORT_WIDTH, portHeight);
            portX += PORT_WIDTH + PORT_SPACING;
        }
        if (hoverOutput && connectionOutput == null) {
            g.setColor(PORT_HOVER_COLOR);
        } else {
            g.setColor(portTypeColor(outputType));
        }
        g.fillRect(r.x, r.y + NODE_HEIGHT, PORT_WIDTH, PORT_HEIGHT);
        g.drawImage(icon, r.x + NODE_PADDING, r.y + NODE_PADDING, NODE_ICON_SIZE, NODE_ICON_SIZE, null);
        g.setColor(Color.WHITE);
        g.setFont(Theme.NETWORK_FONT);
        g.drawString(getShortenedName(node.getName(), 7), r.x + NODE_ICON_SIZE + NODE_PADDING * 2 + 2, r.y + 22);
    }
