GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
TGo4CondArrayPainter.cxx
Go to the documentation of this file.
1 // $Id$
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)
39  return;
40  TGo4CondArray *arconny = dynamic_cast<TGo4CondArray *>(fxCondition);
41  if (arconny) {
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  TGo4Condition *con = arconny->At(i);
47  if (con) {
48  con->SetOwnedByEditor(kTRUE); // prevent interactive deletion
49  con->SetWorkHistogram(workhis);
50  con->SetLineColor((i) % 6 + 2);
51  con->SetFillColor((i) % 6 + 2);
52  if (dynamic_cast<TGo4WinCond *>(con)) {
53  if (!arconny->IsMultiEdit() && i == selected) {
54  con->SetFillStyle(3002);
55  } else {
56  con->SetFillStyle(0);
57  }
58  } else {
59  if (!arconny->IsMultiEdit() && i == selected) {
60  con->SetLineStyle(1);
61  } else {
62  con->SetLineStyle(4);
63  }
64  }
65  con->Paint(opt);
66  }
67  }
68  } // if(arconny)
69 }
70 
72 {
73  if (!gPad)
74  return;
75  TGo4CondArray *arconny = dynamic_cast<TGo4CondArray *>(fxCondition);
76  if (arconny) {
77  Int_t number = arconny->GetNumber();
78  for (Int_t i = 0; i < number; ++i) {
79  TGo4Condition *con = arconny->At(i);
80  if (con)
81  con->UnDraw(opt);
82  }
83  }
84 }
85 
87 {
88  // do not create a label for the complete array
89 }
virtual void UnDraw(Option_t *opt="")
void PaintLabel(Option_t *opt="") override
TGo4Condition * fxCondition
TH1 * GetWorkHistogram() const
void SetOwnedByEditor(Bool_t on)
void UnPaintCondition(Option_t *opt="") override
Int_t GetCurrentIndex() const override
void Paint(Option_t *opt="") override
Int_t GetNumber() const
virtual void SetWorkHistogram(TH1 *histo)
void PaintCondition(Option_t *opt="") override
virtual Bool_t IsMultiEdit() const
TGo4Condition * At(Int_t i) const