Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / libFMap_mapcontext / src / org / gvsig / fmap / mapcontext / events / ExtentEvent.java @ 37298

History | View | Annotate | Download (3.21 KB)

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

    
43

    
44
import org.gvsig.fmap.geom.primitive.Envelope;
45
import org.gvsig.timesupport.Time;
46

    
47

    
48

    
49
/**
50
 * <p>Event produced when the adjusted extent or the time
51
 * of the view port have changed.</p>
52
 * <p>
53
 * TODO: This class has to be renamed to ViewPortEvent.
54
 * </p>
55
 *
56
 * @author Vicente Caballero Navarro
57
 */
58
public class ExtentEvent extends FMapEvent {
59
        /**
60
         * <p>Reference to the new adjusted extent.</p>
61
         */
62
        private Envelope newExtent;
63
        
64
        /**
65
         * <p>Reference to the new time.</p>
66
         */
67
        private Time newTime;
68

    
69
        /**
70
         * <p>Identifier of this kind of event.</p>
71
         */
72
        private static final int EXTENT_EVENT = 0;
73
        private static final int TIME_EVENT = 1;
74

    
75
        /**
76
         * <p>Returns a new extent event.</p>
77
         *
78
         * @param c the new adjusted extent
79
         *
80
         * @return a new extent event
81
         * @deprecated
82
         *         use the constructor 
83
         */
84
        public static ExtentEvent createExtentEvent(Envelope r){
85
                return new ExtentEvent(r, EXTENT_EVENT);
86
        }
87

    
88
        /**
89
         * <p>Creates a new extent event.</p>
90
         *
91
         * @param c the new adjusted extent
92
         * @param eventType identifier of this kind of event
93
         */
94
        private ExtentEvent(Envelope r, int eventType) {
95
                setEventType(eventType);
96
                newExtent = r;
97
        }
98
        
99
        /**
100
     * <p>Creates a new extent event.</p>
101
     *
102
     * @param c the new adjusted extent
103
     */
104
    public ExtentEvent(Envelope envelope) {
105
        this(envelope, EXTENT_EVENT);       
106
    }
107
    
108
    /**
109
     * <p>Creates a new time event.</p>
110
     * @param time
111
     *          the new time
112
     */
113
    public ExtentEvent(Time time) {
114
        setEventType(TIME_EVENT);
115
        newTime = time;
116
    }
117

    
118
        /**
119
         * <p>Gets the new adjusted event.</p>
120
         *
121
         * @return the new adjusted extent
122
         */
123
        public Envelope getNewExtent() {
124
                return newExtent;
125
        }
126
        
127
        /**
128
     * <p>Gets the new time event.</p>
129
     *
130
     * @return the new time extent
131
     */
132
    public Time getNewTime() {
133
        return newTime;
134
    }
135
}
136

    
137