#NEWLINE# def getNextOrNewAlignedLabel( self , fontSize , fontStyle , fontWeight , fontColor , hAlign , vAlign , labelText , isHTML , labelWidget ) : #NEWLINE# #INDENT# if ( self . labelIndex < self . getWidgetCount ( ) ) : #NEWLINE# #INDENT# result = self . getWidget ( self . labelIndex ) #NEWLINE# if ( ( None != result . labelWidget ) and ( labelWidget == result . labelWidget ) ) : #NEWLINE# #INDENT# '\n                * DOM element actually stored in the label\'s Grid-cell, and what\n                * the label "thinks" is stored there, could be inconsistent if,\n                * for example, the same label widget reference was used to\n                * define two different points\' annotations. In that case, we\n                * need to clear the widget reference that the label stores\n                * thus making it consistent with what is really in the DOM.\n                * <p>\n                *\n                * This code was added to fix the bug reproduced by\n                * TestGChart53.java. See that test for more info.\n                *\n                *\n                ' #NEWLINE# e = labelWidget . getElement ( ) #NEWLINE# if ( ( None == e ) or ( DOM . getParent ( e ) != result . innerGrid . getCellFormatter ( ) . getElement ( 0 , 0 ) ) ) : #NEWLINE# #INDENT# result . labelWidget = None #NEWLINE# #UNINDENT# #UNINDENT# if ( self . labelIndex > self . lastVisibleLabel ) : #NEWLINE# #INDENT# result . setVisible ( True ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# result = NonoccludingReusuableAlignedLabel ( ) #NEWLINE# self . add ( result ) #NEWLINE# #UNINDENT# result . setReusableProperties ( fontSize , fontStyle , fontWeight , fontColor , hAlign , self , labelText , isHTML , labelWidget ) #NEWLINE# if ( self . lastVisibleLabel < self . labelIndex ) : #NEWLINE# #INDENT# self . lastVisibleLabel = self . labelIndex #NEWLINE# #UNINDENT# self . labelIndex += 1 #NEWLINE# return result