CMS 3D CMS Logo

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

#include <Fireworks/TableWidget/interface/FWAdapterHeaderTableManager.h>

Inheritance diagram for FWAdapterHeaderTableManager:
FWTableManagerBase

Public Member Functions

FWTableCellRendererBasecellRenderer (int iRow, int iCol) const override
 
 FWAdapterHeaderTableManager (const FWTableManagerBase *)
 
std::vector< std::string > getTitles () const override
 returns the title names for each column More...
 
void implSort (int col, bool sortOrder) override
 Called by 'sort' method to actually handle the sorting of the rows. Arguments are the same as 'sort'. 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) const override
 when passed the index to the sorted order of the rows it returns the original row number from the underlying data More...
 
 ~FWAdapterHeaderTableManager () 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
 

Private Member Functions

 FWAdapterHeaderTableManager (const FWAdapterHeaderTableManager &)=delete
 
const FWAdapterHeaderTableManageroperator= (const FWAdapterHeaderTableManager &)=delete
 

Private Attributes

bool m_descendingSort
 
FWColumnLabelCellRendererm_renderer
 
int m_sortedColumn
 
const FWTableManagerBasem_table
 

Additional Inherited Members

Detailed Description

Description: a TableManager used to pass the header info of another table as the body of this table

Usage: This class is an implementation detail of how the FWTableWidget handles the column headers. The drawing of the column headers is done by the same widget as handles the drawing of the body. The FWAdapterHeaderTableManager is used to make the header information appear to be just another table so that it works with the above mentioned widget.

Definition at line 32 of file FWAdapterHeaderTableManager.h.

Constructor & Destructor Documentation

◆ FWAdapterHeaderTableManager() [1/2]

FWAdapterHeaderTableManager::FWAdapterHeaderTableManager ( const FWTableManagerBase iTable)

Definition at line 29 of file FWAdapterHeaderTableManager.cc.

◆ ~FWAdapterHeaderTableManager()

FWAdapterHeaderTableManager::~FWAdapterHeaderTableManager ( )
override

Definition at line 41 of file FWAdapterHeaderTableManager.cc.

41 {}

◆ FWAdapterHeaderTableManager() [2/2]

FWAdapterHeaderTableManager::FWAdapterHeaderTableManager ( const FWAdapterHeaderTableManager )
privatedelete

Member Function Documentation

◆ cellRenderer()

FWTableCellRendererBase * FWAdapterHeaderTableManager::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 74 of file FWAdapterHeaderTableManager.cc.

74  {
75  if (iCol == m_sortedColumn) {
76  if (m_descendingSort) {
78  } else {
80  }
81  } else {
83  }
84  if (iCol < m_table->numberOfColumns()) {
85  m_renderer->setData(*(getTitles().begin() + iCol), false);
86  } else {
87  m_renderer->setData("", false);
88  }
89  return m_renderer;
90 }

References begin, getTitles(), fireworks::table::kAscendingSort, fireworks::table::kDescendingSort, fireworks::table::kNotSorted, m_descendingSort, m_renderer, m_sortedColumn, numberOfColumns(), FWTextTableCellRenderer::setData(), and FWColumnLabelCellRenderer::setSortOrder().

◆ getTitles()

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

returns the title names for each column

Implements FWTableManagerBase.

Definition at line 72 of file FWAdapterHeaderTableManager.cc.

72 { return m_table->getTitles(); }

References FWTableManagerBase::getTitles(), and m_table.

Referenced by cellRenderer().

◆ implSort()

void FWAdapterHeaderTableManager::implSort ( int  iCol,
bool  iSortOrder 
)
overridevirtual

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

Implements FWTableManagerBase.

Definition at line 58 of file FWAdapterHeaderTableManager.cc.

58  {
61 }

References cuy::col, m_descendingSort, m_sortedColumn, and FWTableManagerBase::sortOrder().

◆ numberOfColumns()

int FWAdapterHeaderTableManager::numberOfColumns ( ) const
overridevirtual

