CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWTableManagerBase.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: TableWidget
4 // Class : FWTableManagerBase
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: Chris Jones
10 // Created: Mon Feb 2 16:40:44 EST 2009
11 // $Id: FWTableManagerBase.cc,v 1.6 2011/03/09 14:20:45 amraktad Exp $
12 //
13 
14 // system include files
15 
16 // user include files
19 
20 
21 //
22 // constants, enums and typedefs
23 //
24 
25 //
26 // static data member definitions
27 //
28 
29 //
30 // constructors and destructor
31 //
33 m_sortColumn(-1),
34 m_sortOrder(false)
35 {
36 }
37 
38 // FWTableManagerBase::FWTableManagerBase(const FWTableManagerBase& rhs)
39 // {
40 // // do actual copying here;
41 // }
42 
44 {
45 }
46 
47 //
48 // assignment operators
49 //
50 // const FWTableManagerBase& FWTableManagerBase::operator=(const FWTableManagerBase& rhs)
51 // {
52 // //An exception safe implementation is
53 // FWTableManagerBase temp(rhs);
54 // swap(rhs);
55 //
56 // return *this;
57 // }
58 
59 //
60 // member functions
61 //
62 void
63 FWTableManagerBase::sort(int col, bool sortOrder)
64 {
65  if(col <= numberOfColumns()) {
66  m_sortColumn = col;
68  implSort(col,sortOrder);
70  }
71 }
72 
74 {
75  if(-1 != m_sortColumn) {
77  }
78  Emit("dataChanged()");
79 }
80 
82 {
83  Emit("visualPropertiesChanged()");
84 }
85 
86 //
87 // const member functions
88 //
89 unsigned int FWTableManagerBase::cellHeight() const
90 {
92  if(cr) {
93  return cr->height();
94  }
95  if(hasRowHeaders()) {
96  cr = rowHeader(0);
97  if(cr) {
98  return cr->height();
99  }
100  }
101  return 0;
102 }
103 
104 std::vector<unsigned int> FWTableManagerBase::maxWidthForColumns() const
105 {
106  std::vector<unsigned int> returnValue;
107  returnValue.reserve(numberOfColumns());
108  const int numCols= numberOfColumns();
109  const int numRows = numberOfRows();
110  for(int col = 0; col < numCols; ++col) {
111  unsigned int max = 0;
112  for(int row=0; row < numRows; ++row) {
113  unsigned int width = cellRenderer(row,col)->width();
114  if(width > max) {
115  max = width;
116  }
117  }
118  returnValue.push_back(max);
119  }
120  return returnValue;
121 }
122 
124 {
125  return true;
126 }
127 
129 {
130  return false;
131 }
133 {
134  return 0;
135 }
136 
137 void
138 FWTableManagerBase::buttonPressedInRowHeader(Int_t row, Event_t* event, Int_t relX, Int_t relY)
139 {
140 }
141 void
142 FWTableManagerBase::buttonReleasedInRowHeader(Int_t row, Event_t* event, Int_t relX, Int_t relY)
143 {
144 }
145 
146 //
147 // static member functions
148 //
149 ClassImp(FWTableManagerBase)
virtual int numberOfColumns() const =0
Number of columns in the table.
virtual UInt_t width() const =0
returns the minimum width of the cell to which the renderer is representing
bool sortOrder(void)
The current sort order for the table.
virtual void implSort(int iCol, bool iSortOrder)=0
Called by &#39;sort&#39; method to actually handle the sorting of the rows. Arguments are the same as &#39;sort&#39;...
void sort(int iCol, bool iSortOrder)
Call to have table sorted on values in column iCol with the sort order being descending if iSortOrder...
void dataChanged()
Classes which inherit from FWTableManagerBase must call this when their underlying data changes...
virtual std::vector< unsigned int > maxWidthForColumns() const
for each column in the table this returns the present maximum width for that column ...
virtual bool hasLabelHeaders() const
virtual int numberOfRows() const =0
Number of rows in the table.
const T & max(const T &a, const T &b)
virtual FWTableCellRendererBase * cellRenderer(int iSortedRowNumber, int iCol) const =0
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
virtual void buttonReleasedInRowHeader(Int_t row, Event_t *event, Int_t relX, Int_t relY)
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.
virtual UInt_t height() const =0
returns the minimum height of the cell to which the renderer is representing
void visualPropertiesChanged()
Classes which inherit from FWTableManagerBase must call this when how the data is shown (e...
virtual unsigned int cellHeight() const
require all cells to be the same height
virtual FWTableCellRendererBase * rowHeader(int iSortedRowNumber) const
Returns the renderer for the row header for the sorted row number iSortedRowNumber.
virtual bool hasRowHeaders() const
Returns &#39;true&#39; if this table has row headers. Defaults return value is false.