Statistics
| Revision:

root / trunk / libraries / libRemoteServices / src / org / gvsig / remoteClient / wms / WMSStatus.java @ 3665

History | View | Annotate | Download (3.84 KB)

1

    
2
package org.gvsig.remoteClient.wms;
3

    
4
import java.awt.geom.Rectangle2D;
5
import java.util.Vector;
6

    
7
/**
8
 * Describes the status of a WMSclient, so it adds to the Remote client status
9
 * a list of layers, a list of layer styles, the extent of the map.
10
 * Provides the functionality to modify these lists.
11
 * 
12
 */
13
public class WMSStatus extends org.gvsig.remoteClient.RemoteClientStatus {
14

    
15

    
16
        // list of leayer to be retrieved by the WMS
17
    private Vector layers;
18
    // List of layer styles
19
    private Vector styles;
20
    private Vector dimensions;
21
    // extent required by the WMS client
22
    private Rectangle2D extent;
23
    private boolean transparency;
24
    public WMSStatus()
25
    {
26
            layers = new Vector();
27
            styles = new Vector();                        
28
    }
29
    
30
    // sets the list of layers required by the WMS client
31
    public void setLayerNames(Vector _layers) {        
32
        layers = _layers;
33
    } 
34

    
35
/**
36
 * <p>Retrieves the layer list required by the WMS client</p>
37
 * 
38
 * 
39
 * @return Vector, the list of layers
40
 */
41
    public Vector getLayerNames() {        
42
        return layers;
43
    } 
44

    
45
/**
46
 * <p> Adds a layer to the list of layers required by the WMS client</p>
47
 * 
48
 * 
49
 * @param _layerName, name of the layer to be added. 
50
 */
51
    public void addLayerName(String _layerName) {        
52
        layers.add(_layerName);
53
    } 
54

    
55
/**
56
 * <p>removes a layer from the layer list</p>
57
 * 
58
 * 
59
 * @param _layerName 
60
 * @return true if the layer name has been deleted from the list
61
 */
62
    public boolean removeLayerName(String _layerName) {
63
            return layers.remove(_layerName);       
64
    } 
65

    
66
/**
67
 * <p>gets the styles list required by the WMS client</p>
68
 * 
69
 * 
70
 * @return Vector with the list of layer styles
71
 */
72
    public Vector getStyles() {        
73
        return styles;
74
    } 
75

    
76
/**
77
 * <p>sets the styles list required by the WMS client</p>
78
 * 
79
 * 
80
 * @param _styles, list to be set as the required styles.
81
 */
82
    public void setStyles(Vector _styles) {        
83
        styles = _styles;
84
    }
85
    
86
    /**
87
     * <p>sets the styles list required by the WMS client</p>
88
     * 
89
     * 
90
     * @param _styles, list to be set as the required styles.
91
     */
92
    public void setDimensions(Vector _dimensions) {        
93
        
94
        dimensions = _dimensions;
95
    } 
96

    
97
/**
98
 * <p>Adds a style name to the styles list required by the WMS client</p>
99
 * 
100
 * 
101
 * @param _name, style name to be added
102
 */
103
    public void addStyleName(String _name) {        
104
        styles.add( _name);
105
    } 
106

    
107
/**
108
 * <p>Removes a style from the list of styles required by the WMS client</p>
109
 * 
110
 * 
111
 * @param _name, style name to be removed
112
 */
113
    public boolean removeStyleName(String _name) {        
114
        return styles.remove(_name);
115
    } 
116
/**
117
 * <p>Gets the extent defined by the map</p>
118
 */
119
    public Rectangle2D getExtent() {        
120
        return extent;
121
    } 
122
/**
123
 * <p>Sets the extent defined by the map</p>
124
 */
125
    public void setExtent(Rectangle2D extent) {        
126
        this.extent = extent;
127
    } 
128
 
129
    public boolean equals(Object obj){
130
        if (obj instanceof WMSStatus)
131
            return false;
132
        WMSStatus s = (WMSStatus) obj;
133
        return  (s.getExtent().equals(this.getExtent()) 
134
             &&  s.getFormat().equals(this.getFormat())
135
             && (s.getHeight() == this.getHeight())
136
             && (s.getWidth()  == this.getWidth())
137
             &&  s.getLayerNames().equals(this.getLayerNames())
138
             &&  s.getStyles().equals(this.getStyles()) 
139
             &&  (s.getTransparency()==this.getTransparency()));
140
    }
141

    
142
    /**
143
     * @return
144
     */
145
    public boolean getTransparency() {
146
        return transparency;
147
    }
148

    
149
    /**
150
     * @param wmsTransparency
151
     */
152
    public void setTransparency(boolean wmsTransparency) {
153
        transparency = wmsTransparency;
154
    }
155

    
156
    /**
157
     * @return
158
     */
159
    public Vector getDimensions() {
160
        return dimensions;
161
    }
162
    
163
}