[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.14, Wed Nov 5 21:07:55 2003 UTC revision 1.21, Wed Feb 25 17:08:17 2004 UTC
# Line 4  Line 4 
4  from FaST.SeedDataFactory import SeedDataFactory  from FaST.SeedDataFactory import SeedDataFactory
5  from FaST.SeedDataFactory import SeedOrganism  from FaST.SeedDataFactory import SeedOrganism
6  from FaST.RecoElem import RecoElem  from FaST.RecoElem import RecoElem
7  from RecoElempanel import RecoElemWindow  from RecoElempanel import RecoElempanel
8    
9    
10    
11  class CatalogWindow:  class Catalogpanel:
12  #    def __init__(self, parent):  #    def __init__(self, parent):
13  #    def initCatEvents(self ):  #    def initCatEvents(self ):
14  #    def initCatData( self ):  #    def initCatData( self ):
# Line 50  Line 50 
50      #------------------------------------------------------------------------      #------------------------------------------------------------------------
51      def initCatEvents(self ):      def initCatEvents(self ):
52      #------------------------------------------------------------------------      #------------------------------------------------------------------------
53          button1= self.parent.OK_button          #button1= self.parent.OK_button
54            button1= self.parent.loadbtn
55          EVT_BUTTON(self.parent, self.parent.loadbtn.GetId(),          EVT_BUTTON(self.parent, self.parent.loadbtn.GetId(),
56                     self.onLoadBtnPress)                     self.onLoadBtnPress)
57          EVT_TREE_SEL_CHANGED(self.parent.catalog_tree,          EVT_TREE_SEL_CHANGED(self.parent.catalog_tree,
# Line 63  Line 64 
64          EVT_RIGHT_DOWN(self.parent.catalog_tree, self.onRightClickCatalogTree)          EVT_RIGHT_DOWN(self.parent.catalog_tree, self.onRightClickCatalogTree)
65    
66    
67          # doesn't work...          EVT_LEFT_DCLICK (self.parent.catalog_tree, self.onLoadBtnPress)
         # EVT_LEFT_DCLICK (self.parent.catalog_tree, self.onLeftDClick)  
68    
69          return          return
70    
# Line 84  Line 84 
84          self.loadWitCatalog( witItemId )          self.loadWitCatalog( witItemId )
85    
86          localSeedServer        = "http://localhost/FIG/"          localSeedServer        = "http://localhost/FIG/"
87    #        localSeedServer        = "http://float179.mcs.anl-external.org/FIG/"
88          self.loadSeedCatalog( localSeedServer)          self.loadSeedCatalog( localSeedServer)
89    
90          self.parent.catalog_tree.Expand( self.parent.catalogRootId)          self.parent.catalog_tree.Expand( self.parent.catalogRootId)
# Line 139  Line 140 
140    
141          seedFactory   = SeedDataFactory( seedServer )          seedFactory   = SeedDataFactory( seedServer )
142    
143            # add it to the list in the catalog
144            try:
145                self.parent.factoryMgr.addFactory( seedServer, seedFactory )
146            except:
147                self.parent.error("loadSeedCatalog: %s already in foundry list." % seedServer)
148                wxEndBusyCursor()
149                return
150    
151          # make an entry in the tree for it          # make an entry in the tree for it
152          #          #
153          newSeedItemId=self.parent.catalog_tree.AppendItem(self.seedItemId, seedServer )          newSeedItemId=self.parent.catalog_tree.AppendItem(self.seedItemId, seedServer )
# Line 149  Line 158 
158          if ( orgList== None ):          if ( orgList== None ):
159              orgItemId=self.parent.catalog_tree.AppendItem(newSeedItemId,              orgItemId=self.parent.catalog_tree.AppendItem(newSeedItemId,
160                           "Could not get Org list from "+ seedServer )                           "Could not get Org list from "+ seedServer )
161                wxEndBusyCursor()
162              return              return
163    
164            itemName="Spontaneous Reactions"
165            spontaneousRxItemId=self.parent.catalog_tree.AppendItem(newSeedItemId, itemName)
166            self.parent.catalog_tree.SetPyData(spontaneousRxItemId,
167                                               (self.seedRecoElemLoader,
168                                               (seedFactory.getRecoElemSpontaneousRx, None) ))
169    
170    
171          orgItemId=self.parent.catalog_tree.AppendItem(newSeedItemId, "Organisms" )          orgItemId=self.parent.catalog_tree.AppendItem(newSeedItemId, "Organisms" )
172          for org in orgList:          for org in orgList:
173              id=self.parent.catalog_tree.AppendItem(orgItemId, org.figOrgName )              id=self.parent.catalog_tree.AppendItem(orgItemId, org.figOrgName )
174              self.parent.catalog_tree.SetPyData(id, (self.seedOrgLoader,              self.parent.catalog_tree.SetPyData(id, (self.seedRecoElemLoader,
175                                                     (seedFactory.getRecoElemByOrg, org) ))                                                     (seedFactory.getRecoElemByOrg, org) ))
176    
177    
178          wxEndBusyCursor()          wxEndBusyCursor()
179          return          return
180    
# Line 261  Line 279 
279          return          return
280    
281      #------------------------------------------------------------------------      #------------------------------------------------------------------------
282      def seedOrgLoader(self,  argList ):      def seedRecoElemLoader(self,  argList ):
283      #------------------------------------------------------------------------      #------------------------------------------------------------------------
284          wxBeginBusyCursor()          wxBeginBusyCursor()
285    

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.21

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3