CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Friends
FWTriggerTableViewTableManager Class Reference

#include <Fireworks/Core/interface/FWTriggerTableViewTableManager.h>

Inheritance diagram for FWTriggerTableViewTableManager:
FWTableManagerBase

Public Member Functions

FWTableCellRendererBasecellRenderer (int iSortedRowNumber, int iCol) const override
 
void dataChanged ()
 
 FWTriggerTableViewTableManager (const FWTriggerTableView *)
 
std::vector< std::string > getTitles () const override
 returns the title names for each column More...
 
int numberOfColumns () const override
 Number of columns in the table. More...
 
int numberOfRows () const override
 Number of rows in the table. More...
 
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...
 
 ~FWTriggerTableViewTableManager () override
 
- 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
 

Protected Member Functions

void implSort (int iCol, bool iSortOrder) override
 

Protected Attributes

TGGC * m_graphicsContext
 
FWTextTableCellRendererm_renderer
 
std::vector< int > m_sortedToUnsortedIndices
 
const FWTriggerTableViewm_view
 

Private Member Functions

 FWTriggerTableViewTableManager (const FWTriggerTableViewTableManager &)=delete
 
const FWTriggerTableViewTableManageroperator= (const FWTriggerTableViewTableManager &)=delete
 

Friends

class FWTriggerTableView
 

Detailed Description

Definition at line 31 of file FWTriggerTableViewTableManager.h.

Constructor & Destructor Documentation

◆ FWTriggerTableViewTableManager() [1/2]

FWTriggerTableViewTableManager::FWTriggerTableViewTableManager ( const FWTriggerTableView view)

Definition at line 9 of file FWTriggerTableViewTableManager.cc.

10  : m_view(view), m_graphicsContext(nullptr), m_renderer(nullptr) {
11  GCValues_t gc = *(m_view->m_tableWidget->GetWhiteGC().GetAttributes());
12  m_graphicsContext = gClient->GetResourcePool()->GetGCPool()->GetGC(&gc, kTRUE);
14 }

References m_graphicsContext, m_renderer, FWTriggerTableView::m_tableWidget, and m_view.

◆ ~FWTriggerTableViewTableManager()

FWTriggerTableViewTableManager::~FWTriggerTableViewTableManager ( )
override

Definition at line 16 of file FWTriggerTableViewTableManager.cc.

16 { delete m_renderer; }

References m_renderer.

◆ FWTriggerTableViewTableManager() [2/2]

FWTriggerTableViewTableManager::FWTriggerTableViewTableManager ( const FWTriggerTableViewTableManager )
privatedelete

Member Function Documentation

◆ cellRenderer()

FWTableCellRendererBase * FWTriggerTableViewTableManager::cellRenderer ( int  iSortedRowNumber,
int  iCol 
) const
overridevirtual

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 43 of file FWTriggerTableViewTableManager.cc.

43  {
44  const int realRowNumber = unsortedRowNumber(iSortedRowNumber);
45  const int acceptColumn = 1;
46  if (!m_view->m_columns.empty() && int(m_view->m_columns.size()) > iCol &&
47  int(m_view->m_columns.front().values.size()) > realRowNumber) {
48  bool accepted = std::string(m_view->m_columns.at(acceptColumn).values.at(realRowNumber)) == "1";
49  if ((m_view->backgroundColor() == kBlack) == accepted)
50  m_graphicsContext->SetForeground(0xe0e0e0);
51  else
52  m_graphicsContext->SetForeground(0x404040);
53  m_renderer->setData(m_view->m_columns.at(iCol).values.at(realRowNumber), false);
54  } else {
55  m_renderer->setData("invalid", false);
56  }
57  return m_renderer;
58 }

References FWTriggerTableView::backgroundColor(), createfilelist::int, FWTriggerTableView::m_columns, m_graphicsContext, m_renderer, m_view, FWTextTableCellRenderer::setData(), AlCaHLTBitMon_QueryRunRegistry::string, and unsortedRowNumber().

Referenced by FWTriggerTableView::saveImageTo().

◆ dataChanged()

void FWTriggerTableViewTableManager::dataChanged ( void  )

◆ getTitles()

std::vector< std::string > FWTriggerTableViewTableManager::getTitles ( ) const
overridevirtual

returns the title names for each column

Implements FWTableManagerBase.

Definition at line 27 of file FWTriggerTableViewTableManager.cc.

27  {
28  unsigned int n = numberOfColumns();
29  std::vector<std::string> ret;
30  ret.reserve(n);
31  for (unsigned int i = 0; i < n; ++i) {
32  ret.push_back(m_view->m_columns.at(i).title);
33  }
34  return ret;
35 }

References mps_fire::i, FWTriggerTableView::m_columns, m_view, dqmiodumpmetadata::n, numberOfColumns(), and runTheMatrix::ret.

◆ implSort()

void FWTriggerTableViewTableManager::implSort ( int  iCol,
bool  iSortOrder 
)
overrideprotectedvirtual

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

Implements FWTableManagerBase.

Definition at line 86 of file FWTriggerTableViewTableManager.cc.

