Statistics
| Revision:

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 @ 494

History | View | Annotate | Download (7.68 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.lib.api.properties.MapControlProperties3D;
38
import org.gvsig.view3d.swing.api.View3DSwingManager.TYPE;
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>Show and hide atmosphere layer. See {@link MapControl3D#showAtmosphere()}
65
 * and {@link MapControl3D#hideAtmosphere()}</li>
66
 * <li>Show and hide Minimap component layer. See
67
 * {@link MapControl3D#showMiniMap()} and {@link MapControl3D#hideMiniMap()}</li>
68
 * <li>Show and hide North indicator component layer. See
69
 * {@link MapControl3D#showNortIndicator()} and
70
 * {@link MapControl3D#hideNorthIndicator()}</li>
71
 * <li>Show and hide scale component layer. See {@link MapControl3D#showScale()}
72
 * and {@link MapControl3D#hideScale()}</li>
73
 * <li>Show and hide start background layer layer. See
74
 * {@link MapControl3D#showStarBackgroundLayer()} and
75
 * {@link MapControl3D#hideStarBackground()}</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
     * Hides Atmosphere component.
145
     * 
146
     * @see MapControl3D#showAtmosphere()
147
     */
148
    public void hideAtmosphere();
149

    
150
    /**
151
     * Hides MiniMap component.
152
     * 
153
     * @see MapControl3D#showMiniMap()
154
     */
155
    public void hideMiniMap();
156

    
157
    /**
158
     * Hides North Indicator component.
159
     * 
160
     * @see MapControl3D#showNortIndicator()
161
     */
162
    public void hideNorthIndicator();
163

    
164
    /**
165
     * Hides Scale component.
166
     * 
167
     * @see MapControl3D#showScale()
168
     */
169
    public void hideScale();
170

    
171
    /**
172
     * Hides Star background layer.
173
     * 
174
     * @see MapControl3D#showStarBackgroundLayer()
175
     */
176
    public void hideStarBackground();
177
    
178
    /**
179
     * Gets if Atmosphere is visible or not.
180
     * 
181
     * @return
182
     */
183
    public boolean isAtmosphereVisible();
184
    
185
    /**
186
     * Gets if Minimap is visible or not.
187
     * 
188
     * @return
189
     */
190
    public boolean isMinimapVisible();
191
    
192
    /**
193
     * Gets if North indicator is visible or not.
194
     * 
195
     * @return
196
     */
197
    public boolean isNorthIndicatorVisible();
198
    
199
    /**
200
     * Gets if Star background is visible or not.
201
     * 
202
     * @return
203
     */
204
    public boolean isStartBackgroundVisible();
205
    
206
    /**
207
     * Gets if Scale is visible or not.
208
     * 
209
     * @return
210
     */
211
    public boolean isScaleVisible();
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
     * Shows Atmosphere layer.
222
     * 
223
     * @see MapControl3D#hideAtmosphere()
224
     */
225
    public void showAtmosphere();
226

    
227
    /**
228
     * Shows Minimap component.
229
     * 
230
     * @see MapControl3D#hideMiniMap()
231
     */
232
    public void showMiniMap();
233

    
234
    /**
235
     * Shows North indicartor component.
236
     * 
237
     * @see MapControl3D#hideNorthIndicator()
238
     */
239
    public void showNortIndicator();
240

    
241
    /**
242
     * Shows Scale component.
243
     * 
244
     * @see MapControl3D#hideScale()
245
     */
246
    public void showScale();
247

    
248
    /**
249
     * Shows Star background layer.
250
     * 
251
     * @see MapControl3D#hideStarBackground()
252
     */
253
    public void showStarBackgroundLayer();
254

    
255
    /**
256
     * Synchronize view of <code>MapControl3D</code> with view port of
257
     * <code>MapContext</code> associated.
258
     */
259
    public void synchronizeViewPorts();
260

    
261
    /**
262
     * Synchronize with <code>MapContext</code> associted only layers with
263
     * changes. To force synchronize all layers use
264
     * {@link MapControl3D#reloadLayers()}.
265
     * 
266
     */
267
    public void synchronizeLayers();
268

    
269
}