Package schrodinger :: Package application :: Package msv :: Package gui :: Module delegates :: Class SecondaryStructureDelegate
[hide private]
[frames] | no frames]

Class SecondaryStructureDelegate

           object --+                        
                    |                        
    sip.simplewrapper --+                    
                        |                    
              sip.wrapper --+                
                            |                
         PyQt4.QtCore.QObject --+            
                                |            
PyQt4.QtGui.QAbstractItemDelegate --+        
                                    |        
      PyQt4.QtGui.QStyledItemDelegate --+    
                                        |    
                          BaseRowDelegate --+
                                            |
                                           SecondaryStructureDelegate

Nested Classes [hide private]

Inherited from PyQt4.QtGui.QAbstractItemDelegate: EndEditHint

Instance Methods [hide private]
 
__init__(self, *args, **kwargs)
x.__init__(...) initializes x; see help(type(x)) for signature
QSizeHint
sizeHint(self, option, index)
Return the size hint for the element at the specified index
 
_paintPartiallyBorderedRect(self, left_x, bottom_y, width, height, painter, brush_color)
Paints a rectangle with dark upper and lower border and the specified dimensions.
 
_paintSSAStartImage(self, ssa_type, brush_color, width, height, bottom_left, painter)
Paint an SSA start block for the specified SSA type.
 
_paintSSAMiddleImage(self, ssa_type, brush_color, width, height, bottom_left, painter)
Paints an SSA middle block for the specified SSA type.
 
_paintSSAEndImage(self, ssa_type, brush_color, width, height, bottom_left, painter)
Paint an SSA end block for the specified SSA type.
 
_paintWithBrush(self, painter, option, index, background_brush)
Paint an SSA image with the specified painter in the location specified by option that matches the data at the specified index in the model
 
_paintSelection(self, painter, option, index)
We want the selection painted in the default way, but without colors
 
_paintDefault(self, painter, option, index)
Paints the default (non-selected) cell using the specified painter, option, and index

Inherited from BaseRowDelegate: clearCache, helpEvent, initStyleOption, paint

Inherited from BaseRowDelegate (private): _getSelectionText, _getText

Inherited from PyQt4.QtGui.QStyledItemDelegate: createEditor, displayText, editorEvent, eventFilter, itemEditorFactory, setEditorData, setItemEditorFactory, setModelData, updateEditorGeometry

Inherited from PyQt4.QtGui.QAbstractItemDelegate: closeEditor, commitData, elidedText, sizeHintChanged

Inherited from PyQt4.QtCore.QObject: __getattr__, blockSignals, childEvent, children, connect, connectNotify, customEvent, deleteLater, destroyed, disconnect, disconnectNotify, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, emit, event, findChild, findChildren, inherits, installEventFilter, isWidgetType, killTimer, metaObject, moveToThread, objectName, parent, property, pyqtConfigure, receivers, removeEventFilter, sender, senderSignalIndex, setObjectName, setParent, setProperty, signalsBlocked, startTimer, thread, timerEvent, tr, trUtf8

Inherited from sip.simplewrapper: __new__

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

Class Variables [hide private]
  ANNOTATION_TYPE = <ANNOTATION_TYPES.secondary_structure: 13>
hash(x)

Inherited from PyQt4.QtGui.QAbstractItemDelegate: EditNextItem, EditPreviousItem, NoHint, RevertModelCache, SubmitModelCache

Inherited from PyQt4.QtCore.QObject: staticMetaObject

Properties [hide private]
  element_height
Return the height of the element.

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args, **kwargs)
(Constructor)

 

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

Overrides: object.__init__
(inherited documentation)

sizeHint(self, option, index)

 

Return the size hint for the element at the specified index

Note that this is only called if the view resizes rows to fit elements

Parameters:
  • option (QtWidgets.QStyleOptionViewItem) - The option to modify with cached information
  • index (QtCore.QModelIndex) - The index in the model
Returns: QSizeHint
The size hint for the element with height appropriately adjusted
Overrides: PyQt4.QtGui.QAbstractItemDelegate.sizeHint

_paintPartiallyBorderedRect(self, left_x, bottom_y, width, height, painter, brush_color)

 

Paints a rectangle with dark upper and lower border and the specified dimensions.

Parameters:
  • left_x (int) - Left x position of the rectangle
  • bottom_y (int) - Bottom y position of the rectangle
  • width (float) - Width of the rectangle
  • height (float) - Height of the rectangle
  • painter (QtGui.QPainter) - The painter to use to paint this rectangle
  • brush_color (QtGui.QColor) - Brush color to paint the rectangle with

_paintSSAStartImage(self, ssa_type, brush_color, width, height, bottom_left, painter)

 

Paint an SSA start block for the specified SSA type.

Parameters:
  • ssa_type - What type of SSA this is. Should be one of schrodinger.structure.SS_HELIX or schrodinger.structure.SS_STRAND
  • brush_color (QtGui.QColor) - What color to paint this image with
  • width (int) - Width of the image
  • height (int) - Height of the image
  • bottom_left (QtGui.QPoint) - The bottom left point of the element to be painted.
  • painter (QtGui.QPainter) - The painter to draw this annotation
  • ss_type (int)

_paintSSAMiddleImage(self, ssa_type, brush_color, width, height, bottom_left, painter)

 

Paints an SSA middle block for the specified SSA type.

Parameters:
  • ssa_type - What type of SSA this is. Should be one of schrodinger.structure.SS_HELIX or schrodinger.structure.SS_STRAND
  • brush_color (QtGui.QColor) - What color to paint this image with
  • width (int) - Width of the image
  • height (int) - Height of the image
  • bottom_left (QtGui.QPoint) - Bottom left corner of the element to paint.
  • painter (QtGui.QPainter) - Painter to paint this image
  • ss_type (int)

_paintSSAEndImage(self, ssa_type, brush_color, width, height, bottom_left, painter)

 

Paint an SSA end block for the specified SSA type.

Parameters:
  • ssa_type - What type of SSA this is. Should be one of schrodinger.structure.SS_HELIX or schrodinger.structure.SS_STRAND
  • brush_color (QtGui.QColor) - What color to paint this image with
  • width (int) - Width of the image
  • height (int) - Height of the image
  • bottom_left (QtGui.QPoint) - Bottom left corner of the element to paint
  • painter - Painter to paint the image @type painter; QtGui.QPainter
  • ss_type (int)

_paintWithBrush(self, painter, option, index, background_brush)

 

Paint an SSA image with the specified painter in the location specified by option that matches the data at the specified index in the model

If the data at the index cannot be converted to an SSA, the parent's paint method is called

Parameters:
  • option (QtWidgets.QStyleOptionViewItem) - The option to modify with cached information
  • index (QtCore.QModelIndex) - The index in the model
  • background_brush (QtGui.QBrush) - The brush to use

_paintSelection(self, painter, option, index)

 

We want the selection painted in the default way, but without colors

Parameters:
  • painter - The painter for the cell
  • option - The option for the cell
  • index - The index in the table
Overrides: BaseRowDelegate._paintSelection

_paintDefault(self, painter, option, index)

 

Paints the default (non-selected) cell using the specified painter, option, and index

Note: This method is overridden in subclasses and should not be merged into paint().

Parameters:
  • painter - The painter for the cell
  • option - The option for the cell
  • index - The index in the table
  • selection_brush - The brush to use in painting
Overrides: BaseRowDelegate._paintDefault
(inherited documentation)

Property Details [hide private]

element_height

Return the height of the element.

rtype: float return: The height of the element

Get Method:
unreachable.element_height(self) - Return the height of the element.