Revision 40391 branches/v2_0_0_prep/libraries/libFMap_controls/src/org/gvsig/fmap/mapcontrol/dal/feature/swing/table/GeometryWKTCellEditor.java
GeometryWKTCellEditor.java | ||
---|---|---|
40 | 40 |
import org.gvsig.fmap.geom.GeometryLocator; |
41 | 41 |
import org.gvsig.fmap.geom.GeometryManager; |
42 | 42 |
import org.gvsig.fmap.geom.exception.CreateGeometryException; |
43 |
import org.gvsig.fmap.geom.operation.fromwkt.FromWKT; |
|
44 |
import org.gvsig.fmap.geom.operation.fromwkt.FromWKTGeometryOperationContext; |
|
45 |
import org.gvsig.fmap.geom.operation.towkt.ToWKT; |
|
46 | 43 |
import org.gvsig.i18n.Messages; |
47 | 44 |
import org.slf4j.Logger; |
48 | 45 |
import org.slf4j.LoggerFactory; |
... | ... | |
54 | 51 |
* rendering of that big text is too slow. |
55 | 52 |
* </p> |
56 | 53 |
* |
57 |
* @author <a href="mailto:cordin@disid.com">C?sar Ordi?ana</a>
|
|
54 |
* @author <a href="mailto:cordin@disid.com">C�sar Ordi�ana</a>
|
|
58 | 55 |
*/ |
59 | 56 |
public class GeometryWKTCellEditor extends TextAreaCellEditor { |
60 | 57 |
private static final GeometryManager geomManager = GeometryLocator.getGeometryManager(); |
... | ... | |
96 | 93 |
@Override |
97 | 94 |
public Object getCellEditorValue() { |
98 | 95 |
String wkt = (String) super.getCellEditorValue(); |
99 |
FromWKTGeometryOperationContext context = new FromWKTGeometryOperationContext( |
|
100 |
wkt, null); |
|
101 |
|
|
102 | 96 |
try { |
103 |
return nullGeometry.invokeOperation(FromWKT.CODE, context);
|
|
97 |
return geomManager.createFrom(wkt);
|
|
104 | 98 |
} catch (Exception ex) { |
105 | 99 |
throw new WKTToGeometryException(wkt, ex); |
106 | 100 |
} |
... | ... | |
164 | 158 |
if (value != null) { |
165 | 159 |
try { |
166 | 160 |
Geometry geometry = (Geometry) value; |
167 |
strValue = (String) geometry.invokeOperation(ToWKT.CODE, |
|
168 |
null); |
|
161 |
strValue = geometry.convertToWKT(); |
|
169 | 162 |
|
170 | 163 |
if (strValue.length() > maxWKTLength) { |
171 | 164 |
wtkTextTooLong = true; |
Also available in: Unified diff