#include <Fireworks/Core/interface/FWTriggerTableViewTableManager.h>
Public Member Functions | |
virtual FWTableCellRendererBase * | cellRenderer (int iSortedRowNumber, int iCol) const |
void | dataChanged () |
Classes which inherit from FWTableManagerBase must call this when their underlying data changes. | |
FWTriggerTableViewTableManager (const FWTriggerTableView *) | |
virtual std::vector< std::string > | getTitles () const |
returns the title names for each column | |
virtual int | numberOfColumns () const |
Number of columns in the table. | |
virtual int | numberOfRows () const |
Number of rows in the table. | |
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 | |
virtual | ~FWTriggerTableViewTableManager () |
Protected Member Functions | |
virtual void | implSort (int iCol, bool iSortOrder) |
Protected Attributes | |
TGGC * | m_graphicsContext |
FWTextTableCellRenderer * | m_renderer |
std::vector< int > | m_sortedToUnsortedIndices |
const FWTriggerTableView * | m_view |
Friends | |
class | FWTriggerTableView |
Definition at line 32 of file FWTriggerTableViewTableManager.h.
FWTriggerTableViewTableManager::FWTriggerTableViewTableManager | ( | const FWTriggerTableView * | view | ) |
Definition at line 9 of file FWTriggerTableViewTableManager.cc.
References m_graphicsContext, m_renderer, FWTriggerTableView::m_tableWidget, and m_view.
: m_view(view), m_graphicsContext(0), m_renderer(0) { GCValues_t gc = *(m_view->m_tableWidget->GetWhiteGC().GetAttributes()); m_graphicsContext = gClient->GetResourcePool()->GetGCPool()->GetGC(&gc,kTRUE); m_renderer = new FWTextTableCellRenderer(m_graphicsContext,m_graphicsContext); }
FWTriggerTableViewTableManager::~FWTriggerTableViewTableManager | ( | ) | [virtual] |
Definition at line 19 of file FWTriggerTableViewTableManager.cc.
References m_renderer.
{ delete m_renderer; }
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 60 of file FWTriggerTableViewTableManager.cc.
References FWTriggerTableView::backgroundColor(), FWTriggerTableView::m_columns, m_graphicsContext, m_renderer, m_view, FWTextTableCellRenderer::setData(), and unsortedRowNumber().
{ const int realRowNumber = unsortedRowNumber(iSortedRowNumber); const int acceptColumn = 1; if ( !m_view->m_columns.empty() && int(m_view->m_columns.size())>iCol && int(m_view->m_columns.front().values.size())>realRowNumber ) { bool accepted = std::string(m_view->m_columns.at(acceptColumn).values.at(realRowNumber)) == "1"; if ((m_view->backgroundColor() == kBlack) == accepted) m_graphicsContext->SetForeground(0xe0e0e0); else m_graphicsContext->SetForeground(0x404040); m_renderer->setData(m_view->m_columns.at(iCol).values.at(realRowNumber), false); } else { m_renderer->setData("invalid", false); } return m_renderer; }
void FWTriggerTableViewTableManager::dataChanged | ( | void | ) |
Classes which inherit from FWTableManagerBase must call this when their underlying data changes.
Reimplemented from FWTableManagerBase.
Definition at line 81 of file FWTriggerTableViewTableManager.cc.
References i, m_sortedToUnsortedIndices, and numberOfRows().
Referenced by FWTriggerTableView::dataChanged(), and FWHLTTriggerTableView::fillTable().
{ m_sortedToUnsortedIndices.clear(); for ( int i=0; i< numberOfRows(); ++i) m_sortedToUnsortedIndices.push_back(i); FWTableManagerBase::dataChanged(); }
std::vector< std::string > FWTriggerTableViewTableManager::getTitles | ( | ) | const [virtual] |
returns the title names for each column
Implements FWTableManagerBase.
Definition at line 40 of file FWTriggerTableViewTableManager.cc.
References i, FWTriggerTableView::m_columns, m_view, n, numberOfColumns(), and runTheMatrix::ret.
void FWTriggerTableViewTableManager::implSort | ( | int | iCol, |
bool | iSortOrder | ||
) | [protected, virtual] |
Called by 'sort' method to actually handle the sorting of the rows. Arguments are the same as 'sort'
Implements FWTableManagerBase.
Definition at line 112 of file FWTriggerTableViewTableManager.cc.
References FWTriggerTableView::m_columns, m_sortedToUnsortedIndices, and m_view.
{ if(sortOrder) { std::multimap<std::string,int,std::greater<std::string> > ordered; doSort(col, m_view->m_columns, ordered, m_sortedToUnsortedIndices); } else { std::multimap<std::string,int> ordered; doSort(col, m_view->m_columns, ordered, m_sortedToUnsortedIndices); } }
int FWTriggerTableViewTableManager::numberOfColumns | ( | ) | const [virtual] |
Number of columns in the table.
Implements FWTableManagerBase.
Definition at line 34 of file FWTriggerTableViewTableManager.cc.
References FWTriggerTableView::m_columns, and m_view.
Referenced by getTitles(), and FWTriggerTableView::setFrom().
int FWTriggerTableViewTableManager::numberOfRows | ( | ) | const [virtual] |
Number of rows in the table.
Implements FWTableManagerBase.
Definition at line 25 of file FWTriggerTableViewTableManager.cc.
References FWTriggerTableView::m_columns, and m_view.
Referenced by dataChanged().
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 52 of file FWTriggerTableViewTableManager.cc.
References m_sortedToUnsortedIndices.
Referenced by cellRenderer().
{ if (iSortedRowNumber >= (int)m_sortedToUnsortedIndices.size()) return 0; return m_sortedToUnsortedIndices[iSortedRowNumber]; }
friend class FWTriggerTableView [friend] |
Definition at line 33 of file FWTriggerTableViewTableManager.h.
TGGC* FWTriggerTableViewTableManager::m_graphicsContext [protected] |
Definition at line 55 of file FWTriggerTableViewTableManager.h.
Referenced by cellRenderer(), and FWTriggerTableViewTableManager().
Definition at line 56 of file FWTriggerTableViewTableManager.h.
Referenced by cellRenderer(), FWTriggerTableViewTableManager(), and ~FWTriggerTableViewTableManager().
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] |
Definition at line 54 of file FWTriggerTableViewTableManager.h.
Referenced by cellRenderer(), FWTriggerTableViewTableManager(), getTitles(), implSort(), numberOfColumns(), and numberOfRows().