[Bio] / PyGUI / Catalogpanel.py Repository:
ViewVC logotype

Diff of /PyGUI/Catalogpanel.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11, Thu Sep 25 23:48:06 2003 UTC revision 1.12, Fri Oct 17 20:25:57 2003 UTC
# Line 1  Line 1 
1  from wxPython.wx import *  from wxPython.wx import *
2  from FaST.BssFactory import BssFactory  from FaST.BssFactory import BssFactory
3  from FaST.WitFactory import WitFactory  from FaST.WitFactory import WitFactory
4    from FaST.SeedDataFactory import SeedDataFactory
5    from FaST.SeedDataFactory import SeedOrganism
6  from FaST.RecoElem import RecoElem  from FaST.RecoElem import RecoElem
7  from RecoElempanel import RecoElemWindow  from RecoElempanel import RecoElemWindow
8    
9    
10    
11  class CatalogWindow:  class CatalogWindow:
12  #    def __init__(self, parent):  #    def __init__(self, parent):
13  #    def initCatEvents(self ):  #    def initCatEvents(self ):
14  #    def initCatData( self ):  #    def initCatData( self ):
15  #    def loadBssCatalog(self, bssItemId):  #    def loadBssCatalog(self, bssItemId):
16  #    def loadWitCatalog(self, witItemId):  #    def loadWitCatalog(self, witItemId):
17    #    def loadSeedCatalog(self, witItemId):
18  #    def onLeftClick(self,treeEvent):  #    def onLeftClick(self,treeEvent):
19  #    def onLoadBtnPress(self, event):  #    def onLoadBtnPress(self, event):
20  #    def bssLoader( self, bssCatEntry ):  #    def bssLoader( self, bssCatEntry ):
# Line 20  Line 25 
25      def __init__(self, parent):      def __init__(self, parent):
26      #------------------------------------------------------------------------      #------------------------------------------------------------------------
27          self.parent = parent          self.parent = parent
28            self.seedServer = "http://cyano.cs.uchicago.edu/FIG/"
29          self.to_re = parent.re          self.to_re = parent.re
30          self.selected = None       #remember last selected catalog entry          self.selected = None       #remember last selected catalog entry
31                                     #..is used when LOAD button is hit.                                     #..is used when LOAD button is hit.
# Line 51  Line 57 
57                                                     "BioSimScratch" )                                                     "BioSimScratch" )
58          witItemId=self.parent.catalog_tree.AppendItem(self.parent.catalogRootId,          witItemId=self.parent.catalog_tree.AppendItem(self.parent.catalogRootId,
59                                                     "WIT3" )                                                     "WIT3" )
60            seedItemId=self.parent.catalog_tree.AppendItem(self.parent.catalogRootId,
61                                                       "Seed" )
62    
63          self.loadBssCatalog( bssItemId )          self.loadBssCatalog( bssItemId )
64          self.loadWitCatalog( witItemId )          self.loadWitCatalog( witItemId )
65            self.loadSeedCatalog( seedItemId )
66    
67          self.parent.catalog_tree.Expand( self.parent.catalogRootId)          self.parent.catalog_tree.Expand( self.parent.catalogRootId)
68          return          return
# Line 90  Line 99 
99          return          return
100    
101      #------------------------------------------------------------------------      #------------------------------------------------------------------------
102        def loadSeedCatalog(self, witItemId):
103        #------------------------------------------------------------------------
104            seed=SeedDataFactory( self.seedServer )
105    
106            orgItemId=self.parent.catalog_tree.AppendItem(witItemId, "Organisms" )
107    
108            orgList = seed.listOrganisms( )
109            for org in orgList:
110                id=self.parent.catalog_tree.AppendItem(orgItemId, org.figOrgName )
111                self.parent.catalog_tree.SetPyData(id, (self.seedOrgLoader, org ))
112    
113            return
114    
115        #------------------------------------------------------------------------
116      def onLeftClick(self,treeEvent):      def onLeftClick(self,treeEvent):
117      #------------------------------------------------------------------------      #------------------------------------------------------------------------
118          item = treeEvent.GetItem()          item = treeEvent.GetItem()
# Line 103  Line 126 
126      #------------------------------------------------------------------------      #------------------------------------------------------------------------
127      def onLeftDClick(self,treeEvent):      def onLeftDClick(self,treeEvent):
128      #------------------------------------------------------------------------      #------------------------------------------------------------------------
129            self.onLoadBtnPress(treeEvent)
130    
131            pt = treeEvent.GetPosition()
132            item = self.parent.tree_ctr.HitTest(pt)
133            print item
134            catEntryTuple = self.parent.tree_ctr.GetPyData(item)
135            apply(catEntryTuple[0], [catEntryTuple[1]])
136            return
137    
138          pt = treeEvent.GetPosition()          pt = treeEvent.GetPosition()
139    
140          item = self.parent.tree_ctr.HitTest(pt)          item = self.parent.tree_ctr.HitTest(pt)
# Line 152  Line 184 
184          return          return
185    
186      #------------------------------------------------------------------------      #------------------------------------------------------------------------
187        def seedOrgLoader(self,  org ):
188        #------------------------------------------------------------------------
189            wxBeginBusyCursor()
190            print "seedOrgLoader getting (", org.figOrgId, " , ", org.figOrgName, ")"
191            seed = SeedDataFactory( self.seedServer )
192            top=seed.getRecoElemByOrg( org )
193            self.to_re.AddRecoElemTree(self.parent.rootId, top)
194            wxEndBusyCursor()
195            return
196    
197        #------------------------------------------------------------------------
198      def witPwyLoader(self,  pwyName ):      def witPwyLoader(self,  pwyName ):
199      #------------------------------------------------------------------------      #------------------------------------------------------------------------
200          wxBeginBusyCursor()          wxBeginBusyCursor()

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3