CMS 3D CMS Logo

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

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

Inheritance diagram for FWCollectionSummaryTableManager:
FWTableManagerBase

Public Member Functions

void buttonReleasedInRowHeader (Int_t row, Event_t *event, Int_t relX, Int_t relY) override
 
FWTableCellRendererBasecellRenderer (int iSortedRowNumber, int iCol) const override
 
 FWCollectionSummaryTableManager (FWEventItem *iCollection, const TGGC *iContext, const TGGC *iHighlightContext, FWCollectionSummaryWidget *)
 
std::vector< std::string > getTitles () const override
 returns the title names for each column More...
 
bool hasRowHeaders () const override
 Returns 'true' if this table has row headers. Defaults return value is false. More...
 
int numberOfColumns () const override
 Number of columns in the table. More...
 
int numberOfRows () const override
 Number of rows in the table. More...
 
FWTableCellRendererBaserowHeader (int iSortedRowNumber) const override
 Returns the renderer for the row header for the sorted row number iSortedRowNumber. 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...
 
 ~FWCollectionSummaryTableManager () 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 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 std::vector< unsigned int > maxWidthForColumns () const
 for each column in the table this returns the present maximum width for that column 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
 Called by 'sort' method to actually handle the sorting of the rows. Arguments are the same as 'sort'. More...
 

Private Member Functions

void dataChanged ()
 
 FWCollectionSummaryTableManager (const FWCollectionSummaryTableManager &)=delete
 
const FWCollectionSummaryTableManageroperator= (const FWCollectionSummaryTableManager &)=delete
 

Private Attributes

FWTextTableCellRenderer m_bodyRenderer
 
FWEventItemm_collection
 
FWCollectionSummaryModelCellRenderer m_renderer
 
std::vector< int > m_sortedToUnsortedIndicies
 
FWCollectionSummaryWidgetm_widget
 

Detailed Description

Description: <one line="" class="" summary>="">

Usage: <usage>

Definition at line 35 of file FWCollectionSummaryTableManager.h.

Constructor & Destructor Documentation

FWCollectionSummaryTableManager::FWCollectionSummaryTableManager ( FWEventItem iCollection,
const TGGC *  iContext,
const TGGC *  iHighlightContext,
FWCollectionSummaryWidget iWidget 
)

Definition at line 35 of file FWCollectionSummaryTableManager.cc.

References FWEventItem::changed_, dataChanged(), FWTableManagerBase::dataChanged(), FWEventItem::itemChanged_, m_collection, and FWEventItem::modelType().

36  :
37  m_collection(iItem),
38  m_renderer(iContext,iHighlightContext),
39  m_bodyRenderer(iContext, iHighlightContext, FWTextTableCellRenderer::kJustifyRight),
40  m_widget(iWidget)
41 {
42  m_collection->changed_.connect(boost::bind(&FWTableManagerBase::dataChanged,this));
44 
45  //try to find the default columns
46  std::vector<std::pair<std::string,std::string> > s_names;
47  edm::TypeWithDict type(*(m_collection->modelType()->GetTypeInfo()));
48 
49 
50  dataChanged();
51 }
type
Definition: HCALResponse.h:21
FWCollectionSummaryModelCellRenderer m_renderer
void dataChanged()
Classes which inherit from FWTableManagerBase must call this when their underlying data changes...
FWItemChangeSignal itemChanged_
Definition: FWEventItem.h:202
FWModelChangeSignal changed_
Definition: FWEventItem.h:199
const TClass * modelType() const
Definition: FWEventItem.cc:566
FWCollectionSummaryTableManager::~FWCollectionSummaryTableManager ( )
override
FWCollectionSummaryTableManager::FWCollectionSummaryTableManager ( const FWCollectionSummaryTableManager )
privatedelete

Member Function Documentation

void FWCollectionSummaryTableManager::buttonReleasedInRowHeader ( Int_t  row,
Event_t *  event,
Int_t  relX,
Int_t  relY 
)
overridevirtual

