CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/Fireworks/TableWidget/src/FWAdapterHeaderTableManager.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:     TableWidget
00004 // Class  :     FWAdapterHeaderTableManager
00005 // 
00006 // Implementation:
00007 //     <Notes on implementation>
00008 //
00009 // Original Author:  Chris Jones
00010 //         Created:  Mon Feb  2 16:44:45 EST 2009
00011 // $Id: FWAdapterHeaderTableManager.cc,v 1.2 2009/03/04 15:34:41 chrjones Exp $
00012 //
00013 
00014 // system include files
00015 
00016 // user include files
00017 #include "Fireworks/TableWidget/src/FWAdapterHeaderTableManager.h"
00018 #include "Fireworks/TableWidget/interface/FWColumnLabelCellRenderer.h"
00019 
00020 //
00021 // constants, enums and typedefs
00022 //
00023 
00024 //
00025 // static data member definitions
00026 //
00027 
00028 //
00029 // constructors and destructor
00030 //
00031 FWAdapterHeaderTableManager::FWAdapterHeaderTableManager(const FWTableManagerBase* iTable) :
00032 m_table(iTable), 
00033 m_renderer(new FWColumnLabelCellRenderer), 
00034 m_sortedColumn(-1),
00035 m_descendingSort(true) 
00036 {}
00037 
00038 // FWAdapterHeaderTableManager::FWAdapterHeaderTableManager(const FWAdapterHeaderTableManager& rhs)
00039 // {
00040 //    // do actual copying here;
00041 // }
00042 
00043 FWAdapterHeaderTableManager::~FWAdapterHeaderTableManager()
00044 {
00045 }
00046 
00047 //
00048 // assignment operators
00049 //
00050 // const FWAdapterHeaderTableManager& FWAdapterHeaderTableManager::operator=(const FWAdapterHeaderTableManager& rhs)
00051 // {
00052 //   //An exception safe implementation is
00053 //   FWAdapterHeaderTableManager temp(rhs);
00054 //   swap(rhs);
00055 //
00056 //   return *this;
00057 // }
00058 
00059 //
00060 // member functions
00061 //
00062 void 
00063 FWAdapterHeaderTableManager::implSort(int col, bool sortOrder) 
00064 { 
00065    m_sortedColumn=col;
00066    m_descendingSort=sortOrder;
00067 }
00068 
00069 //
00070 // const member functions
00071 //
00072 int 
00073 FWAdapterHeaderTableManager::numberOfRows() const { return 1;}
00074 
00075 int 
00076 FWAdapterHeaderTableManager::numberOfColumns() const { return m_table->numberOfColumns();}
00077 
00078 int 
00079 FWAdapterHeaderTableManager::unsortedRowNumber(int iRow) const
00080 {
00081    return iRow;
00082 }
00083 
00084 
00085 std::vector<std::string> 
00086 FWAdapterHeaderTableManager::getTitles() const {
00087    return m_table->getTitles();
00088 }
00089 
00090 FWTableCellRendererBase* 
00091 FWAdapterHeaderTableManager::cellRenderer(int /*iRow*/, int iCol) const
00092 {
00093    if(iCol==m_sortedColumn) {
00094       if(m_descendingSort) {
00095          m_renderer->setSortOrder(fireworks::table::kDescendingSort);         
00096       } else {
00097          m_renderer->setSortOrder(fireworks::table::kAscendingSort);         
00098       }
00099    } else {
00100       m_renderer->setSortOrder(fireworks::table::kNotSorted);
00101    }
00102    if(iCol < m_table->numberOfColumns()) {
00103       m_renderer->setData( *(getTitles().begin()+iCol),false );
00104    } else {
00105       m_renderer->setData("",false);
00106    }
00107    return m_renderer;
00108 }
00109 
00110 //
00111 // static member functions
00112 //