Revision 717
2.1/branches/org.gvsig.view3d_vector_and_extrusion_2.3/org.gvsig.view3d/org.gvsig.view3d/org.gvsig.view3d.lib/org.gvsig.view3d.lib.impl/src/main/java/org/gvsig/view3d/lib/impl/layers/loaders/AbstractVectorLayerLoaderFactory.java | ||
---|---|---|
42 | 42 |
|
43 | 43 |
/** |
44 | 44 |
* Abstract Loader factory for vector layers. |
45 |
*
|
|
45 |
* |
|
46 | 46 |
* @author Andrea Antonello (www.hydrologis.com) |
47 | 47 |
* |
48 | 48 |
*/ |
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/View3DPanel.java | ||
---|---|---|
29 | 29 |
/** |
30 | 30 |
* Component to show a {@link MapControl3D} component and register window |
31 | 31 |
* listeners if it is necessary. |
32 |
*
|
|
32 |
* |
|
33 | 33 |
* @author <a href="mailto:lmarques@disid.com">Lluis Marques</a> |
34 | 34 |
* |
35 | 35 |
*/ |
36 | 36 |
public interface View3DPanel extends Component { |
37 |
|
|
37 |
|
|
38 | 38 |
/** |
39 | 39 |
* Sets full screen mode. |
40 |
*
|
|
40 |
* |
|
41 | 41 |
*/ |
42 | 42 |
public void fullScreen(); |
43 |
|
|
43 |
|
|
44 | 44 |
/** |
45 |
* Gets <code>MapControl3D</code> of this <code>ViewPanel</code> |
|
45 |
* @return Gets <code>MapControl3D</code> of this <code>ViewPanel</code>
|
|
46 | 46 |
*/ |
47 | 47 |
public MapControl3D getMapControl3D(); |
48 |
|
|
48 |
|
|
49 | 49 |
/** |
50 |
* Shows panel like a window.
|
|
50 |
* Shows panel like a window. |
|
51 | 51 |
*/ |
52 | 52 |
public void show(); |
53 | 53 |
} |
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/exceptions/ConversionLayerException.java | ||
---|---|---|
1 |
package org.gvsig.view3d.swing.api.exceptions; |
|
2 |
|
|
3 |
import org.gvsig.tools.exception.BaseException; |
|
4 |
|
|
5 |
|
|
6 |
/** |
|
7 |
* Exception to indicate that a layer can not be converted to WW Layer to be added to WW view. |
|
8 |
* |
|
9 |
* @author <a href="mailto:lmarques@disid.com">Lluis Marques</a> |
|
10 |
* |
|
11 |
*/ |
|
12 |
public class ConversionLayerException extends BaseException { |
|
13 |
|
|
14 |
/** |
|
15 |
* |
|
16 |
*/ |
|
17 |
private static final long serialVersionUID = 5815056395316008358L; |
|
18 |
|
|
19 |
private static final String MESSAGE_KEY = "conversion_layer_exception"; |
|
20 |
|
|
21 |
private static final String MESSAGE = "Can not convert layer to be loaded"; |
|
22 |
|
|
23 |
/** |
|
24 |
* @param e |
|
25 |
*/ |
|
26 |
public ConversionLayerException(Throwable e) { |
|
27 |
super(MESSAGE, e, MESSAGE_KEY, serialVersionUID); |
|
28 |
} |
|
29 |
|
|
30 |
/** |
|
31 |
* @param message |
|
32 |
* @param e |
|
33 |
*/ |
|
34 |
public ConversionLayerException(String message, Throwable e) { |
|
35 |
super(message, e, MESSAGE_KEY, serialVersionUID); |
|
36 |
} |
|
37 |
|
|
38 |
} |
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/View3DSwingManager.java | ||
---|---|---|
28 | 28 |
|
29 | 29 |
import org.gvsig.fmap.mapcontext.MapContext; |
30 | 30 |
import org.gvsig.fmap.mapcontext.layers.ExtendedPropertiesSupport; |
31 |
import org.gvsig.tools.observer.Observable; |
|
31 | 32 |
import org.gvsig.view3d.lib.api.properties.LayerProperties3D; |
32 | 33 |
import org.gvsig.view3d.swing.api.properties.GeneralProperties3D; |
33 | 34 |
import org.gvsig.view3d.swing.api.properties.GeneralProperties3DPanel; |
... | ... | |
39 | 40 |
* This class is responsible of the management of the library's swing user |
40 | 41 |
* interface. It is the swing library's main entry point, and provides all the |
41 | 42 |
* services to manage library swing components. |
42 |
*
|
|
43 |
* |
|
43 | 44 |
* @author <a href="mailto:lmarques@disid.com">Lluis Marques</a> |
44 | 45 |
* |
45 | 46 |
*/ |
46 |
public interface View3DSwingManager { |
|
47 |
public interface View3DSwingManager extends Observable {
|
|
47 | 48 |
|
49 |
public static final String BEFORE_CREATE_MAPCONTROL3D = "beforeCreateMapControl3D"; |
|
50 |
public static final String AFTER_CREATE_MAPCONTROL3D = "afterCreateMapControl3D"; |
|
51 |
|
|
52 |
|
|
48 | 53 |
public enum TYPE { |
49 | 54 |
SPHERE, FLAT |
50 | 55 |
} |
... | ... | |
53 | 58 |
* Creates the general 3D properties panel. General 3D properties is used to |
54 | 59 |
* show and change General 3D properties in a graphical way. See |
55 | 60 |
* {@link GeneralProperties3D}. |
56 |
*
|
|
61 |
* |
|
57 | 62 |
* @param properties |
58 | 63 |
* Model of general 3D properties panel. |
59 | 64 |
* @return general 3D properties panel. |
... | ... | |
64 | 69 |
* Creates the layer 3D properties panel. Layer 3D properties panel is used |
65 | 70 |
* to show and change layer 3D properties in a graphical way. See |
66 | 71 |
* {@link LayerProperties3D}. |
67 |
*
|
|
72 |
* |
|
68 | 73 |
* @param name |
69 | 74 |
* the name/type of the panel to create. Needs to be one of the registered. |
70 | 75 |
* @return layer 3D properties panel. |
... | ... | |
72 | 77 |
public ILayerProperties3DPanel createLayerProperties3DPanel(String name); |
73 | 78 |
|
74 | 79 |
/** |
75 |
* Registers and creatres a <code>MapControl3D</code> as from
|
|
80 |
* Registers and creates a <code>MapControl3D</code> as from |
|
76 | 81 |
* {@link MapContext} {@link TYPE}. When an {@link MapControl3D} is created, |
77 | 82 |
* it automatically adds all available and visible layers of |
78 | 83 |
* <code>MapControl</code>. |
79 |
*
|
|
84 |
* |
|
80 | 85 |
* @param theMapContext |
81 | 86 |
* associated <code>MapContext</code> of |
82 | 87 |
* <code>MapControl3D</code> |
... | ... | |
93 | 98 |
|
94 | 99 |
/** |
95 | 100 |
* Creates a <code>View3DPanel</code> with a {@link MapControl3D}. |
96 |
*
|
|
101 |
* |
|
97 | 102 |
* @param theMapContext |
98 | 103 |
* associated <code>MapContext</code> of |
99 | 104 |
* <code>MapControl3D</code> |
... | ... | |
105 | 110 |
* View properties to register this <code>MapControl3D</code> |
106 | 111 |
* @see View3DSwingManager#createMapControl3D(MapContext, TYPE) |
107 | 112 |
* @see View3DSwingManager#createView3DPanel(MapControl3D, String) |
108 |
* @return |
|
113 |
* @return A View3DPanel instance
|
|
109 | 114 |
*/ |
110 | 115 |
public View3DPanel createView3DPanel(MapContext theMapContext, String title, TYPE type, |
111 | 116 |
ExtendedPropertiesSupport viewProperties); |
112 | 117 |
|
113 | 118 |
/** |
114 | 119 |
* Creates a <code>View3DPanel</code> with a {@link MapControl3D}. |
115 |
*
|
|
120 |
* |
|
116 | 121 |
* @param mapControl3D |
117 | 122 |
* Model of the <code>View3DPanel</code>. |
118 | 123 |
* @param title |
... | ... | |
129 | 134 |
* Creates the view 3D properties panel. View 3D properties panel is used to |
130 | 135 |
* show and change MapControl 3D properties in a graphical way. See |
131 | 136 |
* {@link MapControlProperties3D}. |
132 |
*
|
|
137 |
* |
|
133 | 138 |
* @param properties |
134 | 139 |
* Model of view 3D properties panel. |
135 | 140 |
* @return view 3D properites panel. |
... | ... | |
137 | 142 |
public ViewProperties3DPanel createViewProperties3DPanel(MapControlProperties3D properties); |
138 | 143 |
|
139 | 144 |
/** |
140 |
* Gets <code>GeneralProperties3D<code> of 3D library. |
|
141 |
* |
|
142 | 145 |
* @see View3DSwingManager#setGeneral3DProperties(GeneralProperties3D) |
143 |
* @return |
|
146 |
* @return Gets <code>GeneralProperties3D<code> of 3D library.
|
|
144 | 147 |
*/ |
145 | 148 |
public GeneralProperties3D getGeneral3DProperties(); |
146 | 149 |
|
... | ... | |
149 | 152 |
* {@link ExtendedPropertiesSupport}. If there are not indicated type of |
150 | 153 |
* <code>MapControl3D</code> associated with view properties, it will return |
151 | 154 |
* an empty list. |
152 |
*
|
|
155 |
* |
|
153 | 156 |
* @param viewProperties |
154 | 157 |
* @see View3DSwingManager#getMapControl3D(ExtendedPropertiesSupport, TYPE) |
155 | 158 |
* @return List of <code>MapControl3D</code> associated with the view |
156 |
* propoerties.
|
|
159 |
* properties. |
|
157 | 160 |
*/ |
158 | 161 |
public List<MapControl3D> getMapControl3D(ExtendedPropertiesSupport viewProperties); |
159 | 162 |
|
... | ... | |
163 | 166 |
* are |
164 | 167 |
* not indicated type of <code>MapControl3D</code> registered at view |
165 | 168 |
* properties. |
166 |
*
|
|
169 |
* |
|
167 | 170 |
* @param viewProperties |
168 | 171 |
* @param type |
169 | 172 |
* Type of <code>MapControl3D</code> |
170 | 173 |
* @see View3DSwingManager#getMapControl3D(ExtendedPropertiesSupport) |
171 |
* @return |
|
174 |
* @return A MapControl3D type from view properties
|
|
172 | 175 |
*/ |
173 | 176 |
public MapControl3D getMapControl3D(ExtendedPropertiesSupport viewProperties, TYPE type); |
174 | 177 |
|
175 | 178 |
/** |
176 | 179 |
* Gets <code>MapControlProperties3D</code> linked with the view properties. |
177 |
*
|
|
180 |
* |
|
178 | 181 |
* @param viewProperties |
179 | 182 |
* View properties to get the <code>MapControlProperties3D</code> |
180 | 183 |
* associated. |
181 | 184 |
* @see View3DSwingManager#setMapControlProperties3D(ExtendedPropertiesSupport, |
182 | 185 |
* MapControlProperties3D) |
183 |
* @return |
|
186 |
* @return MapControl 3D properties of view properties
|
|
184 | 187 |
*/ |
185 | 188 |
public MapControlProperties3D getMapControl3DProperties(ExtendedPropertiesSupport viewProperties); |
186 | 189 |
|
187 | 190 |
/** |
188 | 191 |
* Sets <code>GeneralProperties3D</code> to 3D library. |
189 |
*
|
|
192 |
* |
|
190 | 193 |
* @param properties |
191 | 194 |
* General 3D properties. |
192 | 195 |
* @see View3DSwingManager#getGeneral3DProperties() |
... | ... | |
195 | 198 |
|
196 | 199 |
/** |
197 | 200 |
* Sets <code>MapControlProperties3D</code> to view properties. |
198 |
*
|
|
201 |
* |
|
199 | 202 |
* @param viewProperties |
200 | 203 |
* View properties to link the |
201 | 204 |
* <code>MapControlProperties3D</code>. |
... | ... | |
208 | 211 |
|
209 | 212 |
/** |
210 | 213 |
* Register a properties panel. |
211 |
*
|
|
214 |
* |
|
212 | 215 |
* @param propertiesPanel the panel. |
213 | 216 |
*/ |
214 | 217 |
public void registerPropertiesPanel(ILayerProperties3DPanel propertiesPanel); |
215 | 218 |
|
216 | 219 |
/** |
217 | 220 |
* Get a properties panel by name. |
218 |
*
|
|
221 |
* |
|
219 | 222 |
* @param name the name of the panel. |
220 | 223 |
* @return the panel or <code>null</code>. |
221 | 224 |
*/ |
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 | ||
---|---|---|
27 | 27 |
import gov.nasa.worldwind.awt.WorldWindowGLJPanel; |
28 | 28 |
import gov.nasa.worldwind.layers.Layer; |
29 | 29 |
|
30 |
import org.gvsig.fmap.geom.primitive.Envelope; |
|
30 | 31 |
import org.gvsig.fmap.mapcontext.MapContext; |
31 | 32 |
import org.gvsig.fmap.mapcontext.ViewPort; |
32 | 33 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
... | ... | |
40 | 41 |
/** |
41 | 42 |
* A component that includes a {@link MapContext} and a |
42 | 43 |
* {@link WorldWindowGLJPanel}. |
43 |
*
|
|
44 |
* |
|
44 | 45 |
* <code>MapContext</code> is used to: |
45 | 46 |
* <ul> |
46 | 47 |
* <li>Get layers to convert them to {@link Layer}. When <code>MapContext</code> |
47 | 48 |
* layers are converted, they are added to WorldWindowGLJPanel to display it.</li> |
48 | 49 |
* <li>Get {@link ViewPort} to synchronize view ports.</li> |
49 | 50 |
* </ul> |
50 |
*
|
|
51 |
* |
|
51 | 52 |
* <code>WorldWindowGLJPanel</code> is used to display WW Models (globe and |
52 | 53 |
* layers). It's a self-contained component intended to serve as an |
53 | 54 |
* application's WorldWindow. |
54 |
*
|
|
55 |
* |
|
55 | 56 |
* This component offers methods to: |
56 | 57 |
* <ul> |
57 | 58 |
* <li>Get shared object to cancel draw request. See |
... | ... | |
79 | 80 |
* The second methos is {@link MapControl3D#reloadLayers()} that reload all |
80 | 81 |
* layers of <code>MapContext</code></li> |
81 | 82 |
* </ul> |
82 |
*
|
|
83 |
* |
|
83 | 84 |
* @author <a href="mailto:lmarques@disid.com">Lluis Marques</a> |
84 | 85 |
* |
85 | 86 |
*/ |
... | ... | |
110 | 111 |
* Gets shared object to cancel draw of loaded layers. To cancel draw use |
111 | 112 |
* set |
112 | 113 |
* canceled <code>true</code> with {@link Cancellable#setCanceled(boolean)} |
113 |
*
|
|
114 |
* |
|
114 | 115 |
* Note: {@link Cancellable} is deprecated but we have to use it because |
115 | 116 |
* {@link FLayer#draw(java.awt.image.BufferedImage, java.awt.Graphics2D, org.gvsig.fmap.mapcontext.ViewPort, Cancellable, double)} |
116 | 117 |
* use it. |
117 |
* |
|
118 |
* @return A shared Cancellable object |
|
119 |
* |
|
118 | 120 |
* @see Cancellable |
119 | 121 |
*/ |
120 | 122 |
public Cancellable getCancellable(); |
121 | 123 |
|
122 | 124 |
/** |
123 |
* Gets the <code>MapContext</code> associated. |
|
124 |
* |
|
125 |
* @return Gets the <code>MapContext</code> associated. |
|
125 | 126 |
*/ |
126 | 127 |
public MapContext getMapContext(); |
127 | 128 |
|
128 | 129 |
/** |
129 |
* Gets {@link TYPE} of this <code>MapControl3D</code>. |
|
130 |
* |
|
130 |
* @return Gets {@link TYPE} of this <code>MapControl3D</code>. |
|
131 | 131 |
*/ |
132 | 132 |
public TYPE getType(); |
133 |
|
|
133 |
|
|
134 | 134 |
/** |
135 |
* Gets 3D MapControl properties of this MapControl3D. |
|
136 |
* |
|
137 |
* @return |
|
135 |
* @return Gets 3D MapControl properties of this MapControl3D. |
|
138 | 136 |
*/ |
139 | 137 |
public MapControlProperties3D getProperties(); |
140 | 138 |
|
141 | 139 |
/** |
142 |
* Gets vertical exaggeration model of this <code>MapControl3D</code>. |
|
143 |
*
|
|
140 |
* @return Gets vertical exaggeration model of this <code>MapControl3D</code>.
|
|
141 |
* |
|
144 | 142 |
* @see MapControl3D#setVerticalExaggeration(double) |
145 | 143 |
*/ |
146 | 144 |
public double getVerticalExaggeration(); |
147 | 145 |
|
148 | 146 |
/** |
149 | 147 |
* Sets Atmosphere visibility. |
150 |
* |
|
148 |
* @param visibility |
|
149 |
* |
|
151 | 150 |
* @see MapControl3D#getAtmosphereVisibility() |
152 | 151 |
*/ |
153 | 152 |
public void setAtmosphereVisibility(boolean visibility); |
154 | 153 |
|
155 | 154 |
/** |
156 | 155 |
* Sets MiniMap visibility. |
157 |
* |
|
156 |
* @param visibility |
|
157 |
* |
|
158 | 158 |
* @see MapControl3D#getMinimapVisibility() |
159 | 159 |
*/ |
160 | 160 |
public void setMiniMapVisibility(boolean visibility); |
161 | 161 |
|
162 | 162 |
/** |
163 | 163 |
* Sets North Indicator visibility. |
164 |
* |
|
164 |
* @param visibility |
|
165 |
* |
|
165 | 166 |
* @see MapControl3D#getNorthIndicatorVisibility() |
166 | 167 |
*/ |
167 | 168 |
public void setNorthIndicatorVisibility(boolean visibility); |
168 | 169 |
|
169 | 170 |
/** |
170 | 171 |
* Sets Scale visibility. |
171 |
* |
|
172 |
* @param visibility |
|
173 |
* |
|
172 | 174 |
* @see MapControl3D#getScaleVisibility() |
173 | 175 |
*/ |
174 | 176 |
public void setScaleVisibility(boolean visibility); |
175 | 177 |
|
176 | 178 |
/** |
177 | 179 |
* Sets Star background visibility. |
178 |
* |
|
180 |
* @param visibility |
|
181 |
* |
|
179 | 182 |
* @see MapControl3D#getStarBackgroundVisibility() |
180 | 183 |
*/ |
181 | 184 |
public void setStarsBackgroundVisibility(boolean visibility); |
182 |
|
|
185 |
|
|
183 | 186 |
/** |
184 |
* Gets Atmosphere visibility. |
|
185 |
*
|
|
187 |
* @return Gets Atmosphere visibility.
|
|
188 |
* |
|
186 | 189 |
* @see MapControl3D#getAtmosphereVisibility() |
187 | 190 |
*/ |
188 | 191 |
public boolean getAtmosphereVisibility(); |
189 |
|
|
192 |
|
|
190 | 193 |
/** |
191 |
* Gets Minimap visibility. |
|
192 |
*
|
|
194 |
* @return Gets Minimap visibility.
|
|
195 |
* |
|
193 | 196 |
* @see MapControl3D#getMinimapVisibility() |
194 | 197 |
*/ |
195 | 198 |
public boolean getMinimapVisibility(); |
196 |
|
|
199 |
|
|
197 | 200 |
/** |
198 |
* Gets North indicator visibility. |
|
199 |
*
|
|
201 |
* @return Gets North indicator visibility.
|
|
202 |
* |
|
200 | 203 |
* @see MapControl3D#getNorthIndicatorVisibility() |
201 | 204 |
*/ |
202 | 205 |
public boolean getNorthIndicatorVisibility(); |
203 |
|
|
206 |
|
|
204 | 207 |
/** |
205 |
* Gets Star background visibility. |
|
206 |
*
|
|
208 |
* @return Gets Star background visibility.
|
|
209 |
* |
|
207 | 210 |
* @see MapControl3D#getStarBackgroundVisibility() |
208 | 211 |
*/ |
209 | 212 |
public boolean getStarBackgroundVisibility(); |
210 |
|
|
213 |
|
|
211 | 214 |
/** |
212 |
* Gets Scale visibility. |
|
213 |
*
|
|
215 |
* @return Gets Scale visibility.
|
|
216 |
* |
|
214 | 217 |
* @see MapControl3D#getScaleVisibility() |
215 | 218 |
*/ |
216 | 219 |
public boolean getScaleVisibility(); |
217 | 220 |
|
218 | 221 |
/** |
219 | 222 |
* Forces reloading of all layers associated with the <code>MapContext</code>. |
220 |
*
|
|
223 |
* |
|
221 | 224 |
* @see {@link MapControl3D#synchronizeLayers()} |
222 | 225 |
*/ |
223 | 226 |
public void reloadLayers(); |
... | ... | |
228 | 231 |
*/ |
229 | 232 |
public void synchronizeViewPorts(); |
230 | 233 |
|
234 |
// public void setViewPortEnvelope(Envelope envelope); |
|
235 |
|
|
236 |
|
|
231 | 237 |
/** |
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()}.
|
|
238 |
* Gets underline component that MapControl3D implementation is based on.
|
|
239 |
* |
|
240 |
* @return UnderLine object
|
|
235 | 241 |
*/ |
236 |
public void synchronizeLayers();
|
|
242 |
public Object getUnderLineComponent();
|
|
237 | 243 |
|
238 | 244 |
} |
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/properties/ViewProperties3DPanel.java | ||
---|---|---|
4 | 4 |
|
5 | 5 |
/** |
6 | 6 |
* This class represents the available API to get the indicated values at panel. |
7 |
*
|
|
7 |
* |
|
8 | 8 |
* @author <a href="mailto:lmarques@disid.com">Lluis Marques</a> |
9 | 9 |
* |
10 | 10 |
*/ |
11 | 11 |
public interface ViewProperties3DPanel extends Component { |
12 | 12 |
|
13 | 13 |
/** |
14 |
* Gets auto layer synchronize. |
|
15 |
* |
|
16 |
* @return |
|
14 |
* @return Gets auto layer synchronize. |
|
17 | 15 |
*/ |
18 | 16 |
public boolean getAutoLayerSynchronize(); |
19 | 17 |
|
20 | 18 |
/** |
21 |
* Gets auto view port synchronize. |
|
22 |
* |
|
23 |
* @return |
|
19 |
* @return Gets auto view port synchronize. |
|
20 |
* |
|
24 | 21 |
*/ |
25 | 22 |
public boolean getAutoViewPortSynchronize(); |
26 | 23 |
|
27 | 24 |
/** |
28 |
* Gets if Blue Marble is showing. |
|
29 |
* |
|
30 |
* @return |
|
25 |
* @return Gets if Blue Marble is showing. |
|
31 | 26 |
*/ |
32 | 27 |
public boolean getShowBlueMarble(); |
33 | 28 |
|
34 | 29 |
/** |
35 |
* Gets if default elevation is showing. |
|
36 |
* |
|
37 |
* @return |
|
30 |
* @return Gets if default elevation is showing. |
|
38 | 31 |
*/ |
39 | 32 |
public boolean getShowDefaultElevation(); |
40 | 33 |
|
41 | 34 |
/** |
42 |
* Gets if Nasa Landsat is showing. |
|
43 |
* |
|
44 |
* @return |
|
35 |
* @return Gets if Nasa Landsat is showing. |
|
45 | 36 |
*/ |
46 | 37 |
public boolean getShowNasaLandsat(); |
47 | 38 |
|
48 | 39 |
/** |
49 |
* Gets vertical exaggertion of flat 3D view. |
|
50 |
* |
|
51 |
* @return |
|
40 |
* @return Gets vertical exaggertion of flat 3D view. |
|
52 | 41 |
*/ |
53 | 42 |
public double getFlatVerticalExaggeration(); |
54 | 43 |
|
55 | 44 |
/** |
56 |
* Gets vertical exaggeration of sphere 3D view. |
|
57 |
* |
|
58 |
* @return |
|
45 |
* @return Gets vertical exaggeration of sphere 3D view. |
|
59 | 46 |
*/ |
60 | 47 |
public double getSphereVerticalExaggeration(); |
48 |
|
|
49 |
|
|
50 |
/** |
|
51 |
* @return Returns if anaglyph mode is selected or not. |
|
52 |
*/ |
|
53 |
public boolean getAnaglyphMode(); |
|
61 | 54 |
} |
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/properties/GeneralProperties3D.java | ||
---|---|---|
5 | 5 |
|
6 | 6 |
/** |
7 | 7 |
* This class represents the general properties of 3D library. |
8 |
*
|
|
8 |
* |
|
9 | 9 |
* @author <a href="mailto:lmarques@disid.com">Lluis Marques</a> |
10 | 10 |
* |
11 | 11 |
*/ |
... | ... | |
34 | 34 |
|
35 | 35 |
/** |
36 | 36 |
* Adds {@link PropertyChangeListener} that will listen properties changes. |
37 |
*
|
|
37 |
* |
|
38 | 38 |
* @param listener |
39 | 39 |
* @see GeneralProperties3D#removePropertyChangeListener(PropertyChangeListener) |
40 | 40 |
*/ |
... | ... | |
42 | 42 |
|
43 | 43 |
/** |
44 | 44 |
* Gets the atmosphere visibility. |
45 |
*
|
|
45 |
* |
|
46 | 46 |
* @see GeneralProperties3D#setAtmosphereVisibility(boolean) |
47 | 47 |
* @return visibility of atmosphere component. |
48 | 48 |
*/ |
... | ... | |
50 | 50 |
|
51 | 51 |
/** |
52 | 52 |
* Gets path of tile cache. |
53 |
*
|
|
53 |
* |
|
54 | 54 |
* @see GeneralProperties3D#setCachePath(File) |
55 |
* @return |
|
55 |
* @return Returns path of tile cache.
|
|
56 | 56 |
*/ |
57 | 57 |
public File getCachePath(); |
58 | 58 |
|
59 | 59 |
/** |
60 | 60 |
* Gets the default view heigth of 3D views. |
61 |
*
|
|
61 |
* |
|
62 | 62 |
* @see GeneralProperties3D#setDefaultViewHeight(int) |
63 | 63 |
* @return Default height of 3D views. |
64 | 64 |
*/ |
... | ... | |
66 | 66 |
|
67 | 67 |
/** |
68 | 68 |
* Gets the default view width of 3D views. |
69 |
*
|
|
69 |
* |
|
70 | 70 |
* @see GeneralProperties3D#setDefaultViewWidth(int) |
71 | 71 |
* @return Default width of 3D views. |
72 | 72 |
*/ |
... | ... | |
74 | 74 |
|
75 | 75 |
/** |
76 | 76 |
* Gets minimap visibility. |
77 |
*
|
|
77 |
* |
|
78 | 78 |
* @see GeneralProperties3D#setMinimapVisibility(boolean) |
79 | 79 |
* @return Visibility of minimap. |
80 | 80 |
*/ |
... | ... | |
82 | 82 |
|
83 | 83 |
/** |
84 | 84 |
* Gets north indicator visibility. |
85 |
*
|
|
85 |
* |
|
86 | 86 |
* @see GeneralProperties3D#setNorthIndicatorVisibility(boolean) |
87 | 87 |
* @return Visibility of north indicator component. |
88 | 88 |
*/ |
... | ... | |
90 | 90 |
|
91 | 91 |
/** |
92 | 92 |
* Get visibility of scale component. |
93 |
*
|
|
93 |
* |
|
94 | 94 |
* @see GeneralProperties3D#setScaleVisibility(boolean) |
95 | 95 |
* @return Visibility of scale component. |
96 | 96 |
*/ |
... | ... | |
98 | 98 |
|
99 | 99 |
/** |
100 | 100 |
* Get starts background visibility. |
101 |
*
|
|
101 |
* |
|
102 | 102 |
* @see GeneralProperties3D#setStarsBackgroundVisibility(boolean) |
103 | 103 |
* @return Visibility of starts background component. |
104 | 104 |
*/ |
... | ... | |
106 | 106 |
|
107 | 107 |
/** |
108 | 108 |
* Gets if the view port synchronize is animated |
109 |
*
|
|
109 |
* |
|
110 | 110 |
* @see GeneralProperties3D#setViewPortAnimation(boolean) |
111 | 111 |
* @return True if view port synchronize is animated, false if it is not |
112 | 112 |
* animated. |
... | ... | |
115 | 115 |
|
116 | 116 |
/** |
117 | 117 |
* Removes {@link PropertyChangeListener}. |
118 |
*
|
|
118 |
* |
|
119 | 119 |
* @param listener |
120 | 120 |
* @see GeneralProperties3D#addPropertyChangeListener(PropertyChangeListener) |
121 | 121 |
*/ |
... | ... | |
123 | 123 |
|
124 | 124 |
/** |
125 | 125 |
* Sets visibility of atmosphere component. |
126 |
*
|
|
126 |
* |
|
127 | 127 |
* @param visibility |
128 | 128 |
* @see GeneralProperties3D#getAtmosphereVisibility() |
129 | 129 |
*/ |
... | ... | |
131 | 131 |
|
132 | 132 |
/** |
133 | 133 |
* Sets path of tile cache. |
134 |
*
|
|
134 |
* |
|
135 | 135 |
* @param path |
136 | 136 |
* @see GeneralProperties3D#getCachePath() |
137 | 137 |
*/ |
... | ... | |
139 | 139 |
|
140 | 140 |
/** |
141 | 141 |
* Sets default view height. |
142 |
*
|
|
142 |
* |
|
143 | 143 |
* @param height |
144 | 144 |
* @see GeneralProperties3D#getDefaultViewHeight() |
145 | 145 |
*/ |
... | ... | |
147 | 147 |
|
148 | 148 |
/** |
149 | 149 |
* Sets default view width. |
150 |
*
|
|
150 |
* |
|
151 | 151 |
* @param width |
152 | 152 |
* @see GeneralProperties3D#getDefaultViewWidth() |
153 | 153 |
*/ |
... | ... | |
155 | 155 |
|
156 | 156 |
/** |
157 | 157 |
* Sets visibility of miniMap component. |
158 |
*
|
|
158 |
* |
|
159 | 159 |
* @param visibility |
160 | 160 |
* @see GeneralProperties3D#getMinimapVisibility() |
161 | 161 |
*/ |
... | ... | |
163 | 163 |
|
164 | 164 |
/** |
165 | 165 |
* Sets visibility of north indicator component. |
166 |
*
|
|
166 |
* |
|
167 | 167 |
* @param visibility |
168 | 168 |
* @see GeneralProperties3D#getNorthIndicatorVisibility() |
169 | 169 |
*/ |
... | ... | |
171 | 171 |
|
172 | 172 |
/** |
173 | 173 |
* Sets visibility of scale component. |
174 |
*
|
|
174 |
* |
|
175 | 175 |
* @param visibility |
176 | 176 |
* @see GeneralProperties3D#getScaleVisibility() |
177 | 177 |
*/ |
... | ... | |
179 | 179 |
|
180 | 180 |
/** |
181 | 181 |
* Sets visibility of starts background component. |
182 |
*
|
|
182 |
* |
|
183 | 183 |
* @param visibility |
184 | 184 |
* @see GeneralProperties3D#getStarsBackgroundVisibility() |
185 | 185 |
*/ |
... | ... | |
187 | 187 |
|
188 | 188 |
/** |
189 | 189 |
* Sets if the view port synchronize is animated or not. |
190 |
*
|
|
190 |
* |
|
191 | 191 |
* @param flag |
192 | 192 |
* @see GeneralProperties3D#getViewPortAnimation() |
193 | 193 |
*/ |
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/properties/GeneralProperties3DPanel.java | ||
---|---|---|
4 | 4 |
|
5 | 5 |
/** |
6 | 6 |
* This class represents the available API to get the indicated values at panel. |
7 |
*
|
|
7 |
* |
|
8 | 8 |
* @author <a href="mailto:lmarques@disid.com">Lluis Marques</a> |
9 | 9 |
* |
10 | 10 |
*/ |
11 | 11 |
public interface GeneralProperties3DPanel extends Component { |
12 | 12 |
|
13 | 13 |
/** |
14 |
* Gets atmospehere visibility. |
|
15 |
* |
|
16 |
* @return |
|
14 |
* @return Gets atmospehere visibility. |
|
17 | 15 |
*/ |
18 | 16 |
public boolean getAtmosphereVisibility(); |
19 | 17 |
|
20 | 18 |
/** |
21 |
* Gets cache path indicated. |
|
22 |
* |
|
23 |
* @return |
|
19 |
* @return Gets cache path indicated. |
|
24 | 20 |
*/ |
25 | 21 |
public String getCachePath(); |
26 | 22 |
|
27 | 23 |
/** |
28 |
* Gets default height. |
|
29 |
* |
|
30 |
* @return |
|
24 |
* @return Gets default height. |
|
31 | 25 |
*/ |
32 | 26 |
public int getDefaultHeight(); |
33 | 27 |
|
34 | 28 |
/** |
35 |
* Gets default width. |
|
36 |
* |
|
37 |
* @return |
|
29 |
* @return Gets default width. |
|
38 | 30 |
*/ |
39 | 31 |
public int getDefaultWidth(); |
40 | 32 |
|
41 | 33 |
/** |
42 |
* Get minimap visibility. |
|
43 |
* |
|
44 |
* @return |
|
34 |
* @return Get minimap visibility. |
|
45 | 35 |
*/ |
46 | 36 |
public boolean getMinimapVisibility(); |
47 | 37 |
|
48 | 38 |
/** |
49 |
* Gets north indicator visibility. |
|
50 |
* |
|
51 |
* @return |
|
39 |
* @return Gets north indicator visibility. |
|
52 | 40 |
*/ |
53 | 41 |
public boolean getNorthIndicatorVisibility(); |
54 | 42 |
|
55 | 43 |
/** |
56 |
* Gets scale visibility. |
|
57 |
* |
|
58 |
* @return |
|
44 |
* @return Gets scale visibility. |
|
59 | 45 |
*/ |
60 | 46 |
public boolean getScaleVisiblity(); |
61 | 47 |
|
62 | 48 |
/** |
63 |
* Gets starts background visibility |
|
64 |
* |
|
65 |
* @return |
|
49 |
* @return Gets starts background visibility |
|
66 | 50 |
*/ |
67 | 51 |
public boolean getStarsBackgroundVisiblity(); |
68 | 52 |
|
69 | 53 |
/** |
70 |
* Get view port animation. |
|
71 |
* |
|
72 |
* @return |
|
54 |
* @return Get view port animation. |
|
73 | 55 |
*/ |
74 | 56 |
public boolean getViewPortAnimation(); |
75 | 57 |
|
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/properties/MapControlProperties3D.java | ||
---|---|---|
7 | 7 |
|
8 | 8 |
/** |
9 | 9 |
* This class represents the properties of {@link MapControl3D}. |
10 |
*
|
|
10 |
* |
|
11 | 11 |
* @author <a href="mailto:lmarques@disid.com">Lluis Marques</a> |
12 | 12 |
* |
13 | 13 |
*/ |
14 | 14 |
public interface MapControlProperties3D extends Persistent{ |
15 |
|
|
15 |
|
|
16 | 16 |
public static final String PERSISTENCE_NAME = "MapControl3DProperties"; |
17 | 17 |
|
18 | 18 |
public final String SPHERE_VERTICAL_EXAGGERATION_PROPERTY_NAME = |
... | ... | |
29 | 29 |
"nasaLandsatLayerVisibility"; |
30 | 30 |
public final String DEFAULT_ELEVATION_VISIBILITY_PROPERTY_NAME = |
31 | 31 |
"defaultElevationVisibility"; |
32 |
|
|
32 |
public final String ANAGLYPH_MODE_PROPERTY_NAME = "anaglyphMode"; |
|
33 |
|
|
34 |
|
|
33 | 35 |
/** |
34 | 36 |
* Adds {@link PropertyChangeListener} that will listen properties changes. |
35 |
*
|
|
37 |
* |
|
36 | 38 |
* @param listener |
37 | 39 |
*/ |
38 | 40 |
public void addPropertyChangeListener(PropertyChangeListener listener); |
39 |
|
|
41 |
|
|
40 | 42 |
/** |
41 |
* Gets if auto layer synchronize is active or not. |
|
42 |
* |
|
43 |
* @return Returns if anaglyph mode is enabled. |
|
44 |
* @see MapControlProperties3D#setAnaglyphMode() |
|
45 |
*/ |
|
46 |
public boolean getAnaglyphMode(); |
|
47 |
|
|
48 |
|
|
49 |
/** |
|
43 | 50 |
* @see MapControlProperties3D#setAutoLayerSynchronize(boolean) |
44 |
* @return |
|
51 |
* @return Gets if auto layer synchronize is active or not.
|
|
45 | 52 |
*/ |
46 | 53 |
public boolean getAutoLayerSynchronize(); |
47 |
|
|
54 |
|
|
48 | 55 |
/** |
49 |
* Gets if auto view synchronize is active or not |
|
50 |
* |
|
51 | 56 |
* @see MapControlProperties3D#setAutoViewPortSynchronize(boolean) |
52 |
* @return |
|
57 |
* @return Gets if auto view synchronize is active or not
|
|
53 | 58 |
*/ |
54 | 59 |
public boolean getAutoViewPortSynchronize(); |
55 |
|
|
60 |
|
|
56 | 61 |
/** |
57 |
* Gets visibility of Blue Marble layer. |
|
58 |
* |
|
59 | 62 |
* @see MapControlProperties3D#setBlueMarbleLayerVisibility(boolean) |
60 |
* @return |
|
63 |
* @return Gets visibility of Blue Marble layer.
|
|
61 | 64 |
*/ |
62 | 65 |
public boolean getBlueMarbleLayerVisibility(); |
63 |
|
|
66 |
|
|
64 | 67 |
/** |
65 |
* Gets visiblity of default elevation. |
|
66 |
* |
|
67 | 68 |
* @see MapControlProperties3D#setDefaultElevationVisibility(boolean) |
68 |
* @return |
|
69 |
* @return Gets visiblity of default elevation.
|
|
69 | 70 |
*/ |
70 | 71 |
public boolean getDefaultElevationVisibility(); |
71 |
|
|
72 |
|
|
72 | 73 |
/** |
73 |
* Get vertical exaggeration of flat view |
|
74 |
* |
|
75 | 74 |
* @see MapControlProperties3D#setFlatVerticalExaggeration(double) |
76 |
* @return |
|
75 |
* @return Gets vertical exaggeration of flat view
|
|
77 | 76 |
*/ |
78 | 77 |
public double getFlatVerticalExaggeration(); |
79 |
|
|
78 |
|
|
80 | 79 |
/** |
81 |
* Gets visibility of Nasa Landsat Layer |
|
82 |
* |
|
83 | 80 |
* @see MapControlProperties3D#setNasaLandsatVisibility(boolean) |
84 |
* @return |
|
81 |
* @return Gets visibility of Nasa Landsat Layer
|
|
85 | 82 |
*/ |
86 | 83 |
public boolean getNasaLandsatLayerVisibility(); |
87 |
|
|
84 |
|
|
88 | 85 |
/** |
89 |
* Gets vertical exaggeration of sphere view |
|
90 |
* |
|
91 | 86 |
* @see MapControlProperties3D#setSphereVerticalExaggeration(double) |
92 |
* @return |
|
87 |
* @return Gets vertical exaggeration of sphere view
|
|
93 | 88 |
*/ |
94 | 89 |
public double getSphereVerticalExaggeration(); |
95 |
|
|
90 |
|
|
96 | 91 |
/** |
97 | 92 |
* Removes {@link PropertyChangeListener}. |
98 |
*
|
|
93 |
* |
|
99 | 94 |
* @see MapControlProperties3D#addPropertyChangeListener(PropertyChangeListener) |
100 | 95 |
* @param listener |
101 | 96 |
*/ |
102 | 97 |
public void removePropertyChangeListener(PropertyChangeListener listener); |
103 |
|
|
98 |
|
|
104 | 99 |
/** |
100 |
* Sets anaglyph mode |
|
101 |
* |
|
102 |
* @param flag True to enable anaglyph mode, false to disable it. |
|
103 |
* @see MapControlProperties3D#getAnaglyphMode() |
|
104 |
*/ |
|
105 |
public void setAnaglyphMode(boolean flag); |
|
106 |
|
|
107 |
/** |
|
105 | 108 |
* Set auto layer synchronize. |
106 |
*
|
|
109 |
* |
|
107 | 110 |
* @param flag True to active auto layer synchronize, false to disable it. |
108 | 111 |
* @see MapControlProperties3D#getAutoLayerSynchronize() |
109 | 112 |
*/ |
... | ... | |
111 | 114 |
|
112 | 115 |
/** |
113 | 116 |
* Set auto viesport synchronize. |
114 |
*
|
|
117 |
* |
|
115 | 118 |
* @param flag True to active auto viewport synchronize, false to disable it. |
116 | 119 |
* @see MapControlProperties3D#getAutoViewSynchronize() |
117 | 120 |
*/ |
... | ... | |
119 | 122 |
|
120 | 123 |
/** |
121 | 124 |
* Sets visibility of BlueMarble layer. |
122 |
*
|
|
125 |
* |
|
123 | 126 |
* @param visibility |
124 | 127 |
* @see MapControlProperties3D#getBlueMarbleLayerVisibility() |
125 | 128 |
*/ |
... | ... | |
127 | 130 |
|
128 | 131 |
/** |
129 | 132 |
* Sets visibility of deafult elevation. |
130 |
*
|
|
133 |
* |
|
131 | 134 |
* @param visibility |
132 | 135 |
* @see MapControlProperties3D#getDefaultElevationVisibility() |
133 | 136 |
*/ |
... | ... | |
135 | 138 |
|
136 | 139 |
/** |
137 | 140 |
* Sets flat vertical exaggeration. |
138 |
*
|
|
141 |
* |
|
139 | 142 |
* @param value |
140 | 143 |
* @see MapControlProperties3D#getFlatVerticalExaggeration() |
141 | 144 |
*/ |
... | ... | |
143 | 146 |
|
144 | 147 |
/** |
145 | 148 |
* Sets Nasa Landsat visibility. |
146 |
*
|
|
149 |
* |
|
147 | 150 |
* @param visibility |
148 | 151 |
* @see MapControlProperties3D#getNasaLandsatLayerVisibility() |
149 | 152 |
*/ |
... | ... | |
151 | 154 |
|
152 | 155 |
/** |
153 | 156 |
* Sets sphere vertical exaggeration. |
154 |
*
|
|
157 |
* |
|
155 | 158 |
* @param value |
156 | 159 |
* @see MapControlProperties3D#getSphereVerticalExaggeration() |
157 | 160 |
*/ |
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/View3DSwingLocator.java | ||
---|---|---|
45 | 45 |
|
46 | 46 |
/** |
47 | 47 |
* Return the singleton instance. |
48 |
*
|
|
48 |
* |
|
49 | 49 |
* @return the singleton instance |
50 | 50 |
*/ |
51 | 51 |
public static View3DSwingLocator getInstance() { |
... | ... | |
58 | 58 |
|
59 | 59 |
/** |
60 | 60 |
* Return a reference to View3DSwingManager. |
61 |
*
|
|
61 |
* |
|
62 | 62 |
* @return a reference to View3DSwingManager |
63 | 63 |
* @throws LocatorException |
64 | 64 |
* if there is no access to the class or the class |
65 | 65 |
* cannot be instantiated |
66 |
* @see Locator#get(String)View3DSwingManager |
|
66 |
* @see Locator#get(String) View3DSwingManager
|
|
67 | 67 |
*/ |
68 | 68 |
public static View3DSwingManager getManager() throws LocatorException { |
69 | 69 |
return (View3DSwingManager) getInstance().get(MANAGER_NAME); |
... | ... | |
71 | 71 |
|
72 | 72 |
/** |
73 | 73 |
* Registers the Class implementing the View3DSwingLocator interface. |
74 |
*
|
|
74 |
* |
|
75 | 75 |
* @param clazz |
76 | 76 |
* implementing the View3DSwingManager interface |
77 | 77 |
*/ |
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.impl/src/main/java/org/gvsig/view3d/swing/impl/DefaultView3DPanel.java | ||
---|---|---|
63 | 63 |
|
64 | 64 |
/** |
65 | 65 |
* Default implementaion of {@link View3DPanel}. |
66 |
*
|
|
66 |
* |
|
67 | 67 |
* @author <a href="mailto:lmarques@disid.com">Lluis Marques</a> |
68 | 68 |
*/ |
69 | 69 |
public class DefaultView3DPanel extends JPanel implements View3DPanel { |
... | ... | |
82 | 82 |
|
83 | 83 |
/** |
84 | 84 |
* Default constructor of {@link DefaultView3DPanel}. Creates an |
85 |
* {@link MapControl3D}, initialize local fileds and register listeners.
|
|
86 |
*
|
|
85 |
* {@link MapControl3D}, initialize local fields and register listeners.
|
|
86 |
* |
|
87 | 87 |
* @param theMapContext |
88 | 88 |
* associated <code>MapContext</code> |
89 |
* @param title |
|
90 |
* title of this view 3D panel |
|
89 | 91 |
* @param type |
90 | 92 |
* Type of this {@link DefaultMapControl3D}. See {@link TYPE}. |
91 | 93 |
* @param viewProperties |
... | ... | |
103 | 105 |
} |
104 | 106 |
|
105 | 107 |
/** |
106 |
*
|
|
108 |
* |
|
107 | 109 |
* @param mapControl3D |
108 | 110 |
* @param title |
109 | 111 |
*/ |
... | ... | |
225 | 227 |
} |
226 | 228 |
|
227 | 229 |
public void fullScreen() { |
228 |
|
|
230 |
|
|
229 | 231 |
// NOTE: We have to remove dispose component listener because the |
230 | 232 |
// component will be re-used at full screen frame. |
231 | 233 |
removeComponentListener(getDisposeComponentListener()); |
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.impl/src/main/java/org/gvsig/view3d/swing/impl/DefaultView3DSwingManager.java | ||
---|---|---|
36 | 36 |
import org.gvsig.fmap.mapcontext.MapContext; |
37 | 37 |
import org.gvsig.fmap.mapcontext.layers.ExtendedPropertiesSupport; |
38 | 38 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
39 |
import org.gvsig.tools.observer.ObservableHelper; |
|
40 |
import org.gvsig.tools.observer.Observer; |
|
39 | 41 |
import org.gvsig.view3d.lib.api.View3DLocator; |
40 | 42 |
import org.gvsig.view3d.lib.api.View3DManager; |
41 | 43 |
import org.gvsig.view3d.lib.api.loadingmodes.NwwLoaderFactory; |
... | ... | |
64 | 66 |
|
65 | 67 |
/** |
66 | 68 |
* Default implementation of {@link View3DSwingManager}. |
67 |
*
|
|
69 |
* |
|
68 | 70 |
* @author <a href="mailto:lmarques@disid.com">Lluis Marques</a> |
69 | 71 |
*/ |
70 | 72 |
public class DefaultView3DSwingManager implements View3DSwingManager { |
... | ... | |
75 | 77 |
|
76 | 78 |
private List<ILayerProperties3DPanel> registeredPanels = new ArrayList<>(); |
77 | 79 |
|
80 |
|
|
81 |
private ObservableHelper helper; |
|
82 |
|
|
83 |
/** |
|
84 |
* Default constructor |
|
85 |
*/ |
|
86 |
public DefaultView3DSwingManager() { |
|
87 |
helper = new ObservableHelper(); |
|
88 |
} |
|
89 |
|
|
90 |
|
|
91 |
|
|
78 | 92 |
public MapControl3D createMapControl3D(MapContext theMapContext, TYPE type, |
79 | 93 |
ExtendedPropertiesSupport viewProperties) { |
80 | 94 |
|
... | ... | |
83 | 97 |
throw new IllegalArgumentException(); |
84 | 98 |
} |
85 | 99 |
|
100 |
helper.notifyObservers(this, BEFORE_CREATE_MAPCONTROL3D, new Object[] { theMapContext, |
|
101 |
type, viewProperties }); |
|
102 |
|
|
86 | 103 |
MapControl3D mapControl3D = new DefaultMapControl3D(theMapContext, type, viewProperties); |
87 | 104 |
|
88 | 105 |
if (type == TYPE.SPHERE) { |
... | ... | |
91 | 108 |
viewProperties.setProperty("flatMapControl3D", mapControl3D); |
92 | 109 |
} |
93 | 110 |
|
111 |
|
|
112 |
helper.notifyObservers(this, AFTER_CREATE_MAPCONTROL3D, mapControl3D); |
|
113 |
|
|
94 | 114 |
return mapControl3D; |
95 | 115 |
} |
96 | 116 |
|
... | ... | |
230 | 250 |
return null; |
231 | 251 |
} |
232 | 252 |
|
253 |
@Override |
|
254 |
public void addObserver(Observer o) { |
|
255 |
helper.addObserver(o); |
|
256 |
} |
|
257 |
|
|
258 |
@Override |
|
259 |
public void deleteObserver(Observer o) { |
|
260 |
helper.deleteObserver(o); |
|
261 |
} |
|
262 |
|
|
263 |
@Override |
|
264 |
public void deleteObservers() { |
|
265 |
helper.deleteObservers(); |
|
266 |
} |
|
267 |
|
|
233 | 268 |
} |
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.impl/src/main/java/org/gvsig/view3d/swing/impl/data/DefaultRasterServer.java | ||
---|---|---|
56 | 56 |
/** |
57 | 57 |
* Default implementaion of {@link RasterServer}. This class representes a server |
58 | 58 |
* that serves raster information to {@link Retriever}. |
59 |
*
|
|
59 |
* |
|
60 | 60 |
* @author <a href="mailto:lmarques@disid.com">Lluis Marques</a> |
61 | 61 |
*/ |
62 | 62 |
public class DefaultRasterServer extends WWObjectImpl implements RasterServer { |
... | ... | |
70 | 70 |
|
71 | 71 |
/** |
72 | 72 |
* Default constructor as from params. Required params: |
73 |
*
|
|
73 |
* |
|
74 | 74 |
* <ul> |
75 | 75 |
* <li>DefaultMapControl3D.GVSIG_MAPCONTROL3D</li> |
76 | 76 |
* <li>DefaultMapControl3D.GVSIG_LAYER</li> |
77 | 77 |
* </ul> |
78 |
*
|
|
79 |
* @param rasterServerParams parameters to create <code>RasterServer</code>
|
|
78 |
* |
|
79 |
* @param params parameters to create <code>RasterServer</code>
|
|
80 | 80 |
*/ |
81 | 81 |
public DefaultRasterServer(AVList params) { |
82 | 82 |
|
... | ... | |
213 | 213 |
LOG.error("Missing requerided parameter {}", AVKey.DATA_TYPE, |
214 | 214 |
new IllegalArgumentException()); |
215 | 215 |
} |
216 |
|
|
216 |
|
|
217 | 217 |
String dataType = (String) reqParams.getValue(AVKey.DATA_TYPE); |
218 | 218 |
int bytesNumber = getBytesNumber(dataType); |
219 | 219 |
ByteBuffer byteBuffer = |
220 | 220 |
ByteBuffer.allocate(reqWidth * reqHeight * bytesNumber); |
221 |
|
|
221 |
|
|
222 | 222 |
reqRaster = |
223 | 223 |
new ByteBufferRaster(reqWidth, reqHeight, reqSector, |
224 | 224 |
byteBuffer, reqParams); |
... | ... | |
240 | 240 |
|
241 | 241 |
return reqRaster; |
242 | 242 |
} |
243 |
|
|
243 |
|
|
244 | 244 |
private int getBytesNumber(String dataType) { |
245 | 245 |
|
246 | 246 |
if (AVKey.INT8.equals(dataType)) { |
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.impl/src/main/java/org/gvsig/view3d/swing/impl/data/GvSIGLayerDataRaster.java | ||
---|---|---|
74 | 74 |
|
75 | 75 |
/** |
76 | 76 |
* Default implementation of {@link DataRaster}. |
77 |
*
|
|
77 |
* |
|
78 | 78 |
* @author <a href="mailto:lmarques@disid.com">Lluis Marques</a> |
79 | 79 |
* |
80 | 80 |
*/ |
... | ... | |
92 | 92 |
|
93 | 93 |
/** |
94 | 94 |
* Default constructor of <code>GvSIGLayerDataRaster</code> |
95 |
*
|
|
95 |
* |
|
96 | 96 |
* @param mapControl3D |
97 | 97 |
* context where {@link FLayer} is loaded. |
98 | 98 |
* @param theLayer |
... | ... | |
368 | 368 |
|
369 | 369 |
IProjection projection = |
370 | 370 |
mapControl3D.getMapContext().getProjection(); |
371 |
|
|
372 |
ICoordTrans ct = CRSFactory.getCRS("EPSG:4326").getCT(projection); |
|
371 |
ICoordTrans layerCoordTrans = layer.getCoordTrans(); |
|
372 |
ICoordTrans ct; |
|
373 |
if(layerCoordTrans != null){ |
|
374 |
ct = CRSFactory.getCRS("EPSG:4326").getCT(layerCoordTrans.getPDest()); |
|
375 |
} else { |
|
376 |
ct = CRSFactory.getCRS("EPSG:4326").getCT(projection); |
|
377 |
} |
|
373 | 378 |
Point2D p1 = |
374 | 379 |
convert(ct, new Point2D.Double(degrees[2], degrees[0])); |
375 | 380 |
Point2D p2 = |
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.impl/src/main/java/org/gvsig/view3d/swing/impl/DefaultMapControl3D.java | ||
---|---|---|
63 | 63 |
import org.gvsig.view3d.swing.api.View3DSwingLocator; |
64 | 64 |
import org.gvsig.view3d.swing.api.View3DSwingManager; |
65 | 65 |
import org.gvsig.view3d.swing.api.View3DSwingManager.TYPE; |
66 |
import org.gvsig.view3d.swing.api.exceptions.ConversionLayerException; |
|
66 | 67 |
import org.gvsig.view3d.swing.api.properties.GeneralProperties3D; |
67 | 68 |
import org.gvsig.view3d.swing.api.properties.MapControlProperties3D; |
68 | 69 |
import org.gvsig.view3d.swing.impl.layers.DefaultLayerConverter; |
... | ... | |
120 | 121 |
|
121 | 122 |
private WorldWindowGLJPanel wwd; |
122 | 123 |
|
124 |
private PropertyChangeListener verticalExaggerationPropertyListener; |
|
125 |
|
|
126 |
private PropertyChangeListener propertiesChangeListener; |
|
127 |
|
|
123 | 128 |
private StatusBar statusBar; |
124 | 129 |
|
125 | 130 |
private TYPE type; |
... | ... | |
155 | 160 |
setFlatPanelConfiguration(); |
156 | 161 |
} |
157 | 162 |
|
158 |
this.synchronizer = new DefaultSynchronizer(this, this.mapContext, getWwd()); |
|
163 |
View3DSwingManager swingManager = View3DSwingLocator.getManager(); |
|
164 |
this.properties = swingManager.getMapControl3DProperties(viewProperties); |
|
159 | 165 |
|
166 |
// Set pre configurations before instance WWD component |
|
167 |
preConfiguration(); |
|
168 |
|
|
169 |
// Instance WWD component |
|
170 |
getWwd(); |
|
171 |
|
|
172 |
// this.synchronizer = new DefaultSynchronizer(this, this.mapContext, getWwd()); |
|
173 |
|
|
174 |
// Set post configurations after instance WWD component |
|
175 |
postConfiguration(); |
|
176 |
|
|
160 | 177 |
super.add(getWwd(), BorderLayout.CENTER); |
161 | 178 |
|
162 | 179 |
super.add(getStatusBar(), BorderLayout.SOUTH); |
163 | 180 |
|
181 |
this.synchronizer = new DefaultSynchronizer(this, this.mapContext, getWwd()); |
|
182 |
|
|
164 | 183 |
try { |
165 | 184 |
addGvSIGLayers(mapContext.getLayers()); |
166 | 185 |
} catch (BaseException e) { |
167 | 186 |
LOG.info("Can't add MapControl layers", e); |
168 | 187 |
} |
188 |
} |
|
169 | 189 |
|
190 |
private void preConfiguration() { |
|
191 |
|
|
192 |
// WWD Mode |
|
193 |
if (type == TYPE.SPHERE) { |
|
194 |
setSpherePanelConfiguration(); |
|
195 |
} else if (type == TYPE.FLAT) { |
|
196 |
setFlatPanelConfiguration(); |
|
197 |
} |
|
198 |
|
|
199 |
// Enable or disable anaglyph mode |
|
200 |
setAnaglyphMode(this.properties.getAnaglyphMode()); |
|
201 |
} |
|
202 |
|
|
203 |
private void postConfiguration() { |
|
170 | 204 |
setGeneral3DProperties(); |
171 | 205 |
|
172 |
View3DSwingManager swingManager = View3DSwingLocator.getManager(); |
|
173 |
this.properties = swingManager.getMapControl3DProperties(viewProperties); |
|
174 |
addChangePropertyListener(this.properties); |
|
206 |
this.properties.addPropertyChangeListener(getPropertiesChangeListener()); |
|
175 | 207 |
setMapControl3DProperties(); |
176 | 208 |
|
177 |
addVerticalExaggerationChangeProperyListener(); |
|
209 |
getWwd().getSceneController().addPropertyChangeListener( |
|
210 |
getVerticalExaggerationPropertyListener()); |
|
211 |
|
|
212 |
getWwd().getView().getViewInputHandler().setStopOnFocusLost(false); |
|
178 | 213 |
} |
179 | 214 |
|
180 |
private void setGeneral3DProperties() { |
|
215 |
private PropertyChangeListener getPropertiesChangeListener() { |
|
216 |
if (this.propertiesChangeListener == null) { |
|
217 |
this.propertiesChangeListener = new PropertyChangeListener() { |
|
181 | 218 |
|
182 |
View3DSwingManager swingManager = View3DSwingLocator.getManager(); |
|
183 |
GeneralProperties3D general3DProperties = swingManager.getGeneral3DProperties(); |
|
219 |
public void propertyChange(PropertyChangeEvent evt) { |
|
184 | 220 |
|
185 |
this.setAtmosphereVisibility(general3DProperties.getAtmosphereVisibility()); |
|
186 |
this.setMiniMapVisibility(general3DProperties.getMinimapVisibility()); |
|
187 |
this.setNorthIndicatorVisibility(general3DProperties.getNorthIndicatorVisibility()); |
|
188 |
this.setStarsBackgroundVisibility(general3DProperties.getStarsBackgroundVisibility()); |
|
189 |
this.setScaleVisibility(general3DProperties.getScaleVisibility()); |
|
190 |
} |
|
221 |
String propertyName = evt.getPropertyName(); |
|
191 | 222 |
|
192 |
private void addChangePropertyListener(MapControlProperties3D properties) { |
|
193 |
properties.addPropertyChangeListener(new PropertyChangeListener() { |
|
223 |
if (MapControlProperties3D.SPHERE_VERTICAL_EXAGGERATION_PROPERTY_NAME.equals(propertyName) |
|
224 |
&& getType() == TYPE.SPHERE) { |
|
225 |
setVerticalExaggeration((Double) evt.getNewValue()); |
|
194 | 226 |
|
195 |
public void propertyChange(PropertyChangeEvent evt) { |
|
227 |
} else if (MapControlProperties3D.FLAT_VERTICAL_EXAGGERATION_PROPERTY_NAME.equals(propertyName) |
|
228 |
&& getType() == TYPE.FLAT) { |
|
229 |
setVerticalExaggeration((Double) evt.getNewValue()); |
|
196 | 230 |
|
197 |
String propertyName = evt.getPropertyName(); |
|
231 |
} else if (MapControlProperties3D.BLUE_MARBEL_VISIBILITY_PROPERTY_NAME.equals(propertyName)) { |
|
232 |
boolean visibility = (Boolean) evt.getNewValue(); |
|
233 |
setBlueMarbelLayerVisibility(visibility); |
|
198 | 234 |
|
199 |
if (MapControlProperties3D.SPHERE_VERTICAL_EXAGGERATION_PROPERTY_NAME.equals(propertyName)
|
|
200 |
&& getType() == TYPE.SPHERE) {
|
|
201 |
setVerticalExaggeration((Double) evt.getNewValue());
|
|
235 |
} else if (MapControlProperties3D.NASA_LANDSAT_VISIBILITY_PROPERTY_NAME.equals(propertyName)) {
|
|
236 |
boolean visibility = (Boolean) evt.getNewValue();
|
|
237 |
setNasaLandsatLayerVisibility(visibility);
|
|
202 | 238 |
|
203 |
} else if (MapControlProperties3D.FLAT_VERTICAL_EXAGGERATION_PROPERTY_NAME.equals(propertyName) |
|
204 |
&& getType() == TYPE.FLAT) { |
|
205 |
setVerticalExaggeration((Double) evt.getNewValue()); |
|
239 |
} else if (MapControlProperties3D.DEFAULT_ELEVATION_VISIBILITY_PROPERTY_NAME.equals(propertyName)) { |
|
240 |
boolean visibility = (Boolean) evt.getNewValue(); |
|
241 |
setDefaultElevationVisibility(visibility); |
|
242 |
} |
|
243 |
} |
|
244 |
}; |
|
206 | 245 |
|
207 |
} else if (MapControlProperties3D.BLUE_MARBEL_VISIBILITY_PROPERTY_NAME.equals(propertyName)) {
|
|
208 |
boolean visibility = (Boolean) evt.getNewValue();
|
|
209 |
setBlueMarbelLayerVisibility(visibility);
|
|
246 |
}
|
|
247 |
return this.propertiesChangeListener;
|
|
248 |
}
|
|
210 | 249 |
|
211 |
} else if (MapControlProperties3D.NASA_LANDSAT_VISIBILITY_PROPERTY_NAME.equals(propertyName)) {
|
|
212 |
boolean visibility = (Boolean) evt.getNewValue();
|
|
213 |
setNasaLandsatLayerVisibility(visibility);
|
|
250 |
private PropertyChangeListener getVerticalExaggerationPropertyListener() {
|
|
251 |
if (this.verticalExaggerationPropertyListener == null) {
|
|
252 |
this.verticalExaggerationPropertyListener = new PropertyChangeListener() {
|
|
214 | 253 |
|
215 |
} else if (MapControlProperties3D.DEFAULT_ELEVATION_VISIBILITY_PROPERTY_NAME.equals(propertyName)) { |
|
216 |
boolean visibility = (Boolean) evt.getNewValue(); |
|
217 |
setDefaultElevationVisibility(visibility); |
|
254 |
public void propertyChange(PropertyChangeEvent evt) { |
|
255 |
String propertyName = evt.getPropertyName(); |
|
256 |
if (propertyName.equals(AVKey.VERTICAL_EXAGGERATION)) { |
|
257 |
Double value = (Double) evt.getNewValue(); |
|
258 |
if (getType() == TYPE.SPHERE) { |
|
259 |
getProperties().setSphereVerticalExaggeration(value); |
|
260 |
} else if (getType() == TYPE.FLAT) { |
|
261 |
getProperties().setFlatVerticalExaggeration(value); |
|
262 |
} |
|
263 |
} |
|
218 | 264 |
} |
219 |
} |
|
220 |
}); |
|
265 |
}; |
|
266 |
} |
|
267 |
return this.verticalExaggerationPropertyListener; |
|
268 |
} |
|
221 | 269 |
|
270 |
private void setAnaglyphMode(boolean flag) { |
|
271 |
if (flag) { |
|
272 |
System.setProperty("gov.nasa.worldwind.stereo.mode", "redblue"); |
|
273 |
} else { |
|
274 |
System.setProperty("gov.nasa.worldwind.stereo.mode", ""); |
|
275 |
} |
|
222 | 276 |
} |
223 | 277 |
|
224 |
protected void addGvSIGLayer(FLayer layer) throws DataException { |
|
278 |
private void setGeneral3DProperties() { |
|
279 |
|
|
280 |
View3DSwingManager swingManager = View3DSwingLocator.getManager(); |
|
281 |
GeneralProperties3D general3DProperties = swingManager.getGeneral3DProperties(); |
|
282 |
|
|
283 |
this.setAtmosphereVisibility(general3DProperties.getAtmosphereVisibility()); |
|
284 |
this.setMiniMapVisibility(general3DProperties.getMinimapVisibility()); |
|
285 |
this.setNorthIndicatorVisibility(general3DProperties.getNorthIndicatorVisibility()); |
|
286 |
this.setStarsBackgroundVisibility(general3DProperties.getStarsBackgroundVisibility()); |
|
287 |
this.setScaleVisibility(general3DProperties.getScaleVisibility()); |
|
288 |
} |
|
289 |
|
|
290 |
// private void addChangePropertyListener(MapControlProperties3D properties) { |
|
291 |
// properties.addPropertyChangeListener(new PropertyChangeListener() { |
|
292 |
// |
|
293 |
// public void propertyChange(PropertyChangeEvent evt) { |
|
294 |
// |
|
295 |
// String propertyName = evt.getPropertyName(); |
|
296 |
// |
|
297 |
// if (MapControlProperties3D.SPHERE_VERTICAL_EXAGGERATION_PROPERTY_NAME.equals(propertyName) |
|
298 |
// && getType() == TYPE.SPHERE) { |
|
299 |
// setVerticalExaggeration((Double) evt.getNewValue()); |
|
300 |
// |
|
301 |
// } else if (MapControlProperties3D.FLAT_VERTICAL_EXAGGERATION_PROPERTY_NAME.equals(propertyName) |
|
302 |
// && getType() == TYPE.FLAT) { |
Also available in: Unified diff