CMS 3D CMS Logo

Public Member Functions | Protected Attributes | Private Member Functions | Friends

FWTableView Class Reference

#include <Fireworks/Core/interface/FWTableView.h>

Inheritance diagram for FWTableView:
FWViewBase FWConfigurableParameterizable FWParameterizable FWConfigurable

List of all members.

Public Member Functions

void addColumn ()
virtual void addTo (FWConfiguration &) const
void columnSelected (Int_t iCol, Int_t iButton, Int_t iKeyMod)
void dataChanged ()
void deleteColumn ()
 FWTableView (TEveWindowSlot *, FWTableViewManager *)
const FWEventItemitem () const
void modelSelected (Int_t iRow, Int_t iButton, Int_t iKeyMod, Int_t, Int_t)
void modifyColumn ()
void resetColors (const class FWColorManager &)
virtual void saveImageTo (const std::string &iName) const
void selectCollection (Int_t)
void setBackgroundColor (Color_t)
virtual void setFrom (const FWConfiguration &)
void toggleShowHide ()
void updateEvaluators ()
void updateItems ()
virtual ~FWTableView ()

Protected Attributes

TGComboBox * m_collection
TGCompositeFrame * m_column_control
FWGUIValidatingTextEntrym_column_expr_field
TGTextEntry * m_column_name_field
TGTextEntry * m_column_prec_field
FWCustomIconsButtonm_columnUIButton
int m_currentColumn
TEveWindowFrame * m_eveWindow
int m_iColl
FWTableViewManagerm_manager
bool m_showColumnUI
FWTableViewTableManagerm_tableManager
FWTableWidgetm_tableWidget
bool m_useColumnsFromConfig
FWExpressionValidatorm_validator
TGCompositeFrame * m_vert

Private Member Functions

 FWTableView (const FWTableView &)
const FWTableViewoperator= (const FWTableView &)

Friends

class FWTableViewTableManager

Detailed Description

Description: <one line="" class="" summary>="">

Usage: <usage>

Definition at line 51 of file FWTableView.h.


Constructor & Destructor Documentation

FWTableView::FWTableView ( TEveWindowSlot *  iParent,
FWTableViewManager manager 
)

Definition at line 206 of file FWTableView.cc.

References arrow_right(), arrow_right_disabled(), FWColorManager::background(), FWViewManagerBase::colorManager(), errorMatrix2Lands::header, diffTwoXMLs::label, m_collection, m_column_control, m_column_expr_field, m_column_name_field, m_column_prec_field, m_columnUIButton, m_eveWindow, m_manager, m_tableManager, m_tableWidget, m_validator, m_vert, resetColors(), FWTableWidget::SetHeaderBackgroundColor(), FWGUIValidatingTextEntry::setValidator(), and updateItems().

       : FWViewBase(FWViewType::kTable),
       m_iColl(-1),
       m_manager(manager),
       m_tableManager(new FWTableViewTableManager(this)),
       m_tableWidget(0),
       m_showColumnUI(false),
       m_validator(new FWExpressionValidator),
       m_currentColumn(-1),
       m_useColumnsFromConfig(false)

