*/
public void setMode( PObject p ){
//System.out.print( "Mode: " );
//System.out.println( getMode() );
if( p instanceof Numeral ){
Numeral numeral = (Numeral)p;
//System.out.print( "numeral: " );
//System.out.println( numeral.name() );
if( mode == 3 ){
int size = 0;
switch( numeral.get() ){
case '1': size = 1; break;
case '2': size = 2; break;
case '3': size = 3; break;
case '4': size = 4; break;
case '5': size = 5; break;
case '6': size = 6; break;
case '7': size = 7; break;
case '8': size = 8; break;
case '9': size = 9; break;
default: size = 0;
}
if( size < sizes.size() ){
size = sizes.elementAt( size );
if( minSize() != size ) setMinSize( size );
setMode( 0 );
updateDisplay( true, true );
}
} else if( numeral.name().equals( "1" ) ){
//System.out.println( "***** 1 *****" );
if( mode == 2 )
setAngleType( AngleType.DEGREES );
else if( mode == 1 )
setStat( false );
setMode( 0 );
updateDisplay( true, true );
} else if( numeral.name().equals( "2" ) ){
//System.out.println( "***** 2 *****" );
if( mode == 2 )
setAngleType( AngleType.RADIANS );
else if( mode == 1 )
setStat( true );
setMode( 0 );
updateDisplay( true, true );
} else if( numeral.name().equals( "3" ) ){
setMode( 0 );
updateDisplay( true, true );
}
} else if( p instanceof Mode ){
setMode( getMode() + 1 );