Package Pmv :: Module colorCommands :: Class ColorFromPalette
[hide private]
[frames] | no frames]

Class ColorFromPalette

source code

ViewerFramework.VFCommand.Command --+        
                                    |        
                  mvCommand.MVCommand --+    
                                        |    
                             ColorCommand --+
                                            |
   ViewerFramework.VFCommand.ICOM --+       |
                                    |       |
                     mvCommand.MVICOM --+   |
                                        |   |
                     mvCommand.MVAtomICOM --+
                                            |
                                           ColorFromPalette
Known Subclasses:
ColorByAtomType, ColorByChain, ColorByDG, ColorByInstance, ColorByMolecule, ColorByResidueType, ColorFromRamp, ColorShapely, secondaryStructureCommands.ColorBySSElementType

The ColorFromPalette class is the base class from which all the color commands using a colorPalette implemented for PMV will derive.
    
Package : Pmv
    
Module  : colorCommands
    
Class   : ColorFromPalette
    
Description:

     It implements the general functionalities needed to retrieve the colors given a palette and a set of nodes.

    
Synopsis:

     None <- colorFromPalette(nodes, geomsToColor='all')

     
Required Arguments:
      
     nodes---TreeNodeSet holding the current selection

     geomsToColor---list of the name of geometries to color,default is 'all

    
    



Instance Methods [hide private]
  __init__(self, func=None)
  setupUndoBefore(self, nodes, geomsToColor)
This method builds the self.undoCmds string.
  doit(self, nodes, geomsToColor)
virtual method.
  onAddCmdToViewer(self)
method called when an instance of this command is added to the viewer.
  getColors(self, nodes)
  guiCallback(self)
  __call__(self, nodes, geomsToColor='all', **kw)
None <- colorFromPalette(nodes, geomsToColor='all', **kw)...

Inherited from ColorCommand: addNewEntries, buildFormDescr, cleanup, color_cb, deselectall_cb, dismiss_cb, getAvailableGeoms, getChildrenGeomsName, getNodes, selectall_cb, showForm, showUndisplayed_cb

Inherited from mvCommand.MVCommand: strArg

Inherited from mvCommand.MVCommand (private): _strArg

Inherited from ViewerFramework.VFCommand.Command: __repr__, addCallbackAfter, addCallbackBefore, addUndoCall, afterDoit, beforeDoit, buildLogArgList, checkDependencies, customizeGUI, doitWrapper, getArguments, getHelp, getLastUsedValues, getLogArgs, getValNamedArgs, log, logString, onAddNewCmd, onCmdRun, setLastUsedValues, setupUndoAfter, tkCb, updateGeom, warningMsg

Inherited from mvCommand.MVAtomICOM: getObjects

Inherited from ViewerFramework.VFCommand.ICOM: initICOM, startICOM, stopICOM


Class Variables [hide private]

Inherited from ViewerFramework.VFCommand.Command: negateKw, objArgOnly


Method Details [hide private]

__init__(self, func=None)
(Constructor)

source code 
None
Overrides: ColorCommand.__init__

setupUndoBefore(self, nodes, geomsToColor)

source code 
This method builds the self.undoCmds string. This method should have the same signature than the __call__. When this string is executed it should undo the actions of this command. This string will be appended to the undoCmdStack list if the command is successfuly carried out. This method handles only commands with the negateKw. Other commands have to overwrite it.
Overrides: ColorCommand.setupUndoBefore

doit(self, nodes, geomsToColor)

source code 
virtual method. Has to be implemented by the sub classes
Overrides: ColorCommand.doit

onAddCmdToViewer(self)

source code 
method called when an instance of this command is added to the viewer. This enable viewer-addition time initializations
Overrides: ColorCommand.onAddCmdToViewer

getColors(self, nodes)

source code 
None

guiCallback(self)

source code 
None
Overrides: ColorCommand.guiCallback

__call__(self, nodes, geomsToColor='all', **kw)
(Call operator)

source code 
None <- colorFromPalette(nodes, geomsToColor='all', **kw)
           
nodes --- TreeNodeSet holding the current selection
           
geomsToColor --- list of the name of geometries to color,
                         default is 'all'

Overrides: ColorCommand.__call__