CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
DataAdderTableManager Class Reference
Inheritance diagram for DataAdderTableManager:
FWTableManagerBase

Public Member Functions

FWTableCellRendererBasecellRenderer (int iSortedRowNumber, int iCol) const override
 
 DataAdderTableManager (FWJobMetadataManager *manager)
 
std::vector< std::string > getTitles () const override
 returns the title names for each column More...
 
void implSort (int col, bool sortOrder) override
 Called by 'sort' method to actually handle the sorting of the rows. Arguments are the same as 'sort'. More...
 
int numberOfColumns () const override
 Number of columns in the table. More...
 
int numberOfRows () const override
 Number of rows in the table. More...
 
void reset ()
 
virtual bool rowIsSelected (int row) const
 
int selectedRow () const
 
void setSelection (int row, int mask)
 
virtual void sortWithFilter (const char *filter)
 
virtual const std::string title () const
 
int unsortedRowNumber (int iSortedRowNumber) const override
 when passed the index to the sorted order of the rows it returns the original row number from the underlying data More...
 
- Public Member Functions inherited from FWTableManagerBase
virtual void buttonPressedInRowHeader (Int_t row, Event_t *event, Int_t relX, Int_t relY)
 Called if mouse button pressed in Row Header, defaults is to do nothing. More...
 
virtual void buttonReleasedInRowHeader (Int_t row, Event_t *event, Int_t relX, Int_t relY)
 
virtual bool cellDataIsSortable () const
 
virtual unsigned int cellHeight () const
 require all cells to be the same height More...
 
 ClassDefOverride (FWTableManagerBase, 0)
 
void dataChanged ()
 Classes which inherit from FWTableManagerBase must call this when their underlying data changes. More...
 
 FWTableManagerBase ()
 
virtual bool hasLabelHeaders () const
 
virtual bool hasRowHeaders () const
 Returns 'true' if this table has row headers. Defaults return value is false. More...
 
virtual std::vector< unsigned int > maxWidthForColumns () const
 for each column in the table this returns the present maximum width for that column More...
 
virtual FWTableCellRendererBaserowHeader (int iSortedRowNumber) const
 Returns the renderer for the row header for the sorted row number iSortedRowNumber. More...
 
void sort (int iCol, bool iSortOrder)
 Call to have table sorted on values in column iCol with the sort order being descending if iSortOrder is 'true'. More...
 
int sortColumn (void)
 The current sort column. More...
 
bool sortOrder (void)
 The current sort order for the table. More...
 
void visualPropertiesChanged ()
 Classes which inherit from FWTableManagerBase must call this when how the data is shown (e.g. color) changes. More...
 
 ~FWTableManagerBase () override
 

Public Attributes

sigc::signal< void, int > indexSelected_
 

Private Member Functions

void changeSelection (int iRow)
 

Private Attributes

std::string m_filter
 
FWJobMetadataManagerm_manager
 
FWTextTableCellRenderer m_renderer
 
std::vector< int > m_row_to_index
 
int m_selectedRow
 

Additional Inherited Members

Detailed Description

Definition at line 70 of file FWGUIEventDataAdder.cc.

Constructor & Destructor Documentation

◆ DataAdderTableManager()

DataAdderTableManager::DataAdderTableManager ( FWJobMetadataManager manager)
inline

Definition at line 72 of file FWGUIEventDataAdder.cc.

72 : m_manager(manager), m_selectedRow(-1), m_filter() { reset(); }

References reset().

Member Function Documentation

◆ cellRenderer()

FWTableCellRendererBase* DataAdderTableManager::cellRenderer ( int  iSortedRowNumber,
int  iCol 
) const
inlineoverridevirtual

Returns the particular renderer used to handle the requested cell. Arguments: iSortedRowNumber: the row number from the present sort (i.e. the cell number of the view) iCol: the column number of the cell. The returned value must be used immediately and not held onto since the same Renderer can be used for subsequent calls

Implements FWTableManagerBase.

Definition at line 101 of file FWGUIEventDataAdder.cc.

101  {
102  if (static_cast<int>(m_row_to_index.size()) > iSortedRowNumber) {
103  int unsortedRow = m_row_to_index[iSortedRowNumber];
104  const FWJobMetadataManager::Data &data = (m_manager->usableData())[unsortedRow];
105 
106  m_renderer.setData(dataForColumn(data, iCol), m_selectedRow == unsortedRow);
107  } else {
108  m_renderer.setData(std::string(), false);
109  }
110  return &m_renderer;
111  }

