#include <Fireworks/Core/interface/FWCollectionSummaryTableManager.h>
Public Member Functions | |
virtual void | buttonReleasedInRowHeader (Int_t row, Event_t *event, Int_t relX, Int_t relY) |
virtual FWTableCellRendererBase * | cellRenderer (int iSortedRowNumber, int iCol) const |
FWCollectionSummaryTableManager (FWEventItem *iCollection, const TGGC *iContext, const TGGC *iHighlightContext, FWCollectionSummaryWidget *) | |
virtual std::vector< std::string > | getTitles () const |
returns the title names for each column | |
virtual bool | hasRowHeaders () const |
Returns 'true' if this table has row headers. Defaults return value is false. | |
virtual int | numberOfColumns () const |
Number of columns in the table. | |
virtual int | numberOfRows () const |
Number of rows in the table. | |
virtual FWTableCellRendererBase * | rowHeader (int iSortedRowNumber) const |
Returns the renderer for the row header for the sorted row number iSortedRowNumber. | |
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 | ~FWCollectionSummaryTableManager () |
Protected Member Functions | |
virtual void | implSort (int iCol, bool iSortOrder) |
Called by 'sort' method to actually handle the sorting of the rows. Arguments are the same as 'sort'. | |
Private Member Functions | |
void | dataChanged () |
Classes which inherit from FWTableManagerBase must call this when their underlying data changes. | |
FWCollectionSummaryTableManager (const FWCollectionSummaryTableManager &) | |
const FWCollectionSummaryTableManager & | operator= (const FWCollectionSummaryTableManager &) |
Private Attributes | |
FWTextTableCellRenderer | m_bodyRenderer |
FWEventItem * | m_collection |
FWCollectionSummaryModelCellRenderer | m_renderer |
std::vector< int > | m_sortedToUnsortedIndicies |
FWCollectionSummaryWidget * | m_widget |
Description: <one line="" class="" summary>="">
Usage: <usage>
Definition at line 36 of file FWCollectionSummaryTableManager.h.
FWCollectionSummaryTableManager::FWCollectionSummaryTableManager | ( | FWEventItem * | iCollection, |
const TGGC * | iContext, | ||
const TGGC * | iHighlightContext, | ||
FWCollectionSummaryWidget * | iWidget | ||
) |
Definition at line 36 of file FWCollectionSummaryTableManager.cc.
References FWEventItem::changed_, FWTableManagerBase::dataChanged(), dataChanged(), FWEventItem::itemChanged_, m_collection, and FWEventItem::modelType().
: m_collection(iItem), m_renderer(iContext,iHighlightContext), m_bodyRenderer(iContext, iHighlightContext, FWTextTableCellRenderer::kJustifyRight), m_widget(iWidget) { m_collection->changed_.connect(boost::bind(&FWTableManagerBase::dataChanged,this)); m_collection->itemChanged_.connect(boost::bind(&FWCollectionSummaryTableManager::dataChanged,this)); //try to find the default columns std::vector<std::pair<std::string,std::string> > s_names; ROOT::Reflex::Type type = ROOT::Reflex::Type::ByTypeInfo(*(m_collection->modelType()->GetTypeInfo())); dataChanged(); }
FWCollectionSummaryTableManager::~FWCollectionSummaryTableManager | ( | ) | [virtual] |
Definition at line 59 of file FWCollectionSummaryTableManager.cc.
{ }
FWCollectionSummaryTableManager::FWCollectionSummaryTableManager | ( | const FWCollectionSummaryTableManager & | ) | [private] |
void FWCollectionSummaryTableManager::buttonReleasedInRowHeader | ( | Int_t | row, |
Event_t * | event, | ||
Int_t | relX, | ||
Int_t | relY | ||
) | [virtual] |
Reimplemented from FWTableManagerBase.
Definition at line 111 of file FWCollectionSummaryTableManager.cc.
References FWCollectionSummaryModelCellRenderer::clickHit(), FWEventItem::ModelInfo::displayProperties(), FWDisplayProperties::isVisible(), FWCollectionSummaryWidget::itemColorClicked(), FWCollectionSummaryModelCellRenderer::kHitCheck, FWCollectionSummaryModelCellRenderer::kHitColor, FWCollectionSummaryModelCellRenderer::kMiss, m_collection, m_renderer, m_widget, FWEventItem::modelInfo(), FWEventItem::setDisplayProperties(), FWDisplayProperties::setIsVisible(), and unsortedRowNumber().
{ Int_t realRow = unsortedRowNumber(row); int hit = m_renderer.clickHit(relX,relY); if(hit == FWCollectionSummaryModelCellRenderer::kMiss) { return; } if(hit == FWCollectionSummaryModelCellRenderer::kHitColor) { m_widget->itemColorClicked(realRow,event->fXRoot, event->fYRoot+12-relY); return; } FWEventItem::ModelInfo mi = m_collection->modelInfo(realRow); FWDisplayProperties dp = mi.displayProperties(); if(hit == FWCollectionSummaryModelCellRenderer::kHitCheck) { dp.setIsVisible(!dp.isVisible()); } m_collection->setDisplayProperties(realRow,dp); }
FWTableCellRendererBase * FWCollectionSummaryTableManager::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 160 of file FWCollectionSummaryTableManager.cc.
References getHLTprescales::index, m_bodyRenderer, m_collection, m_sortedToUnsortedIndicies, FWEventItem::modelData(), FWEventItem::modelInfo(), FWItemValueGetter::numValues(), FWItemValueGetter::precision(), asciidump::s, FWTextTableCellRenderer::setData(), FWEventItem::size(), v, FWItemValueGetter::valueFor(), and FWEventItem::valueGetter().
{ if(!m_collection->valueGetter().numValues()) { return 0; } if(iSortedRowNumber >= static_cast<int>(m_collection->size())) { m_bodyRenderer.setData("",false); return &m_bodyRenderer; } int index = m_sortedToUnsortedIndicies[iSortedRowNumber]; std::stringstream s; s.setf(std::ios_base::fixed,std::ios_base::floatfield); s.precision( m_collection->valueGetter().precision(iCol)); double v = m_collection->valueGetter().valueFor(m_collection->modelData(index), iCol); s <<v; m_bodyRenderer.setData(s.str(), m_collection->modelInfo(index).isSelected()); return &m_bodyRenderer; }
void FWCollectionSummaryTableManager::dataChanged | ( | void | ) | [private] |
Classes which inherit from FWTableManagerBase must call this when their underlying data changes.
Reimplemented from FWTableManagerBase.
Definition at line 198 of file FWCollectionSummaryTableManager.cc.
References i, m_collection, m_sortedToUnsortedIndicies, and FWEventItem::size().
Referenced by FWCollectionSummaryTableManager().
{ m_sortedToUnsortedIndicies.clear(); m_sortedToUnsortedIndicies.reserve(m_collection->size()); for(int i=0; i< static_cast<int>(m_collection->size());++i) { m_sortedToUnsortedIndicies.push_back(i); } FWTableManagerBase::dataChanged(); }
std::vector< std::string > FWCollectionSummaryTableManager::getTitles | ( | ) | const [virtual] |
returns the title names for each column
Implements FWTableManagerBase.
Definition at line 145 of file FWCollectionSummaryTableManager.cc.
References FWItemValueGetter::getTitles(), m_collection, and FWEventItem::valueGetter().
{ //return titles; return m_collection->valueGetter().getTitles(); }
bool FWCollectionSummaryTableManager::hasRowHeaders | ( | ) | const [virtual] |
Returns 'true' if this table has row headers. Defaults return value is false.
Reimplemented from FWTableManagerBase.
Definition at line 180 of file FWCollectionSummaryTableManager.cc.
{ return true; }
void FWCollectionSummaryTableManager::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 99 of file FWCollectionSummaryTableManager.cc.
References m_collection, m_sortedToUnsortedIndicies, asciidump::s, and FWEventItem::valueGetter().
{ if(iSortOrder) { std::multimap<double,int, std::greater<double> > s; doSort(*m_collection, m_collection->valueGetter(), iCol, s, m_sortedToUnsortedIndicies); } else { std::multimap<double,int, std::less<double> > s; doSort(*m_collection, m_collection->valueGetter(), iCol, s, m_sortedToUnsortedIndicies); } }
int FWCollectionSummaryTableManager::numberOfColumns | ( | ) | const [virtual] |
Number of columns in the table.
Implements FWTableManagerBase.
Definition at line 140 of file FWCollectionSummaryTableManager.cc.
References m_collection, FWItemValueGetter::numValues(), and FWEventItem::valueGetter().
{ return m_collection->valueGetter().numValues(); }
int FWCollectionSummaryTableManager::numberOfRows | ( | ) | const [virtual] |
Number of rows in the table.
Implements FWTableManagerBase.
Definition at line 134 of file FWCollectionSummaryTableManager.cc.
References m_collection, and FWEventItem::size().
{ return m_collection->size(); }
const FWCollectionSummaryTableManager& FWCollectionSummaryTableManager::operator= | ( | const FWCollectionSummaryTableManager & | ) | [private] |
FWTableCellRendererBase * FWCollectionSummaryTableManager::rowHeader | ( | int | iSortedRowNumber | ) | const [virtual] |
Returns the renderer for the row header for the sorted row number iSortedRowNumber.
Reimplemented from FWTableManagerBase.
Definition at line 186 of file FWCollectionSummaryTableManager.cc.
References getHLTprescales::index, m_collection, m_renderer, m_sortedToUnsortedIndicies, FWCollectionSummaryModelCellRenderer::setData(), and FWEventItem::size().
{ if(iSortedRowNumber >= static_cast<int>(m_collection->size())) { return 0; } int index = m_sortedToUnsortedIndicies[iSortedRowNumber]; m_renderer.setData(m_collection, index); return &m_renderer; }
int FWCollectionSummaryTableManager::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 154 of file FWCollectionSummaryTableManager.cc.
References m_sortedToUnsortedIndicies.
Referenced by buttonReleasedInRowHeader().
{ return m_sortedToUnsortedIndicies[iSortedRowNumber]; }
FWTextTableCellRenderer FWCollectionSummaryTableManager::m_bodyRenderer [mutable, private] |
Definition at line 71 of file FWCollectionSummaryTableManager.h.
Referenced by cellRenderer().
Definition at line 67 of file FWCollectionSummaryTableManager.h.
Referenced by buttonReleasedInRowHeader(), cellRenderer(), dataChanged(), FWCollectionSummaryTableManager(), getTitles(), implSort(), numberOfColumns(), numberOfRows(), and rowHeader().
FWCollectionSummaryModelCellRenderer FWCollectionSummaryTableManager::m_renderer [mutable, private] |
Definition at line 70 of file FWCollectionSummaryTableManager.h.
Referenced by buttonReleasedInRowHeader(), and rowHeader().
std::vector<int> FWCollectionSummaryTableManager::m_sortedToUnsortedIndicies [private] |
Definition at line 68 of file FWCollectionSummaryTableManager.h.
Referenced by cellRenderer(), dataChanged(), implSort(), rowHeader(), and unsortedRowNumber().
Definition at line 72 of file FWCollectionSummaryTableManager.h.
Referenced by buttonReleasedInRowHeader().