### Eclipse Workspace Patch 1.0 #P org.gvsig.app.document.layout.app Index: org.gvsig.app.document.layout.app.mainplugin =================================================================== --- org.gvsig.app.document.layout.app.mainplugin (revision 5) +++ org.gvsig.app.document.layout.app.mainplugin (working copy) Property changes on: org.gvsig.app.document.layout.app.mainplugin ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,4 ## +target +.settings +.classpath +.project Index: . =================================================================== --- . (revision 4) +++ . (working copy) Property changes on: . ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,2 ## +target +.project Index: org.gvsig.app.document.layout.app.mainplugin/package.info =================================================================== --- org.gvsig.app.document.layout.app.mainplugin/package.info (revision 45) +++ org.gvsig.app.document.layout.app.mainplugin/package.info (working copy) @@ -1,12 +1,12 @@ # -#Wed Nov 21 14:24:08 CET 2012 +#Tue Apr 09 11:21:08 CEST 2013 owner=gvSIG Association code=org.gvsig.app.document.layout.app.mainplugin java-version=j1_5 official=true type=plugin -version=2.0.0-SNAPSHOT-22 -state=beta2 +version=2.0.0-SNAPSHOT-25 +state=testing operating-system=all dependencies=required\: org.gvsig.app -ge 2.0.0-0 sources-url=https\://devel.gvsig.org/svn/gvsig-app-document-layout @@ -15,6 +15,6 @@ model-version=1.0.1 categories=Layout description=Adds a layout document type which allows to design printed maps. -buildNumber=22 +buildNumber=25 gvSIG-version=2.0.0 name=Document\: Layout Index: org.gvsig.app.document.layout.app.mainplugin/src/main/java/org/gvsig/app/project/documents/layout/fframes/FFrameView.java =================================================================== --- org.gvsig.app.document.layout.app.mainplugin/src/main/java/org/gvsig/app/project/documents/layout/fframes/FFrameView.java (revision 43) +++ org.gvsig.app.document.layout.app.mainplugin/src/main/java/org/gvsig/app/project/documents/layout/fframes/FFrameView.java (working copy) @@ -440,7 +440,7 @@ draw_h, //(int) rectangleLayout.getHeight(), BufferedImage.TYPE_INT_ARGB); - Graphics2D gimg = (Graphics2D) m_image.getGraphics(); + Graphics2D gimg = (Graphics2D) m_image.createGraphics(); /* gimg.translate(-((int) rectangleLayout.getX()), @@ -449,6 +449,7 @@ try { getMapContext().draw(m_image, gimg, getScale()); + gimg.dispose(); } catch (ReadException e) { LOG.error("Error reading the provider" , e); } catch (MapContextException mpex) { @@ -488,20 +489,21 @@ * @param height * @return */ - private BufferedImage copyForcingImageSize(Image img, int w, int h) { + private BufferedImage copyForcingImageSize( + BufferedImage disp_img, int w, int h) { - if (img == null || w < 1 || h < 1) { + if (disp_img == null || w < 1 || h < 1) { return new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB); } - int from_w = img.getWidth(null); - int from_h = img.getHeight(null); + int from_w = disp_img.getWidth(null); + int from_h = disp_img.getHeight(null); if (from_w < 1 || from_h < 1) { return new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB); } BufferedImage resp = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB); - Graphics rg = resp.getGraphics(); + Graphics rg = resp.createGraphics(); double rat_w = (1d*w) / (1d*from_w); double rat_h = (1d*h) / (1d*from_h); @@ -515,7 +517,7 @@ // w, target_h offset_w = 0; offset_h = (h - target_h) / 2; - aux = img.getScaledInstance(w, target_h, Image.SCALE_FAST); + aux = disp_img.getScaledInstance(w, target_h, Image.SCALE_FAST); rg.drawImage(aux, offset_w, offset_h, null); } else { @@ -524,9 +526,13 @@ // target_w, h offset_w = (w - target_w) / 2; offset_h = 0; - aux = img.getScaledInstance(target_w, h, Image.SCALE_FAST); + aux = disp_img.getScaledInstance(target_w, h, Image.SCALE_FAST); rg.drawImage(aux, offset_w, offset_h, null); } + + aux = null; + resp.flush(); + rg.dispose(); return resp; }