28 #include "AliCodeTimer.h"
30 #include <Riostream.h>
31 #include <TApplication.h>
34 #include <TGComboBox.h>
35 #include <TGFileDialog.h>
37 #include <TObjArray.h>
38 #include <TObjString.h>
39 #include <TGButtonGroup.h>
58 : TGCompositeFrame(p,w,h,kVerticalFrame),
59 fNavigationFrame(0x0),
60 fPainterMatrixFrame(0x0),
67 fCurrentNavigationPosition(-1),
68 fAttPainterSelectorFrame(0x0)
72 UInt_t wi = w - fgkBorderSize*2;
73 UInt_t hi = h - fgkBorderSize*3;
75 fNavigationFrame =
new TGHorizontalFrame(
this,wi);
77 AddFrame(fNavigationFrame,
new TGLayoutHints(kLHintsExpandX|kLHintsTop,
78 fgkBorderSize,fgkBorderSize,
79 fgkBorderSize,fgkBorderSize));
81 fBackButton =
new TGPictureButton(fNavigationFrame,
82 gClient->GetPicture(
"tb_back.xpm"));
84 fForwardButton =
new TGPictureButton(fNavigationFrame,
85 gClient->GetPicture(
"tb_forw.xpm"));
87 fPrintMeButton =
new TGTextButton(fNavigationFrame,
"Print");
88 fPrintAsButton =
new TGTextButton(fNavigationFrame,
"Print As...");
92 fGroupTitle =
new TGLabel(fNavigationFrame,
"");
94 fNavigationFrame->AddFrame(fBackButton,
new TGLayoutHints(kLHintsCenterY));
95 fNavigationFrame->AddFrame(fForwardButton,
new TGLayoutHints(kLHintsCenterY));
97 fNavigationFrame->AddFrame(fAttPainterSelectorFrame,
new TGLayoutHints(kLHintsCenterY,10));
99 fNavigationFrame->AddFrame(fPrintMeButton,
new TGLayoutHints(kLHintsCenterY,10));
100 fNavigationFrame->AddFrame(fPrintAsButton,
new TGLayoutHints(kLHintsCenterY,10));
102 fAttPainterSelectorFrame->Connect(
"Clicked(AliMUONAttPainter*)",
103 "AliMUONPainterMasterFrame",
105 "AttributesChanged(AliMUONAttPainter*)");
107 fNavigationFrame->AddFrame(fGroupTitle,
new TGLayoutHints(kLHintsExpandX|kLHintsCenterX|kLHintsCenterY,10));
109 fForwardButton->Connect(
"Clicked()",
"AliMUONPainterMasterFrame",
113 fBackButton->Connect(
"Clicked()",
"AliMUONPainterMasterFrame",
117 fPrintMeButton->Connect(
"Clicked()",
"AliMUONPainterMasterFrame",
121 fPrintAsButton->Connect(
"Clicked()",
"AliMUONPainterMasterFrame",
127 UInt_t h1 = hi - 7*12;
129 MakeTopPainterMatrix(w1,h1,matrix);
131 AddFrame(fPainterMatrixFrame,
new TGLayoutHints(kLHintsExpandX,
132 fgkBorderSize,fgkBorderSize,
139 "AliMUONPainterMasterFrame",
141 "PainterMatrixWantToShow(AliMUONPainterMatrix*)");
143 fPainterMatrixFrame->DataSourceWasChanged(matrix->DataPattern().Data(),matrix->Data(),matrix->DataIndex());
173 Int_t alreadyThere(-1);
175 for ( Int_t j = 0; j <
fNavigation.GetSize(); ++j )
200 new TGFileDialog(gClient->GetRoot(),gClient->GetRoot(),
203 if ( fileInfo.fFilename )
205 SaveAs(gSystem->ExpandPathName(Form(
"%s",fileInfo.fFilename)),
"RECREATE");
237 painterMatrix->
Connect(
"Clicked(AliMUONVPainter*,Double_t*)",
238 "AliMUONPainterMasterFrame",
this,
239 "Clicked(AliMUONVPainter*,Double_t*)");
241 painterMatrix->
Connect(
"ShiftClicked(AliMUONVPainter*,Double_t*)",
242 "AliMUONPainterMasterFrame",
this,
243 "ShiftClicked(AliMUONVPainter*,Double_t*)");
246 "AliMUONPainterMasterFrame",
this,
247 "ChangeTitle(const char*)");
338 TString basename(Form(
"%s-DUAL",painter->
GetName()));
372 new TGMsgBox(gClient->GetRoot(),
this,
373 "Invalid combination",
"Cannot create 2 views from this painter",
374 kMBIconExclamation, kMBOk, &ret);
382 p2->UpdateGroupsFrom(*(painter->
Master()));
392 if ( area.GetDimensionX() > 1.2*area.GetDimensionY() )
407 currentMatrix->
Data(),
457 AliError(
"Cannot work without a painterMatrix");
493 new TGMsgBox(gClient->GetRoot(),
this,
494 "Invalid combination",
"Change of attributes not possible for this object",
495 kMBIconExclamation, kMBOk, &ret);
512 matrix = currentMatrix->
Clone(a);
518 currentMatrix->
Data(),
const char * Whatname() const
void PainterMatrixWantToShow(AliMUONPainterMatrix *group)
virtual const char * GetName() const
Get matrix name.
Widget to select the painter(s) view type.
TGLabel * fGroupTitle
top title
AliMUONVPainter * Detach() const
void UpdateAttributes(const AliMUONPainterMatrix &painterMatrix)
void ShowPainterMatrix(AliMUONPainterMatrix *group)
void SetNavigation(Int_t i)
void ShiftClicked(AliMUONVPainter *painter, Double_t *values)
virtual Bool_t CanBeDetached() const
Whether this painter can be detached from the current view.
virtual TString Name() const
Get our name.
virtual void SetResponder(const char *pattern)
A rectangle area positioned in plane..
void ChangeTitle(const char *newTitle)
virtual const char * GetName() const
Get our name.
static void SetBackgroundColor(const char *resourceBaseName, TGWindow &window)
static std::string NameIt(const char *what, const char *basename, const AliMUONAttPainter &att)
Int_t Register(AliMUONPainterMatrix *group)
void AddPainterMatrix(AliMUONPainterMatrix *group)
void Use(AliMUONPainterMatrix *group)
Int_t ID0() const
Get our first ID.
static AliMUONVPainter * CreatePainter(const char *className, const AliMUONAttPainter &att, Int_t id1, Int_t id2)
static AliMUONPainterRegistry * Instance()
void Connect(const char *sourceMethod, const char *destClassName, void *destObject, const char *destMethod)
const AliMUONAttPainter & Attributes() const
Get our attributes.
Int_t ID1() const
Get our second ID.
Base class for a graphical object representing some part of the MUON tracking system.
Int_t FindIndexOf(AliMUONPainterMatrix *group) const
const char * Basename() const
Base name (short name)
AliMUONPainterMatrix * Clone(const AliMUONAttPainter &attributes) const
void SetCathodeAndPlaneDisabled(Bool_t value)
AliMUONVPainter * Master() const
TGButton * fForwardButton
navigation forward
AliMpArea Area() const
Return the area containing this painter.
The main window for the offline "a la mood" display.
AliMUONAttPainter Validate(const AliMUONAttPainter &att) const
Normalize attributes.
AliMUONVTrackerData * Data() const
void Adopt(AliMUONVPainter *painter)
Adopt a painter in this matrix.
AliMUONPainterMatrix * Matrix() const
Get the matrix pointer.
Widget to plot a matrix of painters.
void UpdateInterface(Bool_t fromScratch)
void AttributesChanged(const AliMUONAttPainter *newValues)
Bool_t IsValid() const
Whether we are valid.
void MakeTopPainterMatrix(UInt_t w, UInt_t h, AliMUONPainterMatrix *matrix)
void AddToHistory(AliMUONPainterMatrix *group)
AliMUONPainterMatrixFrame * fPainterMatrixFrame
main frame with painters
void UpdateGroupsFrom(const AliMUONVPainter &painter)
Basic attributes shared by all painters.
void MouseLeave(const AliMUONVPainter *painter)
Int_t fCurrentNavigationPosition
current position in navigation history
AliMUONPainterMatrix * PainterMatrix(Int_t i) const
void SaveAs(const char *filename="", Option_t *option="") const
void SaveAs(const char *filename="", Option_t *option="") const
AliMUONAttPainterSelectorFrame * fAttPainterSelectorFrame
view type selection frame
TArrayI fNavigation
navigation "history"
void Clicked(AliMUONVPainter *painter, Double_t *values)
TGButton * fBackButton
navigation back
A matrix of AliMUONVPainter.
void Update(const AliMUONAttPainter &att)
const AliMUONAttPainter & Attributes() const
Get our attributes.
virtual ~AliMUONPainterMasterFrame()
TString DataPattern() const
virtual void DrawHistogram(Double_t *values=0x0) const