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