diff options
Diffstat (limited to 'cad/src/protein')
12 files changed, 61 insertions, 46 deletions
diff --git a/cad/src/protein/commands/BackrubProteinSim/BackrubProteinSim_Command.py b/cad/src/protein/commands/BackrubProteinSim/BackrubProteinSim_Command.py index 945ed9f6a..a2f2e372c 100644 --- a/cad/src/protein/commands/BackrubProteinSim/BackrubProteinSim_Command.py +++ b/cad/src/protein/commands/BackrubProteinSim/BackrubProteinSim_Command.py @@ -30,6 +30,8 @@ class BackrubProteinSim_Command(EditCommand): Class for protein sequence design with rosetta when backrub motion is allowed """ # class constants + GraphicsMode_class = BackrubProteinSim_GraphicsMode + PM_class = BackrubProteinSim_PropertyManager commandName = 'BACKRUB_PROTEIN_SEQUENCE_DESIGN' featurename = "Backrub Protein Sequence Design" @@ -43,7 +45,7 @@ class BackrubProteinSim_Command(EditCommand): command_parent = 'SIMULATE_PROTEIN' - GraphicsMode_class = BackrubProteinSim_GraphicsMode + command_can_be_suspended = False command_should_resume_prevMode = True diff --git a/cad/src/protein/commands/BuildPeptide/PeptideGeneratorPropertyManager.py b/cad/src/protein/commands/BuildPeptide/PeptideGeneratorPropertyManager.py index 94bc2b04d..993e253eb 100755 --- a/cad/src/protein/commands/BuildPeptide/PeptideGeneratorPropertyManager.py +++ b/cad/src/protein/commands/BuildPeptide/PeptideGeneratorPropertyManager.py @@ -90,11 +90,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, command ): + def __init__( self, command ): """ Construct the "Build Graphene" Property Manager. """ - _superclass.__init__( self, win, command ) + _superclass.__init__( self, command ) self.showTopRowButtons( PM_DONE_BUTTON | \ diff --git a/cad/src/protein/commands/BuildPeptide/Peptide_EditCommand.py b/cad/src/protein/commands/BuildPeptide/Peptide_EditCommand.py index e788a6037..de8f21e5f 100644 --- a/cad/src/protein/commands/BuildPeptide/Peptide_EditCommand.py +++ b/cad/src/protein/commands/BuildPeptide/Peptide_EditCommand.py @@ -24,10 +24,15 @@ import foundation.env as env from utilities.prefs_constants import cursorTextColor_prefs_key from protein.commands.ModelAndSimulateProtein.ModelAndSimulateProtein_Command import ModelAndSimulateProtein_Command +from protein.commands.BuildPeptide.PeptideGeneratorPropertyManager import PeptideGeneratorPropertyManager + #_superclass = ModelAndSimulateProtein_Command _superclass = EditCommand class Peptide_EditCommand(EditCommand): #class Peptide_EditCommand(ModelAndSimulateProtein_Command): + + PM_class = PeptideGeneratorPropertyManager + cmd = greenmsg("Build Peptide: ") prefix = 'Peptide' # used for gensym cmdname = 'Build Peptide' @@ -293,17 +298,7 @@ class Peptide_EditCommand(EditCommand): ) return - def _createPropMgrObject(self): - """ - Creates a property manager object (that defines UI things) for this - editCommand. - """ - assert not self.propMgr - - propMgr = self.win.createBuildPeptidePropMgr_if_needed(self) - - return propMgr - + def _getStructureType(self): """ diff --git a/cad/src/protein/commands/BuildProtein/BuildProtein_EditCommand.py b/cad/src/protein/commands/BuildProtein/BuildProtein_EditCommand.py index 65c08769a..cbd997e01 100644 --- a/cad/src/protein/commands/BuildProtein/BuildProtein_EditCommand.py +++ b/cad/src/protein/commands/BuildProtein/BuildProtein_EditCommand.py @@ -12,11 +12,18 @@ from utilities.Log import greenmsg from utilities.constants import gensym from ne1_ui.toolbars.Ui_ProteinFlyout import ProteinFlyout +from protein.commands.BuildProtein.BuildProtein_PropertyManager import BuildProtein_PropertyManager + class BuildProtein_EditCommand(EditCommand): """ BuildProtein_EditCommand provides a convenient way to edit or create a Protein object """ + + #Property Manager + PM_class = BuildProtein_PropertyManager + + cmd = greenmsg("Build Protein: ") prefix = 'ProteinGroup' # used for gensym cmdname = "Build Protein" @@ -30,6 +37,8 @@ class BuildProtein_EditCommand(EditCommand): command_can_be_suspended = True create_name_from_prefix = True call_makeMenus_for_each_event = True + + def __init__(self, commandSequencer, struct = None): """ @@ -148,15 +157,4 @@ class BuildProtein_EditCommand(EditCommand): "If you change the sequence, make sure to "\ "hit Enter key at the end so that the changes " "can be saved." - "<br>" - ) - - def _createPropMgrObject(self): - """ - Creates a property manager object (that defines UI things) for this - editCommand. - """ - assert not self.propMgr - propMgr = self.win.createBuildProteinPropMgr_if_needed(self) - return propMgr - + "<br>" )
\ No newline at end of file diff --git a/cad/src/protein/commands/BuildProtein/BuildProtein_PropertyManager.py b/cad/src/protein/commands/BuildProtein/BuildProtein_PropertyManager.py index 2b3c2cc89..219a86b50 100644 --- a/cad/src/protein/commands/BuildProtein/BuildProtein_PropertyManager.py +++ b/cad/src/protein/commands/BuildProtein/BuildProtein_PropertyManager.py @@ -45,21 +45,19 @@ class BuildProtein_PropertyManager( EditCommand_PM, DebugMenuMixin ): #change this ico path later iconPath = "ui/actions/Tools/Build Structures/Peptide.png" - def __init__( self, win, command ): + def __init__( self, command ): """ Constructor for the Build DNA property manager. """ - self.win = win + self.current_protein = "" - self.sequenceEditor = win.createProteinSequenceEditorIfNeeded() + self.sequenceEditor = command.win.createProteinSequenceEditorIfNeeded() #see self.connect_or_disconnect_signals for comment about this flag self.isAlreadyConnected = False self.isAlreadyDisconnected = False - EditCommand_PM.__init__( self, - win, - command) + EditCommand_PM.__init__( self, command) DebugMenuMixin._init1( self ) diff --git a/cad/src/protein/commands/CompareProteins/CompareProteins_Command.py b/cad/src/protein/commands/CompareProteins/CompareProteins_Command.py index 631ac63b4..23c015ef6 100644 --- a/cad/src/protein/commands/CompareProteins/CompareProteins_Command.py +++ b/cad/src/protein/commands/CompareProteins/CompareProteins_Command.py @@ -29,6 +29,11 @@ class CompareProteins_Command(EditCommand): """ # class constants + GraphicsMode_class = CompareProteins_GraphicsMode + + PM_class = CompareProteins_PropertyManager + + commandName = 'COMPARE_PROTEINS' featurename = "Compare Proteins" @@ -39,7 +44,7 @@ class CompareProteins_Command(EditCommand): if MODEL_AND_SIMULATE_PROTEINS: command_parent = 'MODEL_PROTEIN' - GraphicsMode_class = CompareProteins_GraphicsMode + command_can_be_suspended = False diff --git a/cad/src/protein/commands/EditResidues/EditResidues_Command.py b/cad/src/protein/commands/EditResidues/EditResidues_Command.py index 15036771b..69baa6ecd 100644 --- a/cad/src/protein/commands/EditResidues/EditResidues_Command.py +++ b/cad/src/protein/commands/EditResidues/EditResidues_Command.py @@ -29,6 +29,11 @@ class EditResidues_Command(EditCommand): """ # class constants + GraphicsMode_class = EditResidues_GraphicsMode + + PM_class = EditResidues_PropertyManager + + commandName = 'EDIT_RESIDUES' featurename = "Edit Residues" @@ -39,7 +44,7 @@ class EditResidues_Command(EditCommand): if MODEL_AND_SIMULATE_PROTEINS: command_parent = 'SIMULATE_PROTEIN' - GraphicsMode_class = EditResidues_GraphicsMode + command_can_be_suspended = False diff --git a/cad/src/protein/commands/EditRotamers/EditRotamers_Command.py b/cad/src/protein/commands/EditRotamers/EditRotamers_Command.py index 04fdf766e..25f6e860d 100644 --- a/cad/src/protein/commands/EditRotamers/EditRotamers_Command.py +++ b/cad/src/protein/commands/EditRotamers/EditRotamers_Command.py @@ -29,6 +29,11 @@ class EditRotamers_Command(EditCommand): """ # class constants + GraphicsMode_class = EditRotamers_GraphicsMode + + PM_class = EditRotamers_PropertyManager + + commandName = 'EDIT_ROTAMERS' featurename = "Edit Rotamers" @@ -39,7 +44,7 @@ class EditRotamers_Command(EditCommand): if MODEL_AND_SIMULATE_PROTEINS: command_parent = 'MODEL_PROTEIN' - GraphicsMode_class = EditRotamers_GraphicsMode + command_can_be_suspended = False diff --git a/cad/src/protein/commands/FixedBBProteinSim/FixedBBProteinSim_Command.py b/cad/src/protein/commands/FixedBBProteinSim/FixedBBProteinSim_Command.py index db5fb1057..1b715e78c 100644 --- a/cad/src/protein/commands/FixedBBProteinSim/FixedBBProteinSim_Command.py +++ b/cad/src/protein/commands/FixedBBProteinSim/FixedBBProteinSim_Command.py @@ -30,13 +30,17 @@ class FixedBBProteinSim_Command(EditCommand): """ # class constants + GraphicsMode_class = FixedBBProteinSim_GraphicsMode + + PM_class = FixedBBProteinSim_PropertyManager + commandName = 'FIXED_BACKBONE_PROTEIN_SEQUENCE_DESIGN' featurename = "Fixed Backbone Sequence Design" from utilities.constants import CL_SUBCOMMAND command_level = CL_SUBCOMMAND command_parent = 'SIMULATE_PROTEIN' - GraphicsMode_class = FixedBBProteinSim_GraphicsMode + command_can_be_suspended = False diff --git a/cad/src/protein/commands/ModelAndSimulateProtein/ModelAndSimulateProtein_Command.py b/cad/src/protein/commands/ModelAndSimulateProtein/ModelAndSimulateProtein_Command.py index 83264ecbe..241f06594 100644 --- a/cad/src/protein/commands/ModelAndSimulateProtein/ModelAndSimulateProtein_Command.py +++ b/cad/src/protein/commands/ModelAndSimulateProtein/ModelAndSimulateProtein_Command.py @@ -21,6 +21,9 @@ class ModelAndSimulateProtein_Command(EditCommand): ModelAndSimulateProtein_EditCommand provides a convenient way to edit or create or simulate a Protein object """ + + PM_class = ModelAndSimulateProtein_PropertyManager + cmd = greenmsg("Model and simulate protein: ") prefix = 'ProteinGroup' # used for gensym cmdname = "Model and simulate protein" @@ -94,7 +97,7 @@ class ModelAndSimulateProtein_Command(EditCommand): return flyoutToolbar def _createPropMgrObject(self): - propMgr = ModelAndSimulateProtein_PropertyManager(self.w, self) + propMgr = ModelAndSimulateProtein_PropertyManager(self) return propMgr diff --git a/cad/src/protein/commands/ModelAndSimulateProtein/ModelAndSimulateProtein_PropertyManager.py b/cad/src/protein/commands/ModelAndSimulateProtein/ModelAndSimulateProtein_PropertyManager.py index 959daee66..7b1ab4fc3 100644 --- a/cad/src/protein/commands/ModelAndSimulateProtein/ModelAndSimulateProtein_PropertyManager.py +++ b/cad/src/protein/commands/ModelAndSimulateProtein/ModelAndSimulateProtein_PropertyManager.py @@ -43,21 +43,19 @@ class ModelAndSimulateProtein_PropertyManager( EditCommand_PM, DebugMenuMixin ): #change this ico path later iconPath = "ui/actions/Tools/Build Structures/Peptide.png" - def __init__( self, win, command): + def __init__( self, command): """ Constructor for the Build DNA property manager. """ - self.win = win + self.current_protein = "" - self.sequenceEditor = win.createProteinSequenceEditorIfNeeded() + self.sequenceEditor = command.win.createProteinSequenceEditorIfNeeded() #see self.connect_or_disconnect_signals for comment about this flag self.isAlreadyConnected = False self.isAlreadyDisconnected = False - EditCommand_PM.__init__( self, - win, - command) + EditCommand_PM.__init__( self, command) DebugMenuMixin._init1( self ) diff --git a/cad/src/protein/commands/ProteinDisplayStyle/ProteinDisplayStyle_Command.py b/cad/src/protein/commands/ProteinDisplayStyle/ProteinDisplayStyle_Command.py index fa6c48f49..2b7d93e17 100644 --- a/cad/src/protein/commands/ProteinDisplayStyle/ProteinDisplayStyle_Command.py +++ b/cad/src/protein/commands/ProteinDisplayStyle/ProteinDisplayStyle_Command.py @@ -33,13 +33,15 @@ class ProteinDisplayStyle_Command(EditCommand): """ # class constants + GraphicsMode_class = ProteinDisplayStyle_GraphicsMode + + PM_class = ProteinDisplayStyle_PropertyManager + + commandName = 'EDIT_PROTEIN_DISPLAY_STYLE' featurename = "Protein Display Style" from utilities.constants import CL_GLOBAL_PROPERTIES command_level = CL_GLOBAL_PROPERTIES - - GraphicsMode_class = ProteinDisplayStyle_GraphicsMode - command_can_be_suspended = False command_should_resume_prevMode = True |