References data, dataForColumn(), m_manager, m_renderer, m_row_to_index, m_selectedRow, FWTextTableCellRenderer::setData(), AlCaHLTBitMon_QueryRunRegistry::string, and FWJobMetadataManager::usableData().

◆ changeSelection()

void DataAdderTableManager::changeSelection ( int  iRow)
inlineprivate

Definition at line 140 of file FWGUIEventDataAdder.cc.

140  {
141  if (iRow != m_selectedRow) {
142  m_selectedRow = iRow;
143  if (-1 == iRow) {
144  indexSelected_(-1);
145  } else {
146  indexSelected_(iRow);
147  }
149  }
150  }

References indexSelected_, m_selectedRow, and FWTableManagerBase::visualPropertiesChanged().

Referenced by reset(), and setSelection().

◆ getTitles()

std::vector<std::string> DataAdderTableManager::getTitles ( ) const
inlineoverridevirtual

returns the title names for each column

Implements FWTableManagerBase.

Definition at line 90 of file FWGUIEventDataAdder.cc.

90  {
91  std::vector<std::string> returnValue;
92  returnValue.reserve(kNColumns);
93  returnValue.push_back("Purpose");
94  returnValue.push_back("Module Label");
95  returnValue.push_back("Product Instance Label");
96  returnValue.push_back("Process Name");
97  returnValue.push_back("C++ Class");
98  return returnValue;
99  }

References kNColumns.

◆ implSort()

void DataAdderTableManager::implSort ( int  iCol,
bool  iSortOrder 
)
overridevirtual

Called by 'sort' method to actually handle the sorting of the rows. Arguments are the same as 'sort'.

Implements FWTableManagerBase.

Definition at line 306 of file FWGUIEventDataAdder.cc.

306  {
307  doSort(column, m_filter.c_str(), sortOrder, m_manager->usableData(), m_row_to_index);
308 }

References m_filter, m_manager, m_row_to_index, FWTableManagerBase::sortOrder(), and FWJobMetadataManager::usableData().

◆ numberOfColumns()

int DataAdderTableManager::numberOfColumns ( ) const
inlineoverridevirtual

Number of columns in the table.

Implements FWTableManagerBase.

Definition at line 75 of file FWGUIEventDataAdder.cc.

75 { return kNColumns; }

References kNColumns.

◆ numberOfRows()

int DataAdderTableManager::numberOfRows ( ) const
inlineoverridevirtual

Number of rows in the table.

Implements FWTableManagerBase.

Definition at line 74 of file FWGUIEventDataAdder.cc.

74 { return m_row_to_index.size(); }

References m_row_to_index.

◆ reset()

void DataAdderTableManager::reset ( void  )
inline

Definition at line 128 of file FWGUIEventDataAdder.cc.

128  {
129  changeSelection(-1);
130  m_row_to_index.clear();
131  m_row_to_index.reserve(m_manager->usableData().size());
132  for (unsigned int i = 0; i < m_manager->usableData().size(); ++i) {
133  m_row_to_index.push_back(i);
134  }
135  dataChanged();
136  }

References changeSelection(), FWTableManagerBase::dataChanged(), mps_fire::i, m_manager, m_row_to_index, and FWJobMetadataManager::usableData().

Referenced by DataAdderTableManager(), and FWGUIEventDataAdder::metadataUpdatedSlot().

◆ rowIsSelected()

virtual bool DataAdderTableManager::rowIsSelected ( int  row) const
inlinevirtual

Definition at line 126 of file FWGUIEventDataAdder.cc.

126 { return m_selectedRow == row; }

References m_selectedRow.

◆ selectedRow()

int DataAdderTableManager::selectedRow ( ) const
inline

Definition at line 124 of file FWGUIEventDataAdder.cc.

124 { return m_selectedRow; }

References m_selectedRow.

◆ setSelection()

void DataAdderTableManager::setSelection ( int  row,
int  mask 
)
inline

Definition at line 113 of file FWGUIEventDataAdder.cc.

113  {
114  if (mask == 4) {
115  if (row == m_selectedRow) {
116  row = -1;
117  }
118  }
119  changeSelection(row);
120  }

References changeSelection(), and m_selectedRow.

Referenced by FWGUIEventDataAdder::rowClicked().

◆ sortWithFilter()

virtual void DataAdderTableManager::sortWithFilter ( const char *  filter)
inlinevirtual

Updates the table using the passed filter. Notice that in this case we reset the sorting and show results by those best matching the filter.

Definition at line 81 of file FWGUIEventDataAdder.cc.

