CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
FWSummaryManager Class Reference

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

Public Member Functions

void colorsChanged ()
 
 FWSummaryManager (TGFrame *iParent, FWSelectionManager *, FWEventItemsManager *, FWGUIManager *, FWModelChangeManager *, FWColorManager *)
 
void requestForController (FWEventItem *)
 
void requestForError (FWEventItem *)
 
void requestForFilter (FWEventItem *)
 
void requestForInfo (FWEventItem *)
 
void requestForSelectedModelContextMenu (Int_t iGlobalX, Int_t iGlobalY)
 
TGCompositeFrame * widget () const
 
virtual ~FWSummaryManager ()
 

Private Member Functions

void changesDone ()
 
 FWSummaryManager (const FWSummaryManager &)=delete
 
void itemChanged (const FWEventItem *)
 
void itemDestroyed (const FWEventItem *)
 
void newItem (FWEventItem *iItem)
 
const FWSummaryManageroperator= (const FWSummaryManager &)=delete
 
void removeAllItems ()
 
void selectionChanged (const FWSelectionManager &)
 

Private Attributes

std::vector< FWCollectionSummaryWidget * > m_collectionWidgets
 
FWColorManagerm_colorManager
 
FWGUIManagerm_guiManager
 
bool m_itemChanged
 
TGCompositeFrame * m_pack
 

Detailed Description

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

Usage: <usage>

Definition at line 41 of file FWSummaryManager.h.

Constructor & Destructor Documentation

◆ FWSummaryManager() [1/2]

FWSummaryManager::FWSummaryManager ( TGFrame *  iParent,
FWSelectionManager sm,
FWEventItemsManager eim,
FWGUIManager gm,
FWModelChangeManager cm,
FWColorManager colorm 
)

Definition at line 43 of file FWSummaryManager.cc.

49  : m_guiManager(gm), m_colorManager(colorm), m_itemChanged(false) {
50  colorm->colorsHaveChanged_.connect(boost::bind(&FWSummaryManager::colorsChanged, this));
51  sm->selectionChanged_.connect(boost::bind(&FWSummaryManager::selectionChanged, this, _1));
52  eim->newItem_.connect(boost::bind(&FWSummaryManager::newItem, this, _1));
53  eim->goingToClearItems_.connect(boost::bind(&FWSummaryManager::removeAllItems, this));
55 
56  m_pack = new TGVerticalFrame(iParent);
57  m_pack->SetLayoutManager(new FWCompactVerticalLayout(m_pack));
58  const unsigned int backgroundColor = 0x2f2f2f;
59  m_pack->SetBackgroundColor(backgroundColor);
60  cm->changeSignalsAreDone_.connect(boost::bind(&FWSummaryManager::changesDone, this));
61 }

References changesDone(), FWModelChangeManager::changeSignalsAreDone_, colorsChanged(), FWColorManager::colorsHaveChanged_, FWEventItemsManager::goingToClearItems_, FWModelChangeManager::itemsGoingToBeClearedSlot(), m_pack, newItem(), FWEventItemsManager::newItem_, removeAllItems(), selectionChanged(), and FWSelectionManager::selectionChanged_.

◆ ~FWSummaryManager()

FWSummaryManager::~FWSummaryManager ( )
virtual

Definition at line 68 of file FWSummaryManager.cc.

68 {}

◆ FWSummaryManager() [2/2]

FWSummaryManager::FWSummaryManager ( const FWSummaryManager )
privatedelete

Member Function Documentation

◆ changesDone()

void FWSummaryManager::changesDone ( )
private

Definition at line 134 of file FWSummaryManager.cc.

134  {
135  if (m_itemChanged) {
136  m_pack->Layout();
137  m_itemChanged = false;
138  }
139 }

References m_itemChanged, and m_pack.

Referenced by FWSummaryManager().

◆ colorsChanged()

void FWSummaryManager::colorsChanged ( )

Definition at line 141 of file FWSummaryManager.cc.

141  {
142  bool backgroundIsWhite = m_colorManager->backgroundColorIndex() == FWColorManager::kWhiteIndex;
143 
145  m_pack->SetBackgroundColor(TGFrame::GetDefaultFrameBackground());
146  } else {
147  const unsigned int backgroundColor = 0x2f2f2f;
148  m_pack->SetBackgroundColor(backgroundColor);
149  }
150  gClient->NeedRedraw(m_pack);
151  for (std::vector<FWCollectionSummaryWidget*>::iterator it = m_collectionWidgets.begin(),
152  itEnd = m_collectionWidgets.end();
153  it != itEnd;
154  ++it) {
155  if (nullptr != *it) {
156  (*it)->setBackgroundToWhite(backgroundIsWhite);
157  }
158  }
159 }

References FWColorManager::backgroundColorIndex(), FWColorManager::isColorSetLight(), FWColorManager::kWhiteIndex, m_collectionWidgets, m_colorManager, and m_pack.

Referenced by FWSummaryManager().

◆ itemChanged()

