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