コード例 #1
0
    def __init__(self, *args, **kargs):
        OrigCanvasItem.__init__(self, *args, **kargs)

        if 'handle' not in self.opts:
            self.opts['handle'] = None

        ## reload user transform from disk if possible
        if self.opts['handle'] is not None:
            trans = self.opts['handle'].info().get('userTransform', None)
            if trans is not None:
                self.restoreTransform(trans)
            elif 'defaultUserTransform' in self.opts:
                self.restoreTransform(self.opts['defaultUserTransform'])
            if self.opts['name'] is None:
                self.opts['name'] = self.opts['handle'].shortName()
コード例 #2
0
ファイル: CanvasItem.py プロジェクト: ablot/acq4
 def __init__(self, *args, **kargs):
     OrigCanvasItem.__init__(self, *args, **kargs)
     
     if 'handle' not in self.opts:
         self.opts['handle'] = None
     
     ## reload user transform from disk if possible
     if self.opts['handle'] is not None:
         trans = self.opts['handle'].info().get('userTransform', None)
         if trans is not None:
             self.restoreTransform(trans)
         elif 'defaultUserTransform' in self.opts:
             self.restoreTransform(self.opts['defaultUserTransform'])
         if self.opts['name'] is None:
             self.opts['name'] = self.opts['handle'].shortName()
コード例 #3
0
 def saveState(self, relativeTo=None):
     state = OrigCanvasItem.saveState(self)
     state['filename'] = None if self.handle is None else self.handle.name(
         relativeTo=relativeTo)
     return state