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

/Go4ConditionsBase/TGo4LabelPainter.h

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 #ifndef TGO4LABELPAINTER_H
00017 #define TGO4LABELPAINTER_H
00018 
00019 #include "TPaveText.h"
00020 #include "TLine.h"
00021 #include "TNamed.h"
00022 #include "TAttLine.h"
00023 #include "TAttFill.h"
00024 #include "TAttText.h"
00025 
00033 class TGo4Label : public TPaveText {
00034 
00035   public:
00036     TGo4Label(): TPaveText(), fxOwner(0){}
00037     TGo4Label(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Option_t* option = "br")
00038     : TPaveText(x1,y1,x2,y2,option),fxOwner(0){}
00039 
00040     virtual ~TGo4Label(){};
00041     void SetOwner(TObject* ob){fxOwner=ob;}
00042 
00043     virtual void Paint(Option_t* opt="");
00044 
00045   private:
00047     TObject* fxOwner;
00048   ClassDef(TGo4Label,6)
00049 };
00050 
00058 class TGo4LabelConnector : public TLine {
00059 
00060   public:
00061     TGo4LabelConnector(): TLine(), fxOwner(0){}
00062     TGo4LabelConnector(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
00063     : TLine(x1,y1,x2,y2),fxOwner(0){}
00064 
00065     virtual ~TGo4LabelConnector(){};
00066     void SetOwner(TObject* ob){fxOwner=ob;}
00067 
00068     virtual void Paint(Option_t* opt="");
00069 
00070   private:
00072     TObject* fxOwner;
00073   ClassDef(TGo4LabelConnector,6)
00074 };
00075 
00076 
00085 class TGo4LabelPainter : public TNamed, public TAttLine, public TAttFill, public TAttText {
00086   public:
00087     TGo4LabelPainter();
00088     TGo4LabelPainter(const Text_t * name);
00089     TGo4LabelPainter(const Text_t * name, const Text_t * title);
00090     virtual ~TGo4LabelPainter();
00091     
00093     virtual void PaintLabel(Option_t* opt="");
00094     
00096     virtual void UnPaintLabel(Option_t* opt="");
00097     
00099     virtual void RePaintLabel(Option_t* opt="");
00100     
00101     void SetCaption(const Text_t* txt){fxCaption=txt;}
00102     void SetX0(Double_t x=0){fdX0=x;}
00103     void SetY0(Double_t y=0){fdY0=y;}
00104     void SetWidth(Double_t w=0){fdWidth=w;}
00105     void SetHeight(Double_t h=0){fdHeight=h;}
00106 
00107     void AddToLabel(const Text_t* txt) { if(fxLabel) fxLabel->AddText(txt); }
00108     
00110     void InitAttributes();
00111     
00113     Double_t GetLabelXlo();
00114     
00116     Double_t GetLabelYlo();
00117 
00119     Double_t GetLabelXup();
00120     
00122     Double_t GetLabelYup();
00123 
00124    private:
00126      TGo4Label* fxLabel;
00127 
00129     Double_t fdX0;
00130     
00132     Double_t fdY0;
00133 
00135     Double_t fdWidth;
00136     
00138     Double_t fdHeight;
00139 
00141     TString fxCaption;
00142 
00144     Bool_t fbIsLabStreamed; 
00145 
00147     TGo4Label* CreateCurrentLabel(Double_t x, Double_t y);
00148 
00150     void LabelCoords(Double_t &xmin, Double_t &ymin, Double_t &xmax, Double_t &ymax);
00151 
00153     Bool_t CheckLabel();
00154 
00155   ClassDef(TGo4LabelPainter,6)
00156 };
00157 
00158 #endif //TGO4LABELPAINTER_H
00159 
00160 //----------------------------END OF GO4 SOURCE FILE ---------------------

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