pKaTool/pKacalc_interface.py
def update_matrix_display(self):
        """Update the matrix on the screen when we choose a new calculation method"""
        #
        # Delete all object on the canvas
        #
        objects=self.matrix_canvas.find_all()
        for obj in objects:
            self.matrix_canvas.delete(obj)
        #
        # Precompute the group numbers
        #
        self.group_numbers={}
        count=0
        for group in self.groups:
            self.group_numbers[group]=count
            count=count+1
        #
        # Get the titratable groups
        #
        matrix_balloon=Pmw.Balloon(self.mwin)
        import math
        for group in self.groups:
            #
            # Labels
            #
            x,y=self.get_matrix_cell_position(group,group)
            self.matrix_canvas.create_text(x,self.matrix_y_add,text=group,anchor='s')
            self.matrix_canvas.create_text(0,y,text=group,anchor='w')
            #
            # Insert the energies
            #
            for partner in self.groups:
                x,y=self.get_matrix_cell_position(group,partner,type='box')
                if group==partner:
                    self.matrix_canvas.create_rectangle(x,y,x+self.matrix_x_add,y+self.matrix_y_add,fill='black')
                else:
                    record=self.matrix[group][partner]
                    disp=self.m_display.get()
                    intene=record[0]-record[1]-record[2]+record[3]
                    if disp=='Interaction energy (kT/e)':
                        pass
                    elif disp=='Interaction energy (dpKa)':
                        intene=intene/math.log(10)
                    elif disp=='Distance (A)':
                        import tkMessageBox
                        tkMessageBox.showinfo('Not done yet',
                                              'Be nice to Jens to get him to do this',
                                              parent=self.mwin)
                        return
                    elif disp=='eps(effective)':
                        import tkMessageBox
                        tkMessageBox.showinfo('Not done yet',
                                              'Be nice to Jens to get him to do this',
                                              parent=self.mwin)
                        return
                    if intene>0.0:
                        color='red'
                    else:
                        color='blue'
                    self.matrix_canvas.create_rectangle(x,y,x+self.matrix_x_add,y+self.matrix_y_add)
                    x,y=self.get_matrix_cell_position(group,partner)
                    handle=self.matrix_canvas.create_text(x,y,text='%5.3f' %intene,anchor='center',fill=color)
                    matrix_balloon.tagbind(self.matrix_canvas,handle,'%s-%s' %(group,partner))
                    #self.Entry=Entry(self.mwin,width=10,textvariable=energy,bg='white')
                    #self.win=self.matrix_canvas.create_window(x,y,window=self.Entry,anchor='nw')

        return
Update the matrix on the screen when we choose a new calculation method
Update the matrix on the screen when we choose a new calculation method
Update the matrix on the screen when we choose a new calculation method
def update_matrix_display(self):
         Delete all object on the canvas
        objects=self.matrix_canvas.find_all()
        for obj in objects:
            self.matrix_canvas.delete(obj)
         Precompute the group numbers
        self.group_numbers={}
        count=0
        for group in self.groups:
            self.group_numbers[group]=count
            count=count+1
         Get the titratable groups
        matrix_balloon=Pmw.Balloon(self.mwin)
        import math
        for group in self.groups:
             Labels
            x,y=self.get_matrix_cell_position(group,group)
            self.matrix_canvas.create_text(x,self.matrix_y_add,text=group,anchor='s')
            self.matrix_canvas.create_text(0,y,text=group,anchor='w')
             Insert the energies
            for partner in self.groups:
                x,y=self.get_matrix_cell_position(group,partner,type='box')
                if group==partner:
                    self.matrix_canvas.create_rectangle(x,y,x+self.matrix_x_add,y+self.matrix_y_add,fill='black')
                else:
                    record=self.matrix[group][partner]
                    disp=self.m_display.get()
                    intene=record[0]-record[1]-record[2]+record[3]
                    if disp=='Interaction energy (kT/e)':
                        pass
                    elif disp=='Interaction energy (dpKa)':
                        intene=intene/math.log(10)
                    elif disp=='Distance (A)':
                        import tkMessageBox
                        tkMessageBox.showinfo('Not done yet',
                                              'Be nice to Jens to get him to do this',
                                              parent=self.mwin)
                        return
                    elif disp=='eps(effective)':
                        import tkMessageBox
                        tkMessageBox.showinfo('Not done yet',
                                              'Be nice to Jens to get him to do this',
                                              parent=self.mwin)
                        return
                    if intene>0.0:
                        color='red'
                    else:
                        color='blue'
                    self.matrix_canvas.create_rectangle(x,y,x+self.matrix_x_add,y+self.matrix_y_add)
                    x,y=self.get_matrix_cell_position(group,partner)
                    handle=self.matrix_canvas.create_text(x,y,text='%5.3f' %intene,anchor='center',fill=color)
                    matrix_balloon.tagbind(self.matrix_canvas,handle,'%s-%s' %(group,partner))
                    self.Entry=Entry(self.mwin,width=10,textvariable=energy,bg='white')
                    self.win=self.matrix_canvas.create_window(x,y,window=self.Entry,anchor='nw')
        return
def update_matrix_display ( self ) : objects = self . matrix_canvas . find_all ( ) for obj in objects : self . matrix_canvas . delete ( obj ) self . group_numbers = { } count = 0 for group in self . groups : self . group_numbers [ group ] = count count = count + 1 matrix_balloon = Pmw . Balloon ( self . mwin ) import math for group in self . groups : x , y = self . get_matrix_cell_position ( group , group ) self . matrix_canvas . create_text ( x , self . matrix_y_add , text = group , anchor = 's' ) self . matrix_canvas . create_text ( 0 , y , text = group , anchor = 'w' ) for partner in self . groups : x , y = self . get_matrix_cell_position ( group , partner , type = 'box' ) if group == partner : self . matrix_canvas . create_rectangle ( x , y , x + self . matrix_x_add , y + self . matrix_y_add , fill = 'black' ) else : record = self . matrix [ group ] [ partner ] disp = self . m_display . get ( ) intene = record [ 0 ] - record [ 1 ] - record [ 2 ] + record [ 3 ] if disp == 'Interaction energy (kT/e)' : pass elif disp == 'Interaction energy (dpKa)' : intene = intene / math . log ( 10 ) elif disp == 'Distance (A)' : import tkMessageBox tkMessageBox . showinfo ( 'Not done yet' , 'Be nice to Jens to get him to do this' , parent = self . mwin ) return elif disp == 'eps(effective)' : import tkMessageBox tkMessageBox . showinfo ( 'Not done yet' , 'Be nice to Jens to get him to do this' , parent = self . mwin ) return if intene > 0.0 : color = 'red' else : color = 'blue' self . matrix_canvas . create_rectangle ( x , y , x + self . matrix_x_add , y + self . matrix_y_add ) x , y = self . get_matrix_cell_position ( group , partner ) handle = self . matrix_canvas . create_text ( x , y , text = '%5.3f' % intene , anchor = 'center' , fill = color ) matrix_balloon . tagbind ( self . matrix_canvas , handle , '%s-%s' % ( group , partner ) ) return
Update the matrix on the screen when we choose a new calculation method
Update the matrix on the screen when we choose a new calculation method
"""Update the matrix on the screen when we choose a new calculation method""" # # Delete all object on the canvas # # # Precompute the group numbers # # # Get the titratable groups # # # Labels # # # Insert the energies # #self.Entry=Entry(self.mwin,width=10,textvariable=energy,bg='white') #self.win=self.matrix_canvas.create_window(x,y,window=self.Entry,anchor='nw')
self