GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4CondArrayPainter.cxx
Go to the documentation of this file.
1 // $Id: TGo4CondArrayPainter.cxx 478 2009-10-29 12:26:09Z 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 für 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 "TGo4WinCondPainter.h"
20 #include "TGo4PolyCondPainter.h"
21 #include "TGo4CondArray.h"
22 
25 {
26 }
27 
29 : TGo4ConditionPainter(name,"TGo4CondArrayPainter")
30 {
31 }
32 
34 {
36 }
37 
39 {
40 if(gPad==0) return;
41 TGo4CondArray* arconny=dynamic_cast<TGo4CondArray*>(fxCondition);
42 if(arconny)
43  {
44  TH1* workhis=arconny->GetWorkHistogram();
45  Int_t number=arconny->GetNumber();
46  Int_t selected=arconny->GetCurrentIndex();
47  for(Int_t i=0; i<number; ++i)
48  {
49  TGo4Condition* con=arconny->At(i);
50  if(con)
51  {
52  con->SetOwnedByEditor(kTRUE); // prevent interactive deletion
53  con->SetWorkHistogram(workhis);
54  con->SetLineColor((i)%6 +2);
55  con->SetFillColor((i)%6 +2);
56  if(dynamic_cast<TGo4WinCond*>(con))
57  {
58  if(!arconny->IsMultiEdit() && i==selected)
59  {
60  con->SetFillStyle(3002);
61  }
62  else
63  {
64  con->SetFillStyle(0);
65  }
66  }
67  else
68  {
69  if(!arconny->IsMultiEdit() && i==selected)
70  {
71  con->SetLineStyle(1);
72  }
73  else
74  {
75  con->SetLineStyle(4);
76  }
77  }
78  con->Paint(opt);
79  }
80  }
81  } // if(arconny)
82 }
83 
85 {
86 if(gPad==0) return;
87 TGo4CondArray* arconny=dynamic_cast<TGo4CondArray*>(fxCondition);
88 if(arconny)
89  {
90  Int_t number=arconny->GetNumber();
91  for(Int_t i=0; i<number; ++i)
92  {
93  TGo4Condition* con=arconny->At(i);
94  if(con) con->UnDraw(opt);
95  }
96  }
97 }
98 
100 {
101  // do not create a label for the complete array
102 }
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="")
TH1 * GetWorkHistogram()
virtual void Paint(Option_t *opt="")
void SetWorkHistogram(TH1 *histo)
TGo4Condition * At(Int_t i)
Int_t GetNumber() const
virtual Int_t GetCurrentIndex()