#NEWLINE# def draw( self ) : #NEWLINE# #INDENT# rect = self . get_allocation ( ) #NEWLINE# context = self . context = self . window . cairo_create ( ) #NEWLINE# context . set_line_width ( 1 ) #NEWLINE# ( x1 , x2 ) = ( ( corner_radius + 0.5 ) , ( ( rect . width - corner_radius ) - 0.5 ) ) #NEWLINE# ( y1 , y2 ) = ( ( corner_radius + 0.5 ) , ( ( rect . height - corner_radius ) - 0.5 ) ) #NEWLINE# angles = [ ( ( v * math . pi ) / 2.0 ) for v in range ( 0 , 4 ) ] #NEWLINE# context . arc ( x1 , y1 , corner_radius , angles [ 2 ] , angles [ 3 ] ) #NEWLINE# context . arc ( x2 , y1 , corner_radius , x2 [ 3 ] , angles [ 0 ] ) #NEWLINE# context . arc ( x2 , y2 , corner_radius , angles [ 0 ] , angles [ 1 ] ) #NEWLINE# context . arc ( x1 , y2 , corner_radius , angles [ 1 ] , angles [ 2 ] ) #NEWLINE# context . close_path ( ) #NEWLINE# context . set_source_rgb ( 1 , 1 , 1 ) #NEWLINE# context . fill_preserve ( ) #NEWLINE# context . set_source_rgb ( 0 , 0 , 0 ) #NEWLINE# context . stroke ( ) #NEWLINE# context . set_font_size ( 14 ) #NEWLINE# context . move_to ( corner_radius , ( context . font_extents ( ) [ 0 ] + 3 ) ) #NEWLINE# context . show_text ( self . monomer . name ) #NEWLINE# context . move_to ( 0 , ( context . font_extents ( ) [ 0 ] + 8.5 ) ) #NEWLINE# context . rel_line_to ( 100 , 0 ) #NEWLINE# context . stroke ( ) #NEWLINE# context . translate ( corner_radius , sites_y_pos ) #NEWLINE# for site in self . monomer . sites : #NEWLINE# #INDENT# self . draw_site ( site ) #NEWLINE# context . translate ( 0 , sites_y_spacing )