def openScopBrowser(self, strg): new_window = Toplevel() pw = Pmw.PanedWidget(new_window) pw.add('top', min=10) pw.add('bottom', min=10) geometry_string = "%dx%d%+d%+d" % ( 700, 800, 50 + (25 * len(self.parent.system_windows)), 30 + (25 * len(self.parent.system_windows)) ) # width,height,x-offset,y-offset new_window.geometry(geometry_string) new_window.title("SCOP Domain Viewer") ScopViewer(pw, new_window, self).pack(side=TOP, expand=YES) pw.pack(expand=1, fill=BOTH) bottomPane = pw.pane('bottom') bottomPane.system = MolecularSystem.System(self, bottomPane) bottomPane.system.load_pdb("") bottomPane.system.color_ribbon_by_chain() bottomPane.viewer = MolnirMolecularViewer(bottomPane, bottomPane.system) bottomPane.viewer.loadSystem(bottomPane.system) bottomPane.cardframe = CardFrame(bottomPane, bottomPane.system) bottomPane.cardframe.pack(expand=NO, fill=X) self.parent.scopViewer_windows.append(new_window)
def openNewSystem(self): strg = askopenfilename(title='open a new PDB', defaultextension='.pdb', filetypes=[("Protein Data Bank", "*.pdb"), ("all files", "*")]) # stores systems if len(strg) > 0: # create a window new_window = Toplevel() geometry_string = "%dx%d%+d%+d" % ( 700, 600, 50 + (25 * len(self.parent.system_windows)), 30 + (25 * len(self.parent.system_windows)) ) # width,height,x-offset,y-offset new_window.geometry(geometry_string) # create a system new_system = MolecularSystem.System(self, new_window) new_system.load_pdb(strg) new_system.color_ribbon_by_chain() new_window.title(new_system.header) # store it in the window new_window.system = new_system # open a molecular viewer new_viewer = MolnirMolecularViewer(new_window, new_window.system) new_window.viewer = new_viewer new_cardframe = CardFrame(new_window, new_window.system) new_cardframe.pack(expand=NO, fill=X) new_window.cardframe = new_cardframe self.parent.system_windows.append(new_window)
def openUserDbBrowser(self, strg): root_path = "C:\\CourseWork\\CS499\\MyTest\\SCOP_Pdbs\\1-10" root_path = askdirectory(initialdir=root_path, title="select directory", mustexist=1) print root_path new_window = Toplevel() pw = Pmw.PanedWidget(new_window) pw.add('top', min=10) pw.add('bottom', min=10) geometry_string = "%dx%d%+d%+d" % ( 700, 800, 50 + (25 * len(self.parent.system_windows)), 30 + (25 * len(self.parent.system_windows)) ) # width,height,x-offset,y-offset new_window.geometry(geometry_string) new_window.title("User Database Viewer") UserDbViewer(pw, root_path, new_window).pack(side=TOP, expand=YES) pw.pack(expand=1, fill=BOTH) bottomPane = pw.pane('bottom') bottomPane.system = MolecularSystem.System(self, bottomPane) bottomPane.system.load_pdb("") bottomPane.system.color_ribbon_by_chain() bottomPane.viewer = MolnirMolecularViewer(bottomPane, bottomPane.system) bottomPane.viewer.loadSystem(bottomPane.system) bottomPane.cardframe = CardFrame(bottomPane, bottomPane.system) bottomPane.cardframe.pack(expand=NO, fill=X) self.parent.system_windows.append(new_window)
def loadSystem(self, strg, obj=None): if len(strg) > 0: # self.closeSystem(which_window) if obj is None: obj = Toplevel() obj.string = strg #identifier obj.system = MolecularSystem.System(self, obj) obj.system.load_pdb(strg) obj.system.color_ribbon_by_chain() obj.title(obj.system.header) obj.viewer = MolnirMolecularViewer(obj, obj.system) obj.viewer.loadSystem(obj.system) obj.cardframe = CardFrame(obj, obj.system) obj.cardframe.pack(expand=NO, fill=X) self.parent.system_windows.append(obj)