@Override
public void actionPerformed ( final ActionEvent e )
{
// Currently updated element
final BreadcrumbElement be = getElement ( element );
// Calculating progress changes
final float progress = be.getProgress ();
if ( progress >= 1f )
{
if ( run % 2 != 0 )
{
// Clearing previous element progress on odd runs
be.setProgress ( 0f );
be.setShowProgress ( false );
}
else
{
// Saving progress on even runs
be.setProgress ( 1f );
be.setShowProgress ( true );
}
if ( element < 3 )
{
// Still the same run
element = element + 1;
}
else
{
// New run starts
element = 0;
run++;
// Clearing progress on odd run
if ( run % 2 != 0 )
{
for ( int i = 0; i <= 3; i++ )
{
final BreadcrumbElement el = getElement ( i );
el.setProgress ( 0f );
el.setShowProgress ( false );
}
}
}
}
else