#NEWLINE# def paint( self , painter , option , widget ) : #NEWLINE# #INDENT# '\n        Draw the node, whether it\'s in the highlight list, selected or \n        unselected, is currently executable, and its name.  Also draws a \n        little light denoting if it already has data present and/or if it is\n        in a "stale" state.\n        ' #NEWLINE# inputsFulfilled = self . scene ( ) . dag . nodeAllInputsDataPresent ( self . dagNode ) #NEWLINE# gradient = QtGui . QLinearGradient ( 0 , ( ( - self . height ) / 2 ) , 0 , ( self . height / 2 ) ) #NEWLINE# if ( option . state & QtGui . QStyle . State_Selected ) : #NEWLINE# #INDENT# gradient . setColorAt ( 0 , QtGui . QColor ( 255 , ( 255 if highlightColor else 172 ) , 0 ) ) #NEWLINE# gradient . setColorAt ( 1 , QtGui . QColor ( 200 , ( 128 if inputsFulfilled else 0 ) , 0 ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# topGrey = ( 200 if inputsFulfilled else 128 ) #NEWLINE# bottomGrey = ( 96 if inputsFulfilled else 64 ) #NEWLINE# gradient . setColorAt ( 0 , QtGui . QColor ( topGrey , topGrey , topGrey ) ) #NEWLINE# gradient . setColorAt ( 1 , QtGui . QColor ( bottomGrey , bottomGrey , bottomGrey ) ) #NEWLINE# #UNINDENT# if ( self in self . scene ( ) . highlightNodes ) : #NEWLINE# #INDENT# highlightColor = QtGui . QColor ( 0 , 128 , 255 ) #NEWLINE# if self . scene ( ) . highlightIntensities : #NEWLINE# #INDENT# intensityIndex = self . scene ( ) . highlightIntensities [ self . scene ( ) . highlightNodes . index ( self ) ] #NEWLINE# highlightColor . setGreen ( ( highlightColor . green ( ) * intensityIndex ) ) #NEWLINE# highlightColor . setBlue ( ( highlightColor . blue ( ) * intensityIndex ) ) #NEWLINE# #UNINDENT# painter . setPen ( QtGui . QPen ( highlightColor , 3 ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# painter . setPen ( QtGui . QPen ( QtCore . Qt . black , 0 ) ) #NEWLINE# #UNINDENT# painter . setBrush ( QtGui . QBrush ( gradient ) ) #NEWLINE# fullRect = QtCore . QRectF ( ( ( - self . width ) / 2 ) , ( ( - self . height ) / 2 ) , self . width , self . height ) #NEWLINE# painter . drawRoundedRect ( fullRect , 5 , 5 ) #NEWLINE# if ( type ( self . dagNode ) == depends_node . DagNodeDot ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# painter . setPen ( QtGui . QPen ( QtGui . QColor ( 0 , 0 , 0 ) , 0.25 ) ) #NEWLINE# for output in self . dagNode . outputs ( ) : #NEWLINE# #INDENT# if self . scene ( ) . dag . nodeOutputDataPacket ( self . dagNode , output ) . dataPresent ( ) : #NEWLINE# #INDENT# painter . setBrush ( QtGui . QBrush ( QtGui . QColor ( 0 , 255 , 0 ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# painter . setBrush ( QtGui . QBrush ( QtGui . QColor ( 255 , 0 , 0 ) ) ) #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# if self . scene ( ) . dag . nodeStaleState ( self . dagNode ) : #NEWLINE# #INDENT# painter . setBrush ( QtGui . QBrush ( QtGui . QColor ( 0 , 59 , 174 ) ) ) #NEWLINE# #UNINDENT# painter . drawRect ( QtCore . QRectF ( ( ( ( - self . width ) / 2 ) + 5 ) , ( ( ( - self . height ) / 2 ) + 5 ) , 5 , 5 ) ) #NEWLINE# textRect = QtCore . QRectF ( ( self . boundingRect ( ) . left ( ) + 4 ) , self . boundingRect ( ) . top ( ) , ( self . boundingRect ( ) . width ( ) - 4 ) , self . boundingRect ( ) . height ( ) ) #NEWLINE# font = painter . font ( ) #NEWLINE# font . setPointSize ( 10 ) #NEWLINE# painter . setFont ( font ) #NEWLINE# painter . setPen ( QtCore . Qt . black ) #NEWLINE# painter . drawText ( textRect , QtCore . Qt . AlignCenter , self . dagNode . name )