00001 // $Id: TGo4CondArrayPainter.cxx 478 2009-10-29 12:26:09Z linev $ 00002 //----------------------------------------------------------------------- 00003 // The GSI Online Offline Object Oriented (Go4) Project 00004 // Experiment Data Processing at EE department, GSI 00005 //----------------------------------------------------------------------- 00006 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH 00007 // Planckstr. 1, 64291 Darmstadt, Germany 00008 // Contact: http://go4.gsi.de 00009 //----------------------------------------------------------------------- 00010 // This software can be used under the license agreements as stated 00011 // in Go4License.txt file which is part of the distribution. 00012 //----------------------------------------------------------------------- 00013 00014 #include "TGo4CondArrayPainter.h" 00015 00016 #include "TVirtualPad.h" 00017 00018 #include "TGo4WinCond.h" 00019 #include "TGo4WinCondPainter.h" 00020 #include "TGo4PolyCondPainter.h" 00021 #include "TGo4CondArray.h" 00022 00023 TGo4CondArrayPainter::TGo4CondArrayPainter() 00024 : TGo4ConditionPainter() 00025 { 00026 } 00027 00028 TGo4CondArrayPainter::TGo4CondArrayPainter(const char* name) 00029 : TGo4ConditionPainter(name,"TGo4CondArrayPainter") 00030 { 00031 } 00032 00033 TGo4CondArrayPainter::~TGo4CondArrayPainter() 00034 { 00035 UnPaintCondition(); 00036 } 00037 00038 void TGo4CondArrayPainter::PaintCondition(Option_t* opt) 00039 { 00040 if(gPad==0) return; 00041 TGo4CondArray* arconny=dynamic_cast<TGo4CondArray*>(fxCondition); 00042 if(arconny) 00043 { 00044 TH1* workhis=arconny->GetWorkHistogram(); 00045 Int_t number=arconny->GetNumber(); 00046 Int_t selected=arconny->GetCurrentIndex(); 00047 for(Int_t i=0; i<number; ++i) 00048 { 00049 TGo4Condition* con=arconny->At(i); 00050 if(con) 00051 { 00052 con->SetOwnedByEditor(kTRUE); // prevent interactive deletion 00053 con->SetWorkHistogram(workhis); 00054 con->SetLineColor((i)%6 +2); 00055 con->SetFillColor((i)%6 +2); 00056 if(dynamic_cast<TGo4WinCond*>(con)) 00057 { 00058 if(!arconny->IsMultiEdit() && i==selected) 00059 { 00060 con->SetFillStyle(3002); 00061 } 00062 else 00063 { 00064 con->SetFillStyle(0); 00065 } 00066 } 00067 else 00068 { 00069 if(!arconny->IsMultiEdit() && i==selected) 00070 { 00071 con->SetLineStyle(1); 00072 } 00073 else 00074 { 00075 con->SetLineStyle(4); 00076 } 00077 } 00078 con->Paint(opt); 00079 } 00080 } 00081 } // if(arconny) 00082 } 00083 00084 void TGo4CondArrayPainter::UnPaintCondition(Option_t* opt) 00085 { 00086 if(gPad==0) return; 00087 TGo4CondArray* arconny=dynamic_cast<TGo4CondArray*>(fxCondition); 00088 if(arconny) 00089 { 00090 Int_t number=arconny->GetNumber(); 00091 for(Int_t i=0; i<number; ++i) 00092 { 00093 TGo4Condition* con=arconny->At(i); 00094 if(con) con->UnDraw(opt); 00095 } 00096 } 00097 } 00098 00099 void TGo4CondArrayPainter::PaintLabel(Option_t* ) 00100 { 00101 // do not create a label for the complete array 00102 }