Package schrodinger :: Package application :: Package msv :: Package gui :: Module color :: Class RowColorScheme
[hide private]
[frames] | no frames]

Class RowColorScheme

object --+
         |
        RowColorScheme
Known Subclasses:

A color scheme for a row in MSV

A RowColorScheme instance encapsulates all the color information needed to draw a row, as well as (optionally) the meaning of the colors. This includes foreground and background brushes as well as the handling of selection.

Instance Methods [hide private]
 
__init__(self, color_cells=None, key_func=None, scheme_name='')
x.__init__(...) initializes x; see help(type(x)) for signature
 
__deepcopy__(self, memo)
list
keys(self)
Returns: A list of values for which we have brushes in the scheme
QtGui.QBrush
getBackgroundSelectionBrush(self, res)
Returns the brush for the background color when the item is selected
 
getBackgroundBrushByKey(self, key, default=None)
Returns the Brush for a specific key value
QtGui.QBrush
getBackgroundBrush(self, res, default=None)
Returns the brush for the specified residue.
 
setBackgroundBrush(self, color_cell)
QtGui.QColor
getTextColor(self, res)
Returns the text color for the residue
str
getToolTip(self, res)
Returns: The tooltip matching the residue

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  DEFAULT_BACKGROUND_SELECTION_BRUSH = QtGui.QBrush(PALE_BLUE)
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, color_cells=None, key_func=None, scheme_name='')
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • color_cells (dict of str to a ColorCell) - A mapping of strings representing model values to color specifications
  • key_func - Function to determine how the key will be retrieved
  • scheme_name (str) - Name for this color scheme
Overrides: object.__init__

keys(self)

 
Returns: list
A list of values for which we have brushes in the scheme

getBackgroundSelectionBrush(self, res)

 

Returns the brush for the background color when the item is selected

Parameters:
  • res - The residue whose background brush color is to be returned
Returns: QtGui.QBrush
The background brush for a residue of this kind

getBackgroundBrush(self, res, default=None)

 

Returns the brush for the specified residue.

Parameters:
  • res - The residue whose brush color is to be returned.
  • default - The default brush color to be returned
Returns: QtGui.QBrush
The brush for the specified residue

setBackgroundBrush(self, color_cell)

 
Parameters:
  • key (str or int or float) - A value in the domain model
  • color_cell (ColorCell) - A color cell instance

getTextColor(self, res)

 

Returns the text color for the residue

Parameters:
Returns: QtGui.QColor
The text (foreground) color

getToolTip(self, res)

 
Parameters:
Returns: str
The tooltip matching the residue