Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TLegendEntry.h
Go to the documentation of this file.
1 // @(#)root/graf:$Id$
2 // Author: Matthew.Adam.Dobbs 06/09/99
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 //--------------------------------------------------------------------------
12 
13 #ifndef ROOT_TLegendEntry
14 #define ROOT_TLegendEntry
15 
16 
17 #include "TObject.h"
18 #include "TAttText.h"
19 #include "TAttLine.h"
20 #include "TAttFill.h"
21 #include "TAttMarker.h"
22 #include "TString.h"
23 
24 class TLegendEntry : public TObject, public TAttText, public TAttLine,
25  public TAttFill, public TAttMarker {
26 public:
27  TLegendEntry();
28  TLegendEntry(const TObject *obj, const char *label = 0, Option_t *option="lpf" );
29  TLegendEntry( const TLegendEntry &entry );
30  virtual ~TLegendEntry();
31  virtual void Copy( TObject &obj ) const;
32  virtual const char *GetLabel() const { return fLabel.Data(); }
33  virtual TObject *GetObject() const { return fObject; }
34  virtual Option_t *GetOption() const { return fOption.Data(); }
35  virtual void Print( Option_t *option = "" ) const;
36  virtual void SaveEntry( std::ostream &out, const char *name );
37  virtual void SetLabel( const char *label = "" ) { fLabel = label; } // *MENU*
38  virtual void SetObject(TObject* obj );
39  virtual void SetObject( const char *objectName ); // *MENU*
40  virtual void SetOption( Option_t *option="lpf" ) { fOption = option; } // *MENU*
41 
42 protected:
43  TObject *fObject; ///< pointer to object being represented by this entry
44  TString fLabel; ///< Text associated with the entry, will become latex
45  TString fOption; ///< Options associated with this entry
46 
47 private:
48  TLegendEntry& operator=(const TLegendEntry&); // Not implemented
49 
50  ClassDef(TLegendEntry,1) // Storage class for one entry of a TLegend
51 };
52 
53 #endif