private void printAnnotationFromEditor(final WorkflowAnnotation anno,final Graphics2D g2){
  Graphics2D gPr=(Graphics2D)g2.create();
  Rectangle2D loc=anno.getLocation();
  gPr.translate(loc.getX(),loc.getY());
  gPr.setClip(0,0,(int)loc.getWidth(),(int)loc.getHeight());
  Dimension size=new Dimension((int)loc.getWidth(),(int)loc.getHeight());
  pane.setSize(size);
  pane.setText(AnnotationDrawUtils.createStyledCommentString(anno));
  pane.setCaretPosition(0);
  pane.paint(gPr);
  gPr.dispose();
}

private void printAnnotationFromEditor ( final WorkflowAnnotation anno , final Graphics2D g2 ) { Graphics2D gPr = ( Graphics2D ) g2 . create ( ) ; Rectangle2D loc = anno . getLocation ( ) ; gPr . translate ( loc . getX ( ) , loc . getY ( ) ) ; gPr . setClip ( 0 , 0 , ( int ) loc . getWidth ( ) , ( int ) loc . getHeight ( ) ) ; Dimension size = new Dimension ( ( int ) loc . getWidth ( ) , ( int ) loc . getHeight ( ) ) ; pane . setSize ( size ) ; pane . setText ( AnnotationDrawUtils . createStyledCommentString ( anno ) ) ; pane . setCaretPosition ( 0 ) ; pane . paint ( gPr ) ; gPr . dispose ( ) ; }
bypass the cache and the speedy image drawing and directly paint the jeditorpane to the context . required for printing in svg format which would turn out pixelated if it were drawn as an image .
