Statistics
| Revision:

gvsig-3d / 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 @ 496

History | View | Annotate | Download (4.45 KB)

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
}