CMS 3D CMS Logo

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

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

Protected Member Functions

virtual void implSort (int iCol, bool iSortOrder)
 

Protected Attributes

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

Private Member Functions

 FWTriggerTableViewTableManager (const FWTriggerTableViewTableManager &)
 
const
FWTriggerTableViewTableManager
operator= (const FWTriggerTableViewTableManager &)
 

Friends

class FWTriggerTableView
 

Detailed Description

Definition at line 32 of file FWTriggerTableViewTableManager.h.

Constructor & Destructor Documentation

FWTriggerTableViewTableManager::FWTriggerTableViewTableManager ( const FWTriggerTableView view)

Definition at line 10 of file FWTriggerTableViewTableManager.cc.

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

11  : m_view(view),
13  m_renderer(0)
14 {
15  GCValues_t gc = *(m_view->m_tableWidget->GetWhiteGC().GetAttributes());
16  m_graphicsContext = gClient->GetResourcePool()->GetGCPool()->GetGC(&gc,kTRUE);
18 }
FWTableWidget * m_tableWidget
FWTriggerTableViewTableManager::~FWTriggerTableViewTableManager ( )
virtual

Definition at line 20 of file FWTriggerTableViewTableManager.cc.

References m_renderer.

21 {
22  delete m_renderer;
23 }
FWTriggerTableViewTableManager::FWTriggerTableViewTableManager ( const FWTriggerTableViewTableManager )
private

Member Function Documentation

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

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

Referenced by FWTriggerTableView::saveImageTo().

63 {
64  const int realRowNumber = unsortedRowNumber(iSortedRowNumber);
65  const int acceptColumn = 1;
66  if ( !m_view->m_columns.empty() &&
67  int(m_view->m_columns.size())>iCol &&
68  int(m_view->m_columns.front().values.size())>realRowNumber ) {
69  bool accepted = std::string(m_view->m_columns.at(acceptColumn).values.at(realRowNumber)) == "1";
70  if ((m_view->backgroundColor() == kBlack) == accepted)
71  m_graphicsContext->SetForeground(0xe0e0e0);
72  else
73  m_graphicsContext->SetForeground(0x404040);
74  m_renderer->setData(m_view->m_columns.at(iCol).values.at(realRowNumber), false);
75  } else {
76  m_renderer->setData("invalid", false);
77  }
78  return m_renderer;
79 }
std::vector< Column > m_columns
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 und...
Color_t backgroundColor() const
void setData(const std::string &, bool isSelected)
void FWTriggerTableViewTableManager::dataChanged ( void  )

Definition at line 82 of file FWTriggerTableViewTableManager.cc.

References FWTableManagerBase::dataChanged(), i, m_sortedToUnsortedIndices, and numberOfRows().

Referenced by FWTriggerTableView::dataChanged(), and FWHLTTriggerTableView::fillTable().

83 {
85  for ( int i=0; i< numberOfRows(); ++i)
86  m_sortedToUnsortedIndices.push_back(i);
88 }
int i
Definition: DBlmapReader.cc:9
void dataChanged()
Classes which inherit from FWTableManagerBase must call this when their underlying data changes...
virtual int numberOfRows() const
Number of rows in the table.
std::vector< std::string > FWTriggerTableViewTableManager::getTitles ( ) const
virtual

returns the title names for each column

Implements FWTableManagerBase.

Definition at line 41 of file FWTriggerTableViewTableManager.cc.

References i, FWTriggerTableView::m_columns, m_view, n, numberOfColumns(), and run_regression::ret.

42 {
43  unsigned int n = numberOfColumns();
44  std::vector<std::string> ret;
45  ret.reserve(n);
46  for (unsigned int i = 0; i < n; ++i) {
47  ret.push_back(m_view->m_columns.at(i).title);
48  }
49  return ret;
50 }
int i
Definition: DBlmapReader.cc:9
std::vector< Column > m_columns
virtual int numberOfColumns() const
Number of columns in the table.
void FWTriggerTableViewTableManager::implSort ( int  iCol,
bool  iSortOrder 
)
protectedvirtual

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

Implements FWTableManagerBase.

Definition at line 113 of file FWTriggerTableViewTableManager.cc.

References FWTriggerTableView::m_columns, m_sortedToUnsortedIndices, and m_view.

114 {
115  if(sortOrder) {
116  std::multimap<std::string,int,std::greater<std::string> > ordered;
117  doSort(col, m_view->m_columns, ordered, m_sortedToUnsortedIndices);
118  } else {
119  std::multimap<std::string,int> ordered;
120  doSort(col, m_view->m_columns, ordered, m_sortedToUnsortedIndices);
121  }
122 }
bool sortOrder(void)
The current sort order for the table.
std::vector< Column > m_columns
int col
Definition: cuy.py:1008
int FWTriggerTableViewTableManager::numberOfColumns ( ) const
virtual

Number of columns in the table.

Implements FWTableManagerBase.

Definition at line 35 of file FWTriggerTableViewTableManager.cc.

References FWTriggerTableView::m_columns, and m_view.

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

36 {
37  return m_view->m_columns.size();
38 }
std::vector< Column > m_columns
int FWTriggerTableViewTableManager::numberOfRows ( ) const
virtual

Number of rows in the table.

Implements FWTableManagerBase.

Definition at line 26 of file FWTriggerTableViewTableManager.cc.

References FWTriggerTableView::m_columns, and m_view.

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

27 {
28  if ( !m_view->m_columns.empty() )
29  return m_view->m_columns.front().values.size();
30  else
31  return 0;
32 }
std::vector< Column > m_columns
const FWTriggerTableViewTableManager& FWTriggerTableViewTableManager::operator= ( const FWTriggerTableViewTableManager )
private
int FWTriggerTableViewTableManager::unsortedRowNumber ( int  iSortedRowNumber) const
virtual

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

References m_sortedToUnsortedIndices.

Referenced by cellRenderer().

54 {
55  if (iSortedRowNumber >= (int)m_sortedToUnsortedIndices.size())
56  return 0;
57  return m_sortedToUnsortedIndices[iSortedRowNumber];
58 }

Friends And Related Function Documentation

friend class FWTriggerTableView
friend

Definition at line 33 of file FWTriggerTableViewTableManager.h.

Member Data Documentation

TGGC* FWTriggerTableViewTableManager::m_graphicsContext
protected
FWTextTableCellRenderer* FWTriggerTableViewTableManager::m_renderer
protected
std::vector<int> FWTriggerTableViewTableManager::m_sortedToUnsortedIndices
protected

Definition at line 52 of file FWTriggerTableViewTableManager.h.

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

const FWTriggerTableView* FWTriggerTableViewTableManager::m_view
protected