{
     m_eveWindow = iParent->MakeFrame(0);
     TGCompositeFrame *frame = m_eveWindow->GetGUICompositeFrame();
//      TGHorizontalFrame *buttons = new TGHorizontalFrame(frame);
//      frame->AddFrame(buttons, new TGLayoutHints(kLHintsTop | kLHintsExpandX));

//      m_collection = new TGComboBox(buttons);
     m_vert = new TGVerticalFrame(frame);
     frame->AddFrame(m_vert, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
     TGHorizontalFrame *header = new TGHorizontalFrame(m_vert);
     m_vert->AddFrame(header, new TGLayoutHints(kLHintsTop | kLHintsExpandX));
     const bool bgIsBlack = m_manager->colorManager().background() == kBlack;
     m_columnUIButton = new FWCustomIconsButton(header, 
                                                arrow_right(bgIsBlack),
                                                arrow_right_disabled(bgIsBlack),
                                                arrow_right_disabled(bgIsBlack));
     m_columnUIButton->Connect("Clicked()", "FWTableView", this, "toggleShowHide()");
     header->AddFrame(m_columnUIButton, new TGLayoutHints(kLHintsCenterY | kLHintsLeft,6,10));

     TGCompositeFrame *labfr = new TGHorizontalFrame(header, 60, 25, kFixedSize);
     TGLabel *label = new TGLabel(labfr, "Collection");
     labfr->AddFrame(label,  new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 1,3,0,0));
     header->AddFrame(labfr, new TGLayoutHints(kLHintsLeft));

     m_collection = new TGComboBox(header);
     updateItems();
     header->AddFrame(m_collection, new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY));
     m_collection->Connect("Selected(Int_t)", "FWTableView", this, "selectCollection(Int_t)");
     m_collection->Select(2, true);
     m_column_control = new TGVerticalFrame(m_vert);
     m_vert->AddFrame(m_column_control, new TGLayoutHints(kLHintsExpandX));
     TGLabel *column_control_label = new TGLabel(m_column_control, "Column editor");
//      column_control_label->SetBackgroundColor(bgIsBlack ? kBlack : kWhite);
//      column_control_label->SetForegroundColor(bgIsBlack ? kWhite : kBlack);
//      column_control_label->SetTextColor(bgIsBlack ? kWhite : kBlack);
     m_column_control->AddFrame(column_control_label, new TGLayoutHints(kLHintsExpandX));
     TGHorizontalFrame *column_control_fields = new TGHorizontalFrame(m_column_control);
     m_column_control->AddFrame(column_control_fields, new TGLayoutHints(kLHintsExpandX));
     m_column_name_field = new TGTextEntry(column_control_fields);
     m_column_name_field->SetMaxWidth(10);
     m_column_expr_field = new FWGUIValidatingTextEntry(column_control_fields);
//      m_column_expr_field->SetEnabled(kFALSE);
     m_column_expr_field->setValidator(m_validator);
     m_column_prec_field = new TGTextEntry(column_control_fields);
     m_column_prec_field->SetMaxWidth(10);
     TGLabel *name_label = new TGLabel(column_control_fields, "Title");
     TGLabel *expr_label = new TGLabel(column_control_fields, "Expression");
     TGLabel *prec_label = new TGLabel(column_control_fields, "Precision");
     column_control_fields->AddFrame(name_label, new TGLayoutHints(kLHintsBottom, 1, 1, 2, 2));
     column_control_fields->AddFrame(m_column_name_field, new TGLayoutHints(kLHintsExpandX));
     column_control_fields->AddFrame(expr_label, new TGLayoutHints(kLHintsBottom, 1, 1, 2, 2));
     column_control_fields->AddFrame(m_column_expr_field, new TGLayoutHints(kLHintsExpandX));
     column_control_fields->AddFrame(prec_label, new TGLayoutHints( kLHintsBottom, 1, 1, 2, 2)); 
     column_control_fields->AddFrame(m_column_prec_field, new TGLayoutHints(kLHintsExpandX));
     TGTextButton *add_button = new TGTextButton(column_control_fields, "Add");
     TGTextButton *del_button = new TGTextButton(column_control_fields, "Delete");
     TGTextButton *mod_button = new TGTextButton(column_control_fields, "Modify");
     add_button->Connect("Clicked()", "FWTableView", this, "addColumn()");
     del_button->Connect("Clicked()", "FWTableView", this, "deleteColumn()");
     mod_button->Connect("Clicked()", "FWTableView", this, "modifyColumn()");
     column_control_fields->AddFrame(add_button, new TGLayoutHints);
     column_control_fields->AddFrame(del_button, new TGLayoutHints);
     column_control_fields->AddFrame(mod_button, new TGLayoutHints);
     m_tableWidget = new FWTableWidget(m_tableManager, m_vert);
     resetColors(m_manager->colorManager());
     m_tableWidget->SetHeaderBackgroundColor(gVirtualX->GetPixel(kWhite));
     m_tableWidget->Connect("rowClicked(Int_t,Int_t,Int_t,Int_t,Int_t)", "FWTableView",
                            this, "modelSelected(Int_t,Int_t,Int_t,Int_t,Int_t)");
     m_tableWidget->Connect("columnClicked(Int_t,Int_t,Int_t)", "FWTableView",
                            this, "columnSelected(Int_t,Int_t,Int_t)");
     m_vert->AddFrame(m_tableWidget, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
     frame->MapSubwindows();
     m_vert->HideFrame(m_column_control);
     frame->Layout();
     frame->MapWindow();
}
FWTableView::~FWTableView ( ) [virtual]

