Revision 509

View differences:

2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.app/org.gvsig.view3d.app.common/src/main/java/org/gvsig/view3d/app/properties/ViewProperties3DPage.java
9 9
import org.gvsig.propertypage.PropertiesPage;
10 10
import org.gvsig.tools.ToolsLocator;
11 11
import org.gvsig.tools.i18n.I18nManager;
12
import org.gvsig.view3d.lib.api.View3DLocator;
13
import org.gvsig.view3d.lib.api.View3DManager;
14
import org.gvsig.view3d.lib.api.properties.MapControlProperties3D;
15 12
import org.gvsig.view3d.swing.api.View3DSwingLocator;
16 13
import org.gvsig.view3d.swing.api.View3DSwingManager;
14
import org.gvsig.view3d.swing.api.properties.MapControlProperties3D;
17 15
import org.gvsig.view3d.swing.api.properties.ViewProperties3DPanel;
18 16

  
19 17
public class ViewProperties3DPage implements PropertiesPage {
......
30 28

  
31 29
    private void initialize() {
32 30

  
33
        View3DManager manager = View3DLocator.getManager();
31
        View3DSwingManager swingManager = View3DSwingLocator.getManager();
34 32
        MapControlProperties3D mapControl3DProperties =
35
            manager.getMapControl3DProperties(viewDocument);
33
            swingManager.getMapControl3DProperties(viewDocument);
36 34

  
37
        View3DSwingManager swingManager = View3DSwingLocator.getManager();
38 35
        this.properties3DPanel =
39 36
            swingManager.createViewProperties3DPanel(mapControl3DProperties);
40 37
        
......
75 72
        boolean showDefaultElevation =
76 73
            this.properties3DPanel.getShowDefaultElevation();
77 74
        
78
        View3DManager manager = View3DLocator.getManager();
75
        View3DSwingManager swingManager = View3DSwingLocator.getManager();
79 76
        MapControlProperties3D mapControl3DProperties =
80
            manager.getMapControl3DProperties(viewDocument);
77
            swingManager.getMapControl3DProperties(viewDocument);
81 78
        
82 79
        mapControl3DProperties
83 80
            .setSphereVerticalExaggeration(sphereVerticalExaggeration);
......
90 87
        mapControl3DProperties
91 88
            .setDefaultElevationVisibility(showDefaultElevation);
92 89
        
93
        manager.setMapControlProperties3D(viewDocument, mapControl3DProperties);
90
        swingManager.setMapControlProperties3D(viewDocument, mapControl3DProperties);
94 91
        
95 92
        return true;
96 93
    }
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.app/org.gvsig.view3d.app.common/src/main/java/org/gvsig/view3d/app/properties/General3DPreferencePage.java
1 1
package org.gvsig.view3d.app.properties;
2 2

  
3 3
import java.awt.BorderLayout;
4
import java.beans.PropertyChangeEvent;
5
import java.beans.PropertyChangeListener;
6 4

  
7 5
import javax.swing.ImageIcon;
8 6
import javax.swing.JPanel;
......
16 14
import org.gvsig.tools.ToolsLocator;
17 15
import org.gvsig.tools.dynobject.DynObject;
18 16
import org.gvsig.tools.i18n.I18nManager;
19
import org.gvsig.view3d.lib.api.View3DLocator;
20
import org.gvsig.view3d.lib.api.View3DManager;
21
import org.gvsig.view3d.lib.api.properties.GeneralProperties3D;
22 17
import org.gvsig.view3d.swing.api.View3DSwingLocator;
23 18
import org.gvsig.view3d.swing.api.View3DSwingManager;
19
import org.gvsig.view3d.swing.api.properties.GeneralProperties3D;
24 20
import org.gvsig.view3d.swing.api.properties.GeneralProperties3DPanel;
25 21

  
26 22
public class General3DPreferencePage extends AbstractPreferencePage {
......
32 28
    private GeneralProperties3DPanel propertiesPanel;
33 29
    private DynObject pluginProperties;
34 30
    private PluginServices plugin;
35
    private boolean valueChanged = false;
36 31

  
37 32
    public General3DPreferencePage() {
38 33
        initComponents();
39

  
40
        addPropertyChangeListener();
41 34
    }
42 35

  
43
    private void addPropertyChangeListener() {
44

  
45
        View3DManager manager = View3DLocator.getManager();
46
        GeneralProperties3D general3dProperties =
47
            manager.getGeneral3DProperties();
48

  
49
        general3dProperties
50
            .addPropertyChangeListener(new PropertyChangeListener() {
51

  
52
                public void propertyChange(PropertyChangeEvent evt) {
53
                    valueChanged = true;
54
                }
55
            });
56

  
57
    }
58

  
59 36
    private void initComponents() {
60 37
        PluginsManager pluginManager = PluginsLocator.getManager();
61 38
        this.plugin = pluginManager.getPlugin(this);
......
63 40

  
64 41
        initializeValues();
65 42

  
66
        View3DManager manager = View3DLocator.getManager();
43
        View3DSwingManager swingManager = View3DSwingLocator.getManager();
67 44
        GeneralProperties3D generalProperties3D =
68
            manager.getGeneral3DProperties();
45
            swingManager.getGeneral3DProperties();
69 46

  
70
        View3DSwingManager swingManager = View3DSwingLocator.getManager();
71 47
        propertiesPanel =
72 48
            swingManager.createGeneralProperties3DPanel(generalProperties3D);
73 49

  
......
89 65
    }
90 66

  
91 67
    public void initializeValues() {
92
        View3DManager manager = View3DLocator.getManager();
93
        GeneralProperties3D generalProperties3D =
94
            manager.getGeneral3DProperties();
95

  
96
        int width =
97
            (Integer) this.pluginProperties.getDynValue("defultViewWidth");
98
        int height =
99
            (Integer) this.pluginProperties.getDynValue("defultViewHeight");
100
        boolean atmosphereVisibility =
101
            (Boolean) this.pluginProperties.getDynValue("atmosphereVisibility");
102
        boolean northIndicatorVisibility =
103
            (Boolean) this.pluginProperties
104
                .getDynValue("northIndicatorVisibility");
105
        boolean minimapVisibility =
106
            (Boolean) this.pluginProperties.getDynValue("minimapVisibility");
107
        boolean starsBackgroundVisibility =
108
            (Boolean) this.pluginProperties
109
                .getDynValue("starsBackgroundVisibility");
110
        boolean scaleVisibility =
111
            (Boolean) this.pluginProperties.getDynValue("scaleVisibility");
112
        boolean viewportAnimation =
113
            (Boolean) this.pluginProperties.getDynValue("viewportAnimation");
114
        String cachePath =
115
            (String) this.pluginProperties.getDynValue("cachePath");
116

  
117
        generalProperties3D.setDefaultViewWidth(width);
118
        generalProperties3D.setDefaultViewHeight(height);
119
        generalProperties3D.setAtmosphereVisibility(atmosphereVisibility);
120
        generalProperties3D.setMinimapVisibility(minimapVisibility);
121
        generalProperties3D
122
            .setNorthIndicatorVisibility(northIndicatorVisibility);
123
        generalProperties3D
124
            .setStarsBackgroundVisibility(starsBackgroundVisibility);
125
        generalProperties3D.setScaleVisibility(scaleVisibility);
126
        generalProperties3D.setViewPortAnimation(viewportAnimation);
127
        generalProperties3D.setCachePath(cachePath);
128

  
129
        manager.setGeneral3DProperties(generalProperties3D);
68
        
130 69
    }
131 70

  
132 71
    public void initializeDefaults() {
......
143 82
    }
144 83

  
145 84
    public boolean isValueChanged() {
146
        return valueChanged;
85
        return super.hasChanged();
147 86
    }
148 87

  
149 88
    @Override
......
174 113
    @Override
175 114
    public void setChangesApplied() {
176 115

  
177
        View3DManager manager = View3DLocator.getManager();
178
        GeneralProperties3D general3dProperties =
179
            manager.getGeneral3DProperties();
116
        View3DSwingManager swingManager = View3DSwingLocator.getManager();
117
        GeneralProperties3D generalProperties3D =
118
            swingManager.getGeneral3DProperties();
180 119

  
181
        general3dProperties.setDefaultViewWidth(propertiesPanel
120
        generalProperties3D.setDefaultViewWidth(propertiesPanel
182 121
            .getDefaultWidth());
183
        general3dProperties.setDefaultViewHeight(propertiesPanel
122
        generalProperties3D.setDefaultViewHeight(propertiesPanel
184 123
            .getDefaultHeight());
185
        general3dProperties.setAtmosphereVisibility(propertiesPanel
124
        generalProperties3D.setAtmosphereVisibility(propertiesPanel
186 125
            .getAtmosphereVisibility());
187
        general3dProperties.setMinimapVisibility(propertiesPanel
126
        generalProperties3D.setMinimapVisibility(propertiesPanel
188 127
            .getMinimapVisibility());
189
        general3dProperties.setNorthIndicatorVisibility(propertiesPanel
128
        generalProperties3D.setNorthIndicatorVisibility(propertiesPanel
190 129
            .getNorthIndicatorVisibility());
191
        general3dProperties.setScaleVisibility(propertiesPanel
130
        generalProperties3D.setScaleVisibility(propertiesPanel
192 131
            .getScaleVisiblity());
193
        general3dProperties.setStarsBackgroundVisibility(propertiesPanel
132
        generalProperties3D.setStarsBackgroundVisibility(propertiesPanel
194 133
            .getStarsBackgroundVisiblity());
195
        general3dProperties.setViewPortAnimation(propertiesPanel
134
        generalProperties3D.setViewPortAnimation(propertiesPanel
196 135
            .getViewPortAnimation());
197
        general3dProperties.setCachePath(propertiesPanel.getCachePath());
136
        generalProperties3D.setCachePath(propertiesPanel.getCachePath());
198 137

  
199
        manager.setGeneral3DProperties(general3dProperties);
200

  
201
        valueChanged = false;
138
        swingManager.setGeneral3DProperties(generalProperties3D);
202 139
    }
203 140

  
204 141
}
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.lib/org.gvsig.view3d.lib.api/src/main/java/org/gvsig/view3d/lib/api/View3DManager.java
24 24

  
25 25
package org.gvsig.view3d.lib.api;
26 26

  
27
import org.gvsig.fmap.mapcontext.layers.ExtendedPropertiesSupport;
28 27
import org.gvsig.fmap.mapcontext.layers.FLayer;
29
import org.gvsig.view3d.lib.api.properties.GeneralProperties3D;
30 28
import org.gvsig.view3d.lib.api.properties.LayerProperties3D;
31
import org.gvsig.view3d.lib.api.properties.MapControlProperties3D;
32 29

  
33 30

  
34 31
/**
......
40 37
    public LayerProperties3D getLayerProperties(FLayer layer);
41 38
    
42 39
    public void setLayerProperties(FLayer layer, LayerProperties3D properties);
43
    
44
    public MapControlProperties3D getMapControl3DProperties(
45
        ExtendedPropertiesSupport viewProperties);
46
    
47
    public void setMapControlProperties3D(
48
        ExtendedPropertiesSupport viewProperties,
49
        MapControlProperties3D mapControl3DProperties);
50
    
51
    public GeneralProperties3D getGeneral3DProperties();
52
    
53
    public void setGeneral3DProperties(GeneralProperties3D properties);
54 40
}
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.lib/org.gvsig.view3d.lib.api/src/main/java/org/gvsig/view3d/lib/api/properties/GeneralProperties3D.java
1
package org.gvsig.view3d.lib.api.properties;
2

  
3
import java.beans.PropertyChangeListener;
4

  
5
/**
6
 * 
7
 * @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
8
 *
9
 */
10
public interface GeneralProperties3D {
11
    
12
    public void addPropertyChangeListener(PropertyChangeListener listener);
13

  
14
    public boolean getViewPortAnimation();
15

  
16
    public boolean getAtmosphereVisibility();
17

  
18
    public String getCachePath();
19

  
20
    public int getDefaultViewHeight();
21

  
22
    public int getDefaultViewWidht();
23

  
24
    public boolean getMinimapVisibility();
25

  
26
    public boolean getNorthIndicatorVisibility();
27
    
28
    public boolean getStarsBackgroundVisibility();
29

  
30
    public boolean getScaleVisibility();
31
    
32
    public void removePropertyChangeListener(PropertyChangeListener listener);
33

  
34
    public void setViewPortAnimation(boolean flag);
35

  
36
    public void setAtmosphereVisibility(boolean visibility);
37

  
38
    public void setCachePath(String path);
39

  
40
    public void setDefaultViewHeight(int height);
41

  
42
    public void setDefaultViewWidth(int width);
43

  
44
    public void setMinimapVisibility(boolean visibility);
45

  
46
    public void setNorthIndicatorVisibility(boolean visibility);
47

  
48
    public void setStarsBackgroundVisibility(boolean visibility);
49
    
50
    public void setScaleVisibility(boolean visibility);
51
}
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.lib/org.gvsig.view3d.lib.api/src/main/java/org/gvsig/view3d/lib/api/properties/MapControlProperties3D.java
1
package org.gvsig.view3d.lib.api.properties;
2

  
3
import java.beans.PropertyChangeListener;
4

  
5
import org.gvsig.tools.persistence.Persistent;
6

  
7
/**
8
 * 
9
 * @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
10
 *
11
 */
12
public interface MapControlProperties3D extends Persistent{
13
    
14
    public static final String PERSISTENCE_NAME = "MapControl3DProperties";
15

  
16
    public final String SPHERE_VERTICAL_EXAGGERATION_PROPERTY_NAME =
17
        "sphereVerticalExaggeration";
18
    public final String FLAT_VERTICAL_EXAGGERATION_PROPERTY_NAME =
19
        "flatVerticalExaggeration";
20
    public final String AUTO_LAYER_SYNCHRONIZE_PROPERTY_NAME =
21
        "autoLayerSynchronize";
22
    public final String AUTO_VIEWPORT_SYNCHRONIZE_PROPERTY_NAME =
23
        "autoViewPortSynchronize";
24
    public final String BLUE_MARBEL_VISIBILITY_PROPERTY_NAME =
25
        "blueMarbelLayerVisibility";
26
    public final String NASA_LANDSAT_VISIBILITY_PROPERTY_NAME =
27
        "nasaLandsatLayerVisibility";
28
    public final String DEFAULT_ELEVATION_VISIBILITY_PROPERTY_NAME =
29
        "defaultElevationVisibility";
30

  
31
    public void addPropertyChangeListener(PropertyChangeListener listener);
32

  
33
    public boolean getAutoLayerSynchronize();
34

  
35
    public boolean getAutoViewSynchronize();
36

  
37
    public boolean getBlueMarbleLayerVisibility();
38

  
39
    public boolean getDefaultElevationVisibility();
40

  
41
    public double getFlatVerticalExaggeration();
42

  
43
    public boolean getNasaLandsatLayerVisibility();
44

  
45
    public double getSphereVerticalExaggeration();
46

  
47
    public void removePropertyChangeListener(PropertyChangeListener listener);
48

  
49
    public void setAutoLayerSynchronize(boolean flag);
50

  
51
    public void setAutoViewPortSynchronize(boolean flag);
52

  
53
    public void setBlueMarbleLayerVisibility(boolean visibility);
54

  
55
    public void setDefaultElevationVisibility(boolean visibility);
56

  
57
    public void setFlatVerticalExaggeration(double value);
58

  
59
    public void setNasaLandsatVisibility(boolean visibility);
60

  
61
    public void setSphereVerticalExaggeration(double value);
62

  
63
}
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.lib/org.gvsig.view3d.lib.impl/src/main/java/org/gvsig/view3d/lib/impl/DefaultView3DLibrary.java
30 30
import org.gvsig.view3d.lib.api.View3DLibrary;
31 31
import org.gvsig.view3d.lib.api.View3DLocator;
32 32
import org.gvsig.view3d.lib.impl.properties.BasicLayerProperties3D;
33
import org.gvsig.view3d.lib.impl.properties.DefaultMapControlProperties3D;
34 33
import org.gvsig.view3d.lib.impl.properties.DefaultRasterLayerProperties3D;
35 34
import org.gvsig.view3d.lib.impl.properties.DefaultVectorialLayerProperties3D;
36 35

  
......
55 54
    }
56 55

  
57 56
    private void registerPersistence() {
58
        DefaultMapControlProperties3D.registerPersistence();
59 57
        BasicLayerProperties3D.registerPersistence();
60 58
        DefaultVectorialLayerProperties3D.registerPersistence();
61 59
        DefaultRasterLayerProperties3D.registerPersistence();
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.lib/org.gvsig.view3d.lib.impl/src/main/java/org/gvsig/view3d/lib/impl/properties/DefaultGeneralProperties3D.java
1
package org.gvsig.view3d.lib.impl.properties;
2

  
3
import java.beans.PropertyChangeListener;
4
import java.beans.PropertyChangeSupport;
5

  
6
import org.gvsig.view3d.lib.api.properties.GeneralProperties3D;
7

  
8
public class DefaultGeneralProperties3D implements GeneralProperties3D {
9

  
10
    private String DEFAULT_VIEW_HEIGHT_PROPERTY_NAME = "defaultViewHeight";
11
    private String DEFAULT_VIEW_WIDTH_PROPERTY_NAME = "defaultViewWidth";
12

  
13
    private String ATMOSPHERE_VISIBILITY_PROPERTY_NAME = "atmosphereVisibility";
14
    private String MINIMAP_VISIBILITY_PROPERTY_NAME = "minimapVisibility";
15
    private String NORTH_INDICATOR_VISIBILITY_PROPERTY_NAME =
16
        "northIndicatorVisibility";
17
    private String STARS_BACKGROUND_VISIBILITY_PROPERTY_NAME =
18
        "starsBackgroundVisibility";
19
    private String SCALE_VISIBILITY_PROPERTY_NAME = "scaleVisibility";
20

  
21
    private String VIEWPORT_ANIMATION_PROPERTY_NAME = "viewPortAnimation";
22

  
23
    private String CACHE_PATH_PROPERTY_NAME = "cachePath";
24

  
25
    private int defaultViewHeight = 600;
26
    private int defaultViewWidth = 800;
27

  
28
    private boolean atmosphereVisibility = true;
29
    private boolean northIndicatorVisibility = true;
30
    private boolean minimapVisibility = true;
31
    private boolean starsBackgroundVisibility = true;
32
    private boolean scaleVisibility = true;
33

  
34
    private boolean viewPortAnimation = true;
35

  
36
    private String cachePath = "";
37

  
38
    private PropertyChangeSupport support;
39

  
40
    public DefaultGeneralProperties3D() {
41
        support = new PropertyChangeSupport(this);
42
    }
43

  
44
    public boolean getAtmosphereVisibility() {
45
        return atmosphereVisibility;
46
    }
47

  
48
    public String getCachePath() {
49
        return cachePath;
50
    }
51

  
52
    public int getDefaultViewHeight() {
53
        return defaultViewHeight;
54
    }
55

  
56
    public int getDefaultViewWidht() {
57
        return defaultViewWidth;
58
    }
59

  
60
    public boolean getMinimapVisibility() {
61
        return minimapVisibility;
62
    }
63

  
64
    public boolean getNorthIndicatorVisibility() {
65
        return northIndicatorVisibility;
66
    }
67

  
68
    public boolean getScaleVisibility() {
69
        return scaleVisibility;
70
    }
71

  
72
    public boolean getViewPortAnimation() {
73
        return viewPortAnimation;
74
    }
75

  
76
    public void setAtmosphereVisibility(boolean visibility) {
77
        support.firePropertyChange(ATMOSPHERE_VISIBILITY_PROPERTY_NAME,
78
            atmosphereVisibility, visibility);
79
        this.atmosphereVisibility = visibility;
80
    }
81

  
82
    public void setCachePath(String path) {
83
        support.firePropertyChange(CACHE_PATH_PROPERTY_NAME, cachePath, path);
84
        this.cachePath = path;
85
    }
86

  
87
    public void setDefaultViewHeight(int height) {
88
        support.firePropertyChange(DEFAULT_VIEW_HEIGHT_PROPERTY_NAME,
89
            defaultViewHeight, height);
90
        this.defaultViewHeight = height;
91
    }
92

  
93
    public void setDefaultViewWidth(int width) {
94
        support.firePropertyChange(DEFAULT_VIEW_WIDTH_PROPERTY_NAME,
95
            defaultViewHeight, width);
96
        this.defaultViewWidth = width;
97

  
98
    }
99

  
100
    public void setMinimapVisibility(boolean visibility) {
101
        support.firePropertyChange(MINIMAP_VISIBILITY_PROPERTY_NAME,
102
            minimapVisibility, visibility);
103
        this.minimapVisibility = visibility;
104
    }
105

  
106
    public void setNorthIndicatorVisibility(boolean visibility) {
107
        support.firePropertyChange(NORTH_INDICATOR_VISIBILITY_PROPERTY_NAME,
108
            northIndicatorVisibility, visibility);
109
        this.northIndicatorVisibility = visibility;
110
    }
111

  
112
    public void setScaleVisibility(boolean visibility) {
113
        support.firePropertyChange(SCALE_VISIBILITY_PROPERTY_NAME,
114
            scaleVisibility, visibility);
115
        this.scaleVisibility = visibility;
116
    }
117

  
118
    public void setViewPortAnimation(boolean flag) {
119
        support.firePropertyChange(VIEWPORT_ANIMATION_PROPERTY_NAME,
120
            viewPortAnimation, flag);
121
        this.viewPortAnimation = flag;
122
    }
123

  
124
    public boolean getStarsBackgroundVisibility() {
125
        return starsBackgroundVisibility;
126
    }
127

  
128
    public void setStarsBackgroundVisibility(boolean visibility) {
129
        support.firePropertyChange(STARS_BACKGROUND_VISIBILITY_PROPERTY_NAME,
130
            starsBackgroundVisibility, visibility);
131
        this.starsBackgroundVisibility = visibility;
132
    }
133

  
134
    public void addPropertyChangeListener(PropertyChangeListener listener) {
135
        support.addPropertyChangeListener(listener);
136
    }
137

  
138
    public void removePropertyChangeListener(PropertyChangeListener listener) {
139
        support.removePropertyChangeListener(listener);
140
    }
141

  
142
}
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.lib/org.gvsig.view3d.lib.impl/src/main/java/org/gvsig/view3d/lib/impl/properties/DefaultMapControlProperties3D.java
1
package org.gvsig.view3d.lib.impl.properties;
2

  
3
import java.beans.PropertyChangeListener;
4
import java.beans.PropertyChangeSupport;
5

  
6
import org.gvsig.tools.ToolsLocator;
7
import org.gvsig.tools.dynobject.DynStruct;
8
import org.gvsig.tools.persistence.PersistenceManager;
9
import org.gvsig.tools.persistence.PersistentState;
10
import org.gvsig.tools.persistence.exception.PersistenceException;
11
import org.gvsig.view3d.lib.api.properties.MapControlProperties3D;
12

  
13
public class DefaultMapControlProperties3D implements MapControlProperties3D {
14

  
15
    private PropertyChangeSupport propertyChangeSupport;
16

  
17
    private double sphereVerticalExaggeration = 1;
18
    private double flatVerticalExaggeration = 1;
19
    private boolean autoLayerShynchornize = true;
20
    private boolean autoViewPortSynchronize = false;
21
    private boolean showBlueMarbleLayer = true;
22
    private boolean showNasaLandsatLayer = true;
23
    private boolean showDefaultElevation = true;
24

  
25
    public DefaultMapControlProperties3D() {
26
        propertyChangeSupport = new PropertyChangeSupport(this);
27
    }
28

  
29
    public boolean getAutoLayerSynchronize() {
30
        return autoLayerShynchornize;
31
    }
32

  
33
    public boolean getAutoViewSynchronize() {
34
        return autoViewPortSynchronize;
35
    }
36

  
37
    public boolean getBlueMarbleLayerVisibility() {
38
        return showBlueMarbleLayer;
39
    }
40

  
41
    public boolean getDefaultElevationVisibility() {
42
        return showDefaultElevation;
43
    }
44

  
45
    public double getFlatVerticalExaggeration() {
46
        return flatVerticalExaggeration;
47
    }
48

  
49
    public boolean getNasaLandsatLayerVisibility() {
50
        return showNasaLandsatLayer;
51
    }
52

  
53
    public double getSphereVerticalExaggeration() {
54
        return sphereVerticalExaggeration;
55
    }
56

  
57
    public void setAutoLayerSynchronize(boolean flag) {
58
        this.propertyChangeSupport.firePropertyChange(
59
            AUTO_LAYER_SYNCHRONIZE_PROPERTY_NAME, autoLayerShynchornize, flag);
60
        this.autoLayerShynchornize = flag;
61
    }
62

  
63
    public void setAutoViewPortSynchronize(boolean flag) {
64
        this.propertyChangeSupport.firePropertyChange(
65
            AUTO_VIEWPORT_SYNCHRONIZE_PROPERTY_NAME, autoViewPortSynchronize,
66
            flag);
67
        this.autoViewPortSynchronize = flag;
68
    }
69

  
70
    public void setBlueMarbleLayerVisibility(boolean visibility) {
71
        this.propertyChangeSupport.firePropertyChange(
72
            BLUE_MARBEL_VISIBILITY_PROPERTY_NAME, showBlueMarbleLayer,
73
            visibility);
74
        this.showBlueMarbleLayer = visibility;
75
    }
76

  
77
    public void setDefaultElevationVisibility(boolean visibility) {
78
        this.propertyChangeSupport.firePropertyChange(
79
            DEFAULT_ELEVATION_VISIBILITY_PROPERTY_NAME, showDefaultElevation,
80
            visibility);
81
        this.showDefaultElevation = visibility;
82
    }
83

  
84
    public void setFlatVerticalExaggeration(double value) {
85
        this.propertyChangeSupport.firePropertyChange(
86
            FLAT_VERTICAL_EXAGGERATION_PROPERTY_NAME, flatVerticalExaggeration,
87
            value);
88
        this.flatVerticalExaggeration = value;
89
    }
90

  
91
    public void setNasaLandsatVisibility(boolean visibility) {
92
        this.propertyChangeSupport.firePropertyChange(
93
            NASA_LANDSAT_VISIBILITY_PROPERTY_NAME, showNasaLandsatLayer,
94
            visibility);
95
        this.showNasaLandsatLayer = visibility;
96
    }
97

  
98
    public void setSphereVerticalExaggeration(double value) {
99
        this.propertyChangeSupport.firePropertyChange(
100
            SPHERE_VERTICAL_EXAGGERATION_PROPERTY_NAME, sphereVerticalExaggeration,
101
            value);
102
        this.sphereVerticalExaggeration = value;
103
    }
104

  
105
    public void addPropertyChangeListener(PropertyChangeListener listener) {
106
        this.propertyChangeSupport.addPropertyChangeListener(listener);
107
    }
108

  
109
    public void removePropertyChangeListener(PropertyChangeListener listener) {
110
        this.propertyChangeSupport.removePropertyChangeListener(listener);
111
    }
112
    
113
    public static void registerPersistence(){
114
        // MapControl 3D properties register
115
        PersistenceManager manager = ToolsLocator.getPersistenceManager();
116

  
117
        DynStruct definition =
118
            manager
119
                .addDefinition(DefaultMapControlProperties3D.class,
120
                    MapControlProperties3D.PERSISTENCE_NAME,
121
                    "MapControl 3D properties persistence definition", null,
122
                    null);
123

  
124
        definition
125
            .addDynFieldBoolean(MapControlProperties3D.AUTO_LAYER_SYNCHRONIZE_PROPERTY_NAME);
126
        definition
127
            .addDynFieldBoolean(MapControlProperties3D.AUTO_VIEWPORT_SYNCHRONIZE_PROPERTY_NAME);
128
        definition
129
            .addDynFieldDouble(MapControlProperties3D.SPHERE_VERTICAL_EXAGGERATION_PROPERTY_NAME);
130
        definition
131
            .addDynFieldDouble(MapControlProperties3D.FLAT_VERTICAL_EXAGGERATION_PROPERTY_NAME);
132
        definition
133
            .addDynFieldBoolean(MapControlProperties3D.BLUE_MARBEL_VISIBILITY_PROPERTY_NAME);
134
        definition
135
            .addDynFieldBoolean(MapControlProperties3D.NASA_LANDSAT_VISIBILITY_PROPERTY_NAME);
136
        definition
137
            .addDynFieldBoolean(MapControlProperties3D.DEFAULT_ELEVATION_VISIBILITY_PROPERTY_NAME);
138
    }
139

  
140
    public void saveToState(PersistentState state) throws PersistenceException {
141
        
142
        state.set(AUTO_LAYER_SYNCHRONIZE_PROPERTY_NAME,
143
            getAutoLayerSynchronize());
144
        state.set(AUTO_VIEWPORT_SYNCHRONIZE_PROPERTY_NAME,
145
            getAutoViewSynchronize());
146
        state.set(FLAT_VERTICAL_EXAGGERATION_PROPERTY_NAME,
147
            getFlatVerticalExaggeration());
148
        state.set(SPHERE_VERTICAL_EXAGGERATION_PROPERTY_NAME,
149
            getSphereVerticalExaggeration());
150
        state.set(BLUE_MARBEL_VISIBILITY_PROPERTY_NAME,
151
            getBlueMarbleLayerVisibility());
152
        state.set(NASA_LANDSAT_VISIBILITY_PROPERTY_NAME,
153
            getNasaLandsatLayerVisibility());
154
        state.set(DEFAULT_ELEVATION_VISIBILITY_PROPERTY_NAME,
155
            getDefaultElevationVisibility());
156
    }
157

  
158
    public void loadFromState(PersistentState state)
159
        throws PersistenceException {
160
        
161
        setAutoLayerSynchronize(state
162
            .getBoolean(AUTO_LAYER_SYNCHRONIZE_PROPERTY_NAME));
163
        setAutoViewPortSynchronize(state
164
            .getBoolean(AUTO_VIEWPORT_SYNCHRONIZE_PROPERTY_NAME));
165
        setSphereVerticalExaggeration(state
166
            .getDouble(SPHERE_VERTICAL_EXAGGERATION_PROPERTY_NAME));
167
        setFlatVerticalExaggeration(state
168
            .getDouble(FLAT_VERTICAL_EXAGGERATION_PROPERTY_NAME));
169
        setBlueMarbleLayerVisibility(state
170
            .getBoolean(BLUE_MARBEL_VISIBILITY_PROPERTY_NAME));
171
        setNasaLandsatVisibility(state
172
            .getBoolean(NASA_LANDSAT_VISIBILITY_PROPERTY_NAME));
173
        setDefaultElevationVisibility(state
174
            .getBoolean(DEFAULT_ELEVATION_VISIBILITY_PROPERTY_NAME));
175
        
176
    }
177

  
178
}
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.lib/org.gvsig.view3d.lib.impl/src/main/java/org/gvsig/view3d/lib/impl/DefaultView3DManger.java
23 23

  
24 24
package org.gvsig.view3d.lib.impl;
25 25

  
26
import org.gvsig.fmap.mapcontext.layers.ExtendedPropertiesSupport;
27 26
import org.gvsig.fmap.mapcontext.layers.FLayer;
28 27
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
29 28
import org.gvsig.view3d.lib.api.View3DManager;
30
import org.gvsig.view3d.lib.api.properties.GeneralProperties3D;
31 29
import org.gvsig.view3d.lib.api.properties.LayerProperties3D;
32
import org.gvsig.view3d.lib.api.properties.MapControlProperties3D;
33
import org.gvsig.view3d.lib.impl.properties.DefaultGeneralProperties3D;
34
import org.gvsig.view3d.lib.impl.properties.DefaultMapControlProperties3D;
35 30
import org.gvsig.view3d.lib.impl.properties.DefaultRasterLayerProperties3D;
36 31
import org.gvsig.view3d.lib.impl.properties.DefaultVectorialLayerProperties3D;
37 32

  
......
42 37
 */
43 38
public class DefaultView3DManger implements View3DManager {
44 39
    
45
    private GeneralProperties3D generalProperties;
46

  
47 40
    public LayerProperties3D getLayerProperties(FLayer layer) {
48 41
        Object properties = layer.getProperty("properties3D");
49 42
        if(properties == null){
......
63 56
    public void setLayerProperties(FLayer layer, LayerProperties3D properties) {
64 57
        layer.setProperty("properties3D", properties);
65 58
    }
66

  
67
    public MapControlProperties3D getMapControl3DProperties(
68
        ExtendedPropertiesSupport viewProperties) {
69
        
70
        MapControlProperties3D properties =
71
            (MapControlProperties3D) viewProperties
72
                .getProperty("mapControl3DProperties");
73
        
74
        if(properties == null){
75
            properties = new DefaultMapControlProperties3D();
76
            setMapControlProperties3D(viewProperties, properties);
77
        }
78
        
79
        return properties;
80
    }
81

  
82
    public void setMapControlProperties3D(
83
        ExtendedPropertiesSupport viewProperties,
84
        MapControlProperties3D mapControl3DProperties) {
85
        
86
        viewProperties.setProperty("mapControl3DProperties",
87
            mapControl3DProperties);
88
    }
89

  
90
    public GeneralProperties3D getGeneral3DProperties() {
91
        if(generalProperties == null){
92
            generalProperties = new DefaultGeneralProperties3D();
93
        }
94
        return generalProperties;
95
    }
96

  
97
    public void setGeneral3DProperties(GeneralProperties3D properties) {
98
        if(properties != null){
99
            this.generalProperties = properties;
100
        }
101
        
102
    }
103

  
104 59
}
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.swing/org.gvsig.view3d.swing.impl/src/main/java/org/gvsig/view3d/swing/impl/DefaultView3DSwingManager.java
30 30
import org.gvsig.fmap.mapcontext.MapContext;
31 31
import org.gvsig.fmap.mapcontext.layers.ExtendedPropertiesSupport;
32 32
import org.gvsig.fmap.mapcontext.layers.FLayer;
33
import org.gvsig.view3d.lib.api.properties.GeneralProperties3D;
34
import org.gvsig.view3d.lib.api.properties.MapControlProperties3D;
35 33
import org.gvsig.view3d.swing.api.MapControl3D;
36 34
import org.gvsig.view3d.swing.api.View3DPanel;
37 35
import org.gvsig.view3d.swing.api.View3DSwingManager;
36
import org.gvsig.view3d.swing.api.properties.GeneralProperties3D;
38 37
import org.gvsig.view3d.swing.api.properties.GeneralProperties3DPanel;
39 38
import org.gvsig.view3d.swing.api.properties.LayerProperties3DPanel;
39
import org.gvsig.view3d.swing.api.properties.MapControlProperties3D;
40 40
import org.gvsig.view3d.swing.api.properties.ViewProperties3DPanel;
41
import org.gvsig.view3d.swing.impl.properties.DefaultGeneralProperties3D;
41 42
import org.gvsig.view3d.swing.impl.properties.DefaultGeneralProperties3DPanel;
42 43
import org.gvsig.view3d.swing.impl.properties.DefaultLayerProperties3DPanel;
44
import org.gvsig.view3d.swing.impl.properties.DefaultMapControlProperties3D;
43 45
import org.gvsig.view3d.swing.impl.properties.DefaultViewProperties3DPanel;
44 46
import org.slf4j.Logger;
45 47
import org.slf4j.LoggerFactory;
......
53 55

  
54 56
    private static final Logger LOG =
55 57
        LoggerFactory.getLogger(DefaultView3DSwingManager.class);
58
    
59
    private GeneralProperties3D generalProperties;
56 60

  
57 61
    public MapControl3D createMapControl3D(MapContext theMapContext, TYPE type,
58 62
        ExtendedPropertiesSupport viewProperties) {
......
129 133
        GeneralProperties3D properties) {
130 134
        return new DefaultGeneralProperties3DPanel(properties);
131 135
    }
136
    
137
    public MapControlProperties3D getMapControl3DProperties(
138
        ExtendedPropertiesSupport viewProperties) {
139
        
140
        MapControlProperties3D properties =
141
            (MapControlProperties3D) viewProperties
142
                .getProperty("mapControl3DProperties");
143
        
144
        if(properties == null){
145
            properties = new DefaultMapControlProperties3D();
146
            setMapControlProperties3D(viewProperties, properties);
147
        }
148
        
149
        return properties;
150
    }
132 151

  
152
    public void setMapControlProperties3D(
153
        ExtendedPropertiesSupport viewProperties,
154
        MapControlProperties3D mapControl3DProperties) {
155
        
156
        viewProperties.setProperty("mapControl3DProperties",
157
            mapControl3DProperties);
158
    }
159

  
160
    public GeneralProperties3D getGeneral3DProperties() {
161
        if(generalProperties == null){
162
            generalProperties = new DefaultGeneralProperties3D();
163
        }
164
        return generalProperties;
165
    }
166

  
167
    public void setGeneral3DProperties(GeneralProperties3D properties) {
168
        if(properties != null){
169
            this.generalProperties = properties;
170
        }
171
        
172
    }
173

  
133 174
}
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.swing/org.gvsig.view3d.swing.impl/src/main/java/org/gvsig/view3d/swing/impl/data/DefaultLayerConverter.java
55 55
import org.gvsig.view3d.lib.api.View3DManager;
56 56
import org.gvsig.view3d.lib.api.properties.LayerProperties3D;
57 57
import org.gvsig.view3d.swing.api.MapControl3D;
58
import org.gvsig.view3d.swing.api.View3DSwingLocator;
58 59
import org.gvsig.view3d.swing.impl.DefaultMapControl3D;
59 60
import org.slf4j.Logger;
60 61
import org.slf4j.LoggerFactory;
......
372 373
        params.setValue(AVKey.SERVICE_NAME, "Offline");
373 374
        
374 375
        String cachePath =
375
            View3DLocator.getManager().getGeneral3DProperties().getCachePath();
376
            View3DSwingLocator.getManager().getGeneral3DProperties().getCachePath();
376 377
        params.setValue(AVKey.FILE_STORE, new BasicDataFileStore(new File(
377 378
            cachePath)));
378 379
    }
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.swing/org.gvsig.view3d.swing.impl/src/main/java/org/gvsig/view3d/swing/impl/DefaultMapControl3D.java
52 52
import gov.nasa.worldwind.view.orbit.FlatOrbitView;
53 53

  
54 54
import java.awt.BorderLayout;
55
import java.awt.Dimension;
56 55
import java.beans.PropertyChangeEvent;
57 56
import java.beans.PropertyChangeListener;
58 57
import java.util.ArrayList;
......
85 84
import org.gvsig.tools.visitor.VisitCanceledException;
86 85
import org.gvsig.view3d.lib.api.View3DLocator;
87 86
import org.gvsig.view3d.lib.api.View3DManager;
88
import org.gvsig.view3d.lib.api.properties.GeneralProperties3D;
89 87
import org.gvsig.view3d.lib.api.properties.LayerProperties3D;
90
import org.gvsig.view3d.lib.api.properties.MapControlProperties3D;
91 88
import org.gvsig.view3d.lib.api.properties.RasterLayerProperties3D;
92 89
import org.gvsig.view3d.lib.api.properties.VectorialLayerProperties3D;
93 90
import org.gvsig.view3d.swing.api.MapControl3D;
91
import org.gvsig.view3d.swing.api.View3DSwingLocator;
92
import org.gvsig.view3d.swing.api.View3DSwingManager;
94 93
import org.gvsig.view3d.swing.api.View3DSwingManager.TYPE;
94
import org.gvsig.view3d.swing.api.properties.GeneralProperties3D;
95
import org.gvsig.view3d.swing.api.properties.MapControlProperties3D;
95 96
import org.gvsig.view3d.swing.impl.data.DefaultLayerConverter;
96 97
import org.gvsig.view3d.swing.impl.data.DefaultTiledImageLayer;
97 98
import org.gvsig.view3d.swing.impl.data.LayerConverter;
......
187 188

  
188 189
        setGeneral3DProperties();
189 190

  
190
        View3DManager manager = View3DLocator.getManager();
191
        this.properties = manager.getMapControl3DProperties(viewProperties);
191
        View3DSwingManager swingManager = View3DSwingLocator.getManager();
192
        this.properties = swingManager.getMapControl3DProperties(viewProperties);
192 193
        addChangePropertyListener(this.properties);
193 194
        setMapControl3DProperties();
194 195
        
......
197 198

  
198 199
    private void setGeneral3DProperties() {
199 200

  
200
        View3DManager manager = View3DLocator.getManager();
201
        View3DSwingManager swingManager = View3DSwingLocator.getManager();
201 202
        GeneralProperties3D general3DProperties =
202
            manager.getGeneral3DProperties();
203
            swingManager.getGeneral3DProperties();
203 204

  
204 205
        this.setAtmosphereVisibility(general3DProperties
205 206
            .getAtmosphereVisibility());
......
664 665
    private void intializeWWPanel() {
665 666
        wwd = new WorldWindowGLJPanel();
666 667

  
667
        View3DManager manager = View3DLocator.getManager();
668
        GeneralProperties3D general3dProperties =
669
            manager.getGeneral3DProperties();
670
        wwd.setPreferredSize(new Dimension(general3dProperties
671
            .getDefaultViewWidht(), general3dProperties.getDefaultViewHeight()));
672

  
673 668
        // Create the default model as described in the current worldwind
674 669
        // properties.
675 670
        Model m =
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.swing/org.gvsig.view3d.swing.impl/src/main/java/org/gvsig/view3d/swing/impl/properties/DefaultGeneralProperties3D.java
1
package org.gvsig.view3d.swing.impl.properties;
2

  
3
import java.beans.PropertyChangeListener;
4
import java.beans.PropertyChangeSupport;
5

  
6
import org.gvsig.view3d.swing.api.properties.GeneralProperties3D;
7

  
8
public class DefaultGeneralProperties3D implements GeneralProperties3D {
9

  
10
    private String DEFAULT_VIEW_HEIGHT_PROPERTY_NAME = "defaultViewHeight";
11
    private String DEFAULT_VIEW_WIDTH_PROPERTY_NAME = "defaultViewWidth";
12

  
13
    private String ATMOSPHERE_VISIBILITY_PROPERTY_NAME = "atmosphereVisibility";
14
    private String MINIMAP_VISIBILITY_PROPERTY_NAME = "minimapVisibility";
15
    private String NORTH_INDICATOR_VISIBILITY_PROPERTY_NAME =
16
        "northIndicatorVisibility";
17
    private String STARS_BACKGROUND_VISIBILITY_PROPERTY_NAME =
18
        "starsBackgroundVisibility";
19
    private String SCALE_VISIBILITY_PROPERTY_NAME = "scaleVisibility";
20

  
21
    private String VIEWPORT_ANIMATION_PROPERTY_NAME = "viewPortAnimation";
22

  
23
    private String CACHE_PATH_PROPERTY_NAME = "cachePath";
24

  
25
    private int defaultViewHeight = 600;
26
    private int defaultViewWidth = 800;
27

  
28
    private boolean atmosphereVisibility = true;
29
    private boolean northIndicatorVisibility = true;
30
    private boolean minimapVisibility = true;
31
    private boolean starsBackgroundVisibility = true;
32
    private boolean scaleVisibility = true;
33

  
34
    private boolean viewPortAnimation = true;
35

  
36
    private String cachePath = "";
37

  
38
    private PropertyChangeSupport support;
39

  
40
    public DefaultGeneralProperties3D() {
41
        support = new PropertyChangeSupport(this);
42
    }
43

  
44
    public boolean getAtmosphereVisibility() {
45
        return atmosphereVisibility;
46
    }
47

  
48
    public String getCachePath() {
49
        return cachePath;
50
    }
51

  
52
    public int getDefaultViewHeight() {
53
        return defaultViewHeight;
54
    }
55

  
56
    public int getDefaultViewWidht() {
57
        return defaultViewWidth;
58
    }
59

  
60
    public boolean getMinimapVisibility() {
61
        return minimapVisibility;
62
    }
63

  
64
    public boolean getNorthIndicatorVisibility() {
65
        return northIndicatorVisibility;
66
    }
67

  
68
    public boolean getScaleVisibility() {
69
        return scaleVisibility;
70
    }
71

  
72
    public boolean getViewPortAnimation() {
73
        return viewPortAnimation;
74
    }
75

  
76
    public void setAtmosphereVisibility(boolean visibility) {
77
        support.firePropertyChange(ATMOSPHERE_VISIBILITY_PROPERTY_NAME,
78
            atmosphereVisibility, visibility);
79
        this.atmosphereVisibility = visibility;
80
    }
81

  
82
    public void setCachePath(String path) {
83
        support.firePropertyChange(CACHE_PATH_PROPERTY_NAME, cachePath, path);
84
        this.cachePath = path;
85
    }
86

  
87
    public void setDefaultViewHeight(int height) {
88
        support.firePropertyChange(DEFAULT_VIEW_HEIGHT_PROPERTY_NAME,
89
            defaultViewHeight, height);
90
        this.defaultViewHeight = height;
91
    }
92

  
93
    public void setDefaultViewWidth(int width) {
94
        support.firePropertyChange(DEFAULT_VIEW_WIDTH_PROPERTY_NAME,
95
            defaultViewHeight, width);
96
        this.defaultViewWidth = width;
97

  
98
    }
99

  
100
    public void setMinimapVisibility(boolean visibility) {
101
        support.firePropertyChange(MINIMAP_VISIBILITY_PROPERTY_NAME,
102
            minimapVisibility, visibility);
103
        this.minimapVisibility = visibility;
104
    }
105

  
106
    public void setNorthIndicatorVisibility(boolean visibility) {
107
        support.firePropertyChange(NORTH_INDICATOR_VISIBILITY_PROPERTY_NAME,
108
            northIndicatorVisibility, visibility);
109
        this.northIndicatorVisibility = visibility;
110
    }
111

  
112
    public void setScaleVisibility(boolean visibility) {
113
        support.firePropertyChange(SCALE_VISIBILITY_PROPERTY_NAME,
114
            scaleVisibility, visibility);
115
        this.scaleVisibility = visibility;
116
    }
117

  
118
    public void setViewPortAnimation(boolean flag) {
119
        support.firePropertyChange(VIEWPORT_ANIMATION_PROPERTY_NAME,
120
            viewPortAnimation, flag);
121
        this.viewPortAnimation = flag;
122
    }
123

  
124
    public boolean getStarsBackgroundVisibility() {
125
        return starsBackgroundVisibility;
126
    }
127

  
128
    public void setStarsBackgroundVisibility(boolean visibility) {
129
        support.firePropertyChange(STARS_BACKGROUND_VISIBILITY_PROPERTY_NAME,
130
            starsBackgroundVisibility, visibility);
131
        this.starsBackgroundVisibility = visibility;
132
    }
133

  
134
    public void addPropertyChangeListener(PropertyChangeListener listener) {
135
        support.addPropertyChangeListener(listener);
136
    }
137

  
138
    public void removePropertyChangeListener(PropertyChangeListener listener) {
139
        support.removePropertyChangeListener(listener);
140
    }
141

  
142
}
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.swing/org.gvsig.view3d.swing.impl/src/main/java/org/gvsig/view3d/swing/impl/properties/DefaultGeneralProperties3DPanel.java
14 14
import org.gvsig.tools.i18n.I18nManager;
15 15
import org.gvsig.tools.swing.api.ToolsSwingLocator;
16 16
import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager;
17
import org.gvsig.view3d.lib.api.properties.GeneralProperties3D;
17
import org.gvsig.view3d.swing.api.properties.GeneralProperties3D;
18 18

  
19 19
public class DefaultGeneralProperties3DPanel extends
20 20
    AbstractGeneralProperties3DPanel {
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.swing/org.gvsig.view3d.swing.impl/src/main/java/org/gvsig/view3d/swing/impl/properties/DefaultMapControlProperties3D.java
1
package org.gvsig.view3d.swing.impl.properties;
2

  
3
import java.beans.PropertyChangeListener;
4
import java.beans.PropertyChangeSupport;
5

  
6
import org.gvsig.tools.ToolsLocator;
7
import org.gvsig.tools.dynobject.DynStruct;
8
import org.gvsig.tools.persistence.PersistenceManager;
9
import org.gvsig.tools.persistence.PersistentState;
10
import org.gvsig.tools.persistence.exception.PersistenceException;
11
import org.gvsig.view3d.swing.api.properties.MapControlProperties3D;
12

  
13
public class DefaultMapControlProperties3D implements MapControlProperties3D {
14

  
15
    private PropertyChangeSupport propertyChangeSupport;
16

  
17
    private double sphereVerticalExaggeration = 1;
18
    private double flatVerticalExaggeration = 1;
19
    private boolean autoLayerShynchornize = true;
20
    private boolean autoViewPortSynchronize = false;
21
    private boolean showBlueMarbleLayer = true;
22
    private boolean showNasaLandsatLayer = true;
23
    private boolean showDefaultElevation = true;
24

  
25
    public DefaultMapControlProperties3D() {
26
        propertyChangeSupport = new PropertyChangeSupport(this);
27
    }
28

  
29
    public boolean getAutoLayerSynchronize() {
30
        return autoLayerShynchornize;
31
    }
32

  
33
    public boolean getAutoViewSynchronize() {
34
        return autoViewPortSynchronize;
35
    }
36

  
37
    public boolean getBlueMarbleLayerVisibility() {
38
        return showBlueMarbleLayer;
39
    }
40

  
41
    public boolean getDefaultElevationVisibility() {
42
        return showDefaultElevation;
43
    }
44

  
45
    public double getFlatVerticalExaggeration() {
46
        return flatVerticalExaggeration;
47
    }
48

  
49
    public boolean getNasaLandsatLayerVisibility() {
50
        return showNasaLandsatLayer;
51
    }
52

  
53
    public double getSphereVerticalExaggeration() {
54
        return sphereVerticalExaggeration;
55
    }
56

  
57
    public void setAutoLayerSynchronize(boolean flag) {
58
        this.propertyChangeSupport.firePropertyChange(
59
            AUTO_LAYER_SYNCHRONIZE_PROPERTY_NAME, autoLayerShynchornize, flag);
60
        this.autoLayerShynchornize = flag;
61
    }
62

  
63
    public void setAutoViewPortSynchronize(boolean flag) {
64
        this.propertyChangeSupport.firePropertyChange(
65
            AUTO_VIEWPORT_SYNCHRONIZE_PROPERTY_NAME, autoViewPortSynchronize,
66
            flag);
67
        this.autoViewPortSynchronize = flag;
68
    }
69

  
70
    public void setBlueMarbleLayerVisibility(boolean visibility) {
71
        this.propertyChangeSupport.firePropertyChange(
72
            BLUE_MARBEL_VISIBILITY_PROPERTY_NAME, showBlueMarbleLayer,
73
            visibility);
74
        this.showBlueMarbleLayer = visibility;
75
    }
76

  
77
    public void setDefaultElevationVisibility(boolean visibility) {
78
        this.propertyChangeSupport.firePropertyChange(
79
            DEFAULT_ELEVATION_VISIBILITY_PROPERTY_NAME, showDefaultElevation,
80
            visibility);
81
        this.showDefaultElevation = visibility;
82
    }
83

  
84
    public void setFlatVerticalExaggeration(double value) {
85
        this.propertyChangeSupport.firePropertyChange(
86
            FLAT_VERTICAL_EXAGGERATION_PROPERTY_NAME, flatVerticalExaggeration,
87
            value);
88
        this.flatVerticalExaggeration = value;
89
    }
90

  
91
    public void setNasaLandsatVisibility(boolean visibility) {
92
        this.propertyChangeSupport.firePropertyChange(
93
            NASA_LANDSAT_VISIBILITY_PROPERTY_NAME, showNasaLandsatLayer,
94
            visibility);
95
        this.showNasaLandsatLayer = visibility;
96
    }
97

  
98
    public void setSphereVerticalExaggeration(double value) {
99
        this.propertyChangeSupport.firePropertyChange(
100
            SPHERE_VERTICAL_EXAGGERATION_PROPERTY_NAME, sphereVerticalExaggeration,
101
            value);
102
        this.sphereVerticalExaggeration = value;
103
    }
104

  
105
    public void addPropertyChangeListener(PropertyChangeListener listener) {
106
        this.propertyChangeSupport.addPropertyChangeListener(listener);
107
    }
108

  
109
    public void removePropertyChangeListener(PropertyChangeListener listener) {
110
        this.propertyChangeSupport.removePropertyChangeListener(listener);
111
    }
112
    
113
    public static void registerPersistence(){
114
        // MapControl 3D properties register
115
        PersistenceManager manager = ToolsLocator.getPersistenceManager();
116

  
117
        DynStruct definition =
118
            manager
119
                .addDefinition(DefaultMapControlProperties3D.class,
120
                    MapControlProperties3D.PERSISTENCE_NAME,
121
                    "MapControl 3D properties persistence definition", null,
122
                    null);
123

  
124
        definition
125
            .addDynFieldBoolean(MapControlProperties3D.AUTO_LAYER_SYNCHRONIZE_PROPERTY_NAME);
126
        definition
127
            .addDynFieldBoolean(MapControlProperties3D.AUTO_VIEWPORT_SYNCHRONIZE_PROPERTY_NAME);
128
        definition
129
            .addDynFieldDouble(MapControlProperties3D.SPHERE_VERTICAL_EXAGGERATION_PROPERTY_NAME);
130
        definition
131
            .addDynFieldDouble(MapControlProperties3D.FLAT_VERTICAL_EXAGGERATION_PROPERTY_NAME);
132
        definition
133
            .addDynFieldBoolean(MapControlProperties3D.BLUE_MARBEL_VISIBILITY_PROPERTY_NAME);
134
        definition
135
            .addDynFieldBoolean(MapControlProperties3D.NASA_LANDSAT_VISIBILITY_PROPERTY_NAME);
136
        definition
137
            .addDynFieldBoolean(MapControlProperties3D.DEFAULT_ELEVATION_VISIBILITY_PROPERTY_NAME);
138
    }
139

  
140
    public void saveToState(PersistentState state) throws PersistenceException {
141
        
142
        state.set(AUTO_LAYER_SYNCHRONIZE_PROPERTY_NAME,
143
            getAutoLayerSynchronize());
144
        state.set(AUTO_VIEWPORT_SYNCHRONIZE_PROPERTY_NAME,
145
            getAutoViewSynchronize());
146
        state.set(FLAT_VERTICAL_EXAGGERATION_PROPERTY_NAME,
147
            getFlatVerticalExaggeration());
148
        state.set(SPHERE_VERTICAL_EXAGGERATION_PROPERTY_NAME,
149
            getSphereVerticalExaggeration());
150
        state.set(BLUE_MARBEL_VISIBILITY_PROPERTY_NAME,
151
            getBlueMarbleLayerVisibility());
152
        state.set(NASA_LANDSAT_VISIBILITY_PROPERTY_NAME,
153
            getNasaLandsatLayerVisibility());
154
        state.set(DEFAULT_ELEVATION_VISIBILITY_PROPERTY_NAME,
155
            getDefaultElevationVisibility());
156
    }
157

  
158
    public void loadFromState(PersistentState state)
159
        throws PersistenceException {
160
        
161
        setAutoLayerSynchronize(state
162
            .getBoolean(AUTO_LAYER_SYNCHRONIZE_PROPERTY_NAME));
163
        setAutoViewPortSynchronize(state
164
            .getBoolean(AUTO_VIEWPORT_SYNCHRONIZE_PROPERTY_NAME));
165
        setSphereVerticalExaggeration(state
166
            .getDouble(SPHERE_VERTICAL_EXAGGERATION_PROPERTY_NAME));
167
        setFlatVerticalExaggeration(state
168
            .getDouble(FLAT_VERTICAL_EXAGGERATION_PROPERTY_NAME));
169
        setBlueMarbleLayerVisibility(state
170
            .getBoolean(BLUE_MARBEL_VISIBILITY_PROPERTY_NAME));
171
        setNasaLandsatVisibility(state
172
            .getBoolean(NASA_LANDSAT_VISIBILITY_PROPERTY_NAME));
173
        setDefaultElevationVisibility(state
174
            .getBoolean(DEFAULT_ELEVATION_VISIBILITY_PROPERTY_NAME));
175
        
176
    }
177

  
178
}
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.swing/org.gvsig.view3d.swing.impl/src/main/java/org/gvsig/view3d/swing/impl/properties/DefaultViewProperties3DPanel.java
2 2

  
3 3
import javax.swing.JComponent;
4 4

  
5
import org.gvsig.view3d.lib.api.properties.MapControlProperties3D;
5
import org.gvsig.view3d.swing.api.properties.MapControlProperties3D;
6 6

  
7 7
public class DefaultViewProperties3DPanel extends AbstractViewProperties3DPanel {
8 8

  
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.swing/org.gvsig.view3d.swing.impl/src/main/java/org/gvsig/view3d/swing/impl/DefaultView3DSwingLibrary.java
29 29
import org.gvsig.tools.library.LibraryException;
30 30
import org.gvsig.view3d.swing.api.View3DSwingLibrary;
31 31
import org.gvsig.view3d.swing.api.View3DSwingLocator;
32
import org.gvsig.view3d.swing.impl.properties.DefaultMapControlProperties3D;
32 33

  
33 34
/**
34 35
 * Default implementation of {@link View3DSwingLibrary}.
......
50 51
        // Load configuration file
51 52
        System.setProperty("gov.nasa.worldwind.app.config.document",
52 53
            "config/view3d.worldwind.xml");
54
        
55
        registerPersistence();
53 56
    }
54 57

  
58
    private void registerPersistence() {
59
        DefaultMapControlProperties3D.registerPersistence();
60
    }
61

  
55 62
    @Override
56 63
    protected void doPostInitialize() throws LibraryException {
57 64
    }
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.swing/org.gvsig.view3d.swing.impl/src/main/java/org/gvsig/view3d/swing/impl/DefaultView3DPanel.java
25 25
package org.gvsig.view3d.swing.impl;
26 26

  
27 27
import java.awt.BorderLayout;
28
import java.awt.Dimension;
28 29
import java.awt.event.ComponentEvent;
29 30
import java.awt.event.ComponentListener;
30 31

  
......
44 45
import org.gvsig.view3d.swing.api.View3DSwingLocator;
45 46
import org.gvsig.view3d.swing.api.View3DSwingManager;
46 47
import org.gvsig.view3d.swing.api.View3DSwingManager.TYPE;
48
import org.gvsig.view3d.swing.api.properties.GeneralProperties3D;
47 49

  
48 50
/**
49 51
 * Default implementaion of {@link View3DPanel}.
......
76 78
        
77 79
        super(new BorderLayout());
78 80
        
81
        View3DSwingManager swingManager = View3DSwingLocator.getManager();
82
        GeneralProperties3D general3dProperties = swingManager.getGeneral3DProperties();
83
        
79 84
        this.title = composeTitle(title);
80 85

  
81
        View3DSwingManager swingManager = View3DSwingLocator.getManager();
82 86
        this.mapControl3D =
83 87
            swingManager.createMapControl3D(theMapContext, type, viewProperties);
84 88
        this.observableHelper = new ObservableHelper();
......
100 104
                getMapControl3D().dispose();
101 105
            }
102 106
        });
107
        
108
        this.setPreferredSize(new Dimension(general3dProperties.getDefaultViewWidht(),
109
            general3dProperties.getDefaultViewHeight()));
103 110
    }
104 111

  
105 112
    private String composeTitle(String title) {
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.swing/org.gvsig.view3d.swing.api/src/main/java/org/gvsig/view3d/swing/api/View3DSwingManager.java
29 29
import org.gvsig.fmap.mapcontext.MapContext;
30 30
import org.gvsig.fmap.mapcontext.layers.ExtendedPropertiesSupport;
31 31
import org.gvsig.fmap.mapcontext.layers.FLayer;
32
import org.gvsig.view3d.lib.api.properties.GeneralProperties3D;
33
import org.gvsig.view3d.lib.api.properties.MapControlProperties3D;
32
import org.gvsig.view3d.swing.api.properties.GeneralProperties3D;
34 33
import org.gvsig.view3d.swing.api.properties.GeneralProperties3DPanel;
35 34
import org.gvsig.view3d.swing.api.properties.LayerProperties3DPanel;
35
import org.gvsig.view3d.swing.api.properties.MapControlProperties3D;
36 36
import org.gvsig.view3d.swing.api.properties.ViewProperties3DPanel;
37 37

  
38 38
/**
......
134 134
     */
135 135
    public GeneralProperties3DPanel createGeneralProperties3DPanel(
136 136
        GeneralProperties3D properties);
137
    
138
    public MapControlProperties3D getMapControl3DProperties(
139
        ExtendedPropertiesSupport viewProperties);
140
    
141
    public void setMapControlProperties3D(
142
        ExtendedPropertiesSupport viewProperties,
143
        MapControlProperties3D mapControl3DProperties);
144
    
145
    public GeneralProperties3D getGeneral3DProperties();
146
    
147
    public void setGeneral3DProperties(GeneralProperties3D properties);
137 148

  
138 149
}
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
34 34
import org.gvsig.tools.observer.Observable;
35 35
import org.gvsig.tools.swing.api.Component;
36 36
import org.gvsig.tools.task.Cancellable;
37
import org.gvsig.view3d.lib.api.properties.MapControlProperties3D;
38 37
import org.gvsig.view3d.swing.api.View3DSwingManager.TYPE;
38
import org.gvsig.view3d.swing.api.properties.MapControlProperties3D;
39 39

  
40 40
/**
41 41
 * A component that includes a {@link MapContext} and a
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.swing/org.gvsig.view3d.swing.api/src/main/java/org/gvsig/view3d/swing/api/properties/GeneralProperties3D.java
1
package org.gvsig.view3d.swing.api.properties;
2

  
3
import java.beans.PropertyChangeListener;
4

  
5
/**
6
 * 
7
 * @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
8
 *
9
 */
10
public interface GeneralProperties3D {
11
    
12
    public void addPropertyChangeListener(PropertyChangeListener listener);
13

  
14
    public boolean getViewPortAnimation();
15

  
16
    public boolean getAtmosphereVisibility();
17

  
18
    public String getCachePath();
19

  
20
    public int getDefaultViewHeight();
21

  
22
    public int getDefaultViewWidht();
23

  
24
    public boolean getMinimapVisibility();
25

  
26
    public boolean getNorthIndicatorVisibility();
27
    
28
    public boolean getStarsBackgroundVisibility();
29

  
30
    public boolean getScaleVisibility();
31
    
32
    public void removePropertyChangeListener(PropertyChangeListener listener);
33

  
34
    public void setViewPortAnimation(boolean flag);
35

  
36
    public void setAtmosphereVisibility(boolean visibility);
37

  
38
    public void setCachePath(String path);
39

  
40
    public void setDefaultViewHeight(int height);
41

  
42
    public void setDefaultViewWidth(int width);
43

  
44
    public void setMinimapVisibility(boolean visibility);
45

  
46
    public void setNorthIndicatorVisibility(boolean visibility);
47

  
48
    public void setStarsBackgroundVisibility(boolean visibility);
49
    
50
    public void setScaleVisibility(boolean visibility);
51
}
2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.swing/org.gvsig.view3d.swing.api/src/main/java/org/gvsig/view3d/swing/api/properties/MapControlProperties3D.java
1
package org.gvsig.view3d.swing.api.properties;
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff