Main Page
Namespaces
Classes
Package Documentation
Fireworks
TableWidget
src
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
16
#include "
Fireworks/TableWidget/src/FWAdapterHeaderTableManager.h
"
17
#include "
Fireworks/TableWidget/interface/FWColumnLabelCellRenderer.h
"
18
//
19
// constants, enums and typedefs
20
//
21
22
//
23
// static data member definitions
24
//
25
26
//
27
// constructors and destructor
28
//
29
FWAdapterHeaderTableManager::FWAdapterHeaderTableManager
(
const
FWTableManagerBase
* iTable) :
30
m_table(iTable),
31
m_renderer(new
FWColumnLabelCellRenderer
(&(
FWTextTableCellRenderer
::getDefaultGC()), iTable->cellDataIsSortable())),
32
m_sortedColumn(-1),
33
m_descendingSort(
true
)
34
{}
35
36
// FWAdapterHeaderTableManager::FWAdapterHeaderTableManager(const FWAdapterHeaderTableManager& rhs)
37
// {
38
// // do actual copying here;
39
// }
40
41
FWAdapterHeaderTableManager::~FWAdapterHeaderTableManager
()
42
{
43
}
44
45
//
46
// assignment operators
47
//
48
// const FWAdapterHeaderTableManager& FWAdapterHeaderTableManager::operator=(const FWAdapterHeaderTableManager& rhs)
49
// {
50
// //An exception safe implementation is
51
// FWAdapterHeaderTableManager temp(rhs);
52
// swap(rhs);
53
//
54
// return *this;
55
// }
56
57
//
58
// member functions
59
//
60
void
61
FWAdapterHeaderTableManager::implSort
(
int
col
,
bool
sortOrder
)
62
{
63
m_sortedColumn
=
col
;
64
m_descendingSort
=
sortOrder
;
65
}
66
67
//
68
// const member functions
69
//
70
int
71
FWAdapterHeaderTableManager::numberOfRows
()
const
{
return
1;}
72
73
int
74
FWAdapterHeaderTableManager::numberOfColumns
()
const
{
return
m_table
->
numberOfColumns
();}
75
76
int
77
FWAdapterHeaderTableManager::unsortedRowNumber
(
int
iRow)
const
78
{
79
return
iRow;
80
}
81
82
83
std::vector<std::string>
84
FWAdapterHeaderTableManager::getTitles
()
const
{
85
return
m_table
->
getTitles
();
86
}
87
88
FWTableCellRendererBase
*
89
FWAdapterHeaderTableManager::cellRenderer
(
int
/*iRow*/
,
int
iCol)
const
90
{
91
if
(iCol==
m_sortedColumn
) {
92
if
(
m_descendingSort
) {
93
m_renderer
->
setSortOrder
(
fireworks::table::kDescendingSort
);
94
}
else
{
95
m_renderer
->
setSortOrder
(
fireworks::table::kAscendingSort
);
96
}
97
}
else
{
98
m_renderer
->
setSortOrder
(
fireworks::table::kNotSorted
);
99
}
100
if
(iCol < m_table->
numberOfColumns
()) {
101
m_renderer
->
setData
( *(
getTitles
().
begin
()+iCol),
false
);
102
}
else
{
103
m_renderer
->
setData
(
""
,
false
);
104
}
105
return
m_renderer
;
106
}
107
108
//
109
// static member functions
110
//
FWAdapterHeaderTableManager::FWAdapterHeaderTableManager
FWAdapterHeaderTableManager(const FWTableManagerBase *)
Definition:
FWAdapterHeaderTableManager.cc:29
FWTableManagerBase::sortOrder
bool sortOrder(void)
The current sort order for the table.
Definition:
FWTableManagerBase.h:105
FWColumnLabelCellRenderer::setSortOrder
void setSortOrder(fireworks::table::SortOrder)
Definition:
FWColumnLabelCellRenderer.cc:80
FWColumnLabelCellRenderer
Definition:
FWColumnLabelCellRenderer.h:30
fireworks::table::kNotSorted
Definition:
SortOrder.h:29
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:77
FWAdapterHeaderTableManager::numberOfColumns
int numberOfColumns() const override
Number of columns in the table.
Definition:
FWAdapterHeaderTableManager.cc:74
FWAdapterHeaderTableManager::m_renderer
FWColumnLabelCellRenderer * m_renderer
Definition:
FWAdapterHeaderTableManager.h:58
FWAdapterHeaderTableManager::getTitles
std::vector< std::string > getTitles() const override
returns the title names for each column
Definition:
FWAdapterHeaderTableManager.cc:84
FWTableManagerBase
Definition:
FWTableManagerBase.h:44
FWTextTableCellRenderer
Definition:
FWTextTableCellRenderer.h:32
FWAdapterHeaderTableManager::cellRenderer
FWTableCellRendererBase * cellRenderer(int iRow, int iCol) const override
Definition:
FWAdapterHeaderTableManager.cc:89
funct::true
true
Definition:
Factorize.h:184
FWTableManagerBase::numberOfColumns
virtual int numberOfColumns() const =0
Number of columns in the table.
FWAdapterHeaderTableManager::m_sortedColumn
int m_sortedColumn
Definition:
FWAdapterHeaderTableManager.h:59
FWAdapterHeaderTableManager::m_table
const FWTableManagerBase * m_table
Definition:
FWAdapterHeaderTableManager.h:57
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:61
FWTableManagerBase::getTitles
virtual std::vector< std::string > getTitles() const =0
returns the title names for each column
FWTableCellRendererBase
Definition:
FWTableCellRendererBase.h:44
fireworks::table::kAscendingSort
Definition:
SortOrder.h:29
FWAdapterHeaderTableManager::numberOfRows
int numberOfRows() const override
Number of rows in the table.
Definition:
FWAdapterHeaderTableManager.cc:71
fireworks::table::kDescendingSort
Definition:
SortOrder.h:29
FWTextTableCellRenderer::setData
void setData(const std::string &, bool isSelected)
Definition:
FWTextTableCellRenderer.cc:105
FWAdapterHeaderTableManager::~FWAdapterHeaderTableManager
~FWAdapterHeaderTableManager() override
Definition:
FWAdapterHeaderTableManager.cc:41
FWAdapterHeaderTableManager.h
begin
#define begin
Definition:
vmac.h:30
cuy.col
col
Definition:
cuy.py:1008
FWAdapterHeaderTableManager::m_descendingSort
bool m_descendingSort
Definition:
FWAdapterHeaderTableManager.h:60
FWColumnLabelCellRenderer.h
Generated for CMSSW Reference Manual by
1.8.11