diff options
author | Ninad Sathaye <ninad@nanorex.com> | 2008-08-11 19:48:59 +0000 |
---|---|---|
committer | Ninad Sathaye <ninad@nanorex.com> | 2008-08-11 19:48:59 +0000 |
commit | f595c60a741748746111bea03b576003d97f4705 (patch) | |
tree | 38a777653a26127bee36c223fc2376e5c9b30c51 | |
parent | 14f31a0a5d5179be9ddb5eb7d50f07ddc2bfdb28 (diff) | |
download | nanoengineer-f595c60a741748746111bea03b576003d97f4705.tar.gz nanoengineer-f595c60a741748746111bea03b576003d97f4705.zip |
renamed editCommand attr of PMs to 'command'
19 files changed, 307 insertions, 301 deletions
diff --git a/cad/src/cnt/commands/BuildNanotube/BuildNanotube_PropertyManager.py b/cad/src/cnt/commands/BuildNanotube/BuildNanotube_PropertyManager.py index 8d8214f40..f4ac1705b 100644 --- a/cad/src/cnt/commands/BuildNanotube/BuildNanotube_PropertyManager.py +++ b/cad/src/cnt/commands/BuildNanotube/BuildNanotube_PropertyManager.py @@ -62,7 +62,7 @@ class BuildNanotube_PropertyManager( EditCommand_PM, DebugMenuMixin ): pmName = title iconPath = "ui/actions/Tools/Build Structures/Nanotube.png" - def __init__( self, win, editCommand ): + def __init__( self, win, command ): """ Constructor for the Build Nanotube property manager. """ @@ -78,7 +78,7 @@ class BuildNanotube_PropertyManager( EditCommand_PM, DebugMenuMixin ): EditCommand_PM.__init__( self, win, - editCommand) + command) DebugMenuMixin._init1( self ) @@ -139,13 +139,13 @@ class BuildNanotube_PropertyManager( EditCommand_PM, DebugMenuMixin ): #called when you enter another command exiting or suspending the #previous one. . At present. it doesn't exist (first needs cleanup in #command/command sequencer (Done and other methods._)-- Ninad 2008-01-09 - if hasattr(self.editCommand, 'flyoutToolbar') and \ - self.editCommand.flyoutToolbar: - self.editCommand.flyoutToolbar.exitNanotubeAction.setEnabled(not bool_enable) + if hasattr(self.command, 'flyoutToolbar') and \ + self.command.flyoutToolbar: + self.command.flyoutToolbar.exitNanotubeAction.setEnabled(not bool_enable) def model_changed(self): """ - When the editCommand is treated as a 'command' by the + When the command is treated as a 'command' by the commandSequencer, this method will override basicCommand.model_changed. For more info, see BuildAtomsPropertyManager.model_changed docstring. """ @@ -196,8 +196,8 @@ class BuildNanotube_PropertyManager( EditCommand_PM, DebugMenuMixin ): selectedSegments = [] selectedSegments = self.win.assy.getSelectedNanotubeSegments() - ##if self.editCommand is not None and self.editCommand.hasValidStructure(): - ##selectedSegments = self.editCommand.struct.getSelectedSegments() + ##if self.command is not None and self.command.hasValidStructure(): + ##selectedSegments = self.command.struct.getSelectedSegments() return (selectedSegments) @@ -215,9 +215,9 @@ class BuildNanotube_PropertyManager( EditCommand_PM, DebugMenuMixin ): #Or Join strands decrease it by 1) params = None - if self.editCommand and self.editCommand.hasValidStructure(): + if self.command and self.command.hasValidStructure(): strandList = [] - strandList = self.editCommand.struct.getStrands() + strandList = self.command.struct.getStrands() params = len(strandList) return params @@ -252,8 +252,8 @@ class BuildNanotube_PropertyManager( EditCommand_PM, DebugMenuMixin ): selectedSegments[0].edit() #Earlier implementation which used the segments in the #'current Nanotube Group'. Deprecated as of 2008-05-05 - ##if self.editCommand is not None and self.editCommand.hasValidStructure(): - ##selectedSegments = self.editCommand.struct.getSelectedSegments() + ##if self.command is not None and self.command.hasValidStructure(): + ##selectedSegments = self.command.struct.getSelectedSegments() ##if len(selectedSegments) == 1: ##selectedSegments[0].edit() diff --git a/cad/src/cnt/commands/InsertNanotube/InsertNanotube_PropertyManager.py b/cad/src/cnt/commands/InsertNanotube/InsertNanotube_PropertyManager.py index 2eaa96806..be727726e 100644 --- a/cad/src/cnt/commands/InsertNanotube/InsertNanotube_PropertyManager.py +++ b/cad/src/cnt/commands/InsertNanotube/InsertNanotube_PropertyManager.py @@ -66,7 +66,7 @@ class InsertNanotube_PropertyManager( DnaOrCnt_PropertyManager): pmName = title iconPath = "ui/actions/Tools/Build Structures/InsertNanotube.png" - def __init__( self, win, editCommand ): + def __init__( self, win, command ): """ Constructor for the Nanotube property manager. """ @@ -77,7 +77,7 @@ class InsertNanotube_PropertyManager( DnaOrCnt_PropertyManager): _superclass.__init__( self, win, - editCommand) + command) self.showTopRowButtons( PM_DONE_BUTTON | \ PM_CANCEL_BUTTON | \ diff --git a/cad/src/cnt/commands/NanotubeSegment/NanotubeSegment_PropertyManager.py b/cad/src/cnt/commands/NanotubeSegment/NanotubeSegment_PropertyManager.py index 5e954c9ae..83dd56570 100644 --- a/cad/src/cnt/commands/NanotubeSegment/NanotubeSegment_PropertyManager.py +++ b/cad/src/cnt/commands/NanotubeSegment/NanotubeSegment_PropertyManager.py @@ -51,7 +51,7 @@ class NanotubeSegment_PropertyManager( DnaOrCnt_PropertyManager ): pmName = title iconPath = "ui/actions/Tools/Build Structures/Nanotube.png" - def __init__( self, win, editCommand ): + def __init__( self, win, command ): """ Constructor for the Cnt Segment Properties property manager. """ @@ -70,7 +70,7 @@ class NanotubeSegment_PropertyManager( DnaOrCnt_PropertyManager ): _superclass.__init__( self, win, - editCommand) + command) self.showTopRowButtons( PM_DONE_BUTTON | \ @@ -98,27 +98,27 @@ class NanotubeSegment_PropertyManager( DnaOrCnt_PropertyManager ): """ Show this property manager. Overrides EditCommand_PM.show() This method also retrives the name information from the - editCommand's structure for its name line edit field. + command's structure for its name line edit field. @see: NanotubeSegment_EditCommand.getStructureName() @see: self.close() """ _superclass.show(self) - if self.editCommand is not None: - name = self.editCommand.getStructureName() + if self.command is not None: + name = self.command.getStructureName() if name is not None: self.nameLineEdit.setText(name) def close(self): """ Close this property manager. - Also sets the name of the self.editCommand's structure to the one + Also sets the name of the self.command's structure to the one displayed in the line edit field. @see self.show() @see: NanotubeSegment_EditCommand.setStructureName """ - if self.editCommand is not None: + if self.command is not None: name = str(self.nameLineEdit.text()) - self.editCommand.setStructureName(name) + self.command.setStructureName(name) _superclass.close(self) def _connect_showCursorTextCheckBox(self): @@ -231,9 +231,9 @@ class NanotubeSegment_PropertyManager( DnaOrCnt_PropertyManager ): @see: NanotubeSegment_EditCommand.editStructure() """ - if self.editCommand is not None and self.editCommand.hasValidStructure(): + if self.command is not None and self.command.hasValidStructure(): - self.nanotube = self.editCommand.struct.nanotube + self.nanotube = self.command.struct.nanotube self.n, self.m = self.nanotube.getChirality() self.type = self.nanotube.getType() diff --git a/cad/src/command_support/DnaOrCnt_PropertyManager.py b/cad/src/command_support/DnaOrCnt_PropertyManager.py index c7c378d80..c6b25a64b 100644 --- a/cad/src/command_support/DnaOrCnt_PropertyManager.py +++ b/cad/src/command_support/DnaOrCnt_PropertyManager.py @@ -48,7 +48,7 @@ class DnaOrCnt_PropertyManager(EditCommand_PM, DebugMenuMixin): @see: DnaDuplexPropertyManager (subclass) """ - def __init__( self, win, editCommand ): + def __init__( self, win, command ): """ Constructor for the DNA Duplex property manager. """ @@ -60,7 +60,7 @@ class DnaOrCnt_PropertyManager(EditCommand_PM, DebugMenuMixin): _superclass.__init__( self, win, - editCommand) + command) DebugMenuMixin._init1( self ) @@ -316,10 +316,10 @@ class DnaOrCnt_PropertyManager(EditCommand_PM, DebugMenuMixin): if self._colorChooser is None: return - if self.editCommand and self.editCommand.hasValidStructure(): + if self.command and self.command.hasValidStructure(): color = self._colorChooser.getColor() - if hasattr(self.editCommand.struct, 'setColor'): - self.editCommand.struct.setColor(color) + if hasattr(self.command.struct, 'setColor'): + self.command.struct.setColor(color) self.win.glpane.gl_update() diff --git a/cad/src/command_support/EditCommand_PM.py b/cad/src/command_support/EditCommand_PM.py index ec2f36776..71cf4d116 100644 --- a/cad/src/command_support/EditCommand_PM.py +++ b/cad/src/command_support/EditCommand_PM.py @@ -33,7 +33,7 @@ class EditCommand_PM(PM_Dialog): # The relative path to the PNG file that appears in the header iconPath = "" - def __init__(self, win, editCommand = None): + def __init__(self, win, command = None): """ Constructor for the EditCommand_PM """ @@ -46,9 +46,9 @@ class EditCommand_PM(PM_Dialog): # When we begin supporting that, lots of things will change and this # might be one of them .--- ninad 20070613 - self.editCommand = editCommand - if editCommand: - self.struct = self.editCommand.struct + self.command = command + if command: + self.struct = self.command.struct else: self.struct = None @@ -66,12 +66,12 @@ class EditCommand_PM(PM_Dialog): self._createFlyoutActions() - def setEditCommand(self, editCommand): + def setEditCommand(self, command): """ """ - assert editCommand - self.editCommand = editCommand - self.struct = self.editCommand.struct + assert command + self.command = command + self.struct = self.command.struct def show(self): """ @@ -119,7 +119,7 @@ class EditCommand_PM(PM_Dialog): Update various widgets in this Property manager. The default implementation does nothing. Overridden in subclasses. The various widgets , (e.g. spinboxes) will get values from the structure for which - this propMgr is constructed for (seelf.editCommand.struct) + this propMgr is constructed for (seelf.command.struct) @see: RotaryMotorPropertyManager._update_widgets_in_PM_before_show @see: self.show where it is called. @@ -179,15 +179,15 @@ class EditCommand_PM(PM_Dialog): """ Slot for the OK button """ - if self.editCommand: - self.editCommand.preview_or_finalize_structure(previewing = False) + if self.command: + self.command.preview_or_finalize_structure(previewing = False) #This should be cleaned up in a refactoring. There should be a central #updater which should ask when to print a message etc. There could be #mab=ny subclasses without a logMessage. Also, I am not removing #the call that prints history message as some subclasses might be #using it. For now, just do a hasattr test -- Ninad 2008-07-23 - if hasattr(self.editCommand, 'logMessage'): - env.history.message(self.editCommand.logMessage) + if hasattr(self.command, 'logMessage'): + env.history.message(self.command.logMessage) self.win.toolsDone() @@ -195,16 +195,16 @@ class EditCommand_PM(PM_Dialog): """ Slot for the Cancel button. """ - if self.editCommand: - self.editCommand.cancelStructure() + if self.command: + self.command.cancelStructure() self.win.toolsCancel() def preview_btn_clicked(self): """ Slot for the Preview button. """ - self.editCommand.preview_or_finalize_structure(previewing = True) - env.history.message(self.editCommand.logMessage) + self.command.preview_or_finalize_structure(previewing = True) + env.history.message(self.command.logMessage) def abort_btn_clicked(self): """ @@ -226,8 +226,8 @@ class EditCommand_PM(PM_Dialog): def _createFlyoutActions(self): self.exitEditCommandAction = NE1_QWidgetAction(self.win, win = self.win) - if self.editCommand: - text = "Exit " + self.editCommand.cmdname + if self.command: + text = "Exit " + self.command.cmdname else: text = "Exit" self.exitEditCommandAction.setText(text) diff --git a/cad/src/command_support/MotorPropertyManager.py b/cad/src/command_support/MotorPropertyManager.py index b04566a68..94a7e6c20 100644 --- a/cad/src/command_support/MotorPropertyManager.py +++ b/cad/src/command_support/MotorPropertyManager.py @@ -62,8 +62,8 @@ class MotorPropertyManager(EditCommand_PM): #EditCommand_PM.show, the 'preview' properties are not updated #when you are editing an existing R.Motor. Don't know the cause at this #time, issue is trivial. So calling it in the end -- Ninad 2007-10-03 - if self.editCommand and self.editCommand.struct: - self.editCommand.struct.updateCosmeticProps(previewing = True) + if self.command and self.command.struct: + self.command.struct.updateCosmeticProps(previewing = True) self.updateAttachedAtomListWidget() @@ -120,8 +120,8 @@ class MotorPropertyManager(EditCommand_PM): @note: This overrides change_jig_color in class MotorPropertyManager. """ color = self.motorColorComboBox.getColor() - self.editCommand.struct.color = color - self.editCommand.struct.normcolor = color + self.command.struct.color = color + self.command.struct.normcolor = color self.glpane.gl_update() return @@ -137,8 +137,8 @@ class MotorPropertyManager(EditCommand_PM): Slot for reverse direction button. Reverses the direction of the motor. """ - if self.editCommand.struct: - self.editCommand.struct.reverse_direction() + if self.command.struct: + self.command.struct.reverse_direction() self.glpane.gl_update() def updateAttachedAtomListWidget(self, atomList = None): @@ -147,8 +147,8 @@ class MotorPropertyManager(EditCommand_PM): """ if atomList is None: - if self.editCommand.struct: - atomList = self.editCommand.struct.atoms[:] + if self.command.struct: + atomList = self.command.struct.atoms[:] if atomList is not None: self.attachedAtomsListWidget.insertItems(row = 0, diff --git a/cad/src/commands/InsertGraphene/GrapheneGeneratorPropertyManager.py b/cad/src/commands/InsertGraphene/GrapheneGeneratorPropertyManager.py index 835f2f4dd..b32bce091 100755 --- a/cad/src/commands/InsertGraphene/GrapheneGeneratorPropertyManager.py +++ b/cad/src/commands/InsertGraphene/GrapheneGeneratorPropertyManager.py @@ -40,11 +40,11 @@ class GrapheneGeneratorPropertyManager(EditCommand_PM): # The relative path to PNG file that appears in the header. iconPath = "ui/actions/Tools/Build Structures/Graphene.png" - def __init__( self, win, editCommand ): + def __init__( self, win, command ): """ Construct the "Build Graphene" Property Manager. """ - _superclass.__init__( self, win, editCommand ) + _superclass.__init__( self, win, command ) msg = "Edit the Graphene sheet parameters and select <b>Preview</b> to" \ "preview the structure. Click <b>Done</b> to insert it into the model." diff --git a/cad/src/commands/LinearMotorProperties/LinearMotorPropertyManager.py b/cad/src/commands/LinearMotorProperties/LinearMotorPropertyManager.py index abf7eba33..fbde2dba3 100644 --- a/cad/src/commands/LinearMotorProperties/LinearMotorPropertyManager.py +++ b/cad/src/commands/LinearMotorProperties/LinearMotorPropertyManager.py @@ -88,15 +88,15 @@ class LinearMotorPropertyManager(MotorPropertyManager): @see: MotorPropertyManager._update_widgets_in_PM_before_show @see: self.show where it is called. """ - if self.editCommand and self.editCommand.struct: - force = self.editCommand.struct.force - stiffness = self.editCommand.struct.stiffness - enable_minimize = self.editCommand.struct.enable_minimize - - length = self.editCommand.struct.length - width = self.editCommand.struct.width - spoke_radius = self.editCommand.struct.sradius - normcolor = self.editCommand.struct.normcolor + if self.command and self.command.struct: + force = self.command.struct.force + stiffness = self.command.struct.stiffness + enable_minimize = self.command.struct.enable_minimize + + length = self.command.struct.length + width = self.command.struct.width + spoke_radius = self.command.struct.sradius + normcolor = self.command.struct.normcolor else: force = 0.0 stiffness = 0.0 @@ -120,10 +120,10 @@ class LinearMotorPropertyManager(MotorPropertyManager): """ Slot method to change the jig's length, width and/or spoke radius. """ - self.editCommand.struct.length = self.motorLengthDblSpinBox.value() - self.editCommand.struct.width = self.motorWidthDblSpinBox.value() + self.command.struct.length = self.motorLengthDblSpinBox.value() + self.command.struct.width = self.motorWidthDblSpinBox.value() # spoke radius -- - self.editCommand.struct.sradius = self.spokeRadiusDblSpinBox.value() + self.command.struct.sradius = self.spokeRadiusDblSpinBox.value() if gl_update: self.glpane.gl_update() return @@ -132,10 +132,10 @@ class LinearMotorPropertyManager(MotorPropertyManager): """ Load widgets in MotorParamsGroupBox. """ - if self.editCommand and self.editCommand.struct: - force = self.editCommand.struct.force - stiffness = self.editCommand.struct.stiffness - enable_minimize = self.editCommand.struct.enable_minimize + if self.command and self.command.struct: + force = self.command.struct.force + stiffness = self.command.struct.stiffness + enable_minimize = self.command.struct.enable_minimize else: force = 0.0 stiffness = 0.0 @@ -181,11 +181,11 @@ class LinearMotorPropertyManager(MotorPropertyManager): Load widgets in groubox 2. """ - if self.editCommand and self.editCommand.struct: - length = self.editCommand.struct.length - width = self.editCommand.struct.width - spoke_radius = self.editCommand.struct.sradius - normcolor = self.editCommand.struct.normcolor + if self.command and self.command.struct: + length = self.command.struct.length + width = self.command.struct.width + spoke_radius = self.command.struct.sradius + normcolor = self.command.struct.normcolor else: length = 10 width = 1 diff --git a/cad/src/commands/PlaneProperties/PlanePropertyManager.py b/cad/src/commands/PlaneProperties/PlanePropertyManager.py index e6d0661fe..723348f82 100755 --- a/cad/src/commands/PlaneProperties/PlanePropertyManager.py +++ b/cad/src/commands/PlaneProperties/PlanePropertyManager.py @@ -714,15 +714,15 @@ class PlanePropertyManager(EditCommand_PM): else: pass - self.editCommand.struct.glpane.gl_update() + self.command.struct.glpane.gl_update() def toggleHeightfield(self, checked): """ Enables 3D relief drawing mode. """ - if self.editCommand and self.editCommand.struct: - plane = self.editCommand.struct + if self.command and self.command.struct: + plane = self.command.struct plane.display_heightfield = checked if checked: self.heightfieldHQDisplayCheckBox.setEnabled(True) @@ -740,8 +740,8 @@ class PlanePropertyManager(EditCommand_PM): """ Enables high quality rendering in 3D relief mode. """ - if self.editCommand and self.editCommand.struct: - plane = self.editCommand.struct + if self.command and self.command.struct: + plane = self.command.struct plane.heightfield_hq = checked plane.computeHeightfield() plane.glpane.gl_update() @@ -750,8 +750,8 @@ class PlanePropertyManager(EditCommand_PM): """ Enables texturing in 3D relief mode. """ - if self.editCommand and self.editCommand.struct: - plane = self.editCommand.struct + if self.command and self.command.struct: + plane = self.command.struct plane.heightfield_use_texture = checked #if plane.display_heightfield and plane.image: # plane.computeHeightfield() @@ -766,10 +766,10 @@ class PlanePropertyManager(EditCommand_PM): # spinbox.valueChanged() # signal is not emitted after calling spinbox.setValue(). # This flag is used in change_plane_size method.-- Ninad 20070601 - if self.editCommand and self.editCommand.hasValidStructure(): + if self.command and self.command.hasValidStructure(): self.resized_from_glpane = True - self.heightDblSpinBox.setValue(self.editCommand.struct.height) - self.widthDblSpinBox.setValue(self.editCommand.struct.width) + self.heightDblSpinBox.setValue(self.command.struct.height) + self.widthDblSpinBox.setValue(self.command.struct.width) self.win.glpane.gl_update() self.resized_from_glpane = False @@ -787,7 +787,7 @@ class PlanePropertyManager(EditCommand_PM): self.heightfieldTextureCheckBox.setEnabled(False) self.vScaleSpinBox.setEnabled(False) - plane = self.editCommand.struct + plane = self.command.struct plane.deleteImage() plane.heightfield = None plane.display_image = self.imageDisplayCheckBox.isChecked() @@ -828,9 +828,9 @@ class PlanePropertyManager(EditCommand_PM): #when you are editing an existing plane. Don't know the cause at this #time, issue is trivial. So calling it in the end -- Ninad 2007-10-03 - if self.editCommand.struct: + if self.command.struct: - plane = self.editCommand.struct + plane = self.command.struct plane.updateCosmeticProps(previewing = True) if plane.imagePath: self.imageDisplayFileChooser.setText(plane.imagePath) @@ -884,8 +884,8 @@ class PlanePropertyManager(EditCommand_PM): @type newWidth: float """ if self.aspectRatioCheckBox.isChecked(): - self.editCommand.struct.width = newWidth - self.editCommand.struct.height = self.editCommand.struct.width / \ + self.command.struct.width = newWidth + self.command.struct.height = self.command.struct.width / \ self.aspectRatioSpinBox.value() self.update_spinboxes() else: @@ -900,8 +900,8 @@ class PlanePropertyManager(EditCommand_PM): @type newHeight: float """ if self.aspectRatioCheckBox.isChecked(): - self.editCommand.struct.height = newHeight - self.editCommand.struct.width = self.editCommand.struct.height * \ + self.command.struct.height = newHeight + self.command.struct.width = self.command.struct.height * \ self.aspectRatioSpinBox.value() self.update_spinboxes() else: @@ -916,17 +916,17 @@ class PlanePropertyManager(EditCommand_PM): @type gl_update: bool """ if not self.resized_from_glpane: - self.editCommand.struct.width = self.widthDblSpinBox.value() - self.editCommand.struct.height = self.heightDblSpinBox.value() + self.command.struct.width = self.widthDblSpinBox.value() + self.command.struct.height = self.heightDblSpinBox.value() if gl_update: - self.editCommand.struct.glpane.gl_update() + self.command.struct.glpane.gl_update() def change_vertical_scale(self, scale): """ Changes vertical scaling of the heightfield. """ - if self.editCommand and self.editCommand.struct: - plane = self.editCommand.struct + if self.command and self.command.struct: + plane = self.command.struct plane.heightfield_scale = scale plane.computeHeightfield() plane.glpane.gl_update() @@ -945,23 +945,23 @@ class PlanePropertyManager(EditCommand_PM): "With <b>Parallel to Screen</b> plane placement option, the "\ "center of the plane is always (0,0,0)" self.updateMessage(msg) - self.editCommand.placePlaneParallelToScreen() + self.command.placePlaneParallelToScreen() elif buttonId == 1: msg = "Create a Plane with center coinciding with the common center "\ "of <b> 3 or more selected atoms </b>. If exactly 3 atoms are "\ "selected, the Plane will pass through those atoms." self.updateMessage(msg) - self.editCommand.placePlaneThroughAtoms() - if self.editCommand.logMessage: - env.history.message(self.editCommand.logMessage) + self.command.placePlaneThroughAtoms() + if self.command.logMessage: + env.history.message(self.command.logMessage) elif buttonId == 2: msg = "Create a Plane at an <b>offset</b> to the selected plane "\ "indicated by the direction arrow. "\ "you can click on the direction arrow to reverse its direction." self.updateMessage(msg) - self.editCommand.placePlaneOffsetToAnother() - if self.editCommand.logMessage: - env.history.message(self.editCommand.logMessage) + self.command.placePlaneOffsetToAnother() + if self.command.logMessage: + env.history.message(self.command.logMessage) elif buttonId == 3: #'Custom' plane placement. Do nothing (only update message box) # Fixes bug 2439 @@ -986,7 +986,7 @@ class PlanePropertyManager(EditCommand_PM): """ Updates the Aspect Ratio spin box based on the current width and height. """ - aspectRatio = self.editCommand.struct.width / self.editCommand.struct.height + aspectRatio = self.command.struct.width / self.command.struct.height self.aspectRatioSpinBox.setValue(aspectRatio) @@ -1012,10 +1012,10 @@ class PlanePropertyManager(EditCommand_PM): EditCommand_PM.update_props_if_needed_before_closing(self) #Don't draw the direction arrow when the object is finalized. - if self.editCommand.struct and \ - self.editCommand.struct.offsetParentGeometry: + if self.command.struct and \ + self.command.struct.offsetParentGeometry: - dirArrow = self.editCommand.struct.offsetParentGeometry.directionArrow + dirArrow = self.command.struct.offsetParentGeometry.directionArrow dirArrow.setDrawRequested(False) def updateMessage(self, msg = ''): @@ -1033,30 +1033,30 @@ class PlanePropertyManager(EditCommand_PM): """ Rotate the image clockwise. """ - if self.editCommand.hasValidStructure(): - self.editCommand.struct.rotateImage(0) + if self.command.hasValidStructure(): + self.command.struct.rotateImage(0) return def rotate_neg_90(self): """ Rotate the image counterclockwise. """ - if self.editCommand.hasValidStructure(): - self.editCommand.struct.rotateImage(1) + if self.command.hasValidStructure(): + self.command.struct.rotateImage(1) return def flip_image(self): """ Flip the image horizontally. """ - if self.editCommand.hasValidStructure(): - self.editCommand.struct.mirrorImage(1) + if self.command.hasValidStructure(): + self.command.struct.mirrorImage(1) return def mirror_image(self): """ Flip the image vertically. """ - if self.editCommand.hasValidStructure(): - self.editCommand.struct.mirrorImage(0) + if self.command.hasValidStructure(): + self.command.struct.mirrorImage(0) return diff --git a/cad/src/commands/RotaryMotorProperties/RotaryMotorPropertyManager.py b/cad/src/commands/RotaryMotorProperties/RotaryMotorPropertyManager.py index 914c2fb89..2bf1b165e 100755 --- a/cad/src/commands/RotaryMotorProperties/RotaryMotorPropertyManager.py +++ b/cad/src/commands/RotaryMotorProperties/RotaryMotorPropertyManager.py @@ -94,17 +94,17 @@ class RotaryMotorPropertyManager(MotorPropertyManager): @see: MotorPropertyManager._update_widgets_in_PM_before_show @see: self.show where it is called. """ - if self.editCommand and self.editCommand.struct: - torque = self.editCommand.struct.torque - initial_speed = self.editCommand.struct.initial_speed - final_speed = self.editCommand.struct.speed - dampers_enabled = self.editCommand.struct.dampers_enabled - enable_minimize = self.editCommand.struct.enable_minimize + if self.command and self.command.struct: + torque = self.command.struct.torque + initial_speed = self.command.struct.initial_speed + final_speed = self.command.struct.speed + dampers_enabled = self.command.struct.dampers_enabled + enable_minimize = self.command.struct.enable_minimize - length = self.editCommand.struct.length - radius = self.editCommand.struct.radius - spoke_radius = self.editCommand.struct.sradius - normcolor = self.editCommand.struct.normcolor + length = self.command.struct.length + radius = self.command.struct.radius + spoke_radius = self.command.struct.sradius + normcolor = self.command.struct.normcolor else: torque = 0.0 initial_speed = 0.0 @@ -132,12 +132,12 @@ class RotaryMotorPropertyManager(MotorPropertyManager): """ Slot method to change the jig's length, radius and/or spoke radius. """ - if self.editCommand and self.editCommand.struct: - self.editCommand.struct.length = \ + if self.command and self.command.struct: + self.command.struct.length = \ self.motorLengthDblSpinBox.value()# motor length - self.editCommand.struct.radius = \ + self.command.struct.radius = \ self.motorRadiusDblSpinBox.value() # motor radius - self.editCommand.struct.sradius = \ + self.command.struct.sradius = \ self.spokeRadiusDblSpinBox.value() # spoke radius if gl_update: @@ -148,12 +148,12 @@ class RotaryMotorPropertyManager(MotorPropertyManager): """ Load widgets in MotorParamsGroupBox. """ - if self.editCommand and self.editCommand.struct: - torque = self.editCommand.struct.torque - initial_speed = self.editCommand.struct.initial_speed - final_speed = self.editCommand.struct.speed - dampers_enabled = self.editCommand.struct.dampers_enabled - enable_minimize = self.editCommand.struct.enable_minimize + if self.command and self.command.struct: + torque = self.command.struct.torque + initial_speed = self.command.struct.initial_speed + final_speed = self.command.struct.speed + dampers_enabled = self.command.struct.dampers_enabled + enable_minimize = self.command.struct.enable_minimize else: torque = 0.0 initial_speed = 0.0 @@ -221,11 +221,11 @@ class RotaryMotorPropertyManager(MotorPropertyManager): """ Load widgets in groubox 2. """ - if self.editCommand and self.editCommand.struct: - length = self.editCommand.struct.length - radius = self.editCommand.struct.radius - spoke_radius = self.editCommand.struct.sradius - normcolor = self.editCommand.struct.normcolor + if self.command and self.command.struct: + length = self.command.struct.length + radius = self.command.struct.radius + spoke_radius = self.command.struct.sradius + normcolor = self.command.struct.normcolor else: length = 10 radius = 1 diff --git a/cad/src/dna/commands/BuildDna/BuildDna_PropertyManager.py b/cad/src/dna/commands/BuildDna/BuildDna_PropertyManager.py index a0b2fd221..23ffeae70 100644 --- a/cad/src/dna/commands/BuildDna/BuildDna_PropertyManager.py +++ b/cad/src/dna/commands/BuildDna/BuildDna_PropertyManager.py @@ -38,6 +38,7 @@ from PM.PM_Constants import PM_CANCEL_BUTTON from PM.PM_Colors import pmReferencesListWidgetColor from utilities.Comparison import same_vals +DEBUG_CHANGE_COUNTERS = False class BuildDna_PropertyManager( EditCommand_PM, DebugMenuMixin ): """ The BuildDna_PropertyManager class provides a Property Manager @@ -61,7 +62,7 @@ class BuildDna_PropertyManager( EditCommand_PM, DebugMenuMixin ): sponsor_keyword = None # Nanorex is the sponsor. Change to 'DNA' to the # the NUPACK logo. - def __init__( self, win, editCommand ): + def __init__( self, win, command ): """ Constructor for the Build DNA property manager. """ @@ -77,7 +78,7 @@ class BuildDna_PropertyManager( EditCommand_PM, DebugMenuMixin ): EditCommand_PM.__init__( self, win, - editCommand) + command) DebugMenuMixin._init1( self ) @@ -151,17 +152,22 @@ class BuildDna_PropertyManager( EditCommand_PM, DebugMenuMixin ): #called when you enter another command exiting or suspending the #previous one. . At present. it doesn't exist (first needs cleanup in #command/command sequencer (Done and other methods._)-- Ninad 2008-01-09 - if hasattr(self.editCommand, 'flyoutToolbar') and \ - self.editCommand.flyoutToolbar: - self.editCommand.flyoutToolbar.exitDnaAction.setEnabled(not bool_enable) + if hasattr(self.command, 'flyoutToolbar') and \ + self.command.flyoutToolbar: + self.command.flyoutToolbar.exitDnaAction.setEnabled(not bool_enable) def model_changed(self): """ - When the editCommand is treated as a 'command' by the + When the command is treated as a 'command' by the commandSequencer, this method will override basicCommand.model_changed. For more info, see BuildAtomsPropertyManager.model_changed docstring. """ + + if DEBUG_CHANGE_COUNTERS: + print "model_change = %d\nselection_change = %d\n "%( + self.win.assy.model_change_counter(), + self.win.assy.selection_change_counter()) newSelectionParams = self._currentSelectionParams() @@ -245,9 +251,9 @@ class BuildDna_PropertyManager( EditCommand_PM, DebugMenuMixin ): selectedStrands = [] selectedSegments = [] - if self.editCommand is not None and self.editCommand.hasValidStructure(): - selectedStrands = self.editCommand.struct.getSelectedStrands() - selectedSegments = self.editCommand.struct.getSelectedSegments() + if self.command is not None and self.command.hasValidStructure(): + selectedStrands = self.command.struct.getSelectedStrands() + selectedSegments = self.command.struct.getSelectedSegments() return (selectedStrands, selectedSegments) @@ -265,9 +271,9 @@ class BuildDna_PropertyManager( EditCommand_PM, DebugMenuMixin ): #Or Join strands decrease it by 1) params = None - if self.editCommand and self.editCommand.hasValidStructure(): + if self.command and self.command.hasValidStructure(): strandList = [] - strandList = self.editCommand.struct.getStrands() + strandList = self.command.struct.getStrands() params = len(strandList) return params @@ -300,10 +306,10 @@ class BuildDna_PropertyManager( EditCommand_PM, DebugMenuMixin ): Enter the DnaStrand_EditCommand to edit the selected strand. """ - if not self.editCommand.hasValidStructure(): + if not self.command.hasValidStructure(): return - selectedStrandList = self.editCommand.struct.getSelectedStrands() + selectedStrandList = self.command.struct.getSelectedStrands() if len(selectedStrandList) == 1: strand = selectedStrandList[0] @@ -313,8 +319,8 @@ class BuildDna_PropertyManager( EditCommand_PM, DebugMenuMixin ): def _editDnaSegment(self): """ """ - if self.editCommand is not None and self.editCommand.hasValidStructure(): - selectedSegments = self.editCommand.struct.getSelectedSegments() + if self.command is not None and self.command.hasValidStructure(): + selectedSegments = self.command.struct.getSelectedSegments() if len(selectedSegments) == 1: selectedSegments[0].edit() elif len(selectedSegments) > 1: @@ -375,8 +381,8 @@ class BuildDna_PropertyManager( EditCommand_PM, DebugMenuMixin ): #will do an isinstance(node, Chunk) check . Note that it includes both #Strands and Axis chunks -- Ninad 2008-01-09 - if self.editCommand and self.editCommand.hasValidStructure(): - strandChunkList = self.editCommand.struct.getStrands() + if self.command and self.command.hasValidStructure(): + strandChunkList = self.command.struct.getStrands() self.strandListWidget.insertItems( row = 0, @@ -391,12 +397,12 @@ class BuildDna_PropertyManager( EditCommand_PM, DebugMenuMixin ): """ segmentList = [] - if self.editCommand and self.editCommand.hasValidStructure(): + if self.command and self.command.hasValidStructure(): def func(node): if isinstance(node, self.win.assy.DnaSegment): segmentList.append(node) - self.editCommand.struct.apply2all(func) + self.command.struct.apply2all(func) self.segmentListWidget.insertItems( row = 0, items = segmentList) diff --git a/cad/src/dna/commands/BuildDuplex/DnaDuplexPropertyManager.py b/cad/src/dna/commands/BuildDuplex/DnaDuplexPropertyManager.py index 8604d54a4..d7d2b41fd 100644 --- a/cad/src/dna/commands/BuildDuplex/DnaDuplexPropertyManager.py +++ b/cad/src/dna/commands/BuildDuplex/DnaDuplexPropertyManager.py @@ -77,7 +77,7 @@ class DnaDuplexPropertyManager( DnaOrCnt_PropertyManager ): pmName = title iconPath = "ui/actions/Tools/Build Structures/InsertDsDna.png" - def __init__( self, win, editCommand ): + def __init__( self, win, command ): """ Constructor for the DNA Duplex property manager. """ @@ -94,7 +94,7 @@ class DnaDuplexPropertyManager( DnaOrCnt_PropertyManager ): _superclass.__init__( self, win, - editCommand) + command) self.showTopRowButtons( PM_DONE_BUTTON | \ PM_CANCEL_BUTTON | \ @@ -442,7 +442,7 @@ class DnaDuplexPropertyManager( DnaOrCnt_PropertyManager ): """ Slot for the B{Bases per turn} spinbox. """ - self.editCommand.basesPerTurn = basesPerTurn + self.command.basesPerTurn = basesPerTurn self._basesPerTurn = basesPerTurn return @@ -450,7 +450,7 @@ class DnaDuplexPropertyManager( DnaOrCnt_PropertyManager ): """ Slot for the B{Rise} spinbox. """ - self.editCommand.duplexRise = rise + self.command.duplexRise = rise self._duplexRise = rise return diff --git a/cad/src/dna/commands/DnaSegment/DnaSegment_PropertyManager.py b/cad/src/dna/commands/DnaSegment/DnaSegment_PropertyManager.py index 7dbf61623..1d549c77d 100644 --- a/cad/src/dna/commands/DnaSegment/DnaSegment_PropertyManager.py +++ b/cad/src/dna/commands/DnaSegment/DnaSegment_PropertyManager.py @@ -55,7 +55,7 @@ class DnaSegment_PropertyManager( DnaOrCnt_PropertyManager): pmName = title iconPath = "ui/actions/Tools/Build Structures/DNA.png" - def __init__( self, win, editCommand ): + def __init__( self, win, command ): """ Constructor for the Build DNA property manager. """ @@ -79,7 +79,7 @@ class DnaSegment_PropertyManager( DnaOrCnt_PropertyManager): self.basesPerTurn = 10 self.dnaModel = 'PAM3' - _superclass.__init__( self, win, editCommand) + _superclass.__init__( self, win, command) self.showTopRowButtons( PM_DONE_BUTTON | \ @@ -167,8 +167,8 @@ class DnaSegment_PropertyManager( DnaOrCnt_PropertyManager): """ params = None - if self.editCommand: - isStructResizable, why_not = self.editCommand.hasResizableStructure() + if self.command: + isStructResizable, why_not = self.command.hasResizableStructure() params = (isStructResizable, why_not) return params @@ -178,27 +178,27 @@ class DnaSegment_PropertyManager( DnaOrCnt_PropertyManager): """ Show this property manager. Overrides EditCommand_PM.show() This method also retrives the name information from the - editCommand's structure for its name line edit field. + command's structure for its name line edit field. @see: DnaSegment_EditCommand.getStructureName() @see: self.close() """ _superclass.show(self) - if self.editCommand is not None: - name = self.editCommand.getStructureName() + if self.command is not None: + name = self.command.getStructureName() if name is not None: self.nameLineEdit.setText(name) def close(self): """ Close this property manager. - Also sets the name of the self.editCommand's structure to the one + Also sets the name of the self.command's structure to the one displayed in the line edit field. @see self.show() @see: DnaSegment_EditCommand.setStructureName """ - if self.editCommand is not None: + if self.command is not None: name = str(self.nameLineEdit.text()) - self.editCommand.setStructureName(name) + self.command.setStructureName(name) _superclass.close(self) def setParameters(self, params): @@ -249,8 +249,8 @@ class DnaSegment_PropertyManager( DnaOrCnt_PropertyManager): #separate parameter for the reasons mentioned in bug 2802 #-- Ninad 2008-04-12 number_of_basePairs_from_struct = None - if self.editCommand.hasValidStructure(): - number_of_basePairs_from_struct = self.editCommand.struct.getNumberOfBasePairs() + if self.command.hasValidStructure(): + number_of_basePairs_from_struct = self.command.struct.getNumberOfBasePairs() numberOfBases = self.numberOfBasePairsSpinBox.value() dnaForm = self._conformation dnaModel = self.dnaModel diff --git a/cad/src/dna/commands/DnaStrand/DnaStrand_PropertyManager.py b/cad/src/dna/commands/DnaStrand/DnaStrand_PropertyManager.py index 451a56c3f..22015d097 100644 --- a/cad/src/dna/commands/DnaStrand/DnaStrand_PropertyManager.py +++ b/cad/src/dna/commands/DnaStrand/DnaStrand_PropertyManager.py @@ -60,7 +60,7 @@ class DnaStrand_PropertyManager( DnaOrCnt_PropertyManager): pmName = title iconPath = "ui/actions/Properties Manager/Strand.png" - def __init__( self, win, editCommand ): + def __init__( self, win, command ): """ Constructor for the Build DNA property manager. """ @@ -81,7 +81,7 @@ class DnaStrand_PropertyManager( DnaOrCnt_PropertyManager): _superclass.__init__( self, win, - editCommand) + command) @@ -295,18 +295,18 @@ class DnaStrand_PropertyManager( DnaOrCnt_PropertyManager): @see: DnaStrand_EditCommand.model_changed() @see: DnaStrand_EditCommand.hasResizableStructure() """ - isStructResizable, why_not = self.editCommand.hasResizableStructure() + isStructResizable, why_not = self.command.hasResizableStructure() if not isStructResizable: #disable all widgets if self._pmGroupBox1.isEnabled(): self._pmGroupBox1.setEnabled(False) - msg1 = ("Viewing properties of %s <br>") %(self.editCommand.struct.name) + msg1 = ("Viewing properties of %s <br>") %(self.command.struct.name) msg2 = redmsg("DnaStrand is not resizable. Reason: %s"%(why_not)) self.updateMessage(msg1 + msg2) else: if not self._pmGroupBox1.isEnabled(): self._pmGroupBox1.setEnabled(True) - msg1 = ("Viewing properties of %s <br>") %(self.editCommand.struct.name) + msg1 = ("Viewing properties of %s <br>") %(self.command.struct.name) msg2 = "Use resize handles to resize the strand. Use sequence editor"\ "to assign a new sequence or the current one to a file." self.updateMessage(msg1 + msg2) @@ -317,29 +317,29 @@ class DnaStrand_PropertyManager( DnaOrCnt_PropertyManager): As of 2007-11-20, it also shows the Sequence Editor widget and hides the history widget. This implementation may change in the near future This method also retrives the name information from the - editCommand's structure for its name line edit field. + command's structure for its name line edit field. @see: DnaStrand_EditCommand.getStructureName() @see: self.close() """ _superclass.show(self) self._showSequenceEditor() - if self.editCommand is not None: - name = self.editCommand.getStructureName() + if self.command is not None: + name = self.command.getStructureName() if name is not None: self.nameLineEdit.setText(name) def close(self): """ Close this property manager. - Also sets the name of the self.editCommand's structure to the one + Also sets the name of the self.command's structure to the one displayed in the line edit field. @see self.show() @see: DnaSegment_EditCommand.setStructureName """ - if self.editCommand is not None: + if self.command is not None: name = str(self.nameLineEdit.text()) - self.editCommand.setStructureName(name) + self.command.setStructureName(name) if self.sequenceEditor: self.sequenceEditor.close() @@ -370,10 +370,10 @@ class DnaStrand_PropertyManager( DnaOrCnt_PropertyManager): #show it in the text edit in the sequence editor. ##strand = self.strandListWidget.getPickedItem() - if not self.editCommand.hasValidStructure(): + if not self.command.hasValidStructure(): return - strand = self.editCommand.struct + strand = self.command.struct titleString = 'Sequence Editor for ' + strand.name @@ -397,16 +397,16 @@ class DnaStrand_PropertyManager( DnaOrCnt_PropertyManager): def change_struct_highlightPolicy(self,checkedState = False): """ Change the 'highlight policy' of the structure being edited - (i.e. self.editCommand.struct) . + (i.e. self.command.struct) . @param checkedState: The checked state of the checkbox that says 'Don't highlight while editing DNA'. So, it its True, the structure being edited won't get highlighted. @see: DnaStrand.setHighlightPolicy for more comments """ - if self.editCommand and self.editCommand.hasValidStructure(): + if self.command and self.command.hasValidStructure(): highlight = not checkedState - self.editCommand.struct.setHighlightPolicy(highlight = highlight) + self.command.struct.setHighlightPolicy(highlight = highlight) def _addWhatsThisText(self): """ diff --git a/cad/src/dna/commands/MultipleDnaSegmentResize/MultipleDnaSegmentResize_PropertyManager.py b/cad/src/dna/commands/MultipleDnaSegmentResize/MultipleDnaSegmentResize_PropertyManager.py index 4f38ff99b..30d992fb9 100644 --- a/cad/src/dna/commands/MultipleDnaSegmentResize/MultipleDnaSegmentResize_PropertyManager.py +++ b/cad/src/dna/commands/MultipleDnaSegmentResize/MultipleDnaSegmentResize_PropertyManager.py @@ -38,7 +38,7 @@ class MultipleDnaSegmentResize_PropertyManager( EditCommand_PM, DebugMenuMixin ) isAlreadyConnected = False isAlreadyDisconnected = False - def __init__( self, win, editCommand ): + def __init__( self, win, command ): """ Constructor for the Build DNA property manager. """ @@ -63,7 +63,7 @@ class MultipleDnaSegmentResize_PropertyManager( EditCommand_PM, DebugMenuMixin ) _superclass.__init__( self, win, - editCommand) + command) DebugMenuMixin._init1( self ) @@ -150,7 +150,7 @@ class MultipleDnaSegmentResize_PropertyManager( EditCommand_PM, DebugMenuMixin ) self.updateMessage(msg) self.updateListWidgets() - ##self.editCommand.updateHandlePositions() + ##self.command.updateHandlePositions() def _current_model_changed_params(self): @@ -163,11 +163,11 @@ class MultipleDnaSegmentResize_PropertyManager( EditCommand_PM, DebugMenuMixin ) """ params = None - if self.editCommand: + if self.command: #update the list first. - self.editCommand.updateResizeSegmentList() - number_of_segments = len(self.editCommand.getResizeSegmentList()) - isStructResizable, why_not = self.editCommand.hasResizableStructure() + self.command.updateResizeSegmentList() + number_of_segments = len(self.command.getResizeSegmentList()) + isStructResizable, why_not = self.command.hasResizableStructure() params = (number_of_segments, isStructResizable, why_not) return params @@ -254,7 +254,7 @@ class MultipleDnaSegmentResize_PropertyManager( EditCommand_PM, DebugMenuMixin ) """ self.segmentListWidget.deleteSelection() itemDict = self.segmentListWidget.getItemDictonary() - self.editCommand.setResizeStructList(itemDict.values()) + self.command.setResizeStructList(itemDict.values()) self.updateListWidgets() self.win.win_update() @@ -375,7 +375,7 @@ class MultipleDnaSegmentResize_PropertyManager( EditCommand_PM, DebugMenuMixin ) """ segmentList = [] - segmentList = self.editCommand.getResizeSegmentList() + segmentList = self.command.getResizeSegmentList() self.segmentListWidget.insertItems( row = 0, diff --git a/cad/src/ne1_ui/MWsemantics.py b/cad/src/ne1_ui/MWsemantics.py index 9b78a914c..56538896e 100755 --- a/cad/src/ne1_ui/MWsemantics.py +++ b/cad/src/ne1_ui/MWsemantics.py @@ -1602,78 +1602,78 @@ class MWsemantics(QMainWindow, currentCommand.runCommand() - def createBuildNanotubePropMgr_if_needed(self, editCommand): + def createBuildNanotubePropMgr_if_needed(self, command): """ Create Build Nanotube PM object (if one doesn't exist) - If this object is already present, then set its editCommand to this + If this object is already present, then set its command to this parameter - @parameter editCommand: The edit controller object for this PM - @type editCommand: B{BuildNanotube_EditCommand} + @parameter command: The edit controller object for this PM + @type command: B{BuildNanotube_EditCommand} @see: B{BuildNanotube_EditCommand._createPropMgrObject} """ from cnt.commands.BuildNanotube.BuildNanotube_PropertyManager import BuildNanotube_PropertyManager if self._buildCntPropMgr is None: self._buildCntPropMgr = \ - BuildNanotube_PropertyManager(self, editCommand) + BuildNanotube_PropertyManager(self, command) else: - self._buildCntPropMgr.setEditCommand(editCommand) + self._buildCntPropMgr.setEditCommand(command) return self._buildCntPropMgr - def createBuildGraphenePropMgr_if_needed(self, editCommand): + def createBuildGraphenePropMgr_if_needed(self, command): """ Create Graphene PM object (if one doesn't exist) - If this object is already present, then set its editCommand to this + If this object is already present, then set its command to this parameter - @parameter editCommand: The edit controller object for this PM - @type editCommand: B{BuildGraphene_EditCommand} + @parameter command: The edit controller object for this PM + @type command: B{BuildGraphene_EditCommand} @see: B{BuildGraphene_EditCommand._createPropMgrObject} """ from commands.InsertGraphene.GrapheneGeneratorPropertyManager import GrapheneGeneratorPropertyManager if self._buildGraphenePropMgr is None: self._buildGraphenePropMgr = \ - GrapheneGeneratorPropertyManager(self, editCommand) + GrapheneGeneratorPropertyManager(self, command) else: - self._buildGraphenePropMgr.setEditCommand(editCommand) + self._buildGraphenePropMgr.setEditCommand(command) return self._buildGraphenePropMgr - def createBuildPeptidePropMgr_if_needed(self, editCommand): + def createBuildPeptidePropMgr_if_needed(self, command): """ Create Peptide PM object (if one doesn't exist) - If this object is already present, then set its editCommand to this + If this object is already present, then set its command to this parameter - @parameter editCommand: The edit controller object for this PM - @type editCommand: B{BuildPeptide_EditCommand} + @parameter command: The edit controller object for this PM + @type command: B{BuildPeptide_EditCommand} @see: B{BuildPeptide_EditCommand._createPropMgrObject} """ from protein.commands.BuildPeptide.PeptideGeneratorPropertyManager import PeptideGeneratorPropertyManager if self._buildPeptidePropMgr is None: self._buildPeptidePropMgr = \ - PeptideGeneratorPropertyManager(self, editCommand) + PeptideGeneratorPropertyManager(self, command) else: - self._buildPeptidePropMgr.setEditCommand(editCommand) + self._buildPeptidePropMgr.setEditCommand(command) return self._buildPeptidePropMgr - def createNanotubeSegmentPropMgr_if_needed(self, editCommand): + def createNanotubeSegmentPropMgr_if_needed(self, command): """ Create the NanotubeSegment PM object (if one doesn't exist) - If this object is already present, then set its editCommand to this + If this object is already present, then set its command to this parameter - @parameter editCommand: The edit controller object for this PM - @type editCommand: B{NanotubeSegment_EditCommand} + @parameter command: The edit controller object for this PM + @type command: B{NanotubeSegment_EditCommand} @see: B{NanotubeSegment_EditCommand._createPropMgrObject} """ from cnt.commands.NanotubeSegment.NanotubeSegment_PropertyManager import NanotubeSegment_PropertyManager if self._cntSegmentPropMgr is None: self._cntSegmentPropMgr = \ - NanotubeSegment_PropertyManager(self, editCommand) + NanotubeSegment_PropertyManager(self, command) else: - self._cntSegmentPropMgr.setEditCommand(editCommand) + self._cntSegmentPropMgr.setEditCommand(command) return self._cntSegmentPropMgr @@ -1771,21 +1771,21 @@ class MWsemantics(QMainWindow, commandSequencer.currentCommand.runCommand() return - def createBuildProteinPropMgr_if_needed(self, editCommand): + def createBuildProteinPropMgr_if_needed(self, command): """ Create Build Protein PM object (if one doesn't exist) - If this object is already present, then set its editCommand to this + If this object is already present, then set its command to this parameter - @param editCommand: The edit controller object for this PM - @type editCommand: B{BuildDna_EditCommand} + @param command: The edit controller object for this PM + @type command: B{BuildDna_EditCommand} @see: B{BuildDna_EditCommand._createPropMgrObject} """ from protein.commands.BuildProtein.BuildProtein_PropertyManager import BuildProtein_PropertyManager if self._buildProteinPropMgr is None: self._buildProteinPropMgr = \ - BuildProtein_PropertyManager(self, editCommand) + BuildProtein_PropertyManager(self, command) else: - self._buildProteinPropMgr.setEditCommand(editCommand) + self._buildProteinPropMgr.setEditCommand(command) return self._buildProteinPropMgr @@ -2038,62 +2038,62 @@ class MWsemantics(QMainWindow, return self._editRotamersPropMgr - def createRotaryMotorPropMgr_if_needed(self, editCommand): + def createRotaryMotorPropMgr_if_needed(self, command): """ Create the Rotary motor PM object (if one doesn't exist) - If this object is already present, then set its editCommand to this + If this object is already present, then set its command to this parameter - @parameter editCommand: The edit controller object for this PM - @type editCommand: B{RotaryMotor_EditCommand} + @parameter command: The edit controller object for this PM + @type command: B{RotaryMotor_EditCommand} @see: B{RotaryMotor_EditCommand._createPropMgrObject} """ from commands.RotaryMotorProperties.RotaryMotorPropertyManager import RotaryMotorPropertyManager if self._rotaryMotorPropMgr is None: self._rotaryMotorPropMgr = \ - RotaryMotorPropertyManager(self, editCommand) + RotaryMotorPropertyManager(self, command) else: - self._rotaryMotorPropMgr.setEditCommand(editCommand) + self._rotaryMotorPropMgr.setEditCommand(command) return self._rotaryMotorPropMgr - def createLinearMotorPropMgr_if_needed(self, editCommand): + def createLinearMotorPropMgr_if_needed(self, command): """ Create the Linear motor PM object (if one doesn't exist) - If this object is already present, then set its editCommand to this + If this object is already present, then set its command to this parameter - @parameter editCommand: The edit controller object for this PM - @type editCommand: B{LinearMotor_EditCommand} + @parameter command: The edit controller object for this PM + @type command: B{LinearMotor_EditCommand} @see: B{LinearMotor_EditCommand._createPropMgrObject} """ from commands.LinearMotorProperties.LinearMotorPropertyManager import LinearMotorPropertyManager if self._linearMotorPropMgr is None: self._linearMotorPropMgr = \ - LinearMotorPropertyManager( self, editCommand) + LinearMotorPropertyManager( self, command) else: - self._linearMotorPropMgr.setEditCommand(editCommand) + self._linearMotorPropMgr.setEditCommand(command) return self._linearMotorPropMgr - def createPlanePropMgr_if_needed(self, editCommand): + def createPlanePropMgr_if_needed(self, command): """ Create the Plane PM object (if one doesn't exist) - If this object is already present, then set its editCommand to this + If this object is already present, then set its command to this parameter - @parameter editCommand: The edit controller object for this PM - @type editCommand: B{RotaryMotor_EditCommand} + @parameter command: The edit controller object for this PM + @type command: B{RotaryMotor_EditCommand} @see: B{Plane_EditCommand._createPropMgrObject} """ from commands.PlaneProperties.PlanePropertyManager import PlanePropertyManager if self._planePropMgr is None: self._planePropMgr = \ - PlanePropertyManager(self, editCommand) + PlanePropertyManager(self, command) else: - self._planePropMgr.setEditCommand(editCommand) + self._planePropMgr.setEditCommand(command) return self._planePropMgr - def createDnaDuplexPropMgr_if_needed(self, editCommand): + def createDnaDuplexPropMgr_if_needed(self, command): """ THIS METHOD IS NOT USED AS OF 2007-12-04 - This is because the endPoint1 and endPoint2 passed to the @@ -2104,121 +2104,121 @@ class MWsemantics(QMainWindow, PM object and reusing it as needed. Create the DNA Duplex PM object (if one doesn't exist) - If this object is already present, then set its editCommand to this + If this object is already present, then set its command to this parameter - @parameter editCommand: The edit controller object for this PM - @type editCommand: B{DnaDuplex_EditCommand} + @parameter command: The edit controller object for this PM + @type command: B{DnaDuplex_EditCommand} """ from dna.commands.BuildDuplex.DnaDuplexPropertyManager import DnaDuplexPropertyManager if self._dnaDuplexPropMgr is None: self._dnaDuplexPropMgr = \ - DnaDuplexPropertyManager(self, editCommand) + DnaDuplexPropertyManager(self, command) else: - self._dnaDuplexPropMgr.setEditCommand(editCommand) + self._dnaDuplexPropMgr.setEditCommand(command) return self._dnaDuplexPropMgr - def createBuildDnaPropMgr_if_needed(self, editCommand): + def createBuildDnaPropMgr_if_needed(self, command): """ Create Build Dna PM object (if one doesn't exist) - If this object is already present, then set its editCommand to this + If this object is already present, then set its command to this parameter - @parameter editCommand: The edit controller object for this PM - @type editCommand: B{BuildDna_EditCommand} + @parameter command: The edit controller object for this PM + @type command: B{BuildDna_EditCommand} @see: B{BuildDna_EditCommand._createPropMgrObject} """ from dna.commands.BuildDna.BuildDna_PropertyManager import BuildDna_PropertyManager if self._buildDnaPropMgr is None: self._buildDnaPropMgr = \ - BuildDna_PropertyManager(self, editCommand) + BuildDna_PropertyManager(self, command) else: - self._buildDnaPropMgr.setEditCommand(editCommand) + self._buildDnaPropMgr.setEditCommand(command) return self._buildDnaPropMgr - def createDnaSegmentPropMgr_if_needed(self, editCommand): + def createDnaSegmentPropMgr_if_needed(self, command): """ Create the DnaSegment PM object (if one doesn't exist) - If this object is already present, then set its editCommand to this + If this object is already present, then set its command to this parameter - @parameter editCommand: The edit controller object for this PM - @type editCommand: B{DnaSegment_EditCommand} + @parameter command: The edit controller object for this PM + @type command: B{DnaSegment_EditCommand} @see: B{DnaSegment_EditCommand._createPropMgrObject} """ from dna.commands.DnaSegment.DnaSegment_PropertyManager import DnaSegment_PropertyManager if self._dnaSegmentPropMgr is None: self._dnaSegmentPropMgr = \ - DnaSegment_PropertyManager(self, editCommand) + DnaSegment_PropertyManager(self, command) else: - self._dnaSegmentPropMgr.setEditCommand(editCommand) + self._dnaSegmentPropMgr.setEditCommand(command) return self._dnaSegmentPropMgr - def createMultipleDnaSegmentPropMgr_if_needed(self, editCommand): + def createMultipleDnaSegmentPropMgr_if_needed(self, command): """ Create the a Property manager object (if one doesn't exist) for the Multiple Dna Segment Resize command. - If this object is already present, then set its editCommand to this + If this object is already present, then set its command to this parameter - @parameter editCommand: The edit controller object for this PM - @type editCommand: B{{MultipleDnaSegmentResize_EditCommand} + @parameter command: The edit controller object for this PM + @type command: B{{MultipleDnaSegmentResize_EditCommand} @see: B{MultipleDnaSegmentResize_EditCommand._createPropMgrObject} """ from dna.commands.MultipleDnaSegmentResize.MultipleDnaSegmentResize_PropertyManager import MultipleDnaSegmentResize_PropertyManager if self._multipleDnaSegmentPropMgr is None: self._multipleDnaSegmentPropMgr = \ - MultipleDnaSegmentResize_PropertyManager(self, editCommand) + MultipleDnaSegmentResize_PropertyManager(self, command) else: - self._multipleDnaSegmentPropMgr.setEditCommand(editCommand) + self._multipleDnaSegmentPropMgr.setEditCommand(command) return self._multipleDnaSegmentPropMgr - def createMakeCrossoversPropMgr_if_needed(self, editCommand): + def createMakeCrossoversPropMgr_if_needed(self, command): """ Create the a Property manager object (if one doesn't exist) for the Make Crossovers command. - If this object is already present, then set its editCommand to this + If this object is already present, then set its command to this parameter - @parameter editCommand: The edit controller object for this PM - @type editCommand: B{{MakeCrossovers_Command} + @parameter command: The edit controller object for this PM + @type command: B{{MakeCrossovers_Command} @see: B{MakeCrossovers_Command._createPropMgrObject} """ from dna.commands.MakeCrossovers.MakeCrossovers_PropertyManager import MakeCrossovers_PropertyManager if self._makeCrossoversPropMgr is None: self._makeCrossoversPropMgr = \ - MakeCrossovers_PropertyManager(self, editCommand) + MakeCrossovers_PropertyManager(self, command) else: - self._makeCrossoversPropMgr.setEditCommand(editCommand) + self._makeCrossoversPropMgr.setEditCommand(command) return self._makeCrossoversPropMgr - def createDnaStrandPropMgr_if_needed(self, editCommand): + def createDnaStrandPropMgr_if_needed(self, command): """ Create the DnaStrand PM object (if one doesn't exist) - If this object is already present, then set its editCommand to this + If this object is already present, then set its command to this parameter - @parameter editCommand: The edit controller object for this PM - @type editCommand: B{DnaSegment_EditCommand} + @parameter command: The edit controller object for this PM + @type command: B{DnaSegment_EditCommand} @see: B{DnaSegment_EditCommand._createPropMgrObject} """ from dna.commands.DnaStrand.DnaStrand_PropertyManager import DnaStrand_PropertyManager if self._dnaStrandPropMgr is None: self._dnaStrandPropMgr = \ - DnaStrand_PropertyManager(self, editCommand) + DnaStrand_PropertyManager(self, command) else: - self._dnaStrandPropMgr.setEditCommand(editCommand) + self._dnaStrandPropMgr.setEditCommand(command) return self._dnaStrandPropMgr diff --git a/cad/src/protein/commands/BuildPeptide/PeptideGeneratorPropertyManager.py b/cad/src/protein/commands/BuildPeptide/PeptideGeneratorPropertyManager.py index 2e8a6346f..69c181f94 100755 --- a/cad/src/protein/commands/BuildPeptide/PeptideGeneratorPropertyManager.py +++ b/cad/src/protein/commands/BuildPeptide/PeptideGeneratorPropertyManager.py @@ -87,11 +87,11 @@ class PeptideGeneratorPropertyManager(EditCommand_PM): # The relative path to PNG file that appears in the header. iconPath = "ui/actions/Tools/Build Structures/Peptide.png" - def __init__( self, win, editCommand ): + def __init__( self, win, command ): """ Construct the "Build Graphene" Property Manager. """ - _superclass.__init__( self, win, editCommand ) + _superclass.__init__( self, win, command ) self.showTopRowButtons( PM_DONE_BUTTON | \ diff --git a/cad/src/protein/commands/BuildProtein/BuildProtein_PropertyManager.py b/cad/src/protein/commands/BuildProtein/BuildProtein_PropertyManager.py index e2fc3553e..9a734c754 100644 --- a/cad/src/protein/commands/BuildProtein/BuildProtein_PropertyManager.py +++ b/cad/src/protein/commands/BuildProtein/BuildProtein_PropertyManager.py @@ -45,7 +45,7 @@ class BuildProtein_PropertyManager( EditCommand_PM, DebugMenuMixin ): #change this ico path later iconPath = "ui/actions/Tools/Build Structures/Peptide.png" - def __init__( self, win, editCommand ): + def __init__( self, win, command ): """ Constructor for the Build DNA property manager. """ @@ -59,7 +59,7 @@ class BuildProtein_PropertyManager( EditCommand_PM, DebugMenuMixin ): EditCommand_PM.__init__( self, win, - editCommand) + command) DebugMenuMixin._init1( self ) @@ -263,9 +263,9 @@ class BuildProtein_PropertyManager( EditCommand_PM, DebugMenuMixin ): @type bool_enable: bool """ - if hasattr(self.editCommand, 'flyoutToolbar') and \ - self.editCommand.flyoutToolbar: - self.editCommand.flyoutToolbar.exitProteinAction.setEnabled(not bool_enable) + if hasattr(self.command, 'flyoutToolbar') and \ + self.command.flyoutToolbar: + self.command.flyoutToolbar.exitProteinAction.setEnabled(not bool_enable) def ok_btn_clicked(self): """ diff --git a/cad/src/protein/commands/ModelAndSimulateProtein/ModelAndSimulateProtein_PropertyManager.py b/cad/src/protein/commands/ModelAndSimulateProtein/ModelAndSimulateProtein_PropertyManager.py index c06369718..d6e5ac8f8 100644 --- a/cad/src/protein/commands/ModelAndSimulateProtein/ModelAndSimulateProtein_PropertyManager.py +++ b/cad/src/protein/commands/ModelAndSimulateProtein/ModelAndSimulateProtein_PropertyManager.py @@ -43,7 +43,7 @@ class ModelAndSimulateProtein_PropertyManager( EditCommand_PM, DebugMenuMixin ): #change this ico path later iconPath = "ui/actions/Tools/Build Structures/Peptide.png" - def __init__( self, win, editCommand): + def __init__( self, win, command): """ Constructor for the Build DNA property manager. """ @@ -57,7 +57,7 @@ class ModelAndSimulateProtein_PropertyManager( EditCommand_PM, DebugMenuMixin ): EditCommand_PM.__init__( self, win, - editCommand) + command) DebugMenuMixin._init1( self ) @@ -261,9 +261,9 @@ class ModelAndSimulateProtein_PropertyManager( EditCommand_PM, DebugMenuMixin ): @type bool_enable: bool """ - #if hasattr(self.editCommand, 'flyoutToolbar') and \ - #self.editCommand.flyoutToolbar: - #self.editCommand.flyoutToolbar.exitProteinAction.setEnabled(not bool_enable) + #if hasattr(self.command, 'flyoutToolbar') and \ + #self.command.flyoutToolbar: + #self.command.flyoutToolbar.exitProteinAction.setEnabled(not bool_enable) def ok_btn_clicked(self): """ |