CMS 3D CMS Logo

FWAdapterHeaderTableManager.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: TableWidget
4 // Class : FWAdapterHeaderTableManager
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: Chris Jones
10 // Created: Mon Feb 2 16:44:45 EST 2009
11 //
12 
13 // system include files
14 
15 // user include files
18 //
19 // constants, enums and typedefs
20 //
21 
22 //
23 // static data member definitions
24 //
25 
26 //
27 // constructors and destructor
28 //
30  : m_table(iTable),
31  m_renderer(
32  new FWColumnLabelCellRenderer(&(FWTextTableCellRenderer::getDefaultGC()), iTable->cellDataIsSortable())),
33  m_sortedColumn(-1),
34  m_descendingSort(true) {}
35 
36 // FWAdapterHeaderTableManager::FWAdapterHeaderTableManager(const FWAdapterHeaderTableManager& rhs)
37 // {
38 // // do actual copying here;
39 // }
40 
42 
43 //
44 // assignment operators
45 //
46 // const FWAdapterHeaderTableManager& FWAdapterHeaderTableManager::operator=(const FWAdapterHeaderTableManager& rhs)
47 // {
48 // //An exception safe implementation is
49 // FWAdapterHeaderTableManager temp(rhs);
50 // swap(rhs);
51 //
52 // return *this;
53 // }
54 
55 //
56 // member functions
57 //
58 void FWAdapterHeaderTableManager::implSort(int col, bool sortOrder) {
61 }
62 
63 //
64 // const member functions
65 //
67 
69 
70 int FWAdapterHeaderTableManager::unsortedRowNumber(int iRow) const { return iRow; }
71 
72 std::vector<std::string> FWAdapterHeaderTableManager::getTitles() const { return m_table->getTitles(); }
73 
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 }
91 
92 //
93 // static member functions
94 //
FWAdapterHeaderTableManager::~FWAdapterHeaderTableManager
~FWAdapterHeaderTableManager() override
Definition: FWAdapterHeaderTableManager.cc:41
FWAdapterHeaderTableManager::m_sortedColumn
int m_sortedColumn
Definition: FWAdapterHeaderTableManager.h:57
FWColumnLabelCellRenderer
Definition: FWColumnLabelCellRenderer.h:30
FWAdapterHeaderTableManager::FWAdapterHeaderTableManager
FWAdapterHeaderTableManager(const FWTableManagerBase *)
Definition: FWAdapterHeaderTableManager.cc:29
FWAdapterHeaderTableManager.h
cuy.col
col
Definition: cuy.py:1010
FWAdapterHeaderTableManager::implSort
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'.
Definition: FWAdapterHeaderTableManager.cc:58
FWTextTableCellRenderer
Definition: FWTextTableCellRenderer.h:32
FWAdapterHeaderTableManager::getTitles
std::vector< std::string > getTitles() const override
returns the title names for each column
Definition: FWAdapterHeaderTableManager.cc:72
FWColumnLabelCellRenderer.h
FWAdapterHeaderTableManager::m_descendingSort
bool m_descendingSort
Definition: FWAdapterHeaderTableManager.h:58
fireworks::table::kNotSorted
Definition: SortOrder.h:29
FWTableManagerBase
Definition: FWTableManagerBase.h:44
funct::true
true
Definition: Factorize.h:173
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.
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
FWTableCellRendererBase
Definition: FWTableCellRendererBase.h:44
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
FWAdapterHeaderTableManager::numberOfRows
int numberOfRows() const override
Number of rows in the table.
Definition: FWAdapterHeaderTableManager.cc:66
fireworks::table::kAscendingSort
Definition: SortOrder.h:29
FWAdapterHeaderTableManager::cellRenderer
FWTableCellRendererBase * cellRenderer(int iRow, int iCol) const override
Definition: FWAdapterHeaderTableManager.cc:74
FWAdapterHeaderTableManager::unsortedRowNumber
int unsortedRowNumber(int) const override
when passed the index to the sorted order of the rows it returns the original row number from the und...
Definition: FWAdapterHeaderTableManager.cc:70
FWAdapterHeaderTableManager::m_renderer
FWColumnLabelCellRenderer * m_renderer
Definition: FWAdapterHeaderTableManager.h:56
begin
#define begin
Definition: vmac.h:32