public void teken( Graphics g )
{
int waarde = 0;
for( int rij = 0; rij < raster.length; rij++ )
for( int kolom = 0; kolom < raster[0].length; kolom++ )
{
waarde = raster[rij][kolom];
for( int i =0; i < 15; i++ )
{
x += 50;
if( waarde == -1 )
{
g.setColor( Color.blue );
g.drawRect(x, y, grootte, grootte);
g.setColor( Color.black );
g.fillRect(x, y, grootte, grootte);
}
if( waarde == 0 )
{
g.setColor( Color.yellow );
g.drawRect(x, y, grootte, grootte);
g.setColor( Color.black );
g.fillRect(x, y, grootte, grootte);
}
if( waarde == 1 )
{
g.setColor( Color.black );
g.fillRect(x, y, grootte, grootte);
g.setColor( Color.yellow );
g.drawRect(x, y, grootte, grootte);
g.setColor( Color.white );
g.fillOval(x, y, grootte/2, grootte/2 );
}
}
}
} |