Number of columns in the table.

Implements FWTableManagerBase.

Definition at line 68 of file FWAdapterHeaderTableManager.cc.

68 { return m_table->numberOfColumns(); }

References m_table, and FWTableManagerBase::numberOfColumns().

Referenced by cellRenderer().

◆ numberOfRows()

int FWAdapterHeaderTableManager::numberOfRows ( ) const
overridevirtual

Number of rows in the table.

Implements FWTableManagerBase.

Definition at line 66 of file FWAdapterHeaderTableManager.cc.

66 { return 1; }

◆ operator=()

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

◆ unsortedRowNumber()

int FWAdapterHeaderTableManager::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 70 of file FWAdapterHeaderTableManager.cc.

70 { return iRow; }

Member Data Documentation

◆ m_descendingSort

bool FWAdapterHeaderTableManager::m_descendingSort
private

Definition at line 58 of file FWAdapterHeaderTableManager.h.

Referenced by cellRenderer(), and implSort().

◆ m_renderer

FWColumnLabelCellRenderer* FWAdapterHeaderTableManager::m_renderer
private

Definition at line 56 of file FWAdapterHeaderTableManager.h.

Referenced by cellRenderer().

◆ m_sortedColumn

int FWAdapterHeaderTableManager::m_sortedColumn
private

Definition at line 57 of file FWAdapterHeaderTableManager.h.

Referenced by cellRenderer(), and implSort().

◆ m_table

const FWTableManagerBase* FWAdapterHeaderTableManager::m_table
private

Definition at line 55 of file FWAdapterHeaderTableManager.h.

Referenced by getTitles(), and numberOfColumns().

FWAdapterHeaderTableManager::m_sortedColumn
int m_sortedColumn
Definition: FWAdapterHeaderTableManager.h:57
FWColumnLabelCellRenderer
Definition: FWColumnLabelCellRenderer.h:30
cuy.col
col
Definition: cuy.py:1010
FWAdapterHeaderTableManager::getTitles
std::vector< std::string > getTitles() const override
returns the title names for each column
Definition: FWAdapterHeaderTableManager.cc:72
FWAdapterHeaderTableManager::m_descendingSort
bool m_descendingSort
Definition: FWAdapterHeaderTableManager.h:58
fireworks::table::kNotSorted
Definition: SortOrder.h:29
FWAdapterHeaderTableManager::numberOfColumns
int numberOfColumns() const override
Number of columns in the table.
Definition: FWAdapterHeaderTableManager.cc:68
FWTableManagerBase::numberOfColumns
virtual int numberOfColumns() const =0
Number of columns in the table.
FWTextTableCellRenderer::getDefaultGC
static const TGGC & getDefaultGC()
Definition: FWTextTableCellRenderer.cc:128
fireworks::table::kDescendingSort
Definition: SortOrder.h:29
FWColumnLabelCellRenderer::setSortOrder
void setSortOrder(fireworks::table::SortOrder)
Definition: FWColumnLabelCellRenderer.cc:74
FWAdapterHeaderTableManager::m_table
const FWTableManagerBase * m_table
Definition: FWAdapterHeaderTableManager.h:55
FWTableManagerBase::cellDataIsSortable
virtual bool cellDataIsSortable() const
Definition: FWTableManagerBase.h:81
FWTableManagerBase::getTitles
virtual std::vector< std::string > getTitles() const =0
returns the title names for each column
FWTableManagerBase::sortOrder
bool sortOrder(void)
The current sort order for the table.
Definition: FWTableManagerBase.h:102
FWTextTableCellRenderer::setData
void setData(const std::string &, bool isSelected)
Definition: FWTextTableCellRenderer.cc:98
fireworks::table::kAscendingSort
Definition: SortOrder.h:29
FWAdapterHeaderTableManager::m_renderer
FWColumnLabelCellRenderer * m_renderer
Definition: FWAdapterHeaderTableManager.h:56
begin
#define begin
Definition: vmac.h:32