Statistics
| Revision:

root / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / gui / layout / fframes / FFrameView.java @ 1830

History | View | Annotate | Download (18.1 KB)

1
/*
2
 * Created on 20-feb-2004
3
 *
4
 */
5
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
6
 *
7
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
8
 *
9
 * This program is free software; you can redistribute it and/or
10
 * modify it under the terms of the GNU General Public License
11
 * as published by the Free Software Foundation; either version 2
12
 * of the License, or (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with this program; if not, write to the Free Software
21
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
22
 *
23
 * For more information, contact:
24
 *
25
 *  Generalitat Valenciana
26
 *   Conselleria d'Infraestructures i Transport
27
 *   Av. Blasco Ib??ez, 50
28
 *   46010 VALENCIA
29
 *   SPAIN
30
 *
31
 *      +34 963862235
32
 *   gvsig@gva.es
33
 *      www.gvsig.gva.es
34
 *
35
 *    or
36
 *
37
 *   IVER T.I. S.A
38
 *   Salamanca 50
39
 *   46005 Valencia
40
 *   Spain
41
 *
42
 *   +34 963163400
43
 *   dac@iver.es
44
 */
45
package com.iver.cit.gvsig.gui.layout.fframes;
46

    
47
import com.iver.andami.PluginServices;
48
import com.iver.andami.messages.NotificationManager;
49

    
50
import com.iver.cit.gvsig.ProjectExtension;
51
import com.iver.cit.gvsig.fmap.ColorEvent;
52
import com.iver.cit.gvsig.fmap.ExtentEvent;
53
import com.iver.cit.gvsig.fmap.FMap;
54
import com.iver.cit.gvsig.fmap.ViewPort;
55
import com.iver.cit.gvsig.fmap.ViewPortListener;
56
import com.iver.cit.gvsig.fmap.layers.XMLException;
57
import com.iver.cit.gvsig.gui.layout.FLayoutUtilities;
58
import com.iver.cit.gvsig.gui.layout.Layout;
59
import com.iver.cit.gvsig.project.Project;
60
import com.iver.cit.gvsig.project.ProjectView;
61

    
62
import com.iver.utiles.XMLEntity;
63

    
64
import org.apache.log4j.Logger;
65

    
66
import java.awt.Color;
67
import java.awt.Dimension;
68
import java.awt.Graphics2D;
69
import java.awt.Rectangle;
70
import java.awt.geom.AffineTransform;
71
import java.awt.geom.Point2D;
72
import java.awt.geom.Rectangle2D;
73
import java.awt.image.BufferedImage;
74

    
75
import java.util.ArrayList;
76

    
77

    
78
/**
79
 * FFrame para introducir una vista en el Layout.
80
 *
81
 * @author Vicente Caballero Navarro
82
 */
83
public class FFrameView extends FFrame implements ViewPortListener {
84
        private static Logger logger = Logger.getLogger(FFrameView.class.getName());
85
        public static final int AUTOMATICO = 0;
86
        public static final int CONSTANTE = 1;
87
        public static final int MANUAL = 2;
88
        public static final int PRESENTACION = 0;
89
        public static final int BORRADOR = 1;
90
        private int m_Mode;
91
        private int m_typeScale = AUTOMATICO;
92
        private int m_extension = 0;
93
        private int m_quality = PRESENTACION;
94
        private int m_viewing = 0;
95
        private boolean m_bLinked = true;
96
        private ProjectView view = null;
97
        private FMap m_fmap = null;
98
        private double m_Scale = 0;
99
        private int m_mapUnits = 1; //Metros.
100
        private int num = 0;
101
        private BufferedImage m_image = null;
102
        private AffineTransform at = null;
103
        private Project project = null;
104

    
105
        /**
106
         * Creates a new FFrameView object.
107
         */
108
        public FFrameView() {
109
        }
110

    
111
        /**
112
         * Devuelve una descripci?n del FFrameView.
113
         *
114
         * @return Descripci?n.
115
         */
116
        public String toString() {
117
                if (getView() == null) {
118
                        return "FFrameView " + num + ": " + "Vacio";
119
                }
120

    
121
                return "FFrameView " + num + ": " + getView().getName();
122
        }
123

    
124
        /**
125
         * Rellena la escala de la vista que contiene el fframe.
126
         *
127
         * @param d escala de la vista.
128
         */
129
        public void setScale(double d) {
130
                m_Scale = d;
131
        }
132

    
133
        /**
134
         * Inserta el nuevo extent a la FFrameView.
135
         *
136
         * @param r Rect?ngulo a ocupar por el FFrameView.
137
         */
138
        public void setNewExtent(Rectangle2D r) {
139
                getFMap().getViewPort().setExtent(r);
140
                m_Scale = FLayoutUtilities.getScaleView(getFMap().getViewPort(), getBoundBox().width,getBoundingBox(null).width/getBoundBox().width);
141
        }
142

    
143
        /**
144
         * Devuelve el FMap de la vista o una clonaci?n de este si se utiliza una
145
         * escala fija.
146
         *
147
         * @return FMap.
148
         */
149
        public FMap getFMap() {
150
                return m_fmap;
151
        }
152

    
153
        /**
154
         * Rellena la calidad que se quiere aplicar.
155
         *
156
         * @param q entero que representa la calidad a aplicar.
157
         */
158
        public void setQuality(int q) {
159
                m_quality = q;
160
        }
161

    
162
        /**
163
         * Devuelve un entero que representa la calidad que est? seleccionada.
164
         *
165
         * @return tipo de calidad selccionada.
166
         */
167
        public int getQuality() {
168
                return m_quality;
169
        }
170

    
171
        /**
172
         * Devuelve un entero que representa la forma en que se actualiza la vista.
173
         *
174
         * @return forma que se actualiza la vista.
175
         */
176
        public int getViewing() {
177
                return m_viewing;
178
        }
179

    
180
        /**
181
         * Rellena la forma de actualizar la vista.
182
         *
183
         * @param v entero que representa la forma de actualizar la vista.
184
         */
185
        public void setViewing(int v) {
186
                m_viewing = v;
187
        }
188

    
189
        /**
190
         * Inserta el ProjectView de donde obtener las propiedades de la vista a
191
         * mostrar.
192
         *
193
         * @param v Modelo de la vista.
194
         */
195
        public void setView(ProjectView v) {
196
                view = v;
197

    
198
                ViewPort vp = new ViewPort(v.getMapContext().getViewPort()
199
                                                                        .getProjection());
200
                vp.setImageSize(new Dimension((int)getBoundingBox(null).width,(int)getBoundingBox(null).height));
201
                if (m_bLinked) {
202
                        if (getTypeScale() == AUTOMATICO) {
203
                                m_fmap = v.getMapContext().createNewFMap(v.getMapContext()
204
                                                                                                                  .getViewPort()
205
                                                                                                                  .cloneViewPort());
206
                                m_fmap.getViewPort().setImageSize(new Dimension((int)getBoundingBox(null).width,(int)getBoundingBox(null).height));
207
                                v.getMapContext().getViewPort().removeViewPortListener(this);
208
                                v.getMapContext().getViewPort().addViewPortListener(this);
209
                        } else if (getTypeScale() == CONSTANTE) {
210
                                vp.setExtent((Rectangle2D) v.getMapContext().getViewPort()
211
                                                                                        .getExtent().clone());
212
                                m_fmap = v.getMapContext().createNewFMap(vp);
213
                                v.getMapContext().getViewPort().removeViewPortListener(this);
214
                        } else if (getTypeScale() == MANUAL) {
215
                                vp.setExtent(getNewExtent(getScale()));
216
                                m_fmap = v.getMapContext().createNewFMap(vp);
217
                                v.getMapContext().getViewPort().removeViewPortListener(this);
218
                        }
219
                } else if (!m_bLinked) {
220
                        try {
221
                                if (getTypeScale() == AUTOMATICO) {
222
                                        m_fmap = v.getMapContext().cloneFMap(); //(v.getMapContext().getViewPort().cloneViewPort());
223
                                        m_fmap.setViewPort(v.getMapContext().getViewPort()
224
                                                                                .cloneViewPort());
225
                                        v.getMapContext().getViewPort().removeViewPortListener(this);
226
                                        v.getMapContext().getViewPort().addViewPortListener(this);
227
                                } else if (getTypeScale() == CONSTANTE) {
228
                                        vp.setExtent((Rectangle2D) v.getMapContext().getViewPort()
229
                                                                                                .getExtent().clone());
230
                                        m_fmap = v.getMapContext().cloneFMap();
231
                                        m_fmap.setViewPort(vp);
232
                                        v.getMapContext().getViewPort().removeViewPortListener(this);
233
                                } else if (getTypeScale() == MANUAL) {
234
                                        vp.setExtent(getNewExtent(getScale()));
235
                                        m_fmap = v.getMapContext().cloneFMap();
236
                                        m_fmap.setViewPort(vp);
237
                                        v.getMapContext().getViewPort().removeViewPortListener(this);
238
                                }
239
                        } catch (XMLException e1) {
240
                                NotificationManager.addError("Cuando se a?ade una vista al Layout",
241
                                        e1);
242
                        }
243
                }
244

    
245
                /*
246
                   m_fmap = v.getMapContext();
247
                
248
                   v.getMapContext().getViewPort();
249
                   ViewPort vp = new ViewPort();
250
                   vp.setExtent(v.getMapContext().getViewPort().getExtent());
251
                   m_fmap = m_fmap.createNewFMap(vp);
252
                   view = v;
253
                 */
254
        }
255

    
256
        /**
257
         * Devuelve el modelo de la vista.
258
         *
259
         * @return Modelo de la vista.
260
         */
261
        public ProjectView getView() {
262
                return view;
263
        }
264

    
265
        /**
266
         * Devuelve un Rect?ngulo que representa  el extent de la vista que se
267
         * requiere a partir  de una escala.
268
         *
269
         * @param scale Escala a mostrar.
270
         *
271
         * @return Rect?ngulo.
272
         */
273
        private Rectangle2D.Double getNewExtent(long scale) {
274
                double hview = getBoundBox().getHeight();
275
                double wview = getBoundBox().getWidth();
276
                double hextent = (scale * hview) / 100.0;
277
                double wextent = (scale * wview) / 100.0;
278
                double dif = hextent / m_fmap.getViewPort().getExtent().getHeight();
279
                double newx = m_fmap.getViewPort().getExtent().getCenterX() -
280
                        ((m_fmap.getViewPort().getExtent().getWidth() * dif) / 2.0);
281
                double newy = m_fmap.getViewPort().getExtent().getCenterY() -
282
                        ((m_fmap.getViewPort().getExtent().getHeight() * dif) / 2.0);
283

    
284
                return new Rectangle2D.Double(newx, newy, wextent, hextent);
285
        }
286

    
287
        /**
288
         * M?todo que dibuja sobre el graphics que se le pasa como par?metro, seg?n
289
         * la transformada afin que se debe de aplicar y el rect?ngulo que se debe
290
         * de dibujar.
291
         *
292
         * @param g Graphics2D
293
         * @param at Transformada af?n.
294
         * @param rv rect?ngulo sobre el que hacer un clip.
295
         * @param imgBase Imagen para acelerar el dibujado.
296
         *
297
         * @throws com.iver.cit.gvsig.fmap.DriverException
298
         */
299
        public void draw(Graphics2D g, AffineTransform at, Rectangle2D rv,
300
                BufferedImage imgBase) throws com.iver.cit.gvsig.fmap.DriverException {
301
                Rectangle2D.Double r = getBoundingBox(at);
302

    
303
                if (intersects(rv, r)) {
304
                        if (getFMap() == null) {
305
                                drawEmpty(g);
306
                        } else {
307
                                if (rv != null) {
308
                                        // Dibujamos en pantalla
309
                                        Rectangle rclip = g.getClipBounds();
310
                                        g.clipRect((int) r.getMinX(), (int) r.getMinY(),
311
                                                (int) r.getWidth(), (int) r.getHeight());
312

    
313
                                        if (getQuality() == PRESENTACION) {
314
                                                /*     this.getFMap().setTransparent(true);
315
                                                   this.getFMap().drawView((Graphics2D) g,
316
                                                       new Rectangle((int) (r.x), (int) (r.y),
317
                                                           (int) (r.width), (int) (r.height)),
318
                                                       (Rectangle) rv, false, imgBase);
319
                                                 */
320
                                                if (rv.intersects(r)) {
321
                                                        this.getFMap().getViewPort().setOffset(new Point2D.Double(
322
                                                                        r.x, r.y));
323
                                                        this.getFMap().getViewPort().setImageSize(new Dimension(
324
                                                                        (int) r.width, (int) r.height));
325

    
326
                                                        try {
327
                                                            ViewPort viewPort = this.getFMap().getViewPort();
328
                                                            Color theBackColor = viewPort.getBackColor();
329
                                                            if (theBackColor != null)
330
                                                            {
331
                                                                g.setColor(theBackColor);
332
                                                                g.fillRect((int) r.x, (int) r.y, viewPort.getImageWidth(), viewPort.getImageHeight());
333
                                                            }
334
                                                            
335
                                                                this.getFMap().draw(imgBase, g);
336
                                                        } catch (com.iver.cit.gvsig.fmap.DriverException e) {
337
                                                                // TODO Auto-generated catch block
338
                                                                e.printStackTrace();
339
                                                        }
340
                                                }
341

    
342
                                                if (rclip != null) {
343
                                                        g.setClip(rclip.x, rclip.y, rclip.width,
344
                                                                rclip.height); 
345
                                                } 
346
                                        } else {
347
                                                drawDraft(g);
348
                                        }
349
                                } else {
350
                                        print(g, at);
351
                                }
352
                        }
353
                }
354
        }
355

    
356
        /**
357
         * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#print(java.awt.Graphics2D,
358
         *                 java.awt.geom.AffineTransform)
359
         */
360
        public void print(Graphics2D g, AffineTransform at) {
361
                Rectangle2D.Double r = getBoundingBox(at);
362

    
363
                // Dibujamos en impresora
364
                Rectangle rclip = g.getClipBounds();
365
                g.clipRect((int) r.getMinX(), (int) r.getMinY(), (int) r.getWidth(),
366
                        (int) r.getHeight());
367
                this.getFMap().getViewPort().setOffset(new Point2D.Double(r.x, r.y));
368
                this.getFMap().getViewPort().setImageSize(new Dimension((int) r.width,
369
                                (int) r.height));
370

    
371
                try {
372
                        this.getFMap().print(g);
373
                } catch (com.iver.cit.gvsig.fmap.DriverException e) {
374
                        NotificationManager.addError(e.getMessage(), e);
375
                }
376

    
377
                g.setClip(rclip.x, rclip.y, rclip.width, rclip.height);
378
        }
379

    
380
        /**
381
         * Rellena la unidad de medida en la que est? la vista.
382
         *
383
         * @param i entero que representa la unidad de medida de la vista.
384
         */
385
        public void setMapUnits(int i) {
386
                m_mapUnits = i;
387
        }
388

    
389
        /**
390
         * Obtiene la unidad de medida en la que est? la vista.
391
         *
392
         * @return Unidad de medida.
393
         */
394
        public int getMapUnits() {
395
                return m_mapUnits;
396
        }
397

    
398
        /**
399
         * Devuelve la escala seg?n el tipo de escala que se haya seleccionado al
400
         * a?adida la vista.
401
         *
402
         * @return escala.
403
         */
404
        public long getScale() {
405
                /*if (m_bLinked){
406
                   return getScaleView1(METROS);
407
                       }
408
                 */
409
                if (getTypeScale() == AUTOMATICO) {
410
                        return FLayoutUtilities.getScaleView(getFMap().getViewPort(), getBoundBox().width,getBoundingBox(null).width/getBoundBox().width);
411
                } else if (getTypeScale() == CONSTANTE) {
412
                        return (long) m_Scale;
413
                } else if (getTypeScale() == MANUAL) {
414
                        return (long) m_Scale;
415
                }
416

    
417
                return (long) m_Scale;
418
        }
419

    
420
        /**
421
         * Seleccionar si la vista esta relacionada o no con la original.
422
         *
423
         * @param b true si est? ligada y false si no lo est?.
424
         */
425
        public void setLinked(boolean b) {
426
                m_bLinked = b;
427
        }
428

    
429
        /**
430
         * Devuelve si est? ligada o no el FFrameView con la vista.
431
         *
432
         * @return True si la vista est? ligada.
433
         */
434
        public boolean getLinked() {
435
                return m_bLinked;
436
        }
437

    
438
        /**
439
         * Devuelve la opci?n seleccionada:Rellenar marco de la vista o recorte a
440
         * la vista.
441
         *
442
         * @return entero que representa la opci?n elegida.
443
         */
444
        public int getExtension() {
445
                return m_extension;
446
        }
447

    
448
        /**
449
         * Devuelve el tipo de escala que est? seleccionada AUTOMATICO,CONSTANTE o
450
         * MANUAL.
451
         *
452
         * @return entero que representa el tipo seleccionado.
453
         */
454
        public int getTypeScale() {
455
                return m_typeScale;
456
        }
457

    
458
        /**
459
         * Rellenar si se quiere:Rellenar marco de la vista o recorte a la vista.
460
         *
461
         * @param i entero que representa la opci?n elegida.
462
         */
463
        public void setExtension(int i) {
464
                m_extension = i;
465
        }
466

    
467
        /**
468
         * Rellenar el tipo de escala que se desea.
469
         *
470
         * @param i entero que representa el tipo de escala.
471
         */
472
        public void setTypeScale(int i) {
473
                m_typeScale = i;
474
        }
475

    
476
        /**
477
         * @throws XMLException
478
         * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#getXMLEntity()
479
         */
480
        public XMLEntity getXMLEntity() throws XMLException {
481
                XMLEntity xml = new XMLEntity();
482
                xml.putProperty("className",this.getClass().getName());
483
                xml.putProperty("m_name", m_name);
484
                xml.putProperty("x", getBoundBox().x);
485
                xml.putProperty("y", getBoundBox().y);
486
                xml.putProperty("w", getBoundBox().width);
487
                xml.putProperty("h", getBoundBox().height);
488
                xml.putProperty("m_Selected", m_Selected);
489
                xml.putProperty("type", Layout.RECTANGLEVIEW);
490
                xml.putProperty("m_Mode", m_Mode);
491
                xml.putProperty("m_typeScale", m_typeScale);
492
                xml.putProperty("m_extension", m_extension);
493
                xml.putProperty("m_quality", m_quality);
494
                xml.putProperty("m_viewing", m_viewing);
495
                xml.putProperty("m_bLinked", m_bLinked);
496
                xml.putProperty("m_mapUnits", m_mapUnits);
497
                xml.putProperty("m_Scale", m_Scale);
498

    
499
                xml.putProperty("extentX", getFMap().getViewPort().getExtent().getX());
500
                xml.putProperty("extentY", getFMap().getViewPort().getExtent().getY());
501
                xml.putProperty("extentW",
502
                        getFMap().getViewPort().getExtent().getWidth());
503
                xml.putProperty("extentH",
504
                        getFMap().getViewPort().getExtent().getHeight());
505
                xml.putProperty("tag", getTag());
506

    
507
                ProjectExtension pe = (ProjectExtension) PluginServices.getExtension(ProjectExtension.class);
508
                ArrayList views = pe.getProject().getViews();
509

    
510
                boolean hasIndex = false;
511

    
512
                for (int i = 0; i < views.size(); i++) {
513
                        if (view == ((ProjectView) views.get(i))) {
514
                                xml.putProperty("indice", i);
515
                                hasIndex = true;
516
                        }
517
                }
518

    
519
                if (!hasIndex) {
520
                        xml.putProperty("indice", -1);
521
                }
522

    
523
                xml.addChild(m_fmap.getXMLEntity());
524

    
525
                return xml;
526
        }
527

    
528
        /**
529
         * Inserta la imagen para repintar el FFrameView.
530
         *
531
         * @param bi Imagen para repintar.
532
         */
533
        public void setBufferedImage(BufferedImage bi) {
534
                m_image = bi;
535
        }
536

    
537
        /**
538
         * Devuelve la imagen para repintar.
539
         *
540
         * @return Imagen para repintar.
541
         */
542
        public BufferedImage getBufferedImage() {
543
                return m_image;
544
        }
545

    
546
        /**
547
         * Devuelve la MAtriz de transformaci?n utilizada por la FFrameView.
548
         *
549
         * @return MAtriz de transformaci?n.
550
         */
551
        public AffineTransform getAt() {
552
                return at;
553
        }
554

    
555
        /**
556
         * Inserta la matriz de transformaci?n.
557
         *
558
         * @param transform Matriz de transformaci?n.
559
         */
560
        public void setAt(AffineTransform transform) {
561
                at = transform;
562
        }
563

    
564
        /**
565
         * Inserta el proyecto.
566
         *
567
         * @param p Proyecto.
568
         */
569
        public void setProject(Project p) {
570
                project = p;
571
        }
572

    
573
        /**
574
         * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#setXMLEntity(com.iver.utiles.XMLEntity,
575
         *                 com.iver.cit.gvsig.project.Project)
576
         */
577
        public void setXMLEntity(XMLEntity xml, Layout l) {
578
                if (xml.getIntProperty("m_Selected") != 0) {
579
                        this.setSelected(true);
580
                } else {
581
                        this.setSelected(false);
582
                }
583

    
584
                this.setName(xml.getStringProperty("m_name"));
585
                this.setBoundBox(new Rectangle2D.Double(xml.getDoubleProperty("x"),
586
                                xml.getDoubleProperty("y"), xml.getDoubleProperty("w"),
587
                                xml.getDoubleProperty("h")));
588

    
589
                this.m_Mode = xml.getIntProperty("m_Mode");
590
                this.m_typeScale = xml.getIntProperty("m_typeScale");
591
                this.m_extension = xml.getIntProperty("m_extension");
592
                this.m_quality = xml.getIntProperty("m_quality");
593
                this.m_viewing = xml.getIntProperty("m_viewing");
594
                this.m_bLinked = xml.getBooleanProperty("m_bLinked");
595
                this.m_mapUnits = xml.getIntProperty("m_mapUnits");
596

    
597
                ProjectExtension pe = (ProjectExtension) PluginServices.getExtension(ProjectExtension.class);
598
                this.m_Scale = xml.getDoubleProperty("m_Scale");
599

    
600
                int indice = xml.getIntProperty("indice");
601

    
602
                if (indice != -1) {
603
                        ProjectView view = (ProjectView) project.getViews().get(indice);
604
                        this.m_fmap = view.getMapContext();
605
                        this.setView((ProjectView) view);
606

    
607
                        try {
608
                                //this.m_fmap = view.getMapContext();
609

    
610
                                /*        this.getFMap().getViewPort().setExtent(new Rectangle2D.Double(
611
                                   xml.getDoubleProperty("extentX"),
612
                                   xml.getDoubleProperty("extentY"),
613
                                   xml.getDoubleProperty("extentW"),
614
                                   xml.getDoubleProperty("extentH")));
615
                                 */
616
                                if (m_bLinked) {
617
                                        this.getFMap().getViewPort().setExtent(new Rectangle2D.Double(
618
                                                        xml.getDoubleProperty("extentX"),
619
                                                        xml.getDoubleProperty("extentY"),
620
                                                        xml.getDoubleProperty("extentW"),
621
                                                        xml.getDoubleProperty("extentH")));
622
                                } else if (!m_bLinked) {
623
                                        this.m_fmap = FMap.createFromXML(xml.getChild(0));
624
                                }
625
                        } catch (XMLException e) {
626
                                NotificationManager.addError("Pasando las propiedades del XMLEntity al objeto",
627
                                        e);
628
                        }
629
                }
630
        }
631

    
632
        /**
633
         * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#getNameFFrame()
634
         */
635
        public String getNameFFrame() {
636
                return PluginServices.getText(this, "Vista") + num;
637
        }
638

    
639
        /**
640
         * @see com.iver.cit.gvsig.fmap.ExtentListener#extentChanged(com.iver.cit.gvsig.fmap.ExtentEvent)
641
         */
642
        public void extentChanged(ExtentEvent e) {
643
                if (getTypeScale() == AUTOMATICO) {
644
                        m_fmap.getViewPort().setExtent(e.getNewExtent());
645
                }
646
        }
647

    
648
        /**
649
         * @see com.iver.cit.gvsig.fmap.ViewPortListener#backColorChanged(com.iver.cit.gvsig.fmap.ColorEvent)
650
         */
651
        public void backColorChanged(ColorEvent e) {
652
            m_fmap.getViewPort().setBackColor(e.getNewColor());
653
            System.out.println("pasa por backColorChanged");
654
        }
655
}