86  {
87  if (sortOrder) {
88  std::multimap<std::string, int, std::greater<std::string> > ordered;
89  doSort(col, m_view->m_columns, ordered, m_sortedToUnsortedIndices);
90  } else {
91  std::multimap<std::string, int> ordered;
92  doSort(col, m_view->m_columns, ordered, m_sortedToUnsortedIndices);
93  }
94 }

References cuy::col, FWTriggerTableView::m_columns, m_sortedToUnsortedIndices, m_view, and FWTableManagerBase::sortOrder().

◆ numberOfColumns()

int FWTriggerTableViewTableManager::numberOfColumns ( ) const
overridevirtual

Number of columns in the table.

Implements FWTableManagerBase.

Definition at line 25 of file FWTriggerTableViewTableManager.cc.

25 { return m_view->m_columns.size(); }

References FWTriggerTableView::m_columns, and m_view.

Referenced by getTitles(), FWTriggerTableView::saveImageTo(), and FWTriggerTableView::setFrom().

◆ numberOfRows()

int FWTriggerTableViewTableManager::numberOfRows ( ) const
overridevirtual

Number of rows in the table.

Implements FWTableManagerBase.

Definition at line 18 of file FWTriggerTableViewTableManager.cc.

18  {
19  if (!m_view->m_columns.empty())
20  return m_view->m_columns.front().values.size();
21  else
22  return 0;
23 }

References FWTriggerTableView::m_columns, and m_view.

Referenced by dataChanged(), and FWTriggerTableView::saveImageTo().

◆ operator=()

const FWTriggerTableViewTableManager& FWTriggerTableViewTableManager::operator= ( const FWTriggerTableViewTableManager )
privatedelete

◆ unsortedRowNumber()

int FWTriggerTableViewTableManager::unsortedRowNumber ( int  iSortedRowNumber) const
overridevirtual

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 37 of file FWTriggerTableViewTableManager.cc.

37  {
38  if (iSortedRowNumber >= (int)m_sortedToUnsortedIndices.size())
39  return 0;
40  return m_sortedToUnsortedIndices[iSortedRowNumber];
41 }

References m_sortedToUnsortedIndices.

Referenced by cellRenderer().

Friends And Related Function Documentation

◆ FWTriggerTableView

friend class FWTriggerTableView
friend

Definition at line 32 of file FWTriggerTableViewTableManager.h.

Member Data Documentation

◆ m_graphicsContext

TGGC* FWTriggerTableViewTableManager::m_graphicsContext
protected

◆ m_renderer

FWTextTableCellRenderer* FWTriggerTableViewTableManager::m_renderer
protected

◆ m_sortedToUnsortedIndices

std::vector<int> FWTriggerTableViewTableManager::m_sortedToUnsortedIndices
protected

Definition at line 52 of file FWTriggerTableViewTableManager.h.

Referenced by dataChanged(), implSort(), and unsortedRowNumber().

◆ m_view

const FWTriggerTableView* FWTriggerTableViewTableManager::m_view
protected
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:367
mps_fire.i
i
Definition: mps_fire.py:428
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
cuy.col
col
Definition: cuy.py:1010
FWTriggerTableViewTableManager::m_renderer
FWTextTableCellRenderer * m_renderer
Definition: FWTriggerTableViewTableManager.h:56
FWTriggerTableViewTableManager::m_view
const FWTriggerTableView * m_view
Definition: FWTriggerTableViewTableManager.h:54
FWTriggerTableView::backgroundColor
Color_t backgroundColor() const
Definition: FWTriggerTableView.h:47
FWTextTableCellRenderer
Definition: FWTextTableCellRenderer.h:32
FWTriggerTableView::m_tableWidget
FWTableWidget * m_tableWidget
Definition: FWTriggerTableView.h:85
FWTriggerTableViewTableManager::numberOfColumns
int numberOfColumns() const override
Number of columns in the table.
Definition: FWTriggerTableViewTableManager.cc:25
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
FWTableManagerBase::dataChanged
void dataChanged()
Classes which inherit from FWTableManagerBase must call this when their underlying data changes.
Definition: FWTableManagerBase.cc:63
FWTriggerTableView::m_columns
std::vector< Column > m_columns
Definition: FWTriggerTableView.h:67
createfilelist.int
int
Definition: createfilelist.py:10
FWTriggerTableViewTableManager::unsortedRowNumber
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 und...
Definition: FWTriggerTableViewTableManager.cc:37
FWTableManagerBase::sortOrder
bool sortOrder(void)
The current sort order for the table.
Definition: FWTableManagerBase.h:102
FWTriggerTableViewTableManager::numberOfRows
int numberOfRows() const override
Number of rows in the table.
Definition: FWTriggerTableViewTableManager.cc:18
FWTextTableCellRenderer::setData
void setData(const std::string &, bool isSelected)
Definition: FWTextTableCellRenderer.cc:98
FWTriggerTableViewTableManager::m_sortedToUnsortedIndices
std::vector< int > m_sortedToUnsortedIndices
Definition: FWTriggerTableViewTableManager.h:52
FWTriggerTableViewTableManager::m_graphicsContext
TGGC * m_graphicsContext
Definition: FWTriggerTableViewTableManager.h:55