svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.geometry / org.gvsig.fmap.geometry.jts / src / main / java / org / gvsig / fmap / geom / jts / primitive / DefaultNullGeometry.java @ 47432
History | View | Annotate | Download (7.75 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or modify it under
|
7 |
* the terms of the GNU General Public License as published by the Free Software
|
8 |
* Foundation; either version 3 of the License, or (at your option) any later
|
9 |
* version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful, but WITHOUT
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
13 |
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
14 |
* details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License along with
|
17 |
* this program; if not, write to the Free Software Foundation, Inc., 51
|
18 |
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
19 |
*
|
20 |
* For any additional information, do not hesitate to contact us at info AT
|
21 |
* gvsig.com, or visit our website www.gvsig.com.
|
22 |
*/
|
23 |
package org.gvsig.fmap.geom.jts.primitive; |
24 |
|
25 |
import java.awt.Rectangle; |
26 |
import java.awt.Shape; |
27 |
import java.awt.geom.AffineTransform; |
28 |
import java.awt.geom.PathIterator; |
29 |
import java.awt.geom.Point2D; |
30 |
import java.awt.geom.Rectangle2D; |
31 |
|
32 |
import com.vividsolutions.jts.geom.Geometry; |
33 |
|
34 |
import org.cresques.cts.ICoordTrans; |
35 |
|
36 |
import org.gvsig.fmap.geom.GeometryException; |
37 |
import org.gvsig.fmap.geom.aggregate.MultiLine; |
38 |
import org.gvsig.fmap.geom.aggregate.MultiPoint; |
39 |
import org.gvsig.fmap.geom.aggregate.MultiPolygon; |
40 |
import org.gvsig.fmap.geom.handler.Handler; |
41 |
import org.gvsig.fmap.geom.jts.DefaultValidationStatus; |
42 |
import org.gvsig.fmap.geom.operation.GeometryOperationException; |
43 |
import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException; |
44 |
import org.gvsig.fmap.geom.primitive.Envelope; |
45 |
import org.gvsig.fmap.geom.primitive.GeneralPathX; |
46 |
import org.gvsig.fmap.geom.primitive.NullGeometry; |
47 |
import org.gvsig.fmap.geom.type.GeometryType; |
48 |
|
49 |
/**
|
50 |
* DOCUMENT ME!
|
51 |
*
|
52 |
* @author Vicente Caballero Navarro
|
53 |
*/
|
54 |
public class DefaultNullGeometry extends AbstractPrimitive implements NullGeometry { |
55 |
|
56 |
/**
|
57 |
*
|
58 |
*/
|
59 |
private static final long serialVersionUID = -7307693394018682067L; |
60 |
|
61 |
private static final ValidationStatus validationStatus = new DefaultValidationStatus(ValidationStatus.UNKNOW, "Null-geometry is not a valid geometry."); |
62 |
|
63 |
/**
|
64 |
* The constructor with the GeometryType like and argument is used by the
|
65 |
* {@link GeometryType}{@link #create()} to create the geometry
|
66 |
*
|
67 |
* @param type The geometry type
|
68 |
*/
|
69 |
public DefaultNullGeometry(GeometryType geometryType) {
|
70 |
super(geometryType.getType(), geometryType.getSubType());
|
71 |
} |
72 |
|
73 |
@Override
|
74 |
public org.gvsig.fmap.geom.Geometry force2D() throws GeometryOperationNotSupportedException, GeometryOperationException { |
75 |
return this; |
76 |
} |
77 |
|
78 |
@Override
|
79 |
public org.gvsig.fmap.geom.Geometry force2DM() throws GeometryOperationNotSupportedException, GeometryOperationException { |
80 |
return this; |
81 |
} |
82 |
|
83 |
@Override
|
84 |
public org.gvsig.fmap.geom.Geometry force3D() throws GeometryOperationNotSupportedException, GeometryOperationException { |
85 |
return this; |
86 |
} |
87 |
|
88 |
@Override
|
89 |
public org.gvsig.fmap.geom.Geometry force3DM() throws GeometryOperationNotSupportedException, GeometryOperationException { |
90 |
return this; |
91 |
} |
92 |
|
93 |
public Shape getShape() { |
94 |
return null; |
95 |
} |
96 |
|
97 |
public Shape getShape(AffineTransform affineTransform) { |
98 |
return null; |
99 |
} |
100 |
|
101 |
|
102 |
/*
|
103 |
* (non-Javadoc)
|
104 |
*
|
105 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#intersects(java.awt.geom.Rectangle2D)
|
106 |
*/
|
107 |
public boolean intersects(Rectangle2D r) { |
108 |
return false; |
109 |
} |
110 |
|
111 |
/*
|
112 |
* (non-Javadoc)
|
113 |
*
|
114 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#getBounds2D()
|
115 |
*/
|
116 |
public Rectangle2D getBounds2D() { |
117 |
return null; |
118 |
} |
119 |
|
120 |
/*
|
121 |
* (non-Javadoc)
|
122 |
*
|
123 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#cloneGeometry()
|
124 |
*/
|
125 |
@Override
|
126 |
public org.gvsig.fmap.geom.Geometry cloneGeometry() {
|
127 |
return this; |
128 |
} |
129 |
|
130 |
/*
|
131 |
* (non-Javadoc)
|
132 |
*
|
133 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#reProject(org.cresques.cts.ICoordTrans)
|
134 |
*/
|
135 |
public void reProject(ICoordTrans ct) { |
136 |
} |
137 |
|
138 |
/**
|
139 |
* @see org.gvsig.fmap.geom.Geometry#getPathIterator(AffineTransform)
|
140 |
*/
|
141 |
public PathIterator getPathIterator(AffineTransform at) { |
142 |
// TODO falta implementar.
|
143 |
return null; |
144 |
} |
145 |
|
146 |
/*
|
147 |
* (non-Javadoc)
|
148 |
*
|
149 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#fastIntersects(double,
|
150 |
* double, double, double)
|
151 |
*/
|
152 |
public boolean fastIntersects(double x, double y, double w, double h) { |
153 |
return false; |
154 |
} |
155 |
|
156 |
/*
|
157 |
* (non-Javadoc)
|
158 |
*
|
159 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#getHandlers(int)
|
160 |
*/
|
161 |
public Handler[] getHandlers(int type) { |
162 |
return null; |
163 |
} |
164 |
|
165 |
public void transform(AffineTransform at) { |
166 |
|
167 |
} |
168 |
|
169 |
public PathIterator getPathIterator(AffineTransform at, double flatness) { |
170 |
return null; |
171 |
} |
172 |
|
173 |
public boolean contains(double arg0, double arg1) { |
174 |
return false; |
175 |
} |
176 |
|
177 |
public boolean contains(double arg0, double arg1, double arg2, double arg3) { |
178 |
return false; |
179 |
} |
180 |
|
181 |
public boolean intersects(double arg0, double arg1, double arg2, double arg3) { |
182 |
return false; |
183 |
} |
184 |
|
185 |
public Rectangle getBounds() { |
186 |
return null; |
187 |
} |
188 |
|
189 |
public boolean contains(Point2D arg0) { |
190 |
return false; |
191 |
} |
192 |
|
193 |
public boolean contains(Rectangle2D arg0) { |
194 |
return false; |
195 |
} |
196 |
|
197 |
/*
|
198 |
* (non-Javadoc)
|
199 |
*
|
200 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#isSimple()
|
201 |
*/
|
202 |
public boolean isSimple() { |
203 |
return false; |
204 |
} |
205 |
|
206 |
/*
|
207 |
* (non-Javadoc)
|
208 |
*
|
209 |
* @see org.gvsig.geometries.iso.GM_Object#coordinateDimension()
|
210 |
*/
|
211 |
public int getDimension() { |
212 |
return 0; |
213 |
} |
214 |
|
215 |
public Envelope getEnvelope() {
|
216 |
return null; |
217 |
} |
218 |
|
219 |
public GeneralPathX getGeneralPath() {
|
220 |
return null; |
221 |
} |
222 |
|
223 |
public boolean isValid() { |
224 |
return false; |
225 |
} |
226 |
|
227 |
public ValidationStatus getValidationStatus() {
|
228 |
return validationStatus;
|
229 |
} |
230 |
|
231 |
/* (non-Javadoc)
|
232 |
* @see org.gvsig.fmap.geom.Geometry#toPoints()
|
233 |
*/
|
234 |
public MultiPoint toPoints() throws GeometryException { |
235 |
return null; |
236 |
} |
237 |
|
238 |
/* (non-Javadoc)
|
239 |
* @see org.gvsig.fmap.geom.Geometry#toLines()
|
240 |
*/
|
241 |
public MultiLine toLines() throws GeometryException { |
242 |
return null; |
243 |
} |
244 |
|
245 |
/* (non-Javadoc)
|
246 |
* @see org.gvsig.fmap.geom.Geometry#toPolygons()
|
247 |
*/
|
248 |
public MultiPolygon toPolygons() throws GeometryException { |
249 |
return null; |
250 |
} |
251 |
|
252 |
/* (non-Javadoc)
|
253 |
* @see org.gvsig.fmap.geom.jts.GeometryJTS#getJTS()
|
254 |
*/
|
255 |
public Geometry getJTS() {
|
256 |
return null; |
257 |
} |
258 |
|
259 |
/* (non-Javadoc)
|
260 |
* @see org.gvsig.fmap.geom.jts.GeometryJTS#is3D()
|
261 |
*/
|
262 |
public boolean is3D() { |
263 |
return false; |
264 |
} |
265 |
|
266 |
/* (non-Javadoc)
|
267 |
* @see org.gvsig.fmap.geom.jts.GeometryJTS#flip()
|
268 |
*/
|
269 |
public void flip() throws GeometryOperationNotSupportedException, GeometryOperationException { |
270 |
// do nothing
|
271 |
} |
272 |
|
273 |
/* (non-Javadoc)
|
274 |
* @see org.gvsig.fmap.geom.Geometry#offset(double)
|
275 |
*/
|
276 |
public org.gvsig.fmap.geom.Geometry offset(double distance) throws GeometryOperationNotSupportedException, |
277 |
GeometryOperationException { |
278 |
//FIXME: ?this, null o qu??
|
279 |
return this; |
280 |
} |
281 |
|
282 |
@Override
|
283 |
public org.gvsig.fmap.geom.Geometry offset(int joinStyle, double distance) throws GeometryOperationNotSupportedException, GeometryOperationException { |
284 |
return offset(distance);
|
285 |
} |
286 |
|
287 |
|
288 |
@Override
|
289 |
public boolean canBeTransformed(AffineTransform at) { |
290 |
return false; |
291 |
} |
292 |
|
293 |
@Override
|
294 |
public boolean canBeReprojected(ICoordTrans ct) { |
295 |
return false; |
296 |
} |
297 |
|
298 |
|
299 |
} |