def __init__( self, aModelEditor, aLayoutName, anObjectId ): """ sets up a modal dialogwindow displaying the MEVariableReferenceEditor and the LineProperty """ self.theModelEditor = aModelEditor self.theTopFrame = gtk.VBox() self.getTheObject(aLayoutName, anObjectId) self.theComponent = VariableReferenceEditorComponent( self, self.theTopFrame,self.theLayout,self.theObjectMap) self.theComponent.setDisplayedVarRef(self.theLayout,self.theObjectMap) # self.win.show_all() self.update() self.bringToTop()
class ConnectionObjectEditorWindow: def __init__( self, aModelEditor, aLayoutName, anObjectId ): """ sets up a modal dialogwindow displaying the MEVariableReferenceEditor and the LineProperty """ self.theModelEditor = aModelEditor self.theTopFrame = gtk.VBox() self.getTheObject(aLayoutName, anObjectId) self.theComponent = VariableReferenceEditorComponent( self, self.theTopFrame,self.theLayout,self.theObjectMap) self.theComponent.setDisplayedVarRef(self.theLayout,self.theObjectMap) # self.win.show_all() self.update() self.bringToTop() def bringToTop( self ): self.theModelEditor.theMainWindow.setSmallWindow( self.theTopFrame ) self.theComponent.bringToTop() # -- Private methods def setDisplayConnObjectEditorWindow(self,aLayoutName, anObjectId): self.getTheObject( aLayoutName, anObjectId) self.theComponent.setDisplayedVarRef(self.theLayout,self.theObjectMap) self.update() self.bringToTop() def getTheObject(self,aLayoutName, anObjectId): self.theLayout =self.theModelEditor.theLayoutManager.getLayout(aLayoutName) self.theObjectMap = {} if anObjectId == None: return elif type( anObjectId ) == type([]): for anId in anObjectId: self.theObjectMap[ anId] = self.theLayout.getObject(anId) elif type( anObjectId ) == str: self.theObjectMap[ anObjectId] = self.theLayout.getObject(anObjectId) def modifyConnObjectProperty(self,aPropertyName, aPropertyValue): aCommandList = [] if aPropertyName == OB_PROP_FILL_COLOR : # create command for anId in self.theObjectMap.keys(): aCommandList += [ SetObjectProperty(self.theLayout, anId, aPropertyName, aPropertyValue ) ] if aPropertyName == OB_PROP_SHAPE_TYPE : # create command for anId in self.theObjectMap.keys(): aCommandList += [SetObjectProperty( self.theLayout, anId, aPropertyName, aPropertyValue ) ] if len( aCommandList ) > 0: self.theLayout.passCommand( aCommandList ) def update(self, aType = None, aFullID = None): self.theComponent.update() def destroy( self, *arg ): """destroy dialog """ pass