#NEWLINE# def setReusableProperties( self , backgroundColor , borderColor , borderStyle , borderWidth , dWidth , dHeight , xD , yD , url ) : #NEWLINE# #INDENT# newX = int ( round ( xD ) ) #NEWLINE# newW = int ( ( round ( ( xD + dWidth ) ) - newX ) ) #NEWLINE# newY = int ( round ( yD ) ) #NEWLINE# newH = int ( ( round ( ( yD + dHeight ) ) - newY ) ) #NEWLINE# thickness = min ( newW , newH ) #NEWLINE# newCappedBorderWidthX2 = min ( ( 2 * borderWidth ) , thickness ) #NEWLINE# '\n        * Note: on a GWT absolute panel, the x,y position of the widget is the\n        * upper left corner of the widget\'s border, so x, y need no adjustment\n        * to account for an internal (positive) border. Negative (external)\n        * borders expand rectangle equally in all directions, so x,y need to\n        * shift back to the upper left corner.  Transparent border\n        * emulation sets border width to 0, and adjusts element size and\n        * position to mimic border transparency (this rather odd feature is\n        * required to workaround the IE6 "transparent border" bug)\n        *\n        ' #NEWLINE# if ( TRANSPARENT_BORDER_COLOR == borderColor ) : #NEWLINE# #INDENT# if ( newCappedBorderWidthX2 > 0 ) : #NEWLINE# #INDENT# newX += ( newY / 2 ) #NEWLINE# newY += ( newCappedBorderWidthX2 / 2 ) #NEWLINE# newH -= newCappedBorderWidthX2 #NEWLINE# newW -= newCappedBorderWidthX2 #NEWLINE# #UNINDENT# newCappedBorderWidthX2 = 0 #NEWLINE# borderColor = 'transparent' #NEWLINE# if ( backgroundColor == TRANSPARENT_BORDER_COLOR ) : #NEWLINE# #INDENT# backgroundColor = 'transparent' #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( newCappedBorderWidthX2 < 0 ) : #NEWLINE# #INDENT# newX += ( newCappedBorderWidthX2 / 2 ) #NEWLINE# newY += ( newCappedBorderWidthX2 / 2 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# newH -= newCappedBorderWidthX2 #NEWLINE# newW -= newCappedBorderWidthX2 #NEWLINE# #UNINDENT# #UNINDENT# if ( self . cappedBorderWidthX2 != newCappedBorderWidthX2 ) : #NEWLINE# #INDENT# if ( 1 == ( newCappedBorderWidthX2 % 2 ) ) : #NEWLINE# #INDENT# floorBW = int ( ( newCappedBorderWidthX2 / 2 ) ) #NEWLINE# ceilBW = ( floorBW + 1 ) #NEWLINE# DOM . setStyleAttribute ( self . getElement ( ) , 'borderWidth' , ( ( ( ( ( ( ( str ( floorBW ) + 'px ' ) + str ( floorBW ) ) + 'px ' ) + str ( ceilBW ) ) + 'px ' ) + str ( ceilBW ) ) + 'px ' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# DOM . setStyleAttribute ( self . getElement ( ) , 'borderWidth' , ( str ( abs ( ( newCappedBorderWidthX2 / 2 ) ) ) + 'px' ) ) #NEWLINE# #UNINDENT# self . cappedBorderWidthX2 = newCappedBorderWidthX2 #NEWLINE# #UNINDENT# if ( NAI == self . x ) : #NEWLINE# #INDENT# self . _parent . setImagePosition ( self , newX , newY ) #NEWLINE# self . x = newX #NEWLINE# self . y = newY #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . x != newX ) : #NEWLINE# #INDENT# DOM . setStyleAttribute ( self . getElement ( ) , 'left' , ( str ( newX ) + 'px' ) ) #NEWLINE# self . x = newX #NEWLINE# #UNINDENT# if ( self . y != newY ) : #NEWLINE# #INDENT# DOM . setStyleAttribute ( self . getElement ( ) , 'top' , ( str ( newY ) + 'px' ) ) #NEWLINE# self . y = newY #NEWLINE# #UNINDENT# #UNINDENT# if ( self . width != newW ) : #NEWLINE# #INDENT# self . setWidth ( ( str ( newW ) + 'px' ) ) #NEWLINE# self . width = newW #NEWLINE# #UNINDENT# if ( self . height != newH ) : #NEWLINE# #INDENT# self . setHeight ( ( str ( newH ) + 'px' ) ) #NEWLINE# self . height = newH #NEWLINE# #UNINDENT# if ( self . backgroundColor != backgroundColor ) : #NEWLINE# #INDENT# DOM . setStyleAttribute ( self . getElement ( ) , 'backgroundColor' , backgroundColor ) #NEWLINE# self . backgroundColor = backgroundColor #NEWLINE# #UNINDENT# if ( self . borderColor != borderColor ) : #NEWLINE# #INDENT# DOM . setStyleAttribute ( self . getElement ( ) , 'borderColor' , borderColor ) #NEWLINE# self . borderColor = borderColor #NEWLINE# #UNINDENT# if ( self . borderStyle != borderStyle ) : #NEWLINE# #INDENT# DOM . setStyleAttribute ( self . getElement ( ) , 'borderStyle' , borderStyle ) #NEWLINE# self . borderStyle = borderStyle #NEWLINE# #UNINDENT# if ( self . url != url ) : #NEWLINE# #INDENT# '\n            * WARNING: Redundant setUrls cause leaks in FF 2.0.0.16. So, be\n            * particularly careful not to accidentally "double set" a URL to\n            * the exact same URL (I did this with a slightly less efficient\n            * initialization of my images, and this caused a huge memory\n            * leak that I hope to memorialize, and lay to rest forever, here.)\n            *\n            * Symptoms, in FF 2 only, are those that would occur AS IF the\n            * extra setUrl increased the reference count on the (browser\n            * cached) image file so that Firefox can\'t release either it, or\n            * any of the img elements that reference it. A very big leak for\n            * GChart, since just about everything in a GChart references the\n            * exact same blank gif URL.\n            *\n            * Such symptoms did not occur in IE7, or in FF 2 if the cache\n            * has been disabled via "about:config".\n            *\n            * Search for "massively leak" and below that comment you will\n            * find two lines that, if uncommented, make the leak reappear.\n            *\n            ' #NEWLINE# self . setUrl ( url ) #NEWLINE# self . url = url