Definition at line 294 of file FWTableView.cc.

References m_eveWindow, m_tableManager, m_validator, and m_vert.

{
     // take out composite frame and delete it directly ( without the timeout) 
     TGCompositeFrame *frame = m_eveWindow->GetGUICompositeFrame();
     frame->RemoveFrame(m_vert);
     delete m_vert;

     m_eveWindow->DestroyWindowAndSlot();
     delete m_tableManager;
     delete m_validator;
}
FWTableView::FWTableView ( const FWTableView ) [private]

Member Function Documentation

void FWTableView::addColumn ( )

Definition at line 667 of file FWTableView.cc.

References FWTableViewManager::dataChanged(), alignCSCRings::e, FWTableWidget::forceLayout(), fwLog, fwlog::kInfo, m_column_expr_field, m_column_name_field, m_column_prec_field, m_currentColumn, m_manager, FWTableViewTableManager::m_tableFormats, m_tableManager, m_tableWidget, and mergeVDriftHistosByStation::name.

{
     std::string name = m_column_name_field->GetText();
     std::string expr = m_column_expr_field->GetText();
     // convert the precision to a long int
     char *endptr = 0;
     int prec = (int) strtol(m_column_prec_field->GetText(), &endptr, 0);
     if (name == "" || expr == "" || 
         m_column_prec_field->GetText() == 0 || *endptr != 0) {
        fwLog(fwlog::kInfo) << "bad input\n";
          fflush(stdout);
          return;
     }
     fwLog(fwlog::kInfo) << "adding column "<<  name << ": " << expr << ", precision " << prec << std::endl;
     fflush(stdout);
//      m_manager->tableFormats(*item->modelType())
     FWTableViewManager::TableEntry e = { expr, name, prec };
     m_tableManager->m_tableFormats->push_back(e);
     m_currentColumn = (int)m_tableManager->m_tableFormats->size() + 1;
     // change needs to be propagated to all tables, because all
     // tables displaying objects of this type are affected
     // MT -- this is NOT true!!! FIX
     m_tableWidget->forceLayout();
     m_manager->dataChanged();
}
void FWTableView::addTo ( FWConfiguration iTo) const [virtual]

Reimplemented from FWConfigurableParameterizable.

Definition at line 336 of file FWTableView.cc.

References FWConfiguration::addKeyValue(), FWTableViewManager::addToImpl(), runEdmFileComparison::collection, ecaldqm::collectionName, FWTableWidget::descendingSort(), FWTableViewManager::items(), kCollection, kDescendingSort, kSortColumn, kTableView, m_iColl, m_manager, m_tableWidget, FWTableViewManager::m_views, main(), and FWTableWidget::sortedColumn().

