question: private Image cacheAnnotationImage ( final WorkflowAnnotation anno , final int cacheId ) { Rectangle2D loc = anno . getLocation ( ) ; Dimension size = new Dimension ( ( int ) loc . getWidth ( ) , ( int ) loc . getHeight ( ) ) ; pane . setSize ( size ) ; pane . setText ( AnnotationDrawUtils . createStyledCommentString ( anno ) ) ; pane . setCaretPosition ( 0 ) ; BufferedImage img = new BufferedImage ( ( int ) loc . getWidth ( ) , ( int ) loc . getHeight ( ) , BufferedImage . TYPE_INT_ARGB ) ; Graphics2D gImg = img . createGraphics ( ) ; gImg . setRenderingHints ( ProcessDrawer . HI_QUALITY_HINTS ) ; gImg . setComposite ( AlphaComposite . SrcOver ) ; pane . paint ( gImg ) ; displayCache . put ( anno . getId ( ) , new WeakReference < Image > ( img ) ) ; cachedID . put ( anno . getId ( ) , cacheId ) ; return img ; }
target:  Creates an image of the given annotation and caches it with the specified cache id.