GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4CondArrayPainter.cxx
Go to the documentation of this file.
1 // $Id: TGo4CondArrayPainter.cxx 2746 2020-04-16 09:10:17Z linev $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #include "TGo4CondArrayPainter.h"
15 
16 #include "TVirtualPad.h"
17 
18 #include "TGo4WinCond.h"
19 #include "TGo4CondArray.h"
20 
23 {
24 }
25 
27 : TGo4ConditionPainter(name,"TGo4CondArrayPainter")
28 {
29 }
30 
32 {
34 }
35 
37 {
38 if(gPad==0) return;
39 TGo4CondArray* arconny=dynamic_cast<TGo4CondArray*>(fxCondition);
40 if(arconny)
41  {
42  TH1* workhis=arconny->GetWorkHistogram();
43  Int_t number=arconny->GetNumber();
44  Int_t selected=arconny->GetCurrentIndex();
45  for(Int_t i=0; i<number; ++i)
46  {
47  TGo4Condition* con=arconny->At(i);
48  if(con)
49  {
50  con->SetOwnedByEditor(kTRUE); // prevent interactive deletion
51  con->SetWorkHistogram(workhis);
52  con->SetLineColor((i)%6 +2);
53  con->SetFillColor((i)%6 +2);
54  if(dynamic_cast<TGo4WinCond*>(con))
55  {
56  if(!arconny->IsMultiEdit() && i==selected)
57  {
58  con->SetFillStyle(3002);
59  }
60  else
61  {
62  con->SetFillStyle(0);
63  }
64  }
65  else
66  {
67  if(!arconny->IsMultiEdit() && i==selected)
68  {
69  con->SetLineStyle(1);
70  }
71  else
72  {
73  con->SetLineStyle(4);
74  }
75  }
76  con->Paint(opt);
77  }
78  }
79  } // if(arconny)
80 }
81 
83 {
84 if(gPad==0) return;
85 TGo4CondArray* arconny=dynamic_cast<TGo4CondArray*>(fxCondition);
86 if(arconny)
87  {
88  Int_t number=arconny->GetNumber();
89  for(Int_t i=0; i<number; ++i)
90  {
91  TGo4Condition* con=arconny->At(i);
92  if(con) con->UnDraw(opt);
93  }
94  }
95 }
96 
98 {
99  // do not create a label for the complete array
100 }
virtual void UnPaintCondition(Option_t *opt="")
virtual void UnDraw(Option_t *opt="")
TGo4Condition * fxCondition
void SetOwnedByEditor(Bool_t on)
virtual Bool_t IsMultiEdit()
virtual void PaintCondition(Option_t *opt="")
virtual void PaintLabel(Option_t *opt="")
virtual void SetWorkHistogram(TH1 *histo)
TH1 * GetWorkHistogram()
virtual void Paint(Option_t *opt="")
TGo4Condition * At(Int_t i)
Int_t GetNumber() const
virtual Int_t GetCurrentIndex()