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

History | View | Annotate | Download (7.23 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

    
39
/**
40
 * A component that includes a {@link MapContext} and a
41
 * {@link WorldWindowGLJPanel}.
42
 * 
43
 * <code>MapContext</code> is used to:
44
 * <ul>
45
 * <li>Get layers to convert them to {@link Layer}. When <code>MapContext</code>
46
 * layers are converted, they are added to WorldWindowGLJPanel to display it.</li>
47
 * <li>Get {@link ViewPort} to synchronize view ports.</li>
48
 * </ul>
49
 * 
50
 * <code>WorldWindowGLJPanel</code> is used to display WW Models (globe and
51
 * layers). It's a self-contained component intended to serve as an
52
 * application's WorldWindow.
53
 * 
54
 * This component offers methods to:
55
 * <ul>
56
 * <li>Get shared object to cancel draw request. See
57
 * {@link MapControl3D#getCancellable()}</li>
58
 * <li>Get and set associated <code>MapContext</code>. See
59
 * {@link MapControl3D#getMapContext()}</li>
60
 * <li>Get and set vertical exaggeration of WW Model. See
61
 * {@link MapControl3D#getVerticalExaggeration()} and
62
 * {@link MapControl3D#setVerticalExaggeration(double)}</li>
63
 * <li>Show and hide atmosphere layer. See {@link MapControl3D#showAtmosphere()}
64
 * and {@link MapControl3D#hideAtmosphere()}</li>
65
 * <li>Show and hide Minimap component layer. See
66
 * {@link MapControl3D#showMiniMap()} and {@link MapControl3D#hideMiniMap()}</li>
67
 * <li>Show and hide North indicator component layer. See
68
 * {@link MapControl3D#showNortIndicator()} and
69
 * {@link MapControl3D#hideNorthIndicator()}</li>
70
 * <li>Show and hide scale component layer. See {@link MapControl3D#showScale()}
71
 * and {@link MapControl3D#hideScale()}</li>
72
 * <li>Show and hide start background layer layer. See
73
 * {@link MapControl3D#showStarBackgroundLayer()} and
74
 * {@link MapControl3D#hideStarBackground()}</li>
75
 * <li>Synchronize view ports. See {@link MapControl3D#synchronizeViewPorts()}</li>
76
 * <li>Reload layers. There are two methos to reload layers. The first methos is
77
 * {@link MapControl3D#synchronizeLayers()} that only reload layers with chages.
78
 * The second methos is {@link MapControl3D#reloadLayers()} that reload all
79
 * layers of <code>MapContext</code></li>
80
 * </ul>
81
 * 
82
 * @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
83
 *
84
 */
85
@SuppressWarnings("deprecation")
86
public interface MapControl3D extends Component, Disposable, Observable {
87

    
88
    /**
89
     * Notification that notifies just before that this
90
     * <code>MapControl3D</code>is diposed.
91
     */
92
    static final String BEFORE_DISPOSE_MAPCONTEX3D_NOTIFICATION =
93
        "MapControl3D.beforeDisposePanel";
94

    
95
    /**
96
     * Notification that notifies just after that this <code>MapControl3D</code>
97
     * is
98
     * diposed.
99
     */
100
    static final String AFTER_DISPOSE_MAPCONTEX3D_NOTIFICATION =
101
        "MapControl3D.afterDisposePanel";
102

    
103
    /**
104
     * Gets shared object to cancel draw of loaded layers. To cancel draw use
105
     * set
106
     * canceled <code>true</code> with {@link Cancellable#setCanceled(boolean)}
107
     * 
108
     * Note: {@link Cancellable} is deprecated but we have to use it because
109
     * {@link FLayer#draw(java.awt.image.BufferedImage, java.awt.Graphics2D, org.gvsig.fmap.mapcontext.ViewPort, Cancellable, double)}
110
     * use it.
111
     * 
112
     * @see Cancellable
113
     */
114
    public Cancellable getCancellable();
115

    
116
    /**
117
     * Gets the <code>MapContext</code> associated.
118
     * 
119
     * @see MapContext
120
     */
121
    public MapContext getMapContext();
122

    
123
    /**
124
     * Gets {@link TYPE} of this <code>MapControl3D</code>.
125
     * 
126
     */
127
    public TYPE getType();
128

    
129
    /**
130
     * Gets vertical exaggeration model of this <code>MapControl3D</code>.
131
     * 
132
     * @see MapControl3D#setVerticalExaggeration(double)
133
     */
134
    public double getVerticalExaggeration();
135

    
136
    /**
137
     * Hides Atmosphere component.
138
     * 
139
     * @see MapControl3D#showAtmosphere()
140
     */
141
    public void hideAtmosphere();
142

    
143
    /**
144
     * Hides MiniMap component.
145
     * 
146
     * @see MapControl3D#showMiniMap()
147
     */
148
    public void hideMiniMap();
149

    
150
    /**
151
     * Hides North Indicator component.
152
     * 
153
     * @see MapControl3D#showNortIndicator()
154
     */
155
    public void hideNorthIndicator();
156

    
157
    /**
158
     * Hides Scale component.
159
     * 
160
     * @see MapControl3D#showScale()
161
     */
162
    public void hideScale();
163

    
164
    /**
165
     * Hides Star background layer.
166
     * 
167
     * @see MapControl3D#showStarBackgroundLayer()
168
     */
169
    public void hideStarBackground();
170

    
171
    /**
172
     * Forces reload all layers of <code>MapContext</code> associted.
173
     * 
174
     * @see {@link MapControl3D#synchronizeLayers()}
175
     */
176
    public void reloadLayers();
177

    
178
    /**
179
     * Sets MapContext and loads new MapContext layers.
180
     * 
181
     * @see MapControl3D#getMapContext()
182
     */
183
    public void setMapContext(MapContext theMapContext);
184

    
185
    /**
186
     * Sets vertical exaggeration.
187
     * 
188
     * @see MapControl3D#getVerticalExaggeration()
189
     */
190
    public void setVerticalExaggeration(double verticalExaggeration);
191

    
192
    /**
193
     * Shows Atmosphere layer.
194
     * 
195
     * @see MapControl3D#hideAtmosphere()
196
     */
197
    public void showAtmosphere();
198

    
199
    /**
200
     * Shows Minimap component.
201
     * 
202
     * @see MapControl3D#hideMiniMap()
203
     */
204
    public void showMiniMap();
205

    
206
    /**
207
     * Shows North indicartor component.
208
     * 
209
     * @see MapControl3D#hideNorthIndicator()
210
     */
211
    public void showNortIndicator();
212

    
213
    /**
214
     * Shows Scale component.
215
     * 
216
     * @see MapControl3D#hideScale()
217
     */
218
    public void showScale();
219

    
220
    /**
221
     * Shows Star background layer.
222
     * 
223
     * @see MapControl3D#hideStarBackground()
224
     */
225
    public void showStarBackgroundLayer();
226

    
227
    /**
228
     * Synchronize view of <code>MapControl3D</code> with view port of
229
     * <code>MapContext</code> associated.
230
     */
231
    public void synchronizeViewPorts();
232

    
233
    /**
234
     * Synchronize with <code>MapContext</code> associted only layers with
235
     * changes. To force synchronize all layers use
236
     * {@link MapControl3D#reloadLayers()}.
237
     * 
238
     */
239
    public void synchronizeLayers();
240

    
241
}