void FWSummaryManager::itemChanged ( const FWEventItem )
private

Definition at line 113 of file FWSummaryManager.cc.

113 { m_itemChanged = true; }

References m_itemChanged.

Referenced by newItem().

◆ itemDestroyed()

void FWSummaryManager::itemDestroyed ( const FWEventItem iItem)
private

Definition at line 104 of file FWSummaryManager.cc.

104  {
105  m_pack->HideFrame(m_collectionWidgets[iItem->id()]);
106  m_pack->RemoveFrame(m_collectionWidgets[iItem->id()]);
107  delete m_collectionWidgets[iItem->id()];
108  m_collectionWidgets[iItem->id()] = nullptr;
109  m_pack->Layout();
110  gClient->NeedRedraw(m_pack);
111 }

References FWEventItem::id(), m_collectionWidgets, and m_pack.

Referenced by newItem().

◆ newItem()

void FWSummaryManager::newItem ( FWEventItem iItem)
private

Definition at line 85 of file FWSummaryManager.cc.

85  {
86  TGLayoutHints* hints = new TGLayoutHints(kLHintsExpandX);
88  m_pack->AddFrame(lst, hints);
89  m_collectionWidgets.push_back(lst);
91  lst->setBackgroundToWhite(backgroundIsWhite);
92  iItem->goingToBeDestroyed_.connect(boost::bind(&FWSummaryManager::itemDestroyed, this, _1));
93  iItem->itemChanged_.connect(boost::bind(&FWSummaryManager::itemChanged, this, _1));
94  lst->Connect("requestForInfo(FWEventItem*)", "FWSummaryManager", this, "requestForInfo(FWEventItem*)");
95  lst->Connect("requestForFilter(FWEventItem*)", "FWSummaryManager", this, "requestForFilter(FWEventItem*)");
96  lst->Connect("requestForErrorInfo(FWEventItem*)", "FWSummaryManager", this, "requestForError(FWEventItem*)");
97  lst->Connect("requestForController(FWEventItem*)", "FWSummaryManager", this, "requestForController(FWEventItem*)");
98  lst->Connect("requestForModelContextMenu(Int_t,Int_t)",
99  "FWSummaryManager",
100  this,
101  "requestForSelectedModelContextMenu(Int_t,Int_t)");
102 }

References FWColorManager::backgroundColorIndex(), FWEventItem::goingToBeDestroyed_, itemChanged(), FWEventItem::itemChanged_, itemDestroyed(), FWColorManager::kWhiteIndex, lst, m_collectionWidgets, m_colorManager, and m_pack.

Referenced by FWSummaryManager().

◆ operator=()

const FWSummaryManager& FWSummaryManager::operator= ( const FWSummaryManager )
privatedelete

◆ removeAllItems()

void FWSummaryManager::removeAllItems ( )
private

Definition at line 115 of file FWSummaryManager.cc.

115  {
116  for (std::vector<FWCollectionSummaryWidget*>::iterator it = m_collectionWidgets.begin(),
117  itEnd = m_collectionWidgets.end();
118  it != itEnd;
119  ++it) {
120  if (nullptr != *it) {
121  m_pack->HideFrame(*it);
122  m_pack->RemoveFrame(*it);
123  delete *it;
124  *it = nullptr;
125  }
126  }
127  m_collectionWidgets.clear();
128  m_pack->Layout();
129  gClient->NeedRedraw(m_pack);
130 }

References m_collectionWidgets, and m_pack.

Referenced by FWSummaryManager().

◆ requestForController()

void FWSummaryManager::requestForController ( FWEventItem iItem)

Definition at line 165 of file FWSummaryManager.cc.

References m_guiManager, and FWGUIManager::showEDIFrame().

◆ requestForError()

void FWSummaryManager::requestForError ( FWEventItem iItem)

Definition at line 163 of file FWSummaryManager.cc.

References m_guiManager, and FWGUIManager::showEDIFrame().

◆ requestForFilter()

void FWSummaryManager::requestForFilter ( FWEventItem iItem)

Definition at line 162 of file FWSummaryManager.cc.

References kFilter, m_guiManager, and FWGUIManager::showEDIFrame().

◆ requestForInfo()

void FWSummaryManager::requestForInfo ( FWEventItem iItem)

Definition at line 161 of file FWSummaryManager.cc.

References kData, m_guiManager, and FWGUIManager::showEDIFrame().

◆ requestForSelectedModelContextMenu()

void FWSummaryManager::requestForSelectedModelContextMenu ( Int_t  iGlobalX,
Int_t  iGlobalY 
)

Definition at line 167 of file FWSummaryManager.cc.

167  {
168  m_guiManager->showSelectedModelContextMenu(iGlobalX, iGlobalY, nullptr);
169 }

References m_guiManager, and FWGUIManager::showSelectedModelContextMenu().

◆ selectionChanged()

void FWSummaryManager::selectionChanged ( const FWSelectionManager iSM)
private

