Revision 56
trunk/org.gvsig.app.document.layout.app/org.gvsig.app.document.layout.app.mainplugin/src/main/java/org/gvsig/app/project/documents/layout/fframes/FFrameView.java | ||
---|---|---|
223 | 223 |
* @param v |
224 | 224 |
* Modelo de la vista. |
225 | 225 |
*/ |
226 |
public void setView(DefaultViewDocument v) { |
|
227 |
viewDocument = v; |
|
226 |
public void setView(ViewDocument dvd) { |
|
227 |
|
|
228 |
viewDocument = dvd; |
|
229 |
MapContext mctxt = dvd.getMapContext(); |
|
230 |
|
|
228 | 231 |
ViewPort vp = null; |
229 | 232 |
if (getMapContext() != null) { |
230 | 233 |
vp = getMapContext().getViewPort(); |
231 | 234 |
}else{ |
232 | 235 |
try { |
233 |
vp = (ViewPort) v.getMapContext().getViewPort().clone();
|
|
236 |
vp = (ViewPort) mctxt.getViewPort().clone();
|
|
234 | 237 |
} catch (CloneNotSupportedException e1) { |
235 | 238 |
NotificationManager.addError("Excepci?n :", e1); |
236 | 239 |
} |
... | ... | |
243 | 246 |
if (getTypeScale() == AUTOMATICO) { |
244 | 247 |
try { |
245 | 248 |
mapContext = |
246 |
v.getMapContext().createNewFMap(
|
|
247 |
(ViewPort) v.getMapContext().getViewPort().clone());
|
|
249 |
mctxt.createNewFMap(
|
|
250 |
(ViewPort) mctxt.getViewPort().clone());
|
|
248 | 251 |
} catch (CloneNotSupportedException e1) { |
249 | 252 |
NotificationManager.addError("Excepci?n :", e1); |
250 | 253 |
} |
... | ... | |
252 | 255 |
mapContext.getViewPort().setImageSize( |
253 | 256 |
new Dimension((int) getBoundingBox(null).width, |
254 | 257 |
(int) getBoundingBox(null).height)); |
255 |
v.getMapContext().getViewPort().addViewPortListener(this);
|
|
256 |
v.getMapContext().addLayerListener(this);
|
|
258 |
mctxt.getViewPort().addViewPortListener(this);
|
|
259 |
mctxt.addLayerListener(this);
|
|
257 | 260 |
}else{ |
258 | 261 |
if (getTypeScale() == CONSTANTE) { |
259 |
mapContext = v.getMapContext().createNewFMap(vp);
|
|
262 |
mapContext = mctxt.createNewFMap(vp);
|
|
260 | 263 |
vp.setEnvelope(getNewEnvelope(getScale())); |
261 |
v.getMapContext().getViewPort().addViewPortListener(this);
|
|
262 |
v.getMapContext().addLayerListener(this);
|
|
264 |
mctxt.getViewPort().addViewPortListener(this);
|
|
265 |
mctxt.addLayerListener(this);
|
|
263 | 266 |
}else{ |
264 | 267 |
if (getTypeScale() == MANUAL) { |
265 |
mapContext = v.getMapContext().createNewFMap(vp);
|
|
268 |
mapContext = mctxt.createNewFMap(vp);
|
|
266 | 269 |
vp.setEnvelope(getNewEnvelope(getScale())); |
267 |
v.getMapContext().getViewPort()
|
|
270 |
mctxt.getViewPort()
|
|
268 | 271 |
.addViewPortListener(this); |
269 |
v.getMapContext().addLayerListener(this);
|
|
272 |
mctxt.addLayerListener(this);
|
|
270 | 273 |
} |
271 | 274 |
} |
272 | 275 |
} |
... | ... | |
274 | 277 |
if (!linked) { |
275 | 278 |
|
276 | 279 |
if (getTypeScale() == AUTOMATICO) { |
277 |
mapContext = v.getMapContext().cloneFMap(); // (v.getMapContext().getViewPort().cloneViewPort()); |
|
280 |
mapContext = mctxt.cloneFMap(); |
|
281 |
// (v.getMapContext().getViewPort().cloneViewPort()); |
|
278 | 282 |
try { |
279 |
mapContext.setViewPort((ViewPort) v.getMapContext()
|
|
283 |
mapContext.setViewPort((ViewPort) mctxt
|
|
280 | 284 |
.getViewPort().clone()); |
281 | 285 |
} catch (CloneNotSupportedException e1) { |
282 | 286 |
NotificationManager.addError("Excepci?n :", e1); |
... | ... | |
284 | 288 |
mapContext.getViewPort().setImageSize( |
285 | 289 |
new Dimension((int) getBoundingBox(null).width, |
286 | 290 |
(int) getBoundingBox(null).height)); |
287 |
v.getMapContext().getViewPort().addViewPortListener(this);
|
|
291 |
mctxt.getViewPort().addViewPortListener(this);
|
|
288 | 292 |
}else{ |
289 | 293 |
if (getTypeScale() == CONSTANTE) { |
290 |
mapContext = v.getMapContext().cloneFMap();
|
|
294 |
mapContext = mctxt.cloneFMap();
|
|
291 | 295 |
vp.setEnvelope(getNewEnvelope(getScale())); |
292 | 296 |
mapContext.setViewPort(vp); |
293 |
v.getMapContext().getViewPort() |
|
294 |
.addViewPortListener(this); |
|
297 |
mctxt.getViewPort().addViewPortListener(this); |
|
295 | 298 |
}else{ |
296 | 299 |
if (getTypeScale() == MANUAL) { |
297 |
mapContext = v.getMapContext().cloneFMap();
|
|
300 |
mapContext = mctxt.cloneFMap();
|
|
298 | 301 |
vp.setEnvelope(getNewEnvelope(getScale())); |
299 | 302 |
mapContext.setViewPort(vp); |
300 |
v.getMapContext().getViewPort()
|
|
303 |
mctxt.getViewPort()
|
|
301 | 304 |
.addViewPortListener(this); |
302 | 305 |
} |
303 | 306 |
} |
Also available in: Unified diff