Reimplemented from FWTableManagerBase.

Definition at line 110 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().

111 {
112  Int_t realRow = unsortedRowNumber(row);
113  int hit = m_renderer.clickHit(relX,relY);
115  return;
116  }
118  m_widget->itemColorClicked(realRow,event->fXRoot, event->fYRoot+12-relY);
119  return;
120  }
124  dp.setIsVisible(!dp.isVisible());
125  }
126  m_collection->setDisplayProperties(realRow,dp);
127 }
FWCollectionSummaryModelCellRenderer m_renderer
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:68
void setDisplayProperties(int iIndex, const FWDisplayProperties &) const
Definition: FWEventItem.cc:278
void itemColorClicked(int iIndex, Int_t iRootX, Int_t iRootY)
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:540
void setIsVisible(bool iSet)
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: event.py:1
FWTableCellRendererBase * FWCollectionSummaryTableManager::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 159 of file FWCollectionSummaryTableManager.cc.

References alignBH_cfg::fixed, FWEventItem::ModelInfo::isSelected(), m_bodyRenderer, m_collection, m_sortedToUnsortedIndicies, FWEventItem::modelData(), FWEventItem::modelInfo(), FWItemValueGetter::numValues(), FWItemValueGetter::precision(), alignCSCRings::s, FWTextTableCellRenderer::setData(), FWEventItem::size(), findQualityFiles::v, FWItemValueGetter::valueFor(), and FWEventItem::valueGetter().

160 {
162  return nullptr;
163  }
164  if(iSortedRowNumber >= static_cast<int>(m_collection->size())) {
165  m_bodyRenderer.setData("",false);
166  return &m_bodyRenderer;
167  }
168  int index = m_sortedToUnsortedIndicies[iSortedRowNumber];
169  std::stringstream s;
170  s.setf(std::ios_base::fixed,std::ios_base::floatfield);
171  s.precision( m_collection->valueGetter().precision(iCol));
172  double v = m_collection->valueGetter().valueFor(m_collection->modelData(index), iCol);
173  s <<v;
175  return &m_bodyRenderer;
176 }
const FWItemValueGetter & valueGetter() const
one value from the model which is normally used for the popup
Definition: FWEventItem.h:119
bool isSelected() const
Definition: FWEventItem.h:71
void setData(const std::string &, bool isSelected)
size_t size() const
Definition: FWEventItem.cc:553
double valueFor(const void *, int idx) const
const void * modelData(int iIndex) const
Definition: FWEventItem.cc:572
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:540
UInt_t precision(int idx) const
void FWCollectionSummaryTableManager::dataChanged ( void  )
private

Definition at line 197 of file FWCollectionSummaryTableManager.cc.

References FWTableManagerBase::dataChanged(), mps_fire::i, m_collection, m_sortedToUnsortedIndicies, and FWEventItem::size().

Referenced by FWCollectionSummaryTableManager().

198 {
201  for(int i=0; i< static_cast<int>(m_collection->size());++i) {
202  m_sortedToUnsortedIndicies.push_back(i);
203  }
205 }
void dataChanged()
Classes which inherit from FWTableManagerBase must call this when their underlying data changes...
size_t size() const
Definition: FWEventItem.cc:553
std::vector< std::string > FWCollectionSummaryTableManager::getTitles ( ) const
overridevirtual

returns the title names for each column

Implements FWTableManagerBase.

Definition at line 144 of file FWCollectionSummaryTableManager.cc.

References FWItemValueGetter::getTitles(), m_collection, and FWEventItem::valueGetter().

144  {
145 
146 
147 
148  //return titles;
149  return m_collection->valueGetter().getTitles();
150 }
const FWItemValueGetter & valueGetter() const
one value from the model which is normally used for the popup
Definition: FWEventItem.h:119
std::vector< std::string > getTitles() const
bool FWCollectionSummaryTableManager::hasRowHeaders ( ) const
overridevirtual

