00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TLegend
00013 #define ROOT_TLegend
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef ROOT_TPave
00025 #include "TPave.h"
00026 #endif
00027 #ifndef ROOT_TAttText
00028 #include "TAttText.h"
00029 #endif
00030
00031 class TObject;
00032 class TList;
00033 class TLegendEntry;
00034
00035 class TLegend : public TPave , public TAttText {
00036
00037 protected:
00038 TLegend& operator=(const TLegend&);
00039
00040 public:
00041 TLegend();
00042 TLegend( Double_t x1, Double_t y1, Double_t x2, Double_t y2,
00043 const char* header = "", Option_t* option="brNDC" );
00044 virtual ~TLegend();
00045 TLegend( const TLegend &legend );
00046
00047 TLegendEntry *AddEntry(const TObject* obj, const char* label = "", Option_t* option = "lpf" );
00048 TLegendEntry *AddEntry(const char *name, const char* label = "", Option_t* option = "lpf" );
00049 virtual void Clear( Option_t* option = "" );
00050 virtual void Copy( TObject &obj ) const;
00051 virtual void DeleteEntry();
00052 virtual void Draw( Option_t* option = "" );
00053 virtual void EditEntryAttFill();
00054 virtual void EditEntryAttLine();
00055 virtual void EditEntryAttMarker();
00056 virtual void EditEntryAttText();
00057 Float_t GetColumnSeparation() const { return fColumnSeparation; }
00058 TLegendEntry *GetEntry() const;
00059 Float_t GetEntrySeparation() const { return fEntrySeparation; }
00060 virtual const char *GetHeader() const;
00061 TList *GetListOfPrimitives() const {return fPrimitives;}
00062 Float_t GetMargin() const { return fMargin; }
00063 Int_t GetNColumns() const { return fNColumns; }
00064 Int_t GetNRows() const;
00065 virtual void InsertEntry( const char* objectName = "",const char* label = "",
00066 Option_t* option = "lpf" );
00067 virtual void Paint( Option_t* option = "" );
00068 virtual void PaintPrimitives();
00069 virtual void Print( Option_t* option = "" ) const;
00070 virtual void RecursiveRemove(TObject *obj);
00071 virtual void SavePrimitive(ostream &out, Option_t *option = "");
00072 void SetDefaults() { fEntrySeparation = 0.1f; fMargin = 0.25f; fNColumns = 1; fColumnSeparation = 0.0f; }
00073 void SetColumnSeparation( Float_t columnSeparation )
00074 { fColumnSeparation = columnSeparation; }
00075 virtual void SetEntryLabel( const char* label );
00076 virtual void SetEntryOption( Option_t* option );
00077 void SetEntrySeparation( Float_t entryseparation )
00078 { fEntrySeparation = entryseparation; }
00079 virtual void SetHeader( const char *header = "" );
00080 void SetMargin( Float_t margin ) { fMargin = margin; }
00081 void SetNColumns( Int_t nColumns );
00082
00083 protected:
00084 TList *fPrimitives;
00085 Float_t fEntrySeparation;
00086
00087
00088 Float_t fMargin;
00089 Int_t fNColumns;
00090 Float_t fColumnSeparation;
00091
00092
00093 ClassDef(TLegend,2)
00094 };
00095
00096 #endif