{
     // are we the first FWTableView to go into the configuration?  If
     // we are, then we are responsible for writing out the list of
     // types (which we do by letting FWTableViewManager::addToImpl
     // write into our configuration)
     if (this == m_manager->m_views.front().get())
          m_manager->addToImpl(iTo);
     // then there is the stuff we have to do anyway: remember what
     // collection we display
     FWConfiguration main(1);
     std::string collectionName;
     if (m_manager->items()[m_iColl])
        collectionName = m_manager->items()[m_iColl]->name();
     else
        collectionName = "NULL";

     FWConfiguration collection(collectionName);
     main.addKeyValue(kCollection, collection);
     FWConfiguration sortColumn(m_tableWidget->sortedColumn());
     main.addKeyValue(kSortColumn, sortColumn);
     FWConfiguration descendingSort(m_tableWidget->descendingSort());
     main.addKeyValue(kDescendingSort, descendingSort);
//      FWConfiguration columns(1);
//      for (std::vector<FWTableViewManager::TableEntry>::const_iterator 
//             i = m_tableManager->m_tableFormats->begin(),
//             iEnd = m_tableManager->m_tableFormats->end();
//        i != iEnd; ++i) {
//        columns.addValue(i->name);
//        columns.addValue(i->expression);
//        char prec[100];
//        snprintf(prec, 100, "%d", i->precision);
//        columns.addValue(prec);
//      }
//      main.addKeyValue(kColumns, columns);
     iTo.addKeyValue(kTableView, main);
     // take care of parameters
     FWConfigurableParameterizable::addTo(iTo);
}
void FWTableView::columnSelected ( Int_t  iCol,
Int_t  iButton,
Int_t  iKeyMod 
)
void FWTableView::dataChanged ( )

Definition at line 585 of file FWTableView.cc.

References FWTableViewTableManager::dataChanged(), m_tableManager, and updateEvaluators().

Referenced by FWTableViewManager::notifyViews(), and selectCollection().

{
//      const FWEventItem *item = m_manager->items()[m_iColl];
     updateEvaluators();
     m_tableManager->dataChanged();
//      std::vector<FWExpressionEvaluator> &ev = m_evaluators;
//      for (unsigned int i = 0; i < item->size(); ++i) {
//        for (unsigned int j = 0; j < ev.size(); ++j) {
//             printf("%s = %f\t", (*m_manager->tableFormats(item->modelType()->GetName())).second[j].name.c_str(),
//                    ev[j].evalExpression(item->modelData(i)));
//        }
//        printf("\n");
//      }
//      fflush(stdout);
}
void FWTableView::deleteColumn ( )

Definition at line 693 of file FWTableView.cc.

References FWTableViewManager::dataChanged(), FWTableWidget::forceLayout(), m_column_expr_field, m_column_name_field, m_column_prec_field, m_currentColumn, m_manager, FWTableViewTableManager::m_tableFormats, m_tableManager, and m_tableWidget.

{
     if (m_currentColumn >= 0 && 
         m_currentColumn < (int)m_tableManager->m_tableFormats->size()) {
          m_tableManager->m_tableFormats->erase(m_tableManager->m_tableFormats->begin() + 
                                               m_currentColumn);
          m_column_name_field->SetText("");
          m_column_expr_field->SetText("");
          m_column_prec_field->SetText("");
          m_currentColumn = -1;
     }
     // change needs to be propagated to all tables, because all
     // tables displaying objects of this type are affected
     // MT -- this is NOT true!!! FIX
     m_tableWidget->forceLayout();
     m_manager->dataChanged();
}
const FWEventItem * FWTableView::item ( ) const
void FWTableView::modelSelected ( Int_t  iRow,
Int_t  iButton,
Int_t  iKeyMod,
Int_t  iGlobalX,
Int_t  iGlobalY 
)

Definition at line 634 of file FWTableView.cc.

References FWSelectionManager::clearSelection(), item(), FWViewBase::openSelectedModelContextMenu_, FWEventItem::select(), FWEventItem::selectionManager(), and FWEventItem::toggleSelect().

{
     if(iKeyMod & kKeyControlMask) {      
          item()->toggleSelect(iRow);
     } else {
          FWChangeSentry sentry(*(item()->changeManager()));
          item()->selectionManager()->clearSelection();
          item()->select(iRow);
     }
   if(iButton == kButton3) {
      openSelectedModelContextMenu_(iGlobalX,iGlobalY);
   }
}
void FWTableView::modifyColumn ( )

Definition at line 711 of file FWTableView.cc.

