svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.mapcontext / org.gvsig.fmap.mapcontext.api / src / main / java / org / gvsig / fmap / mapcontext / events / ExtentEvent.java @ 40559
History | View | Annotate | Download (2.94 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 3
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
package org.gvsig.fmap.mapcontext.events; |
25 |
|
26 |
|
27 |
import org.gvsig.fmap.geom.primitive.Envelope; |
28 |
import org.gvsig.timesupport.Time; |
29 |
|
30 |
|
31 |
|
32 |
/**
|
33 |
* <p>Event produced when the adjusted extent or the time
|
34 |
* of the view port have changed.</p>
|
35 |
* <p>
|
36 |
* TODO: This class has to be renamed to ViewPortEvent.
|
37 |
* </p>
|
38 |
*
|
39 |
* @author Vicente Caballero Navarro
|
40 |
*/
|
41 |
public class ExtentEvent extends FMapEvent { |
42 |
/**
|
43 |
* <p>Reference to the new adjusted extent.</p>
|
44 |
*/
|
45 |
private Envelope newExtent;
|
46 |
|
47 |
/**
|
48 |
* <p>Reference to the new time.</p>
|
49 |
*/
|
50 |
private Time newTime; |
51 |
|
52 |
/**
|
53 |
* <p>Identifier of this kind of event.</p>
|
54 |
*/
|
55 |
private static final int EXTENT_EVENT = 0; |
56 |
private static final int TIME_EVENT = 1; |
57 |
|
58 |
/**
|
59 |
* <p>Returns a new extent event.</p>
|
60 |
*
|
61 |
* @param c the new adjusted extent
|
62 |
*
|
63 |
* @return a new extent event
|
64 |
* @deprecated
|
65 |
* use the constructor
|
66 |
*/
|
67 |
public static ExtentEvent createExtentEvent(Envelope r){ |
68 |
return new ExtentEvent(r, EXTENT_EVENT); |
69 |
} |
70 |
|
71 |
/**
|
72 |
* <p>Creates a new extent event.</p>
|
73 |
*
|
74 |
* @param c the new adjusted extent
|
75 |
* @param eventType identifier of this kind of event
|
76 |
*/
|
77 |
private ExtentEvent(Envelope r, int eventType) { |
78 |
setEventType(eventType); |
79 |
newExtent = r; |
80 |
} |
81 |
|
82 |
/**
|
83 |
* <p>Creates a new extent event.</p>
|
84 |
*
|
85 |
* @param c the new adjusted extent
|
86 |
*/
|
87 |
public ExtentEvent(Envelope envelope) {
|
88 |
this(envelope, EXTENT_EVENT);
|
89 |
} |
90 |
|
91 |
/**
|
92 |
* <p>Creates a new time event.</p>
|
93 |
* @param time
|
94 |
* the new time
|
95 |
*/
|
96 |
public ExtentEvent(Time time) { |
97 |
setEventType(TIME_EVENT); |
98 |
newTime = time; |
99 |
} |
100 |
|
101 |
/**
|
102 |
* <p>Gets the new adjusted event.</p>
|
103 |
*
|
104 |
* @return the new adjusted extent
|
105 |
*/
|
106 |
public Envelope getNewExtent() {
|
107 |
return newExtent;
|
108 |
} |
109 |
|
110 |
/**
|
111 |
* <p>Gets the new time event.</p>
|
112 |
*
|
113 |
* @return the new time extent
|
114 |
*/
|
115 |
public Time getNewTime() { |
116 |
return newTime;
|
117 |
} |
118 |
} |
119 |
|
120 |
|