[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.9, Thu Aug 7 19:14:27 2003 UTC revision 1.13, Wed Nov 5 02:28:44 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):
13    #    def initCatEvents(self ):
14    #    def initCatData( self ):
15    #    def loadBssCatalog(self, bssItemId):
16    #    def loadWitCatalog(self, witItemId):
17    #    def loadSeedCatalog(self, witItemId):
18    #    def onLeftClick(self,treeEvent):
19    #    def onLoadBtnPress(self, event):
20    #    def bssLoader( self, bssCatEntry ):
21    #    def witOrgLoader(self,  orgName ):
22    #    def witPwyLoader(self,  pwyName ):
23    
24      #------------------------------------------------------------------------      #------------------------------------------------------------------------
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.__seedDataFactory = SeedDataFactory( self.seedServer )
30    
31          self.to_re = parent.re          self.to_re = parent.re
32          self.selected = None       #remember last selected catalog entry          self.selected = None       #remember last selected catalog entry
33                                     #..is used when LOAD button is hit.                                     #..is used when LOAD button is hit.
# Line 27  Line 46 
46          EVT_TREE_SEL_CHANGED(self.parent.catalog_tree,          EVT_TREE_SEL_CHANGED(self.parent.catalog_tree,
47                               self.parent.catalog_treeId,                               self.parent.catalog_treeId,
48                               self.onLeftClick)                               self.onLeftClick)
49            EVT_LEFT_DCLICK (self.parent.catalog_tree, self.onLeftDClick)
50    
51          return          return
52    
# Line 39  Line 59 
59                                                     "BioSimScratch" )                                                     "BioSimScratch" )
60          witItemId=self.parent.catalog_tree.AppendItem(self.parent.catalogRootId,          witItemId=self.parent.catalog_tree.AppendItem(self.parent.catalogRootId,
61                                                     "WIT3" )                                                     "WIT3" )
62            seedItemId=self.parent.catalog_tree.AppendItem(self.parent.catalogRootId,
63                                                       "Seed" )
64    
65          self.loadBssCatalog( bssItemId )          self.loadBssCatalog( bssItemId )
66          self.loadWitCatalog( witItemId )          self.loadWitCatalog( witItemId )
67            self.loadSeedCatalog( seedItemId )
68    
69    
70          self.parent.catalog_tree.Expand( self.parent.catalogRootId)          self.parent.catalog_tree.Expand( self.parent.catalogRootId)
71          return          return
# Line 78  Line 102 
102          return          return
103    
104      #------------------------------------------------------------------------      #------------------------------------------------------------------------
105        def loadSeedCatalog(self, seedItemId):
106        #------------------------------------------------------------------------
107    
108            orgList = self.__seedDataFactory.listOrganisms( )
109            if ( orgList== None ):
110                orgItemId=self.parent.catalog_tree.AppendItem(seedItemId,
111                             "Could not get Org list from "+ self.seedServer )
112                return
113    
114            orgItemId=self.parent.catalog_tree.AppendItem(seedItemId, "Organisms" )
115            for org in orgList:
116                id=self.parent.catalog_tree.AppendItem(orgItemId, org.figOrgName )
117                self.parent.catalog_tree.SetPyData(id, (self.seedOrgLoader, org ))
118    
119            return
120    
121        #------------------------------------------------------------------------
122      def onLeftClick(self,treeEvent):      def onLeftClick(self,treeEvent):
123      #------------------------------------------------------------------------      #------------------------------------------------------------------------
124          item = treeEvent.GetItem()          item = treeEvent.GetItem()
125    
126          catEntryTuple = self.parent.tree_ctr.GetPyData(item)          catEntryTuple = self.parent.tree_ctr.GetPyData(item)
127          if (catEntryTuple == None ):          if (catEntryTuple == None ):
128              return              return
129          self.selected = catEntryTuple          self.selected = catEntryTuple
130    
131          return          return
132        #------------------------------------------------------------------------
133        def onLeftDClick(self,treeEvent):
134        #------------------------------------------------------------------------
135            self.onLoadBtnPress(treeEvent)
136    
137            pt = treeEvent.GetPosition()
138            item = self.parent.tree_ctr.HitTest(pt)
139            print item
140            catEntryTuple = self.parent.tree_ctr.GetPyData(item)
141            apply(catEntryTuple[0], [catEntryTuple[1]])
142            return
143    
144            pt = treeEvent.GetPosition()
145    
146            item = self.parent.tree_ctr.HitTest(pt)
147    
148            print item
149            catEntryTuple = self.parent.tree_ctr.GetPyData(item)
150            #print catEntryTuple, "catEntryTuple"
151            #self.selected = catEntryTuple
152    
153            #catEntryTuple = self.selected
154            #apply(catEntryTuple[0], [catEntryTuple[1]])
155    
156            return
157    
158    
159      #------------------------------------------------------------------------      #------------------------------------------------------------------------
160      def onLoadBtnPress(self, event):      def onLoadBtnPress(self, event):
# Line 122  Line 190 
190          return          return
191    
192      #------------------------------------------------------------------------      #------------------------------------------------------------------------
193        def seedOrgLoader(self,  org ):
194        #------------------------------------------------------------------------
195            wxBeginBusyCursor()
196    
197            top=self.__seedDataFactory.getRecoElemByOrg( org )
198            self.to_re.AddRecoElemTree(self.parent.rootId, top)
199            wxEndBusyCursor()
200            return
201    
202        #------------------------------------------------------------------------
203      def witPwyLoader(self,  pwyName ):      def witPwyLoader(self,  pwyName ):
204      #------------------------------------------------------------------------      #------------------------------------------------------------------------
205          wxBeginBusyCursor()          wxBeginBusyCursor()

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.13

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3