Пример #1
0
 def __init__( self, manager, canvas, molds, modelObject = None ):
     assert modelObject == None or isinstance( modelObject, Observable )
     EventDispatcher.__init__( self )
     object.__setattr__( self, 'canvas', canvas )
     object.__setattr__( self, 'manager', manager )
     object.__setattr__( self, 'props', { 'rect': ( 0, 0, 0, 0 ) } )
     object.__setattr__( self, 'idToPartMap', {} )
     object.__setattr__( self, 'functionToPartsMap', {} )
     object.__setattr__( self, 'moldToPartMap', {} )
     object.__setattr__( self, 'molds', None )
     object.__setattr__( self, 'modelObject', None )
     object.__setattr__( self, 'parts', None )
     object.__setattr__( self, 'disposed', False )
     _molds = PartMolds(
         molds.id,
         molds.parent,
         molds.function,
         (
             ExprCompiler( "code:props['rect'][ 0 ]" ).compile().result,
             ExprCompiler( "code:props['rect'][ 1 ]" ).compile().result
             ),
         (
             ExprCompiler( "code:props['rect'][ 2 ]" ).compile().result,
             ExprCompiler( "code:props['rect'][ 3 ]" ).compile().result
             ) )
     _molds.dynamic = True
     _molds.children = molds.children[:]
     self.modelObject = modelObject
     self.molds = _molds
Пример #2
0
 def __init__( self, manager, canvas, modelObject = None ):
     assert modelObject == None or isinstance( modelObject, Observable )
     EventDispatcher.__init__( self )
     object.__setattr__( self, 'manager', manager )
     object.__setattr__( self, 'canvas', canvas )
     object.__setattr__( self, 'canvasItem', None )
     object.__setattr__( self, 'disposed', False )
     object.__setattr__( self, 'modelObject', None )
     object.__setattr__( self, 'props', {
         'rect': ( 0, 0, 0, 0 ),
         'orientation': CONNECTOR_ORI_VERTICAL,
         'color': 0x808080ff,
         } )
     self.modelObject = modelObject