Definition at line 132 of file FWSummaryManager.cc.

132 {}

Referenced by FWSummaryManager().

◆ widget()

TGCompositeFrame * FWSummaryManager::widget ( ) const

Definition at line 174 of file FWSummaryManager.cc.

174 { return m_pack; }

References m_pack.

Referenced by FWGUIManager::createList().

Member Data Documentation

◆ m_collectionWidgets

std::vector<FWCollectionSummaryWidget*> FWSummaryManager::m_collectionWidgets
private

Definition at line 81 of file FWSummaryManager.h.

Referenced by colorsChanged(), itemDestroyed(), newItem(), and removeAllItems().

◆ m_colorManager

FWColorManager* FWSummaryManager::m_colorManager
private

Definition at line 83 of file FWSummaryManager.h.

Referenced by colorsChanged(), and newItem().

◆ m_guiManager

FWGUIManager* FWSummaryManager::m_guiManager
private

◆ m_itemChanged

bool FWSummaryManager::m_itemChanged
private

Definition at line 84 of file FWSummaryManager.h.

Referenced by changesDone(), and itemChanged().

◆ m_pack

TGCompositeFrame* FWSummaryManager::m_pack
private
FWSummaryManager::m_itemChanged
bool m_itemChanged
Definition: FWSummaryManager.h:84
FWSummaryManager::selectionChanged
void selectionChanged(const FWSelectionManager &)
Definition: FWSummaryManager.cc:132
FWColorManager::colorsHaveChanged_
sigc::signal< void > colorsHaveChanged_
Definition: FWColorManager.h:101
FWEventItem::goingToBeDestroyed_
FWItemChangeSignal goingToBeDestroyed_
Definition: FWEventItem.h:197
FWModelChangeManager::itemsGoingToBeClearedSlot
void itemsGoingToBeClearedSlot(void)
Definition: FWModelChangeManager.cc:170
FWColorManager::backgroundColorIndex
BackgroundColorIndex backgroundColorIndex() const
Definition: FWColorManager.cc:260
FWEventItem::id
unsigned int id() const
Definition: FWEventItem.cc:433
FWEventItemsManager::goingToClearItems_
sigc::signal< void > goingToClearItems_
Definition: FWEventItemsManager.h:75
FWSummaryManager::newItem
void newItem(FWEventItem *iItem)
Definition: FWSummaryManager.cc:85
FWModelChangeManager::changeSignalsAreDone_
sigc::signal< void > changeSignalsAreDone_
Definition: FWModelChangeManager.h:50
FWSummaryManager::itemDestroyed
void itemDestroyed(const FWEventItem *)
Definition: FWSummaryManager.cc:104
kData
Definition: FWDataCategories.h:26
FWSelectionManager::selectionChanged_
sigc::signal< void, const FWSelectionManager & > selectionChanged_
Definition: FWSelectionManager.h:53
lst
int lst[30]
Definition: CascadeWrapper.h:19
FWSummaryManager::colorsChanged
void colorsChanged()
Definition: FWSummaryManager.cc:141
FWSummaryManager::m_guiManager
FWGUIManager * m_guiManager
Definition: FWSummaryManager.h:82
FWGUIManager::showEDIFrame
void showEDIFrame(int iInfoToShow=-1)
Allowed values are -1 or ones from FWDataCategories enum.
Definition: FWGUIManager.cc:557
FWEventItem::itemChanged_
FWItemChangeSignal itemChanged_
Definition: FWEventItem.h:181
FWGUIManager::showSelectedModelContextMenu
void showSelectedModelContextMenu(Int_t iGlobalX, Int_t iGlobalY, FWViewContextMenuHandlerBase *iHandler)
Definition: FWGUIManager.cc:673
FWSummaryManager::changesDone
void changesDone()
Definition: FWSummaryManager.cc:134
FWSummaryManager::m_collectionWidgets
std::vector< FWCollectionSummaryWidget * > m_collectionWidgets
Definition: FWSummaryManager.h:81
FWCompactVerticalLayout
Definition: FWCompactVerticalLayout.h:28
kFilter
Definition: FWDataCategories.h:26
FWColorManager::kWhiteIndex
Definition: FWColorManager.h:73
FWSummaryManager::itemChanged
void itemChanged(const FWEventItem *)
Definition: FWSummaryManager.cc:113
FWSummaryManager::m_colorManager
FWColorManager * m_colorManager
Definition: FWSummaryManager.h:83
FWSummaryManager::removeAllItems
void removeAllItems()
Definition: FWSummaryManager.cc:115
FWEventItemsManager::newItem_
sigc::signal< void, FWEventItem * > newItem_
Definition: FWEventItemsManager.h:73
FWCollectionSummaryWidget
Definition: FWCollectionSummaryWidget.h:49
FWSummaryManager::m_pack
TGCompositeFrame * m_pack
Definition: FWSummaryManager.h:80
FWColorManager::isColorSetLight
Bool_t isColorSetLight() const
Definition: FWColorManager.h:58