References FWTableViewManager::dataChanged(), alignCSCRings::e, FWTableWidget::forceLayout(), fwLog, fwlog::kInfo, m_column_expr_field, m_column_name_field, m_column_prec_field, m_currentColumn, m_manager, FWTableViewTableManager::m_tableFormats, m_tableManager, m_tableWidget, and mergeVDriftHistosByStation::name.

{
     std::string name = m_column_name_field->GetText();
     std::string expr = m_column_expr_field->GetText();
     // convert the precision to a long int
     char *endptr = 0;
     int prec = (int) strtol(m_column_prec_field->GetText(), &endptr, 0);
     if (name == "" || expr == "" || 
         m_column_prec_field->GetText() == 0 || *endptr != 0) {
        fwLog(fwlog::kInfo) << "bad input\n";
          fflush(stdout);
          return;
     }
     fwLog(fwlog::kInfo) << "modify column "<<  name << ": " << expr << ", precision " << prec << std::endl;
     fflush(stdout);
//      m_manager->tableFormats(*item->modelType())
     FWTableViewManager::TableEntry e = { expr, name, prec };
     m_tableManager->m_tableFormats->at(m_currentColumn) = e;
     // Change needs to be propagated to all tables, because all
     // tables displaying objects of this type are affected
     // MT -- this is NOT true!!! FIX
     m_tableWidget->forceLayout();
     m_manager->dataChanged();
}
const FWTableView& FWTableView::operator= ( const FWTableView ) [private]
void FWTableView::resetColors ( const class FWColorManager )

Definition at line 314 of file FWTableView.cc.

References FWColorManager::background(), FWColorManager::foreground(), m_tableWidget, FWTableWidget::SetBackgroundColor(), and FWTableWidget::SetLineSeparatorColor().

Referenced by FWTableView().

{
     m_tableWidget->SetBackgroundColor(gVirtualX->GetPixel(manager.background()));
//      m_tableWidget->SetHeaderBackgroundColor(gVirtualX->GetPixel(manager.background()));
//      switch (manager.foreground()) {
//      case FWColorManager::kBlackIndex:
//        m_tableWidget->SetHeaderForegroundColor(gVirtualX->GetPixel(kBlack));
//        break;
//      default:
//        m_tableWidget->SetHeaderForegroundColor(0xffffff);
//        break;
//      }
     m_tableWidget->SetLineSeparatorColor(gVirtualX->GetPixel(manager.foreground()));
//      m_tableWidget->dataChanged();
}
void FWTableView::saveImageTo ( const std::string &  iName) const [virtual]

Implements FWViewBase.

Definition at line 443 of file FWTableView.cc.

References trackerHits::c, FWTableViewTableManager::cellRenderer(), gather_cfg::cout, data, FWTextTableCellRenderer::data(), cmsPerfStripChart::format, FWTableViewTableManager::m_tableFormats, m_tableManager, FWTableViewTableManager::numberOfColumns(), FWTableViewTableManager::numberOfRows(), alignCSCRings::r, confdb::splitter(), and FWTableViewTableManager::unsortedRowNumber().

