#include <featuregui.h>
Inheritance diagram for DnaStrGui:
Public Member Functions | |
DnaStrGui (FeatureData *data) | |
void | paintMe (QPainter *p, TR_PIX x_pix, TR_PIX y_pix, TR_DNA x1_dna, TR_DNA x2_dna, double width, int height, int center) |
Private Member Functions | |
DnaStrData * | dnaStrData () |
Private Attributes | |
QFont | f |
int | currentWidth |
int | currentHeight |
int | oldRequestedHeight |
int | oldRequestedWidth |
int | currentDescent |
Definition at line 81 of file featuregui.h.
|
Definition at line 84 of file featuregui.h. References currentDescent, currentHeight, currentWidth, f, oldRequestedHeight, and oldRequestedWidth. 00084 : FeatureGui( data ) 00085 { 00086 f.setFamily("Luxi Mono"); 00087 f.setFixedPitch( true ); 00088 oldRequestedHeight = 0; 00089 oldRequestedWidth = 0; 00090 currentHeight = 0; 00091 currentWidth = 0; 00092 currentDescent = 0; 00093 // cerr << "in dnastrgui ctor" << endl; 00094 }
|
|
Definition at line 109 of file featuregui.cpp. References FeatureGui::m_data. Referenced by paintMe(). 00110 { 00111 return dynamic_cast<DnaStrData *>( m_data ); 00112 }
|
|
Paints the visual appearance of a feature.
Implements FeatureGui. Definition at line 114 of file featuregui.cpp. References currentDescent, currentHeight, currentWidth, dnaStrData(), DnaStrData::dnaVector, f, oldRequestedHeight, oldRequestedWidth, and TrapperVector< T >::stlVector(). 00116 { 00117 if ( height != oldRequestedHeight || width != oldRequestedWidth ) { 00118 oldRequestedHeight = height; 00119 oldRequestedWidth = width; 00120 00121 int sz = height; 00122 00123 while ( sz > 0 ) { 00124 f.setPointSize( sz ); 00125 QFontMetrics fm( f ); 00126 00127 if ( fm.width('m') <= width && fm.height() <= height ) { 00128 currentHeight = fm.height(); 00129 currentDescent = fm.descent(); 00130 currentWidth = fm.width('m'); 00131 break; 00132 } 00133 --sz; 00134 } 00135 } 00136 00137 QString str; 00138 QBrush brush; 00139 brush.setStyle( Qt::SolidPattern ); 00140 00141 QColor color; 00142 brush.setColor( Qt::black ); 00143 00144 p->setFont(f); 00145 00146 int pixelsHigh = currentHeight; 00147 00148 00149 for ( int i = x1_dna; i <= x2_dna ; ++i ) { 00150 char c = dnaStrData()->dnaVector.stlVector()[i]; 00151 QChar c2( c ); 00152 QString a( c2 ); 00153 p->drawText( x_pix + ( ( i- x1_dna ) + 0.25)* width , y_pix + height - ( ( height - pixelsHigh ) / 2 )- currentDescent, a ); 00154 } 00155 return; 00156 }
|
|
Definition at line 100 of file featuregui.h. Referenced by DnaStrGui(), and paintMe(). |
|
Definition at line 100 of file featuregui.h. Referenced by DnaStrGui(), and paintMe(). |
|
Definition at line 100 of file featuregui.h. Referenced by DnaStrGui(), and paintMe(). |
|
Definition at line 99 of file featuregui.h. Referenced by DnaStrGui(), and paintMe(). |
|
Definition at line 100 of file featuregui.h. Referenced by DnaStrGui(), and paintMe(). |
|
Definition at line 100 of file featuregui.h. Referenced by DnaStrGui(), and paintMe(). |