{
Image buffer = null;
try
{
final int selectedIndex = this.selectedIndex;
final Font font = this.font;
final RowSet rowSet = this.rowSet;
final String[] labels = this.labels;
Graphics g = graphics;
final int height = getHeight();
if( !isDoubleBuffered() )
{
buffer = Image.createImage( getWidth(), height );
g = buffer.getGraphics();
}
g.setColor( background );
g.fillRect( 0, 0, getWidth(), height );
// g.setColor( 0x85B0C6 );
// g.fillRect( 0, 0, getWidth(), height );
// g.setColor( background );
// g.fillArc( 0, 0, getWidth(), height, 45, -45 );
g.setFont( font );
g.setColor( color );
int y = 0;
// Paint buttons
final int fontHeight = font.getHeight();
String status = null;
if( buttons.size() > 0 )
{
status = paintButtons( g );
y += 7 + maxButtonHeight;
}
if(
rowSet != null && rowSet.size() > 0 && fields.size() > 0 &&
labels != null && labels.length > 0
)
{
final int size = rowSet.size();
// Paint rows
rowSet.openSource();
final int itemCount = indexes.length;
for( int i = 0; i < itemCount; i++ )
{
final int index = indexes[i];
final boolean isSelectedLine = index == selectedIndex;
paintLine(
g,
y,
Tools.splitInLines(
labels[i],
font,
font,
getWidth() - 2,
isSelectedLine ? currentMaxLines : 1,
wrap
),
isSelectedLine
);
y += lineHeight * (isSelectedLine ? currentMaxLines : 1);
}
if( selectedPane == LIST_PANE )
{
status = (selectedIndex + 1) + "/" + size;
}
}
else if( selectedPane == LIST_PANE )
{
status = ResourceManager.getResource( "rowSetListView.noData" );
}
y = height - fontHeight - 2;
g.setColor( color );
g.drawLine( 1, y, getWidth() - 2, y );
g.drawString(
status != null ? status : "",
1,
height - fontHeight + font.getBaselinePosition(),
Graphics.LEFT | Graphics.BASELINE
);
}
catch( Exception e )
{