{
   TString format; 
   TString data;
   FWTextTableCellRenderer* textRenderer;

   // calculate widths
   int ndheader = TMath::Ceil(TMath::Log10(m_tableManager->numberOfRows()));
  
   std::vector<size_t> widths(m_tableManager->numberOfColumns());

   for (int c = 0; c < m_tableManager->numberOfColumns(); ++c )
      widths[c] = m_tableManager->m_tableFormats->at(c).name.size();
   
   for (int c = 0; c < m_tableManager->numberOfColumns(); ++c )
   {
      for (int r = 0; r < m_tableManager->numberOfRows(); r++ )
      {
         textRenderer = (FWTextTableCellRenderer*) m_tableManager->cellRenderer(r, c); // setup cell renderer
         size_t ss = textRenderer->data().size();
         if (widths[c] < ss) widths[c] = ss;
      }
   }

   int rlen = 0;
   for (size_t c = 0; c < (size_t)m_tableManager->numberOfColumns(); ++c )
      rlen += widths[c]; 
   rlen += (m_tableManager->numberOfColumns() -1 )*3 ;
   rlen++;


   // header
   printf("\n"); 
   TString headerFormat;
   headerFormat.Form("%%%ds",ndheader +3);
   data.Form(headerFormat, "  ");
   printf("%s", data.Data());

   int lastCol = m_tableManager->numberOfColumns() -1;

   for (int c = 0; c < m_tableManager->numberOfColumns(); ++c )
   {
      format.Form("%%%ds", (int)widths[c]);
      data.Form(format, m_tableManager->m_tableFormats->at(c).name.c_str());

      if (c == lastCol) 
         printf("%s", data.Data());
      else
         printf("%s | ", data.Data());
   }
   printf("\n"); 

   std::string splitter(rlen, '-');
   std::cout << splitter << std::endl;

   // body
   headerFormat.Form("[%%%dd] ",ndheader );
   for (int r = 0; r < m_tableManager->numberOfRows(); r++ )
   {
      for (int c = 0; c < m_tableManager->numberOfColumns(); ++c )
        {
         if (!c) {
            data.Form(headerFormat, m_tableManager->unsortedRowNumber(r));
            printf("%s", data.Data());
         }
         format.Form("%%%ds", (int)widths[c]);
         textRenderer = (FWTextTableCellRenderer*) m_tableManager->cellRenderer(r, c); // setup cell renderer
         data.Form(format, textRenderer->data().c_str());
         if (c == lastCol) 
            printf("%s", data.Data());
         else
            printf("%s | ", data.Data());
      }
      printf("\n");
   }
}
void FWTableView::selectCollection ( Int_t  i_coll)

Select the collection to be displayed by the table view and updates the evaluators required to retrieve the data from the event.

Definition at line 606 of file FWTableView.cc.

References dataChanged(), FWTableWidget::forceLayout(), fwLog, item(), FWTableViewManager::items(), fwlog::kInfo, m_iColl, m_manager, FWTableViewTableManager::m_tableFormats, FWTableViewManager::m_tableFormats, m_tableManager, m_tableWidget, m_useColumnsFromConfig, m_validator, FWEventItem::modelType(), edm::second(), FWExpressionValidator::setType(), and FWTableViewManager::tableFormats().

{
//      printf("selected collection %d, ", i_coll);
     const FWEventItem *item = m_manager->items()[i_coll];
     assert(0!=item);
//      printf("%s\n", item->modelType()->GetName());
     m_iColl = i_coll;
//      m_validator = new FWExpressionValidator;
//      m_column_expr_field->setValidator(m_validator);
     if (m_validator != 0) {
//        std::cout << "setting validator to " << item->modelType()->GetName() << std::endl;
          m_validator->setType(Reflex::Type::ByTypeInfo(*(item->modelType()->GetTypeInfo())));
     } else {
//        std::cout << "can't set null validator\n";
     }
     if (not m_useColumnsFromConfig) {
          if (m_manager->tableFormats(*item->modelType()) == m_manager->m_tableFormats.end()) {
               fwLog(fwlog::kInfo) << "No table format for objects of this type " << item->modelType()->GetName() << std::endl;
               m_tableManager->m_tableFormats->clear();
          } else {
               m_tableManager->m_tableFormats = &m_manager->tableFormats(*item->modelType())->second;
          }
     }
//      columnSelected(-1, 1, 0);
     if (m_tableWidget) m_tableWidget->forceLayout();
     dataChanged();
}
void FWTableView::setBackgroundColor ( Color_t  iColor)

Definition at line 307 of file FWTableView.cc.

References m_tableWidget, and FWTableWidget::SetBackgroundColor().

{
     m_tableWidget->SetBackgroundColor(gVirtualX->GetPixel(iColor));
//      m_tableWidget->SetBackgroundColor(TColor::Number2Pixel(iColor));
//    m_viewer->GetGLViewer()->SetClearColor(iColor);
}
void FWTableView::setFrom ( const FWConfiguration iFrom) [virtual]

