source: ether_statistics/service/implementation/gov/noaa/pmel/sgt/dm/SGTFull3DVector.java @ 569

Last change on this file since 569 was 569, checked in by vmipsl, 12 years ago

Nouveau projet

File size: 5.3 KB
Line 
1/*
2 * $Id: SGTFull3DVector.java,v 1.2 2003/02/06 23:19:33 oz Exp $
3 *
4 * This software is provided by NOAA for full, free and open release.  It is
5 * understood by the recipient/user that NOAA assumes no liability for any
6 * errors contained in the code.  Although this software is released without
7 * conditions or restrictions in its use, it is expected that appropriate
8 * credit be given to its author and to the National Oceanic and Atmospheric
9 * Administration should the software be included by the recipient as an
10 * element in other product development.
11 */
12
13package gov.noaa.pmel.sgt.dm;
14
15import gov.noaa.pmel.sgt.SGLabel;
16import gov.noaa.pmel.util.SoTRange;
17
18import java.beans.PropertyChangeListener;
19import java.io.Serializable;
20
21/**
22 * Defines a data object to be a Vector. Interpretation
23 * of U and V is determined by the <code>CoordinateSystem</code>.  For
24 * <code>Cartesian</code>, U and V are the Cartesian vector
25 * components. For <code>Polar</code> ,
26 * U and V are R (radius) and Theta (angle) vector components,
27 * respectively.
28 *
29 * @author Donald Denbo
30 * @version $Revision: 1.2 $, $Date: 2003/02/06 23:19:33 $
31 * @since 1.0
32 * @see SGTData
33 * @see CoordinateSystem
34 */
35public class SGTFull3DVector implements SGTData, Cloneable, Serializable {
36  String title_;
37  SGLabel keyTitle_ = null;
38  String id_ = null;
39    /**@shapeType AggregationLink
40  * @clientRole u comp*/
41    ThreeDGrid uComp_;
42    /**@shapeType AggregationLink
43  * @clientRole v comp*/
44    ThreeDGrid vComp_;
45    /**@shapeType AggregationLink
46  * @clientRole w comp*/
47    ThreeDGrid wComp_;
48   
49  /**
50   * Default constructor.
51   */
52  public SGTFull3DVector() {
53  }
54  /**
55   * Construct a SGT3DVector from three components. The three components
56   * must match in both SGTData and CoordinateSystem Interfaces.
57   * All components must be the same shape.
58   *
59   * @param uComp U component of the vector
60   * @param vComp V component of the vector
61   * @param wComp W component of the vector
62   */
63  public SGTFull3DVector(ThreeDGrid uComp, ThreeDGrid vComp, ThreeDGrid wComp) {
64    uComp_ = uComp;
65    vComp_ = vComp;
66    wComp_ = wComp;
67  }
68  /**
69   * Create a copy. Creates a shallow copy.
70   *
71   * @see SGTData
72   */
73  public SGTData copy() {
74    SGTFull3DVector newSGTVector;
75    try {
76      newSGTVector = (SGTFull3DVector)clone();
77    } catch (CloneNotSupportedException e) {
78      newSGTVector = new SGTFull3DVector(this.uComp_, this.vComp_, this.wComp_);
79    }
80    return newSGTVector;
81  }
82  /**
83   * Get the U component.
84   *
85   * @return U component
86   */
87  public ThreeDGrid getU() {
88    return uComp_;
89  }
90  /**
91   * Get the V component.
92   *
93   * @return V component
94   */
95  public ThreeDGrid getV() {
96    return vComp_;
97  }
98  /**
99   * Get the W component.
100   *
101   * @return W component
102   */
103  public ThreeDGrid getW() {
104    return wComp_;
105  }
106  /**
107   * Set the U component.
108   *
109   * @param uComp U component
110   */
111  public void setU(ThreeDGrid uComp) {
112    uComp_ = uComp;
113  }
114  /**
115   * Set the V component.
116   *
117   * @param vComp V component
118   */
119  public void setV(ThreeDGrid vComp) {
120    vComp_ = vComp;
121  }
122  /**
123   * Set the W component.
124   *
125   * @param vComp W component
126   */
127  public void setW(ThreeDGrid wComp) {
128    wComp_ = wComp;
129  }
130  /**
131   * Set the vector components.
132   *
133   * @param uComp U component
134   * @param vComp V component
135   */
136  public void setComponents(ThreeDGrid uComp, ThreeDGrid vComp, ThreeDGrid wComp) {
137    uComp_ = uComp;
138    vComp_ = vComp;
139    wComp_ = wComp;
140  }
141  /**
142   * Set the vector's title.
143   *
144   * @param title
145   */
146  public void setTitle(String title) {
147    title_ = title;
148  }
149  public SGLabel getKeyTitle() {
150    return keyTitle_;
151  }
152  /** Set the title formatted for the <code>VectorKey</code>. */
153  public void setKeyTitle(SGLabel title) {
154    keyTitle_ = title;
155  }
156  /**
157   * Get the unique identifier.  The presence of the identifier
158   * is optional, but if it is present it should be unique.  This
159   * field is used to search for the layer that contains the data.
160   *
161   * @return unique identifier
162   * @see gov.noaa.pmel.sgt.Pane
163   * @see gov.noaa.pmel.sgt.Layer
164   */
165  public String getId() {
166    return id_;
167  }
168  /**
169   * Set the unique identifier.
170   */
171  public void setId(String ident) {
172    id_ = ident;
173  }
174  /**
175   * Get the vector's title.
176   *
177   * @return the title
178   */
179  public String getTitle() {
180    return title_;
181  }
182  public boolean isXTime() {
183    return uComp_.isXTime();
184  }
185  public boolean isYTime() {
186    return uComp_.isYTime();
187  }
188  public boolean isZTime() {
189    return uComp_.isZTime();
190  }
191  public SGTMetaData getXMetaData() {
192    return uComp_.getXMetaData();
193  }
194  public SGTMetaData getYMetaData() {
195    return uComp_.getYMetaData();
196  }
197  public SGTMetaData getZMetaData() {
198    return uComp_.getZMetaData();
199  }
200  public SoTRange getXRange() {
201    return uComp_.getXRange();
202  }
203  public SoTRange getYRange() {
204    return uComp_.getYRange();
205  }
206  public SoTRange getZRange() {
207    return uComp_.getZRange();
208  }
209  public void addPropertyChangeListener(PropertyChangeListener l) {
210    uComp_.addPropertyChangeListener(l);
211    vComp_.addPropertyChangeListener(l);
212    wComp_.addPropertyChangeListener(l);
213  }
214  public void removePropertyChangeListener(PropertyChangeListener l) {
215    uComp_.removePropertyChangeListener(l);
216    vComp_.removePropertyChangeListener(l);
217    wComp_.removePropertyChangeListener(l);
218  }
219}
Note: See TracBrowser for help on using the repository browser.