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 @ 44612
History | View | Annotate | Download (7.03 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 |
|
79 |
public Shape getShape() { |
80 |
return null; |
81 |
} |
82 |
|
83 |
public Shape getShape(AffineTransform affineTransform) { |
84 |
return null; |
85 |
} |
86 |
|
87 |
|
88 |
/*
|
89 |
* (non-Javadoc)
|
90 |
*
|
91 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#intersects(java.awt.geom.Rectangle2D)
|
92 |
*/
|
93 |
public boolean intersects(Rectangle2D r) { |
94 |
return false; |
95 |
} |
96 |
|
97 |
/*
|
98 |
* (non-Javadoc)
|
99 |
*
|
100 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#getBounds2D()
|
101 |
*/
|
102 |
public Rectangle2D getBounds2D() { |
103 |
return null; |
104 |
} |
105 |
|
106 |
/*
|
107 |
* (non-Javadoc)
|
108 |
*
|
109 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#cloneGeometry()
|
110 |
*/
|
111 |
public org.gvsig.fmap.geom.Geometry cloneGeometry() {
|
112 |
return this; |
113 |
} |
114 |
|
115 |
/*
|
116 |
* (non-Javadoc)
|
117 |
*
|
118 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#reProject(org.cresques.cts.ICoordTrans)
|
119 |
*/
|
120 |
public void reProject(ICoordTrans ct) { |
121 |
} |
122 |
|
123 |
/**
|
124 |
* @see org.gvsig.fmap.geom.Geometry#getPathIterator(AffineTransform)
|
125 |
*/
|
126 |
public PathIterator getPathIterator(AffineTransform at) { |
127 |
// TODO falta implementar.
|
128 |
return null; |
129 |
} |
130 |
|
131 |
/*
|
132 |
* (non-Javadoc)
|
133 |
*
|
134 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#fastIntersects(double,
|
135 |
* double, double, double)
|
136 |
*/
|
137 |
public boolean fastIntersects(double x, double y, double w, double h) { |
138 |
return false; |
139 |
} |
140 |
|
141 |
/*
|
142 |
* (non-Javadoc)
|
143 |
*
|
144 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#getHandlers(int)
|
145 |
*/
|
146 |
public Handler[] getHandlers(int type) { |
147 |
return null; |
148 |
} |
149 |
|
150 |
public void transform(AffineTransform at) { |
151 |
|
152 |
} |
153 |
|
154 |
public PathIterator getPathIterator(AffineTransform at, double flatness) { |
155 |
return null; |
156 |
} |
157 |
|
158 |
public boolean contains(double arg0, double arg1) { |
159 |
return false; |
160 |
} |
161 |
|
162 |
public boolean contains(double arg0, double arg1, double arg2, double arg3) { |
163 |
return false; |
164 |
} |
165 |
|
166 |
public boolean intersects(double arg0, double arg1, double arg2, double arg3) { |
167 |
return false; |
168 |
} |
169 |
|
170 |
public Rectangle getBounds() { |
171 |
return null; |
172 |
} |
173 |
|
174 |
public boolean contains(Point2D arg0) { |
175 |
return false; |
176 |
} |
177 |
|
178 |
public boolean contains(Rectangle2D arg0) { |
179 |
return false; |
180 |
} |
181 |
|
182 |
/*
|
183 |
* (non-Javadoc)
|
184 |
*
|
185 |
* @see com.iver.cit.gvsig.fmap.core.IGeometry#isSimple()
|
186 |
*/
|
187 |
public boolean isSimple() { |
188 |
return false; |
189 |
} |
190 |
|
191 |
/*
|
192 |
* (non-Javadoc)
|
193 |
*
|
194 |
* @see org.gvsig.geometries.iso.GM_Object#coordinateDimension()
|
195 |
*/
|
196 |
public int getDimension() { |
197 |
return 0; |
198 |
} |
199 |
|
200 |
public Envelope getEnvelope() {
|
201 |
return null; |
202 |
} |
203 |
|
204 |
public GeneralPathX getGeneralPath() {
|
205 |
return null; |
206 |
} |
207 |
|
208 |
public boolean isValid() { |
209 |
return false; |
210 |
} |
211 |
|
212 |
public ValidationStatus getValidationStatus() {
|
213 |
return validationStatus;
|
214 |
} |
215 |
|
216 |
/* (non-Javadoc)
|
217 |
* @see org.gvsig.fmap.geom.Geometry#toPoints()
|
218 |
*/
|
219 |
public MultiPoint toPoints() throws GeometryException { |
220 |
return null; |
221 |
} |
222 |
|
223 |
/* (non-Javadoc)
|
224 |
* @see org.gvsig.fmap.geom.Geometry#toLines()
|
225 |
*/
|
226 |
public MultiLine toLines() throws GeometryException { |
227 |
return null; |
228 |
} |
229 |
|
230 |
/* (non-Javadoc)
|
231 |
* @see org.gvsig.fmap.geom.Geometry#toPolygons()
|
232 |
*/
|
233 |
public MultiPolygon toPolygons() throws GeometryException { |
234 |
return null; |
235 |
} |
236 |
|
237 |
/* (non-Javadoc)
|
238 |
* @see org.gvsig.fmap.geom.jts.GeometryJTS#getJTS()
|
239 |
*/
|
240 |
public Geometry getJTS() {
|
241 |
return null; |
242 |
} |
243 |
|
244 |
/* (non-Javadoc)
|
245 |
* @see org.gvsig.fmap.geom.jts.GeometryJTS#is3D()
|
246 |
*/
|
247 |
public boolean is3D() { |
248 |
return false; |
249 |
} |
250 |
|
251 |
/* (non-Javadoc)
|
252 |
* @see org.gvsig.fmap.geom.jts.GeometryJTS#flip()
|
253 |
*/
|
254 |
public void flip() throws GeometryOperationNotSupportedException, GeometryOperationException { |
255 |
// do nothing
|
256 |
} |
257 |
|
258 |
/* (non-Javadoc)
|
259 |
* @see org.gvsig.fmap.geom.Geometry#offset(double)
|
260 |
*/
|
261 |
public org.gvsig.fmap.geom.Geometry offset(double distance) throws GeometryOperationNotSupportedException, |
262 |
GeometryOperationException { |
263 |
//FIXME: ?this, null o qu??
|
264 |
return this; |
265 |
} |
266 |
|
267 |
|
268 |
@Override
|
269 |
public boolean canBeTransformed(AffineTransform at) { |
270 |
return false; |
271 |
} |
272 |
|
273 |
@Override
|
274 |
public boolean canBeReprojected(ICoordTrans ct) { |
275 |
return false; |
276 |
} |
277 |
|
278 |
|
279 |
} |