Reimplemented from FWConfigurableParameterizable.

Definition at line 377 of file FWTableView.cc.

References dtNoiseDBValidation_cfg::cerr, runEdmFileComparison::collection, ecaldqm::collectionName, FWTableViewManager::items(), kCollection, kDescendingSort, kSortColumn, kTableView, m_collection, m_manager, m_tableManager, m_tableWidget, FWTableViewManager::m_views, main(), FWTableViewTableManager::numberOfColumns(), FWTableViewManager::setFrom(), python::multivaluedict::sort(), FWTableWidget::sort(), FWConfiguration::value(), FWConfiguration::valueForKey(), and FWConfiguration::version().

{
     if (this == m_manager->m_views.front().get())
          m_manager->setFrom(iFrom);
     try {
          const FWConfiguration *main = iFrom.valueForKey(kTableView);
          assert(main != 0);
          // use the columns from the config, not the default columns for
          // the collection type
//        m_useColumnsFromConfig = true;
//        m_tableManager->m_tableFormats->clear();
//        const FWConfiguration *columns = main->valueForKey(kColumns);
//        for (FWConfiguration::StringValuesIt it = columns->stringValues()->begin(),
//                  itEnd = columns->stringValues()->end(); it != itEnd; ++it) {
//             const std::string &name = *it++;
//             const std::string &expr = *it++;
//             int prec = atoi(it->c_str());
//             FWTableViewManager::TableEntry e = { expr, name, prec };
//             m_tableManager->m_tableFormats->push_back(e);
//        }
          const FWConfiguration *collection = main->valueForKey(kCollection);
          const std::string &collectionName = collection->value();
          // find item 
          for (std::vector<const FWEventItem *>::const_iterator 
                    it = m_manager->items().begin(), 
                    itEnd = m_manager->items().end();
               it != itEnd; ++it) {
               if (*it && (*it)->name() == collectionName) {
                    m_collection->Select(it - m_manager->items().begin(), true);
                    break;
               }
          }
          const FWConfiguration *sortColumn = main->valueForKey(kSortColumn);
          const FWConfiguration *descendingSort = main->valueForKey(kDescendingSort);
          if (sortColumn != 0 && descendingSort != 0) {
               unsigned int sort = sortColumn->version();
               bool descending = descendingSort->version();
               if (sort < (( unsigned int) m_tableManager->numberOfColumns()))
                    m_tableWidget->sort(sort, descending);
          }
     } catch (...) {
          // configuration doesn't contain info for the table.  Be forgiving.
          std::cerr << "This configuration file contains tables, but no column information.  "
               "(It is probably old.)  Using defaults." << std::endl;
     }

//      main.addKeyValue(kCollection, collection);
//      FWConfiguration columns(1);
//      for (std::vector<FWTableViewManager::TableEntry>::const_iterator 
//             i = m_tableManager->m_tableFormats->begin(),
//             iEnd = m_tableManager->m_tableFormats->end();
//        i != iEnd; ++i) {
//        columns.addValue(i->name);
//        columns.addValue(i->expression);
//        columns.addValue(Form("%d", i->precision));
//      }
//      main.addKeyValue(kColumns, columns);
//      iTo.addKeyValue(kTableView, main);
//      // take care of parameters
//      FWConfigurableParameterizable::addTo(iTo);

     // take care of parameters
     FWConfigurableParameterizable::setFrom(iFrom);
}
void FWTableView::toggleShowHide ( )

Definition at line 521 of file FWTableView.cc.

References arrow_down(), arrow_down_disabled(), arrow_right(), arrow_right_disabled(), FWColorManager::background(), FWViewManagerBase::colorManager(), m_column_control, m_columnUIButton, m_manager, m_showColumnUI, m_vert, and FWCustomIconsButton::swapIcons().

