org.gvsig.app.document.layout.app_patch.txt

Juan Lucas Domínguez, 04/09/2013 11:50 AM

Download (4.64 KB)

 
1
### Eclipse Workspace Patch 1.0
2
#P org.gvsig.app.document.layout.app
3
Index: org.gvsig.app.document.layout.app.mainplugin
4
===================================================================
5
--- org.gvsig.app.document.layout.app.mainplugin	(revision 5)
6
+++ org.gvsig.app.document.layout.app.mainplugin	(working copy)
7

    
8
Property changes on: org.gvsig.app.document.layout.app.mainplugin
9
___________________________________________________________________
10
Added: svn:ignore
11
## -0,0 +1,4 ##
12
+target
13
+.settings
14
+.classpath
15
+.project
16
Index: .
17
===================================================================
18
--- .	(revision 4)
19
+++ .	(working copy)
20

    
21
Property changes on: .
22
___________________________________________________________________
23
Added: svn:ignore
24
## -0,0 +1,2 ##
25
+target
26
+.project
27
Index: org.gvsig.app.document.layout.app.mainplugin/package.info
28
===================================================================
29
--- org.gvsig.app.document.layout.app.mainplugin/package.info	(revision 45)
30
+++ org.gvsig.app.document.layout.app.mainplugin/package.info	(working copy)
31
@@ -1,12 +1,12 @@
32
 #
33
-#Wed Nov 21 14:24:08 CET 2012
34
+#Tue Apr 09 11:21:08 CEST 2013
35
 owner=gvSIG Association
36
 code=org.gvsig.app.document.layout.app.mainplugin
37
 java-version=j1_5
38
 official=true
39
 type=plugin
40
-version=2.0.0-SNAPSHOT-22
41
-state=beta2
42
+version=2.0.0-SNAPSHOT-25
43
+state=testing
44
 operating-system=all
45
 dependencies=required\: org.gvsig.app -ge 2.0.0-0
46
 sources-url=https\://devel.gvsig.org/svn/gvsig-app-document-layout
47
@@ -15,6 +15,6 @@
48
 model-version=1.0.1
49
 categories=Layout
50
 description=Adds a layout document type which allows to design printed maps.
51
-buildNumber=22
52
+buildNumber=25
53
 gvSIG-version=2.0.0
54
 name=Document\: Layout
55
Index: org.gvsig.app.document.layout.app.mainplugin/src/main/java/org/gvsig/app/project/documents/layout/fframes/FFrameView.java
56
===================================================================
57
--- org.gvsig.app.document.layout.app.mainplugin/src/main/java/org/gvsig/app/project/documents/layout/fframes/FFrameView.java	(revision 43)
58
+++ org.gvsig.app.document.layout.app.mainplugin/src/main/java/org/gvsig/app/project/documents/layout/fframes/FFrameView.java	(working copy)
59
@@ -440,7 +440,7 @@
60
                     draw_h, //(int) rectangleLayout.getHeight(),
61
                     BufferedImage.TYPE_INT_ARGB);
62
 
63
-            Graphics2D gimg = (Graphics2D) m_image.getGraphics();
64
+            Graphics2D gimg = (Graphics2D) m_image.createGraphics();
65
             
66
             /*
67
             gimg.translate(-((int) rectangleLayout.getX()),
68
@@ -449,6 +449,7 @@
69
             
70
             try {
71
                 getMapContext().draw(m_image, gimg, getScale());
72
+                gimg.dispose();
73
             } catch (ReadException e) {
74
                 LOG.error("Error reading the provider" , e);
75
             } catch (MapContextException mpex) {
76
@@ -488,20 +489,21 @@
77
      * @param height
78
      * @return
79
      */
80
-    private BufferedImage copyForcingImageSize(Image img, int w, int h) {
81
+    private BufferedImage copyForcingImageSize(
82
+        BufferedImage disp_img, int w, int h) {
83
         
84
-        if (img == null || w < 1 || h < 1) {
85
+        if (disp_img == null || w < 1 || h < 1) {
86
             return new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB);
87
         }
88
-        int from_w = img.getWidth(null);
89
-        int from_h = img.getHeight(null);
90
+        int from_w = disp_img.getWidth(null);
91
+        int from_h = disp_img.getHeight(null);
92
         if (from_w < 1 || from_h < 1) {
93
             return new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB);
94
         }
95
         
96
         BufferedImage resp =
97
             new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
98
-        Graphics rg = resp.getGraphics();
99
+        Graphics rg = resp.createGraphics();
100
         
101
         double rat_w = (1d*w) / (1d*from_w);
102
         double rat_h = (1d*h) / (1d*from_h);
103
@@ -515,7 +517,7 @@
104
             // w, target_h
105
             offset_w = 0;
106
             offset_h = (h - target_h) / 2;
107
-            aux = img.getScaledInstance(w, target_h, Image.SCALE_FAST);
108
+            aux = disp_img.getScaledInstance(w, target_h, Image.SCALE_FAST);
109
             rg.drawImage(aux, offset_w, offset_h, null);
110
 
111
         } else {
112
@@ -524,9 +526,13 @@
113
             // target_w, h
114
             offset_w = (w - target_w) / 2;
115
             offset_h = 0;
116
-            aux = img.getScaledInstance(target_w, h, Image.SCALE_FAST);
117
+            aux = disp_img.getScaledInstance(target_w, h, Image.SCALE_FAST);
118
             rg.drawImage(aux, offset_w, offset_h, null);
119
         }
120
+        
121
+        aux = null;
122
+        resp.flush();
123
+        rg.dispose();
124
         return resp;
125
     }
126