mailr13454 - in /branches/gui_testing/gui/spin_viewer: containers.py tree.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on July 06, 2011 - 15:46:
Author: bugman
Date: Wed Jul  6 15:46:36 2011
New Revision: 13454

URL: http://svn.gna.org/viewcvs/relax?rev=13454&view=rev
Log:
Reverted r13450 as a different approach will be used.

The command used was:
svn merge -r13450:13449 .

.....
  r13450 | bugman | 2011-07-06 14:53:05 +0200 (Wed, 06 Jul 2011) | 6 lines
  Changed paths:
     M /branches/gui_testing/gui/spin_viewer/containers.py
     M /branches/gui_testing/gui/spin_viewer/tree.py
  
  The info data structure is no longer passed into the container object.
  
  The Container.display() method has been deleted, and the root, molecule, 
residue and spin container
  methods are called directly from the tree.
.....


Modified:
    branches/gui_testing/gui/spin_viewer/containers.py
    branches/gui_testing/gui/spin_viewer/tree.py

Modified: branches/gui_testing/gui/spin_viewer/containers.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/spin_viewer/containers.py?rev=13454&r1=13453&r2=13454&view=diff
==============================================================================
--- branches/gui_testing/gui/spin_viewer/containers.py (original)
+++ branches/gui_testing/gui/spin_viewer/containers.py Wed Jul  6 15:46:36 
2011
@@ -30,7 +30,7 @@
 import wx
 
 # relax module imports.
-from generic_fns.mol_res_spin import return_spin
+from generic_fns.mol_res_spin import generate_spin_id, return_spin
 
 # GUI module imports.
 from gui import paths
@@ -85,24 +85,18 @@
         self.Refresh()
 
 
-    def container_molecule(self, mol_name=None, mol_id=None, select=True):
+    def container_molecule(self, mol_name=None):
         """Build and display the molecule container
 
         @keyword mol_name:  The name of the molecule.
         @type mol_name:     str
-        @keyword mol_id:    The molecule ID string.
-        @type mol_id:       str
-        @keyword select:    The selection flag.
-        @type select:       bool
         """
 
         # Store the args.
         self.mol_name = mol_name
-        self.mol_id = mol_id
-        self.select = select
-
-        # Destroy all the original contents.
-        self.main_sizer.Clear(deleteWindows=True)
+
+        # The molecule ID.
+        self.mol_id = generate_spin_id(mol_name=mol_name)
 
         # Create the header.
         sizer = self.header_molecule()
@@ -114,12 +108,8 @@
         line = wx.StaticLine(self, -1, (25, 50))
         self.main_sizer.Add(line, 0, wx.EXPAND|wx.ALL, border=self.border)
 
-        # Re-perform the window layout.
-        self.Layout()
-        self.Refresh()
-
-
-    def container_residue(self, mol_name=None, res_num=None, res_name=None, 
res_id=None, select=True):
+
+    def container_residue(self, mol_name=None, res_num=None, res_name=None):
         """Build and display the residue container
 
         @keyword mol_name:  The molecule name.
@@ -128,21 +118,15 @@
         @type res_num:      str
         @keyword res_name:  The residue name.
         @type res_name:     str
-        @keyword res_id:    The residue ID string.
-        @type res_id:       str
-        @keyword select:    The selection flag.
-        @type select:       bool
         """
 
         # Store the args.
         self.mol_name = mol_name
         self.res_num = res_num
         self.res_name = res_name
-        self.res_id = res_id
-        self.select = select
-
-        # Destroy all the original contents.
-        self.main_sizer.Clear(deleteWindows=True)
+
+        # The residue ID.
+        self.res_id = generate_spin_id(mol_name=mol_name, res_num=res_num, 
res_name=res_name)
 
         # Create the header.
         sizer = self.header_residue()
@@ -154,12 +138,8 @@
         line = wx.StaticLine(self, -1, (25, 50))
         self.main_sizer.Add(line, 0, wx.EXPAND|wx.ALL, border=self.border)
 
-        # Re-perform the window layout.
-        self.Layout()
-        self.Refresh()
-
-
-    def container_spin(self, mol_name=None, res_num=None, res_name=None, 
spin_num=None, spin_name=None, spin_id=None, select=True):
+
+    def container_spin(self, mol_name=None, res_num=None, res_name=None, 
spin_num=None, spin_name=None):
         """Build and display the spin container
 
         @keyword mol_name:  The molecule name.
@@ -168,14 +148,10 @@
         @type res_num:      str
         @keyword res_name:  The residue name.
         @type res_name:     str
-        @keyword spin_num:  The spin number.
-        @type spin_num:     str
-        @keyword spin_name: The spin name.
-        @type spin_name:    str
-        @keyword spin_id:   The spin ID string.
-        @type spin_id:      str
-        @keyword select:    The selection flag.
-        @type select:       bool
+        @keyword spin_num:   The spin number.
+        @type spin_num:      str
+        @keyword spin_name:  The spin name.
+        @type spin_name:     str
         """
 
         # Store the args.
