Draws the node for the graphics scene.  this method can and should \
        be overloaded to create custom nodes.
        
        :param      painter     <QPainter>
        :param      option      <QGraphicsItemSytleOption>
        :param      rect        <QRectF>

def draw(self, painter, option, rect):
        """
        Draws the node for the graphics scene.  this method can and should \
        be overloaded to create custom nodes.
        
        :param      painter     <QPainter>
        :param      option      <QGraphicsItemSytleOption>
        :param      rect        <QRectF>
        """
        painter.save()
        
        # draw the node
        rect = self.rect()
        
        left, top, right, bottom = self.contentsMargins()
        
        x = rect.x() + left
        y = rect.y() + top
        w = rect.width() - (left + right)
        h = rect.height() - (top + bottom)
        r = self.roundingRadius()
        
        l_pinch, t_pinch, r_pinch, b_pinch = self.pinch()
        
        painter.setRenderHint(painter.Antialiasing)
        painter.setRenderHint(painter.TextAntialiasing)
        
        # draw the border
        painter.save()
        if self.isEnabled():
            pen = QPen(self.borderColor())
        else:
            pen = QPen(self.disabledBorderColor())
        
        pen.setWidthF(0.8)
        painter.setRenderHint(painter.Antialiasing)
        painter.setPen(pen)
        
        self.drawStyle(painter, x, y, w, h, r)
        painter.restore()
        
        if self.style() == XNode.NodeStyle.Pixmap:
            painter.restore()
            return
        
        # draw the icon
        icon = self.icon()
        if icon and not icon.isNull():
            pixmap = icon.pixmap(self.iconSize())
            offset = (h - self.iconSize().height()) / 2
            painter.drawPixmap(x + 4, offset, pixmap)
            x += self.iconSize().width() + 4
            w -= self.iconSize().width() + 4
        
        # draw the font
        x += 6
        w -= 12
        metrics = QFontMetrics(self.titleFont())
        if not self.wordWrap():
            e_text  = metrics.elidedText(nativestring(self.displayName()), 
                                         Qt.ElideRight,
                                         w)
        else:
            e_text = self.displayName()
        
        # draw the text
        painter.setFont(self.titleFont())
        painter.drawText(x, 
                         y, 
                         w, 
                         h, 
                         Qt.AlignCenter | Qt.TextWordWrap, 
                         e_text)
        
        painter.restore()