{
     m_showColumnUI = not m_showColumnUI;
     const TGPicture* picture = 0;
     const TGPicture* down = 0;
     const TGPicture* disabled = 0;
     const bool bgIsBlack = m_manager->colorManager().background() == kBlack;
     if (m_showColumnUI) {
          picture = arrow_down(bgIsBlack);
          down = arrow_down_disabled(bgIsBlack);
          disabled = arrow_down_disabled(bgIsBlack);
          m_vert->ShowFrame(m_column_control);
     } else {
          picture = arrow_right(bgIsBlack);
          down = arrow_right_disabled(bgIsBlack);
          disabled = arrow_right_disabled(bgIsBlack);
          m_vert->HideFrame(m_column_control);
     }
     m_vert->Layout();
     m_columnUIButton->swapIcons(picture,down,disabled);
}
void FWTableView::updateEvaluators ( )
void FWTableView::updateItems ( void  )

Reconstructs the combo box using the information coming from FWEventItemsManager.

Definition at line 546 of file FWTableView.cc.

References alignCSCRings::e, i, getHLTprescales::index, item(), FWTableViewManager::items(), m_collection, m_iColl, m_manager, siStripFEDMonitor_P5_cff::Min, and FWEventItem::name().

Referenced by FWTableView(), and FWTableViewManager::notifyViews().

{
   int selected = m_collection->GetSelected();
   m_collection->RemoveAll();
   int index = 0;

   for (size_t i = 0, e = m_manager->items().size(); i != e; ++i)
   {
      const FWEventItem *item = m_manager->items()[i];
      if (item) 
         m_collection->AddEntry(item->name().c_str(), i);

      if (m_iColl == index && 0 == item) 
      {
         //the collection we were showing is now gone
         m_iColl = -1;
         selected = -1;
      }
   }

   if (selected != -1 && selected < m_collection->GetNumberOfEntries())
      m_collection->Select(selected, false);

   TGListBox *lb  = m_collection->GetListBox();
   lb->SetHeight(TMath::Min(lb->GetNumberOfEntries()*lb->GetItemVsize() + 2*lb->GetBorderWidth(), 200u));
}

Friends And Related Function Documentation

friend class FWTableViewTableManager [friend]

Definition at line 52 of file FWTableView.h.


Member Data Documentation

TGComboBox* FWTableView::m_collection [protected]

Definition at line 88 of file FWTableView.h.

Referenced by FWTableView(), setFrom(), and updateItems().

TGCompositeFrame * FWTableView::m_column_control [protected]

Definition at line 89 of file FWTableView.h.

Referenced by FWTableView(), and toggleShowHide().

Definition at line 97 of file FWTableView.h.

Referenced by addColumn(), columnSelected(), deleteColumn(), FWTableView(), and modifyColumn().

TGTextEntry* FWTableView::m_column_name_field [protected]

Definition at line 96 of file FWTableView.h.

Referenced by addColumn(), columnSelected(), deleteColumn(), FWTableView(), and modifyColumn().

TGTextEntry* FWTableView::m_column_prec_field [protected]

Definition at line 99 of file FWTableView.h.

Referenced by addColumn(), columnSelected(), deleteColumn(), FWTableView(), and modifyColumn().

Definition at line 95 of file FWTableView.h.

Referenced by FWTableView(), and toggleShowHide().

Definition at line 100 of file FWTableView.h.

Referenced by addColumn(), columnSelected(), deleteColumn(), and modifyColumn().

TEveWindowFrame* FWTableView::m_eveWindow [protected]

Definition at line 87 of file FWTableView.h.

Referenced by FWTableView(), and ~FWTableView().

int FWTableView::m_iColl [protected]
bool FWTableView::m_showColumnUI [protected]

Definition at line 94 of file FWTableView.h.

Referenced by toggleShowHide().

Definition at line 101 of file FWTableView.h.

Referenced by selectCollection().

Definition at line 98 of file FWTableView.h.

Referenced by FWTableView(), selectCollection(), and ~FWTableView().

TGCompositeFrame* FWTableView::m_vert [protected]

Definition at line 89 of file FWTableView.h.

Referenced by FWTableView(), toggleShowHide(), and ~FWTableView().