Package schrodinger :: Package application :: Package msv :: Package gui :: Module viewmodel :: Class _ToggleProxyModel
[hide private]
[frames] | no frames]

Class _ToggleProxyModel

                                                     object --+            
                                                              |            
                    ui.qt.table_helper.DataMethodDecoratorMixin --+        
                                                                  |        
                   ui.qt.table_speed_up.MultipleRolesRoleModelMixin --+    
                                                                      |    
                       ui.qt.table_speed_up.MultipleRolesRoleProxyMixin --+
                                                                          |
                                                         object --+       |
                                                                  |       |
                                           GroupExpansionProxyMixin --+   |
                                                                      |   |
                                                 object --+           |   |
                                                          |           |   |
ui.qt.table_speed_up.MultipleRolesRoleProxyPassthroughMixin --+       |   |
                                                              |       |   |
                                                     ProxyMixin --+   |   |
                                                                  |   |   |
                                           PostReorderingProxyMixin --+   |
                                                                      |   |
                                               PostAnnotationProxyMixin --+
                                                                          |
                                         object --+                       |
                                                  |                       |
                                  sip.simplewrapper --+                   |
                                                      |                   |
                                            sip.wrapper --+               |
                                                          |               |
                                       PyQt5.QtCore.QObject --+           |
                                                              |           |
                                PyQt5.QtCore.QAbstractItemModel --+       |
                                                                  |       |
                                   PyQt5.QtCore.QAbstractProxyModel --+   |
                                                                      |   |
                                       PyQt5.QtCore.QIdentityProxyModel --+
                                                                          |
                                                                         _ToggleProxyModel
Known Subclasses:

A model that can be toggled between row wrapping (by setting the source to a RowWrapProxyModel) and non-row-wrapping (by setting the source to an AnnotationFilterProxyModel). This model is also responsible for most styling options, including text size and color schemes.

Nested Classes [hide private]

Inherited from PostAnnotationProxyMixin: __metaclass__

Inherited from PyQt5.QtCore.QAbstractItemModel: LayoutChangeHint

Instance Methods [hide private]
 
__init__(self, parent=None)
x.__init__(...) initializes x; see help(type(x)) for signature
 
tableWidthChanged(self, width)
Emit the tableWidthChangedSignal with the specified width.
dict
_multipleRolesData(self, proxy_index, source_index, source_model, multiple_roles)
Provide data for all requested roles.
QtGui.QBrush
_getBackgroundBrushForResidue(self, scheme, res, col_has_all_same_residues)
Return the appropriate background brush for a specified residue.
str
_toolTipData(self, proxy_index, source_index)
Returns the tooltip for the source index
str
_getResidueToolTip(self, res, seq)
Return a string containing residue and sequence information
 
_fontData(self, proxy_index, source_index, source_model, multiple_roles_data)
QtGui.QFont
_defaultFont(self)
Return the default font to be used.
 
_styleData(self, proxy_index, source_index, source_model, _, role)
 
_getRowSchemeAndRes(self, source_index, source_model, multiple_roles_data)
Fetch the approrpiate scheme for a row and the residue for the given index.
 
undoableReorderRow(self, from_row, to_row)
Reorder a row in response to a drag and drop and make the reordering undoable.
 
setTextSize(self, size)
Set the text size to the specified size
 
updateTextSize(self, change)
Increment the text size one point smaller or larger
 
_updateFonts(self)
Create a bold and a regular font object in the current font size, and notify the view that font size has changed.
 
updateColorScheme(self, row_type, scheme_type)
Used to set the color scheme of a specific row type.
dict
getColorScheme(self)
Returns: The color scheme currently in use
 
updateColorByAln(self, mode)
Update the current color by alignment mode
ColorByAln
getColorByAln(self)
Get the current color by alignment mode

Inherited from ui.qt.table_speed_up.MultipleRolesRoleProxyMixin: data

Inherited from ui.qt.table_speed_up.MultipleRolesRoleProxyMixin (private): _genDataArgs

Inherited from ui.qt.table_speed_up.MultipleRolesRoleModelMixin (private): _fetchMultipleRoles

Inherited from ui.qt.table_helper.DataMethodDecoratorMixin (private): _callDataMethod, _collectDataMethods

Inherited from PostAnnotationProxyMixin: getShownRowTypes

Inherited from GroupExpansionProxyMixin: groupByChanged, groupExpansionChanged, setSourceModel

Inherited from PostReorderingProxyMixin: reorderRow

Inherited from PostReorderingProxyMixin (private): _mapRowToSource

Inherited from ProxyMixin: emitResidueSelection, getResidueDisplayMode, residueFormatChanged, residuesSelected, sourceModel

Inherited from PyQt5.QtCore.QIdentityProxyModel: columnCount, dropMimeData, headerData, index, insertColumns, insertRows, mapFromSource, mapSelectionFromSource, mapSelectionToSource, mapToSource, match, parent, removeColumns, removeRows, rowCount, sibling

Inherited from PyQt5.QtCore.QAbstractProxyModel: buddy, canDropMimeData, canFetchMore, fetchMore, flags, hasChildren, itemData, mimeData, mimeTypes, resetInternalData, revert, setData, setHeaderData, setItemData, sort, sourceModelChanged, span, submit, supportedDragActions, supportedDropActions