81  {
82  m_filter = filter;
83  sort(-1, sortOrder());
84  dataChanged();
85  }

References FWTableManagerBase::dataChanged(), ALCARECOTkAlBeamHalo_cff::filter, m_filter, FWTableManagerBase::sort(), and FWTableManagerBase::sortOrder().

Referenced by FWGUIEventDataAdder::updateFilterString().

◆ title()

virtual const std::string DataAdderTableManager::title ( ) const
inlinevirtual

Definition at line 122 of file FWGUIEventDataAdder.cc.

122 { return "Viewable Collections"; }

◆ unsortedRowNumber()

int DataAdderTableManager::unsortedRowNumber ( int  iSortedRowNumber) const
inlineoverridevirtual

when passed the index to the sorted order of the rows it returns the original row number from the underlying data

Implements FWTableManagerBase.

Definition at line 87 of file FWGUIEventDataAdder.cc.

87 { return m_row_to_index[iSortedRowNumber]; }

References m_row_to_index.

Member Data Documentation

◆ indexSelected_

sigc::signal<void, int> DataAdderTableManager::indexSelected_

Definition at line 137 of file FWGUIEventDataAdder.cc.

Referenced by changeSelection(), and FWGUIEventDataAdder::createWindow().

◆ m_filter

std::string DataAdderTableManager::m_filter
private

Definition at line 154 of file FWGUIEventDataAdder.cc.

Referenced by implSort(), and sortWithFilter().

◆ m_manager

FWJobMetadataManager* DataAdderTableManager::m_manager
private

Definition at line 151 of file FWGUIEventDataAdder.cc.

Referenced by cellRenderer(), implSort(), and reset().

◆ m_renderer

FWTextTableCellRenderer DataAdderTableManager::m_renderer
mutableprivate

Definition at line 155 of file FWGUIEventDataAdder.cc.

Referenced by cellRenderer().

◆ m_row_to_index

std::vector<int> DataAdderTableManager::m_row_to_index
private

◆ m_selectedRow

int DataAdderTableManager::m_selectedRow
private
FWTableManagerBase::sort
void sort(int iCol, bool iSortOrder)
Call to have table sorted on values in column iCol with the sort order being descending if iSortOrder...
Definition: FWTableManagerBase.cc:54
mps_fire.i
i
Definition: mps_fire.py:428
DataAdderTableManager::m_selectedRow
int m_selectedRow
Definition: FWGUIEventDataAdder.cc:153
DataAdderTableManager::m_renderer
FWTextTableCellRenderer m_renderer
Definition: FWGUIEventDataAdder.cc:155
FWTableManagerBase::visualPropertiesChanged
void visualPropertiesChanged()
Classes which inherit from FWTableManagerBase must call this when how the data is shown (e....
Definition: FWTableManagerBase.cc:70
DataAdderTableManager::m_filter
std::string m_filter
Definition: FWGUIEventDataAdder.cc:154
DataAdderTableManager::reset
void reset()
Definition: FWGUIEventDataAdder.cc:128
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
FWTableManagerBase::dataChanged
void dataChanged()
Classes which inherit from FWTableManagerBase must call this when their underlying data changes.
Definition: FWTableManagerBase.cc:63
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
FWTableManagerBase::sortOrder
bool sortOrder(void)
The current sort order for the table.
Definition: FWTableManagerBase.h:102
FWTextTableCellRenderer::setData
void setData(const std::string &, bool isSelected)
Definition: FWTextTableCellRenderer.cc:98
FWJobMetadataManager::Data
Definition: FWJobMetadataManager.h:20
kNColumns
static const unsigned int kNColumns
Definition: FWGUIEventDataAdder.cc:69
DataAdderTableManager::m_manager
FWJobMetadataManager * m_manager
Definition: FWGUIEventDataAdder.cc:151
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
FWJobMetadataManager::usableData
std::vector< Data > & usableData()
Definition: FWJobMetadataManager.h:31
DataAdderTableManager::indexSelected_
sigc::signal< void, int > indexSelected_
Definition: FWGUIEventDataAdder.cc:137
DataAdderTableManager::m_row_to_index
std::vector< int > m_row_to_index
Definition: FWGUIEventDataAdder.cc:152
dataForColumn
static const std::string & dataForColumn(const FWJobMetadataManager::Data &iData, int iCol)
Definition: FWGUIEventDataAdder.cc:45
DataAdderTableManager::changeSelection
void changeSelection(int iRow)
Definition: FWGUIEventDataAdder.cc:140