static void paintFromSingleCachedImage(final Graphics2D g,final JRSUIControl control,final JRSUIState controlState,final Rectangle bounds){
  if (bounds.width <= 0 || bounds.height <= 0) {
    return;
  }
  int focus=0;
  if (controlState.is(JRSUIConstants.Focused.YES)) {
    focus=JRSUIConstants.FOCUS_SIZE;
  }
  final int imgX=bounds.x - focus;
  final int imgY=bounds.y - focus;
  final int imgW=bounds.width + (focus << 1);
  final int imgH=bounds.height + (focus << 1);
  final GraphicsConfiguration config=g.getDeviceConfiguration();
  final ImageCache cache=ImageCache.getInstance();
  final AquaPixelsKey key=new AquaPixelsKey(config,imgW,imgH,bounds,controlState);
  Image img=cache.getImage(key);
  if (img == null) {
    img=new MultiResolutionCachedImage(imgW,imgH,null);
    if (!controlState.is(JRSUIConstants.Animating.YES)) {
      cache.setImage(key,img);
    }
  }
  g.drawImage(img,imgX,imgY,imgW,imgH,null);
}

static void paintFromSingleCachedImage ( final Graphics2D g , final JRSUIControl control , final JRSUIState controlState , final Rectangle bounds ) { if ( bounds . width <= 0 || bounds . height <= 0 ) { return ; } int focus = 0 ; if ( controlState . is ( JRSUIConstants . Focused . YES ) ) { focus = JRSUIConstants . FOCUS_SIZE ; } final int imgX = bounds . x - focus ; final int imgY = bounds . y - focus ; final int imgW = bounds . width + ( focus << 1 ) ; final int imgH = bounds . height + ( focus << 1 ) ; final GraphicsConfiguration config = g . getDeviceConfiguration ( ) ; final ImageCache cache = ImageCache . getInstance ( ) ; final AquaPixelsKey key = new AquaPixelsKey ( config , imgW , imgH , bounds , controlState ) ; Image img = cache . getImage ( key ) ; if ( img == null ) { img = new MultiResolutionCachedImage ( imgW , imgH , null ) ; if ( ! controlState . is ( JRSUIConstants . Animating . YES ) ) { cache . setImage ( key , img ) ; } } g . drawImage ( img , imgX , imgY , imgW , imgH , null ) ; }
paints a native control , which identified by its size and a set of additional arguments using a cached image .