Returns 'true' if this table has row headers. Defaults return value is false.

Reimplemented from FWTableManagerBase.

Definition at line 179 of file FWCollectionSummaryTableManager.cc.

180 {
181  return true;
182 }
void FWCollectionSummaryTableManager::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 98 of file FWCollectionSummaryTableManager.cc.

References m_collection, m_sortedToUnsortedIndicies, alignCSCRings::s, and FWEventItem::valueGetter().

99 {
100  if(iSortOrder) {
101  std::multimap<double,int, std::greater<double> > s;
103  } else {
104  std::multimap<double,int, std::less<double> > s;
106  }
107 }
const FWItemValueGetter & valueGetter() const
one value from the model which is normally used for the popup
Definition: FWEventItem.h:119
int FWCollectionSummaryTableManager::numberOfColumns ( ) const
overridevirtual

Number of columns in the table.

Implements FWTableManagerBase.

Definition at line 139 of file FWCollectionSummaryTableManager.cc.

References m_collection, FWItemValueGetter::numValues(), and FWEventItem::valueGetter().

139  {
140  return m_collection->valueGetter().numValues();
141 }
const FWItemValueGetter & valueGetter() const
one value from the model which is normally used for the popup
Definition: FWEventItem.h:119
int FWCollectionSummaryTableManager::numberOfRows ( ) const
overridevirtual

Number of rows in the table.

Implements FWTableManagerBase.

Definition at line 133 of file FWCollectionSummaryTableManager.cc.

References m_collection, and FWEventItem::size().

134 {
135  return m_collection->size();
136 }
size_t size() const
Definition: FWEventItem.cc:553
const FWCollectionSummaryTableManager& FWCollectionSummaryTableManager::operator= ( const FWCollectionSummaryTableManager )
privatedelete
FWTableCellRendererBase * FWCollectionSummaryTableManager::rowHeader ( int  iSortedRowNumber) const
overridevirtual

Returns the renderer for the row header for the sorted row number iSortedRowNumber.

Reimplemented from FWTableManagerBase.

Definition at line 185 of file FWCollectionSummaryTableManager.cc.

References m_collection, m_renderer, m_sortedToUnsortedIndicies, FWCollectionSummaryModelCellRenderer::setData(), and FWEventItem::size().

186 {
187  if(iSortedRowNumber >= static_cast<int>(m_collection->size())) {
188  return nullptr;
189  }
190  int index = m_sortedToUnsortedIndicies[iSortedRowNumber];
192  index);
193  return &m_renderer;
194 }
FWCollectionSummaryModelCellRenderer m_renderer
size_t size() const
Definition: FWEventItem.cc:553
void setData(const FWEventItem *iItem, int iIndex)
int FWCollectionSummaryTableManager::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 153 of file FWCollectionSummaryTableManager.cc.

References m_sortedToUnsortedIndicies.

Referenced by buttonReleasedInRowHeader().

154 {
155  return m_sortedToUnsortedIndicies[iSortedRowNumber];
156 }

Member Data Documentation

FWTextTableCellRenderer FWCollectionSummaryTableManager::m_bodyRenderer
mutableprivate

Definition at line 70 of file FWCollectionSummaryTableManager.h.

Referenced by cellRenderer().

FWEventItem* FWCollectionSummaryTableManager::m_collection
private
FWCollectionSummaryModelCellRenderer FWCollectionSummaryTableManager::m_renderer
mutableprivate

Definition at line 69 of file FWCollectionSummaryTableManager.h.

Referenced by buttonReleasedInRowHeader(), and rowHeader().

std::vector<int> FWCollectionSummaryTableManager::m_sortedToUnsortedIndicies
private
FWCollectionSummaryWidget* FWCollectionSummaryTableManager::m_widget
private

Definition at line 71 of file FWCollectionSummaryTableManager.h.

Referenced by buttonReleasedInRowHeader().