Statistics
| Revision:

gvsig-3d / 2.1 / branches / org.gvsig.view3d_vector_and_extrusion_2.3 / org.gvsig.view3d / org.gvsig.view3d / org.gvsig.view3d.swing / org.gvsig.view3d.swing.api / src / main / java / org / gvsig / view3d / swing / api / MapControl3D.java @ 708

History | View | Annotate | Download (7.66 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
     * Name of gvSIG MapContext property
91
     */
92
    public static final String GVSIG_MAPCONTROL3D = "org.gvsig.view3d.swing.api.MapControl3D";
93

    
94
    /**
95
     * Notification that notifies just before that this
96
     * <code>MapControl3D</code>is diposed.
97
     */
98
    static final String BEFORE_DISPOSE_MAPCONTEX3D_NOTIFICATION =
99
        "MapControl3D.beforeDisposePanel";
100

    
101
    /**
102
     * Notification that notifies just after that this <code>MapControl3D</code>
103
     * is
104
     * diposed.
105
     */
106
    static final String AFTER_DISPOSE_MAPCONTEX3D_NOTIFICATION =
107
        "MapControl3D.afterDisposePanel";
108

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

    
122
    /**
123
     * Gets the <code>MapContext</code> associated.
124
     * 
125
     */
126
    public MapContext getMapContext();
127

    
128
    /**
129
     * Gets {@link TYPE} of this <code>MapControl3D</code>.
130
     * 
131
     */
132
    public TYPE getType();
133
    
134
    /**
135
     * Gets 3D MapControl properties of this MapControl3D. 
136
     * 
137
     * @return
138
     */
139
    public MapControlProperties3D getProperties();
140

    
141
    /**
142
     * Gets vertical exaggeration model of this <code>MapControl3D</code>.
143
     * 
144
     * @see MapControl3D#setVerticalExaggeration(double)
145
     */
146
    public double getVerticalExaggeration();
147

    
148
    /**
149
     * Sets Atmosphere visibility.
150
     * 
151
     * @see MapControl3D#getAtmosphereVisibility()
152
     */
153
    public void setAtmosphereVisibility(boolean visibility);
154

    
155
    /**
156
     * Sets MiniMap visibility.
157
     * 
158
     * @see MapControl3D#getMinimapVisibility()
159
     */
160
    public void setMiniMapVisibility(boolean visibility);
161

    
162
    /**
163
     * Sets North Indicator visibility.
164
     * 
165
     * @see MapControl3D#getNorthIndicatorVisibility()
166
     */
167
    public void setNorthIndicatorVisibility(boolean visibility);
168

    
169
    /**
170
     * Sets Scale visibility.
171
     * 
172
     * @see MapControl3D#getScaleVisibility()
173
     */
174
    public void setScaleVisibility(boolean visibility);
175

    
176
    /**
177
     * Sets Star background visibility.
178
     * 
179
     * @see MapControl3D#getStarBackgroundVisibility()
180
     */
181
    public void setStarsBackgroundVisibility(boolean visibility);
182
    
183
    /**
184
     * Gets Atmosphere visibility.
185
     * 
186
     * @see MapControl3D#getAtmosphereVisibility()
187
     */
188
    public boolean getAtmosphereVisibility();
189
    
190
    /**
191
     * Gets Minimap visibility.
192
     * 
193
     * @see MapControl3D#getMinimapVisibility()
194
     */
195
    public boolean getMinimapVisibility();
196
    
197
    /**
198
     * Gets North indicator visibility.
199
     * 
200
     * @see MapControl3D#getNorthIndicatorVisibility()
201
     */
202
    public boolean getNorthIndicatorVisibility();
203
    
204
    /**
205
     * Gets Star background visibility.
206
     * 
207
     * @see MapControl3D#getStarBackgroundVisibility()
208
     */
209
    public boolean getStarBackgroundVisibility();
210
    
211
    /**
212
     * Gets Scale visibility.
213
     * 
214
     * @see MapControl3D#getScaleVisibility()
215
     */
216
    public boolean getScaleVisibility();
217

    
218
    /**
219
     * Forces reloading of all layers associated with the <code>MapContext</code>.
220
     * 
221
     * @see {@link MapControl3D#synchronizeLayers()}
222
     */
223
    public void reloadLayers();
224

    
225
    /**
226
     * Synchronizes view of <code>MapControl3D</code> with the viewport of the
227
     * associated <code>MapContext</code>.
228
     */
229
    public void synchronizeViewPorts();
230

    
231
    /**
232
     * Synchronizes only dirty layers in the 3d view with the 
233
     * <code>MapContext</code>. To force synchronization of all layers use
234
     * {@link MapControl3D#reloadLayers()}.
235
     */
236
    public void synchronizeLayers();
237

    
238
}