gvsig-3d / 2.1 / trunk / org.gvsig.view3d / org.gvsig.view3d.swing / org.gvsig.view3d.swing.api / src / main / java / org / gvsig / view3d / swing / api / MapControl3D.java @ 509
History | View | Annotate | Download (7.45 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright ? 2007-2015 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 2
|
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 |
|
25 |
package org.gvsig.view3d.swing.api; |
26 |
|
27 |
import gov.nasa.worldwind.awt.WorldWindowGLJPanel; |
28 |
import gov.nasa.worldwind.layers.Layer; |
29 |
|
30 |
import org.gvsig.fmap.mapcontext.MapContext; |
31 |
import org.gvsig.fmap.mapcontext.ViewPort; |
32 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
33 |
import org.gvsig.tools.dispose.Disposable; |
34 |
import org.gvsig.tools.observer.Observable; |
35 |
import org.gvsig.tools.swing.api.Component; |
36 |
import org.gvsig.tools.task.Cancellable; |
37 |
import org.gvsig.view3d.swing.api.View3DSwingManager.TYPE; |
38 |
import org.gvsig.view3d.swing.api.properties.MapControlProperties3D; |
39 |
|
40 |
/**
|
41 |
* A component that includes a {@link MapContext} and a
|
42 |
* {@link WorldWindowGLJPanel}.
|
43 |
*
|
44 |
* <code>MapContext</code> is used to:
|
45 |
* <ul>
|
46 |
* <li>Get layers to convert them to {@link Layer}. When <code>MapContext</code>
|
47 |
* layers are converted, they are added to WorldWindowGLJPanel to display it.</li>
|
48 |
* <li>Get {@link ViewPort} to synchronize view ports.</li>
|
49 |
* </ul>
|
50 |
*
|
51 |
* <code>WorldWindowGLJPanel</code> is used to display WW Models (globe and
|
52 |
* layers). It's a self-contained component intended to serve as an
|
53 |
* application's WorldWindow.
|
54 |
*
|
55 |
* This component offers methods to:
|
56 |
* <ul>
|
57 |
* <li>Get shared object to cancel draw request. See
|
58 |
* {@link MapControl3D#getCancellable()}</li>
|
59 |
* <li>Get and set associated <code>MapContext</code>. See
|
60 |
* {@link MapControl3D#getMapContext()}</li>
|
61 |
* <li>Get and set vertical exaggeration of WW Model. See
|
62 |
* {@link MapControl3D#getVerticalExaggeration()} and
|
63 |
* {@link MapControl3D#setVerticalExaggeration(double)}</li>
|
64 |
* <li>Get and set atmosphere layer. See {@link MapControl3D#getAtmosphereVisibility()}
|
65 |
* and {@link MapControl3D#setAtmosphereVisibility(boolean)}</li>
|
66 |
* <li>Get and set Minimap component layer. See
|
67 |
* {@link MapControl3D#getMinimapVisibility()} and {@link MapControl3D#setMiniMapVisibility(boolean)}</li>
|
68 |
* <li>Get and set North indicator component layer. See
|
69 |
* {@link MapControl3D#getNorthIndicatorVisibility()} and
|
70 |
* {@link MapControl3D#setNorthIndicatorVisibility(boolean)}</li>
|
71 |
* <li>Get and set scale component layer. See {@link MapControl3D#getScaleVisibility()}
|
72 |
* and {@link MapControl3D#setScaleVisibility(boolean)}</li>
|
73 |
* <li>Get and set star background layer. See
|
74 |
* {@link MapControl3D#getStarBackgroundVisibility()} and
|
75 |
* {@link MapControl3D#setStarsBackgroundVisibility(boolean)}</li>
|
76 |
* <li>Synchronize view ports. See {@link MapControl3D#synchronizeViewPorts()}</li>
|
77 |
* <li>Reload layers. There are two methos to reload layers. The first methos is
|
78 |
* {@link MapControl3D#synchronizeLayers()} that only reload layers with chages.
|
79 |
* The second methos is {@link MapControl3D#reloadLayers()} that reload all
|
80 |
* layers of <code>MapContext</code></li>
|
81 |
* </ul>
|
82 |
*
|
83 |
* @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
|
84 |
*
|
85 |
*/
|
86 |
@SuppressWarnings("deprecation") |
87 |
public interface MapControl3D extends Component, Disposable, Observable { |
88 |
|
89 |
/**
|
90 |
* Notification that notifies just before that this
|
91 |
* <code>MapControl3D</code>is diposed.
|
92 |
*/
|
93 |
static final String BEFORE_DISPOSE_MAPCONTEX3D_NOTIFICATION = |
94 |
"MapControl3D.beforeDisposePanel";
|
95 |
|
96 |
/**
|
97 |
* Notification that notifies just after that this <code>MapControl3D</code>
|
98 |
* is
|
99 |
* diposed.
|
100 |
*/
|
101 |
static final String AFTER_DISPOSE_MAPCONTEX3D_NOTIFICATION = |
102 |
"MapControl3D.afterDisposePanel";
|
103 |
|
104 |
/**
|
105 |
* Gets shared object to cancel draw of loaded layers. To cancel draw use
|
106 |
* set
|
107 |
* canceled <code>true</code> with {@link Cancellable#setCanceled(boolean)}
|
108 |
*
|
109 |
* Note: {@link Cancellable} is deprecated but we have to use it because
|
110 |
* {@link FLayer#draw(java.awt.image.BufferedImage, java.awt.Graphics2D, org.gvsig.fmap.mapcontext.ViewPort, Cancellable, double)}
|
111 |
* use it.
|
112 |
*
|
113 |
* @see Cancellable
|
114 |
*/
|
115 |
public Cancellable getCancellable();
|
116 |
|
117 |
/**
|
118 |
* Gets the <code>MapContext</code> associated.
|
119 |
*
|
120 |
* @see MapContext
|
121 |
*/
|
122 |
public MapContext getMapContext();
|
123 |
|
124 |
/**
|
125 |
* Gets {@link TYPE} of this <code>MapControl3D</code>.
|
126 |
*
|
127 |
*/
|
128 |
public TYPE getType();
|
129 |
|
130 |
/**
|
131 |
*
|
132 |
* @return
|
133 |
*/
|
134 |
public MapControlProperties3D getProperties();
|
135 |
|
136 |
/**
|
137 |
* Gets vertical exaggeration model of this <code>MapControl3D</code>.
|
138 |
*
|
139 |
* @see MapControl3D#setVerticalExaggeration(double)
|
140 |
*/
|
141 |
public double getVerticalExaggeration(); |
142 |
|
143 |
/**
|
144 |
* Sets Atmosphere visibility.
|
145 |
*
|
146 |
* @see MapControl3D#getAtmosphereVisibility()
|
147 |
*/
|
148 |
public void setAtmosphereVisibility(boolean visibility); |
149 |
|
150 |
/**
|
151 |
* Sets MiniMap visibility.
|
152 |
*
|
153 |
* @see MapControl3D#getMinimapVisibility()
|
154 |
*/
|
155 |
public void setMiniMapVisibility(boolean visibility); |
156 |
|
157 |
/**
|
158 |
* Sets North Indicator visibility.
|
159 |
*
|
160 |
* @see MapControl3D#getNorthIndicatorVisibility()
|
161 |
*/
|
162 |
public void setNorthIndicatorVisibility(boolean visibility); |
163 |
|
164 |
/**
|
165 |
* Sets Scale visibility.
|
166 |
*
|
167 |
* @see MapControl3D#getScaleVisibility()
|
168 |
*/
|
169 |
public void setScaleVisibility(boolean visibility); |
170 |
|
171 |
/**
|
172 |
* Sets Star background visibility.
|
173 |
*
|
174 |
* @see MapControl3D#getStarBackgroundVisibility()
|
175 |
*/
|
176 |
public void setStarsBackgroundVisibility(boolean visibility); |
177 |
|
178 |
/**
|
179 |
* Gets Atmosphere visibility.
|
180 |
*
|
181 |
* @see MapControl3D#getAtmosphereVisibility()
|
182 |
*/
|
183 |
public boolean getAtmosphereVisibility(); |
184 |
|
185 |
/**
|
186 |
* Gets Minimap visibility.
|
187 |
*
|
188 |
* @see MapControl3D#getMinimapVisibility()
|
189 |
*/
|
190 |
public boolean getMinimapVisibility(); |
191 |
|
192 |
/**
|
193 |
* Gets North indicator visibility.
|
194 |
*
|
195 |
* @see MapControl3D#getNorthIndicatorVisibility()
|
196 |
*/
|
197 |
public boolean getNorthIndicatorVisibility(); |
198 |
|
199 |
/**
|
200 |
* Gets Star background visibility.
|
201 |
*
|
202 |
* @see MapControl3D#getStarBackgroundVisibility()
|
203 |
*/
|
204 |
public boolean getStarBackgroundVisibility(); |
205 |
|
206 |
/**
|
207 |
* Gets Scale visibility.
|
208 |
*
|
209 |
* @see MapControl3D#getScaleVisibility()
|
210 |
*/
|
211 |
public boolean getScaleVisibility(); |
212 |
|
213 |
/**
|
214 |
* Forces reload all layers of <code>MapContext</code> associted.
|
215 |
*
|
216 |
* @see {@link MapControl3D#synchronizeLayers()}
|
217 |
*/
|
218 |
public void reloadLayers(); |
219 |
|
220 |
/**
|
221 |
* Synchronize view of <code>MapControl3D</code> with view port of
|
222 |
* <code>MapContext</code> associated.
|
223 |
*/
|
224 |
public void synchronizeViewPorts(); |
225 |
|
226 |
/**
|
227 |
* Synchronize with <code>MapContext</code> associted only layers with
|
228 |
* changes. To force synchronize all layers use
|
229 |
* {@link MapControl3D#reloadLayers()}.
|
230 |
*
|
231 |
*/
|
232 |
public void synchronizeLayers(); |
233 |
|
234 |
} |