Inherited from PyQt5.QtCore.QAbstractItemModel: beginInsertColumns, beginInsertRows, beginMoveColumns, beginMoveRows, beginRemoveColumns, beginRemoveRows, beginResetModel, changePersistentIndex, changePersistentIndexList, columnsAboutToBeInserted, columnsAboutToBeMoved, columnsAboutToBeRemoved, columnsInserted, columnsMoved, columnsRemoved, createIndex, dataChanged, decodeData, encodeData, endInsertColumns, endInsertRows, endMoveColumns, endMoveRows, endRemoveColumns, endRemoveRows, endResetModel, hasIndex, headerDataChanged, insertColumn, insertRow, layoutAboutToBeChanged, layoutChanged, modelAboutToBeReset, modelReset, moveColumn, moveColumns, moveRow, moveRows, persistentIndexList, removeColumn, removeRow, roleNames, rowsAboutToBeInserted, rowsAboutToBeMoved, rowsAboutToBeRemoved, rowsInserted, rowsMoved, rowsRemoved

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

Inherited from sip.simplewrapper: __new__

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

Class Variables [hide private]

Inherited from PyQt5.QtCore.QAbstractItemModel: HorizontalSortHint, NoLayoutChangeHint, VerticalSortHint

Inherited from PyQt5.QtCore.QObject: staticMetaObject

Instance Variables [hide private]
 
tableWidthChangedSignal(...)
A signal emitted when the table width is changed.
 
undoableReorderRowSignal(...)
A signal emitted when a row should be moved and the move should be undoable.
 
textSizeChanged(...)
A signal emitted when the text size changes.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, parent=None)
(Constructor)

 

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

Overrides: object.__init__
(inherited documentation)

tableWidthChanged(self, width)

 

Emit the tableWidthChangedSignal with the specified width. The RowWrapProxyModel should receive this signal and adjust the wrapping as necessary.

Parameters:
  • width (int) - The current number of columns in the table

_multipleRolesData(self, proxy_index, source_index, source_model, multiple_roles)

 

Provide data for all requested roles. The last argument must be an iterable of roles to fetch data for. All additional arguments will be passed to the data methods.

Returns: dict
A {role: value} dictionary of data for all requested roles.
Decorators:
  • @table_helper.data_method(CustomRole.MultipleRoles)
Overrides: ui.qt.table_speed_up.MultipleRolesRoleModelMixin._multipleRolesData
(inherited documentation)

_getBackgroundBrushForResidue(self, scheme, res, col_has_all_same_residues)

 

Return the appropriate background brush for a specified residue.

Parameters:
  • scheme (color.RowColorScheme) - Row's color scheme
  • res (residue.Residue) - Residue to get the brush for
  • col_has_all_same_residues (bool) - Whether the alignment has all same residues in this residue's column.
Returns: QtGui.QBrush
The appropriate brush for this residue.

_toolTipData(self, proxy_index, source_index)

 

Returns the tooltip for the source index

This method lives on the topmost proxy because it needs to assemble information from the color proxy as well as the residue and sequence objects.

Parameters:
  • source_index (QtCore.QModelIndex) - The source index for which we need a tooltip
Returns: str
A tooltip for the specified cell
Decorators:
  • @table_helper.data_method(Qt.ToolTipRole)

_getResidueToolTip(self, res, seq)

 

Return a string containing residue and sequence information

Parameters:
Returns: str
Residue and sequence information

_fontData(self, proxy_index, source_index, source_model, multiple_roles_data)

 
Decorators:
  • @table_helper.data_method(Qt.FontRole)

_defaultFont(self)

 

Return the default font to be used.

@return Default font

Returns: QtGui.QFont

_styleData(self, proxy_index, source_index, source_model, _, role)

 
Decorators:
  • @table_helper.data_method(Qt.BackgroundRole, Qt.ForegroundRole, CustomRole.BackgroundSelectionBrush, CustomRole.ColorToolTip)

_getRowSchemeAndRes(self, source_index, source_model, multiple_roles_data)

 

Fetch the approrpiate scheme for a row and the residue for the given index.

Parameters:
  • source_index (QtCore.QModelIndex) - The source model index to fetch data for.
  • source_model (QtCore.QAbstractItemModel) - The source model
  • multiple_roles_data (dict or NoneType) - A dictionary of source model data containing RowType and Residue data, or None if this data has not been retrieved.

undoableReorderRow(self, from_row, to_row)

 

Reorder a row in response to a drag and drop and make the reordering undoable.

Parameters:
  • from_row (int) - The row number of the row to move.
  • to_row (int) - The row number of where the row should be moved to.

setTextSize(self, size)

 

Set the text size to the specified size

Parameters:
  • size (int) - The new point size for the text

updateTextSize(self, change)

 

Increment the text size one point smaller or larger

Note that requests to reduce the text size below MIN_TEXT_SIZE or increase it above MAX_TEXT_SIZE will have no effect.

Parameters:

updateColorScheme(self, row_type, scheme_type)

 

Used to set the color scheme of a specific row type.

Decorators:
  • @table_helper.model_reset_method

getColorScheme(self)

 
Returns: dict
The color scheme currently in use

updateColorByAln(self, mode)

 

Update the current color by alignment mode

Parameters:
  • mode (ColorByAln) - Color by alignment mode to set
Decorators:
  • @table_helper.model_reset_method

getColorByAln(self)

 

Get the current color by alignment mode

Returns: ColorByAln
Color by alignment mode

Instance Variable Details [hide private]

tableWidthChangedSignal(...)

 
A signal emitted when the table width is changed. This signal is emitted in response to the view calling tableWidthChanged.

undoableReorderRowSignal(...)

 
A signal emitted when a row should be moved and the move should be undoable. This signal is emitted in response to the view calling undoableReorderRow, which happens when the user drag-and- drops a row. The signal receiver (ViewModel) is responsible for creating a QtWidgets.QUndoCommand that calls reorderRow.