TotalTextRep.cxx

Go to the documentation of this file.
00001 
00012 #include "TotalTextRep.h"
00013 
00014 #include "graphics/ViewBase.h"
00015 #include "pattern/string_convert.h"
00016 #include "projectors/NTupleProjector.h"
00017 
00018 using std::string;
00019 
00020 using namespace hippodraw;
00021 
00022 TotalTextRep::TotalTextRep ( )
00023   : TextRepBase ( "Total Entries" )
00024 {
00025 }
00026 
00027 TotalTextRep::TotalTextRep ( const TotalTextRep & rep )
00028   : TextRepBase( rep )
00029 {
00030 }
00031 
00032 RepBase * TotalTextRep::clone ()
00033 {
00034   return new TotalTextRep ( *this );
00035 }
00036 
00037 void
00038 TotalTextRep::
00039 drawProjectedValues ( ProjectorBase & proj,
00040                       ViewBase & view )
00041 {
00042   int total = proj.getNumberOfEntries ();
00043   string text ( "Total_entries = " );
00044   if ( total < 0 ) {
00045     text += "meaningless";
00046   }
00047   else {
00048     text += String::convert ( total );
00049   }
00050 
00051   view.drawText ( text, 5, 10, m_size, 0, 'l', 't', true, 0, & m_color );
00052 }

Generated for HippoDraw Class Library by doxygen