CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

virtual FWTableCellRendererBasecellRenderer (int iSortedRowNumber, int iCol) const override
 
 DataAdderTableManager (FWJobMetadataManager *manager)
 
virtual std::vector< std::string > getTitles () const override
 returns the title names for each column More...
 
virtual 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...
 
virtual int numberOfColumns () const override
 Number of columns in the table. More...
 
virtual 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
 
virtual 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...
 
 ClassDef (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...
 
virtual ~FWTableManagerBase ()
 

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 71 of file FWGUIEventDataAdder.cc.

Constructor & Destructor Documentation

DataAdderTableManager::DataAdderTableManager ( FWJobMetadataManager manager)
inline

Definition at line 73 of file FWGUIEventDataAdder.cc.

References reset().

73  :
74  m_manager(manager), m_selectedRow(-1), m_filter()
75  {
76  reset();
77  }
FWJobMetadataManager * m_manager

Member Function Documentation

virtual 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 113 of file FWGUIEventDataAdder.cc.

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

114  {
115 
116  if(static_cast<int>(m_row_to_index.size())>iSortedRowNumber) {
117  int unsortedRow = m_row_to_index[iSortedRowNumber];
118  const FWJobMetadataManager::Data& data = (m_manager->usableData())[unsortedRow];
119 
120  m_renderer.setData(dataForColumn(data,iCol),m_selectedRow==unsortedRow);
121  } else {
122  m_renderer.setData(std::string(),false);
123  }
124  return &m_renderer;
125  }
FWTextTableCellRenderer m_renderer
std::vector< int > m_row_to_index
std::vector< Data > & usableData()
void setData(const std::string &, bool isSelected)
static const std::string & dataForColumn(const FWJobMetadataManager::Data &iData, int iCol)
FWJobMetadataManager * m_manager
void DataAdderTableManager::changeSelection ( int  iRow)
inlineprivate

Definition at line 159 of file FWGUIEventDataAdder.cc.

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

Referenced by reset(), and setSelection().

159  {
160  if(iRow != m_selectedRow) {
161  m_selectedRow=iRow;
162  if(-1 == iRow) {
163  indexSelected_(-1);
164  } else {
165  indexSelected_(iRow);
166  }
168  }
169  }
sigc::signal< void, int > indexSelected_
void visualPropertiesChanged()
Classes which inherit from FWTableManagerBase must call this when how the data is shown (e...
virtual std::vector<std::string> DataAdderTableManager::getTitles ( ) const
inlineoverridevirtual

returns the title names for each column

Implements FWTableManagerBase.

Definition at line 102 of file FWGUIEventDataAdder.cc.

References kNColumns.

102  {
103  std::vector<std::string> returnValue;
104  returnValue.reserve(kNColumns);
105  returnValue.push_back("Purpose");
106  returnValue.push_back("Module Label");
107  returnValue.push_back("Product Instance Label");
108  returnValue.push_back("Process Name");
109  returnValue.push_back("C++ Class");
110  return returnValue;
111  }
static const unsigned int kNColumns
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 338 of file FWGUIEventDataAdder.cc.

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

339 {
340  doSort(column, m_filter.c_str(), sortOrder, m_manager->usableData(), m_row_to_index);
341 }
bool sortOrder(void)
The current sort order for the table.
std::vector< int > m_row_to_index
std::vector< Data > & usableData()
FWJobMetadataManager * m_manager
virtual int DataAdderTableManager::numberOfColumns ( ) const
inlineoverridevirtual

Number of columns in the table.

Implements FWTableManagerBase.

Definition at line 82 of file FWGUIEventDataAdder.cc.

References kNColumns.

82  {
83  return kNColumns;
84  }
static const unsigned int kNColumns
virtual int DataAdderTableManager::numberOfRows ( ) const
inlineoverridevirtual

Number of rows in the table.

Implements FWTableManagerBase.

Definition at line 79 of file FWGUIEventDataAdder.cc.

References m_row_to_index.

79  {
80  return m_row_to_index.size();
81  }
std::vector< int > m_row_to_index
void DataAdderTableManager::reset ( void  )
inline

Definition at line 148 of file FWGUIEventDataAdder.cc.

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

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

148  {
149  changeSelection(-1);
150  m_row_to_index.clear();
151  m_row_to_index.reserve(m_manager->usableData().size());
152  for(unsigned int i =0; i < m_manager->usableData().size(); ++i) {
153  m_row_to_index.push_back(i);
154  }
155  dataChanged();
156  }
int i
Definition: DBlmapReader.cc:9
std::vector< int > m_row_to_index
void dataChanged()
Classes which inherit from FWTableManagerBase must call this when their underlying data changes...
std::vector< Data > & usableData()
FWJobMetadataManager * m_manager
virtual bool DataAdderTableManager::rowIsSelected ( int  row) const
inlinevirtual

Definition at line 144 of file FWGUIEventDataAdder.cc.

References m_selectedRow.

144  {
145  return m_selectedRow == row;
146  }
int DataAdderTableManager::selectedRow ( ) const
inline

Definition at line 140 of file FWGUIEventDataAdder.cc.

References m_selectedRow.

140  {
141  return m_selectedRow;
142  }
void DataAdderTableManager::setSelection ( int  row,
int  mask 
)
inline

Definition at line 127 of file FWGUIEventDataAdder.cc.

References changeSelection(), and m_selectedRow.

Referenced by FWGUIEventDataAdder::rowClicked().

127  {
128  if(mask == 4) {
129  if( row == m_selectedRow) {
130  row = -1;
131  }
132  }
133  changeSelection(row);
134  }
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 90 of file FWGUIEventDataAdder.cc.

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

Referenced by FWGUIEventDataAdder::updateFilterString().

91  {
92  m_filter = filter;
93  sort(-1, sortOrder());
94  dataChanged();
95  }
bool sortOrder(void)
The current sort order for the table.
void sort(int iCol, bool iSortOrder)
Call to have table sorted on values in column iCol with the sort order being descending if iSortOrder...
void dataChanged()
Classes which inherit from FWTableManagerBase must call this when their underlying data changes...
virtual const std::string DataAdderTableManager::title ( ) const
inlinevirtual
virtual 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 97 of file FWGUIEventDataAdder.cc.

References m_row_to_index.

97  {
98  return m_row_to_index[iSortedRowNumber];
99  }
std::vector< int > m_row_to_index

Member Data Documentation

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

Definition at line 157 of file FWGUIEventDataAdder.cc.

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

std::string DataAdderTableManager::m_filter
private

Definition at line 173 of file FWGUIEventDataAdder.cc.

Referenced by implSort(), and sortWithFilter().

FWJobMetadataManager* DataAdderTableManager::m_manager
private

Definition at line 170 of file FWGUIEventDataAdder.cc.

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

FWTextTableCellRenderer DataAdderTableManager::m_renderer
mutableprivate

Definition at line 174 of file FWGUIEventDataAdder.cc.

Referenced by cellRenderer().

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