public static SeaGlassContext getContext ( Class type , JComponent component , Region region , SynthStyle style , int state ) { SeaGlassContext context = null ; synchronized ( contextMap ) { List instances = ( List ) contextMap . get ( type ) ; if ( instances != null ) { int size = instances . size ( ) ; if ( size > 0 ) { context = ( SeaGlassContext ) instances . remove ( size - 1 ) ; } } } if ( context == null ) { try { context = ( SeaGlassContext ) type . newInstance ( ) ; } catch ( IllegalAccessException iae ) { iae . printStackTrace ( ) ; } catch ( InstantiationException ie ) { ie . printStackTrace ( ) ; } } context . reset ( component , region , style , state ) ; return context ; }
The method used to get a context .