Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/Go4ConditionsBase/TGo4CondArrayPainter.cxx

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

Generated on Tue Nov 8 10:55:51 2005 for Go4-v2.10-5 by doxygen1.2.15