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
 
 DataAdderTableManager (FWJobMetadataManager *manager)
 
virtual std::vector< std::string > getTitles () const
 returns the title names for each column More...
 
virtual void implSort (int col, bool sortOrder)
 Called by 'sort' method to actually handle the sorting of the rows. Arguments are the same as 'sort'. More...
 
virtual int numberOfColumns () const
 Number of columns in the table. More...
 
virtual int numberOfRows () const
 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
 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 72 of file FWGUIEventDataAdder.cc.

Constructor & Destructor Documentation

DataAdderTableManager::DataAdderTableManager ( FWJobMetadataManager manager)
inline

Definition at line 74 of file FWGUIEventDataAdder.cc.

References reset().

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

Member Function Documentation

virtual FWTableCellRendererBase* DataAdderTableManager::cellRenderer ( int  iSortedRowNumber,
int  iCol 
) const
inlinevirtual
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 114 of file FWGUIEventDataAdder.cc.

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

115  {
116 
117  if(static_cast<int>(m_row_to_index.size())>iSortedRowNumber) {
118  int unsortedRow = m_row_to_index[iSortedRowNumber];
119  const FWJobMetadataManager::Data& data = (m_manager->usableData())[unsortedRow];
120 
121  m_renderer.setData(dataForColumn(data,iCol),m_selectedRow==unsortedRow);
122  } else {
123  m_renderer.setData(std::string(),false);
124  }
125  return &m_renderer;
126  }
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)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
FWJobMetadataManager * m_manager
void DataAdderTableManager::changeSelection ( int  iRow)
inlineprivate

Definition at line 160 of file FWGUIEventDataAdder.cc.

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

Referenced by reset(), and setSelection().

160  {
161  if(iRow != m_selectedRow) {
162  m_selectedRow=iRow;
163  if(-1 == iRow) {
164  indexSelected_(-1);
165  } else {
166  indexSelected_(iRow);
167  }
169  }
170  }
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
inlinevirtual

returns the title names for each column

Implements FWTableManagerBase.

Definition at line 103 of file FWGUIEventDataAdder.cc.

References kNColumns.

103  {
104  std::vector<std::string> returnValue;
105  returnValue.reserve(kNColumns);
106  returnValue.push_back("Purpose");
107  returnValue.push_back("Module Label");
108  returnValue.push_back("Product Instance Label");
109  returnValue.push_back("Process Name");
110  returnValue.push_back("C++ Class");
111  return returnValue;
112  }
static const unsigned int kNColumns
void DataAdderTableManager::implSort ( int  iCol,
bool  iSortOrder 
)
virtual

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

Implements FWTableManagerBase.

Definition at line 339 of file FWGUIEventDataAdder.cc.

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

340 {
341  doSort(column, m_filter.c_str(), sortOrder, m_manager->usableData(), m_row_to_index);
342 }
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
inlinevirtual

Number of columns in the table.

Implements FWTableManagerBase.

Definition at line 83 of file FWGUIEventDataAdder.cc.

References kNColumns.

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

Number of rows in the table.

Implements FWTableManagerBase.

Definition at line 80 of file FWGUIEventDataAdder.cc.

References m_row_to_index.

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

Definition at line 149 of file FWGUIEventDataAdder.cc.

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

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

149  {
150  changeSelection(-1);
151  m_row_to_index.clear();
152  m_row_to_index.reserve(m_manager->usableData().size());
153  for(unsigned int i =0; i < m_manager->usableData().size(); ++i) {
154  m_row_to_index.push_back(i);
155  }
156  dataChanged();
157  }
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 145 of file FWGUIEventDataAdder.cc.

References m_selectedRow.

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

Definition at line 141 of file FWGUIEventDataAdder.cc.

References m_selectedRow.

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

Definition at line 128 of file FWGUIEventDataAdder.cc.

References changeSelection(), and m_selectedRow.

Referenced by FWGUIEventDataAdder::rowClicked().

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

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

Referenced by FWGUIEventDataAdder::updateFilterString().

92  {
93  m_filter = filter;
94  sort(-1, sortOrder());
95  dataChanged();
96  }
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
inlinevirtual

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

References m_row_to_index.

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

Member Data Documentation

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

Definition at line 158 of file FWGUIEventDataAdder.cc.

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

std::string DataAdderTableManager::m_filter
private

Definition at line 174 of file FWGUIEventDataAdder.cc.

Referenced by implSort(), and sortWithFilter().

FWJobMetadataManager* DataAdderTableManager::m_manager
private

Definition at line 171 of file FWGUIEventDataAdder.cc.

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

FWTextTableCellRenderer DataAdderTableManager::m_renderer
mutableprivate

Definition at line 175 of file FWGUIEventDataAdder.cc.

Referenced by cellRenderer().

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