@@ -184,11 +160,9 @@
         self.res_name = res_name
         self.spin_num = spin_num
         self.spin_name = spin_name
-        self.spin_id = spin_id
-        self.select = select
-
-        # Destroy all the original contents.
-        self.main_sizer.Clear(deleteWindows=True)
+
+        # The spin ID.
+        self.spin_id = generate_spin_id(mol_name=mol_name, res_num=res_num, 
res_name=res_name, spin_num=spin_num, spin_name=spin_name)
 
         # Create the header.
         sizer = self.header_spin()
@@ -203,10 +177,6 @@
         # The spin container variables.
         sizer2 = self.spin_vars()
         self.main_sizer.Add(sizer2, 1, wx.ALL|wx.EXPAND, border=self.border)
-
-        # Re-perform the window layout.
-        self.Layout()
-        self.Refresh()
 
 
     def create_head_text(self, text):
@@ -278,11 +248,39 @@
         return title
 
 
+    def display(self, info):
+        """Display the info for the selected container.
+
+        @param info:    The information list consisting of the container 
type ('root', 'mol', 'res', or 'spin'), the molecule name, the residue 
number, the residue name, the spin number, and the spin name.  The name and 
number information is dropped when not needed.
+        @type info:     list of str and int
+        """
+
+        # Destroy all the original contents.
+        self.main_sizer.Clear(deleteWindows=True)
+
+        # The root window display.
+        if info == 'root':
+            self.display_root()
+
+        # The molecule container display.
+        elif info['type'] == 'mol':
+            self.container_molecule(mol_name=info['mol_name'])
+
+        # The residue container display.
+        elif info['type'] == 'res':
+            self.container_residue(mol_name=info['mol_name'], 
res_num=info['res_num'], res_name=info['res_name'])
+
+        # The spin container display.
+        elif info['type'] == 'spin':
+            self.container_spin(mol_name=info['mol_name'], 
res_num=info['res_num'], res_name=info['res_name'], 
spin_num=info['spin_num'], spin_name=info['spin_name'])
+
+        # Re-perform the window layout.
+        self.Layout()
+        self.Refresh()
+
+
     def display_root(self):
         """Build and display the root window."""
-
-        # Destroy all the original contents.
-        self.main_sizer.Clear(deleteWindows=True)
 
         # A sizer for the header.
         sizer = wx.BoxSizer(wx.VERTICAL)
@@ -293,10 +291,6 @@
 
         # Add to the sizer.
         self.main_sizer.Add(sizer, 0, wx.ALL|wx.EXPAND, border=self.border)
-
-        # Re-perform the window layout.
-        self.Layout()
-        self.Refresh()
 
 
     def header_molecule(self):

Modified: branches/gui_testing/gui/spin_viewer/tree.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/spin_viewer/tree.py?rev=13454&r1=13453&r2=13454&view=diff
==============================================================================
--- branches/gui_testing/gui/spin_viewer/tree.py (original)
+++ branches/gui_testing/gui/spin_viewer/tree.py Wed Jul  6 15:46:36 2011
@@ -163,21 +163,8 @@
         # The python data.
         info = self.tree.GetItemPyData(item)
 
-        # The root window display.
-        if info == 'root':
-            self.gui.spin_viewer.container.display_root()
-
-        # The molecule container display.
-        elif info['type'] == 'mol':
-            
self.gui.spin_viewer.container.container_molecule(mol_name=info['mol_name'], 
mol_id=info['id'], select=info['select'])
-
-        # The residue container display.
-        elif info['type'] == 'res':
-            
self.gui.spin_viewer.container.container_residue(mol_name=info['mol_name'], 
res_num=info['res_num'], res_name=info['res_name'], res_id=info['id'], 
select=info['select'])
-
-        # The spin container display.
-        elif info['type'] == 'spin':
-            
self.gui.spin_viewer.container.container_spin(mol_name=info['mol_name'], 
res_num=info['res_num'], res_name=info['res_name'], 
spin_num=info['spin_num'], spin_name=info['spin_name'], spin_id=info['id'], 
select=info['select'])
+        # Display the container.
+        self.gui.spin_view.container.display(info)
 
 
     def create_residue(self, event):




Related Messages


Powered by MHonArc, Updated Wed Jul 06 16:00:02 2011