Revision 9392 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/Print.java
Print.java | ||
---|---|---|
71 | 71 |
import com.iver.andami.PluginServices; |
72 | 72 |
import com.iver.andami.plugins.Extension; |
73 | 73 |
import com.iver.andami.ui.mdiManager.IWindow; |
74 |
import com.iver.cit.gvsig.gui.layout.Attributes; |
|
75 |
import com.iver.cit.gvsig.gui.layout.Layout; |
|
74 |
import com.iver.cit.gvsig.project.documents.layout.Attributes; |
|
76 | 75 |
import com.iver.cit.gvsig.project.documents.layout.FLayoutUtilities; |
76 |
import com.iver.cit.gvsig.project.documents.layout.gui.Layout; |
|
77 | 77 |
|
78 | 78 |
|
79 | 79 |
/** |
... | ... | |
126 | 126 |
try { |
127 | 127 |
PluginServices.backgroundExecution(new Runnable() { |
128 | 128 |
public void run() { |
129 |
if (l.getAtributes().getType() == Attributes.CUSTOM) { |
|
129 |
if (l.getLayoutContext().getAtributes().getType() == Attributes.CUSTOM) {
|
|
130 | 130 |
l.showPrintDialog(printerJob); |
131 | 131 |
} else { |
132 | 132 |
l.showPrintDialog(null); |
... | ... | |
140 | 140 |
e); |
141 | 141 |
} |
142 | 142 |
} |
143 |
|
|
143 |
|
|
144 | 144 |
public void setLayout(Layout l){ |
145 | 145 |
this.l=l; |
146 | 146 |
} |
... | ... | |
218 | 218 |
(double) 72 / (double) (Attributes.DPI)); |
219 | 219 |
System.err.println("Clip 2 =" + g2d.getClip()); |
220 | 220 |
|
221 |
if (l.getAtributes().isMargin()) { |
|
222 |
g2d.setClip((int) (l.getRect().getMinX() + |
|
223 |
FLayoutUtilities.fromSheetDistance(l.getAtributes().m_area[2], |
|
224 |
l.getAT())), |
|
225 |
(int) (l.getRect().getMinY() + |
|
226 |
FLayoutUtilities.fromSheetDistance(l.getAtributes().m_area[0], |
|
227 |
l.getAT())), |
|
228 |
(int) (l.getRect().getWidth() - |
|
229 |
FLayoutUtilities.fromSheetDistance(l.getAtributes().m_area[2] + |
|
230 |
l.getAtributes().m_area[3], l.getAT())),
|
|
231 |
(int) (l.getRect().getHeight() - |
|
232 |
FLayoutUtilities.fromSheetDistance(l.getAtributes().m_area[0] + |
|
233 |
l.getAtributes().m_area[1], l.getAT())));
|
|
221 |
if (l.getLayoutContext().getAtributes().isMargin()) {
|
|
222 |
g2d.setClip((int) (l.getLayoutControl().getRect().getMinX() +
|
|
223 |
FLayoutUtilities.fromSheetDistance(l.getLayoutContext().getAtributes().m_area[2],
|
|
224 |
l.getLayoutControl().getAT())),
|
|
225 |
(int) (l.getLayoutControl().getRect().getMinY() +
|
|
226 |
FLayoutUtilities.fromSheetDistance(l.getLayoutContext().getAtributes().m_area[0],
|
|
227 |
l.getLayoutControl().getAT())),
|
|
228 |
(int) (l.getLayoutControl().getRect().getWidth() -
|
|
229 |
FLayoutUtilities.fromSheetDistance(l.getLayoutContext().getAtributes().m_area[2] +
|
|
230 |
l.getLayoutContext().getAtributes().m_area[3], l.getLayoutControl().getAT())),
|
|
231 |
(int) (l.getLayoutControl().getRect().getHeight() -
|
|
232 |
FLayoutUtilities.fromSheetDistance(l.getLayoutContext().getAtributes().m_area[0] +
|
|
233 |
l.getLayoutContext().getAtributes().m_area[1], l.getLayoutControl().getAT())));
|
|
234 | 234 |
} else { |
235 | 235 |
/* |
236 | 236 |
Rectangle rec=(Rectangle)g2d.getClipBounds(); |
... | ... | |
270 | 270 |
//paper = format.getPaper(); |
271 | 271 |
|
272 | 272 |
try { |
273 |
if (layout.getAtributes().getType() == Attributes.CUSTOM) { |
|
273 |
if (layout.getLayoutContext().getAtributes().getType() == Attributes.CUSTOM) {
|
|
274 | 274 |
layout.showPrintDialog(printerJob); |
275 | 275 |
} else { |
276 | 276 |
layout.showPrintDialog(null); |
... | ... | |
295 | 295 |
com.iver.cit.gvsig.Print.class)); |
296 | 296 |
|
297 | 297 |
//Actualizar attributes |
298 |
PrintRequestAttributeSet att = layout.getAtributes() |
|
298 |
PrintRequestAttributeSet att = layout.getLayoutContext().getAtributes()
|
|
299 | 299 |
.toPrintAttributes(); |
300 | 300 |
DocFlavor flavor = DocFlavor.SERVICE_FORMATTED.PRINTABLE; |
301 | 301 |
|
Also available in: Unified diff