CMS 3D CMS Logo

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

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

Private Member Functions

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

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 33 of file FWAdapterHeaderTableManager.h.

Constructor & Destructor Documentation

FWAdapterHeaderTableManager::FWAdapterHeaderTableManager ( const FWTableManagerBase iTable)
FWAdapterHeaderTableManager::~FWAdapterHeaderTableManager ( )
virtual

Definition at line 42 of file FWAdapterHeaderTableManager.cc.

43 {
44 }
FWAdapterHeaderTableManager::FWAdapterHeaderTableManager ( const FWAdapterHeaderTableManager )
private

Member Function Documentation

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

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

91 {
92  if(iCol==m_sortedColumn) {
93  if(m_descendingSort) {
95  } else {
97  }
98  } else {
100  }
101  if(iCol < m_table->numberOfColumns()) {
102  m_renderer->setData( *(getTitles().begin()+iCol),false );
103  } else {
104  m_renderer->setData("",false);
105  }
106  return m_renderer;
107 }
virtual int numberOfColumns() const
Number of columns in the table.
void setSortOrder(fireworks::table::SortOrder)
virtual std::vector< std::string > getTitles() const
returns the title names for each column
FWColumnLabelCellRenderer * m_renderer
void setData(const std::string &, bool isSelected)
#define begin
Definition: vmac.h:31
std::vector< std::string > FWAdapterHeaderTableManager::getTitles ( ) const
virtual

returns the title names for each column

Implements FWTableManagerBase.

Definition at line 85 of file FWAdapterHeaderTableManager.cc.

References FWTableManagerBase::getTitles(), and m_table.

Referenced by cellRenderer().

85  {
86  return m_table->getTitles();
87 }
virtual std::vector< std::string > getTitles() const =0
returns the title names for each column
const FWTableManagerBase * m_table
void FWAdapterHeaderTableManager::implSort ( int  iCol,
bool  iSortOrder 
)
virtual

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

Implements FWTableManagerBase.

Definition at line 62 of file FWAdapterHeaderTableManager.cc.

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

63 {
64  m_sortedColumn=col;
66 }
bool sortOrder(void)
The current sort order for the table.
int FWAdapterHeaderTableManager::numberOfColumns ( ) const
virtual

Number of columns in the table.

Implements FWTableManagerBase.

Definition at line 75 of file FWAdapterHeaderTableManager.cc.

References m_table, and FWTableManagerBase::numberOfColumns().

Referenced by cellRenderer().

75 { return m_table->numberOfColumns();}
virtual int numberOfColumns() const =0
Number of columns in the table.
const FWTableManagerBase * m_table
int FWAdapterHeaderTableManager::numberOfRows ( ) const
virtual

Number of rows in the table.

Implements FWTableManagerBase.

Definition at line 72 of file FWAdapterHeaderTableManager.cc.

72 { return 1;}
const FWAdapterHeaderTableManager& FWAdapterHeaderTableManager::operator= ( const FWAdapterHeaderTableManager )
private
int FWAdapterHeaderTableManager::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 78 of file FWAdapterHeaderTableManager.cc.

79 {
80  return iRow;
81 }

Member Data Documentation

bool FWAdapterHeaderTableManager::m_descendingSort
private

Definition at line 61 of file FWAdapterHeaderTableManager.h.

Referenced by cellRenderer(), and implSort().

FWColumnLabelCellRenderer* FWAdapterHeaderTableManager::m_renderer
private

Definition at line 59 of file FWAdapterHeaderTableManager.h.

Referenced by cellRenderer().

int FWAdapterHeaderTableManager::m_sortedColumn
private

Definition at line 60 of file FWAdapterHeaderTableManager.h.

Referenced by cellRenderer(), and implSort().

const FWTableManagerBase* FWAdapterHeaderTableManager::m_table
private

Definition at line 58 of file FWAdapterHeaderTableManager.h.

Referenced by getTitles(), and numberOfColumns().