Revision 24429 branches/v2_0_0_prep/extensions/extCAD/src/com/iver/cit/gvsig/gui/cad/tools/SymmetryCADTool.java
SymmetryCADTool.java | ||
---|---|---|
49 | 49 |
|
50 | 50 |
import org.gvsig.fmap.data.exceptions.DataException; |
51 | 51 |
import org.gvsig.fmap.data.exceptions.ReadException; |
52 |
import org.gvsig.fmap.data.feature.EditableFeature; |
|
52 | 53 |
import org.gvsig.fmap.data.feature.Feature; |
53 | 54 |
import org.gvsig.fmap.data.feature.FeatureSet; |
54 | 55 |
import org.gvsig.fmap.data.feature.FeatureStore; |
... | ... | |
73 | 74 |
import com.iver.cit.gvsig.gui.cad.tools.smc.SymmetryCADToolContext.SymmetryCADToolState; |
74 | 75 |
import com.iver.cit.gvsig.layers.VectorialLayerEdited; |
75 | 76 |
|
76 |
|
|
77 | 77 |
/** |
78 | 78 |
* Herramienta para crear una geometr?a sim?trica a otra, con la posibilidad de |
79 | 79 |
* borrar la original. |
... | ... | |
81 | 81 |
* @author Vicente Caballero Navarro |
82 | 82 |
*/ |
83 | 83 |
public class SymmetryCADTool extends DefaultCADTool { |
84 |
private SymmetryCADToolContext _fsm; |
|
85 |
private Point2D firstPoint; |
|
86 |
private Point2D secondPoint; |
|
87 |
private GeometryFactory geomFactory=GeometryManager.getInstance().getGeometryFactory(); |
|
84 |
private SymmetryCADToolContext _fsm; |
|
85 |
private Point2D firstPoint; |
|
86 |
private Point2D secondPoint; |
|
87 |
private GeometryFactory geomFactory = GeometryManager.getInstance() |
|
88 |
.getGeometryFactory(); |
|
88 | 89 |
|
89 |
/**
|
|
90 |
* Crea un nuevo SymmetryCADTool.
|
|
91 |
*/
|
|
92 |
public SymmetryCADTool() {
|
|
93 |
}
|
|
90 |
/**
|
|
91 |
* Crea un nuevo SymmetryCADTool.
|
|
92 |
*/
|
|
93 |
public SymmetryCADTool() {
|
|
94 |
}
|
|
94 | 95 |
|
95 |
/**
|
|
96 |
* M?todo de inicio, para poner el c?digo de todo lo que se requiera de una
|
|
97 |
* carga previa a la utilizaci?n de la herramienta.
|
|
98 |
*/
|
|
99 |
public void init() {
|
|
100 |
_fsm = new SymmetryCADToolContext(this);
|
|
101 |
}
|
|
96 |
/**
|
|
97 |
* M?todo de inicio, para poner el c?digo de todo lo que se requiera de una
|
|
98 |
* carga previa a la utilizaci?n de la herramienta.
|
|
99 |
*/
|
|
100 |
public void init() {
|
|
101 |
_fsm = new SymmetryCADToolContext(this);
|
|
102 |
}
|
|
102 | 103 |
|
103 |
/* (non-Javadoc) |
|
104 |
* @see com.iver.cit.gvsig.gui.cad.CADTool#transition(com.iver.cit.gvsig.fmap.layers.FBitSet, double, double) |
|
105 |
*/ |
|
106 |
public void transition(double x, double y, InputEvent event) { |
|
107 |
_fsm.addPoint(x, y, event); |
|
108 |
} |
|
104 |
/* |
|
105 |
* (non-Javadoc) |
|
106 |
* |
|
107 |
* @see com.iver.cit.gvsig.gui.cad.CADTool#transition(com.iver.cit.gvsig.fmap.layers.FBitSet, |
|
108 |
* double, double) |
|
109 |
*/ |
|
110 |
public void transition(double x, double y, InputEvent event) { |
|
111 |
_fsm.addPoint(x, y, event); |
|
112 |
} |
|
109 | 113 |
|
110 |
/* (non-Javadoc) |
|
111 |
* @see com.iver.cit.gvsig.gui.cad.CADTool#transition(com.iver.cit.gvsig.fmap.layers.FBitSet, double) |
|
112 |
*/ |
|
113 |
public void transition(double d) { |
|
114 |
_fsm.addValue(d); |
|
115 |
} |
|
114 |
/* |
|
115 |
* (non-Javadoc) |
|
116 |
* |
|
117 |
* @see com.iver.cit.gvsig.gui.cad.CADTool#transition(com.iver.cit.gvsig.fmap.layers.FBitSet, |
|
118 |
* double) |
|
119 |
*/ |
|
120 |
public void transition(double d) { |
|
121 |
_fsm.addValue(d); |
|
122 |
} |
|
116 | 123 |
|
117 |
/* (non-Javadoc) |
|
118 |
* @see com.iver.cit.gvsig.gui.cad.CADTool#transition(com.iver.cit.gvsig.fmap.layers.FBitSet, java.lang.String) |
|
119 |
*/ |
|
120 |
public void transition(String s) throws CommandException { |
|
121 |
if (!super.changeCommand(s)){ |
|
122 |
_fsm.addOption(s); |
|
123 |
} |
|
124 |
} |
|
124 |
/* |
|
125 |
* (non-Javadoc) |
|
126 |
* |
|
127 |
* @see com.iver.cit.gvsig.gui.cad.CADTool#transition(com.iver.cit.gvsig.fmap.layers.FBitSet, |
|
128 |
* java.lang.String) |
|
129 |
*/ |
|
130 |
public void transition(String s) throws CommandException { |
|
131 |
if (!super.changeCommand(s)) { |
|
132 |
_fsm.addOption(s); |
|
133 |
} |
|
134 |
} |
|
125 | 135 |
|
126 |
/** |
|
127 |
* DOCUMENT ME! |
|
128 |
*/ |
|
129 |
public void selection() { |
|
130 |
FeatureSet selection=null; |
|
131 |
try { |
|
132 |
selection = (FeatureSet)getVLE().getFeatureStore().getSelection(); |
|
133 |
} catch (ReadException e) { |
|
134 |
// TODO Auto-generated catch block |
|
135 |
e.printStackTrace(); |
|
136 |
} |
|
137 |
if (selection.size() == 0 && !CADExtension.getCADTool().getClass().getName().equals("com.iver.cit.gvsig.gui.cad.tools.SelectionCADTool")) { |
|
138 |
CADExtension.setCADTool("_selection",false); |
|
139 |
((SelectionCADTool) CADExtension.getCADTool()).setNextTool( |
|
140 |
"_symmetry"); |
|
141 |
} |
|
142 |
} |
|
136 |
/** |
|
137 |
* DOCUMENT ME! |
|
138 |
*/ |
|
139 |
public void selection() { |
|
140 |
FeatureSet selection = null; |
|
141 |
try { |
|
142 |
selection = (FeatureSet) getVLE().getFeatureStore().getSelection(); |
|
143 | 143 |
|
144 |
/** |
|
145 |
* Equivale al transition del prototipo pero sin pasarle como par?metro el |
|
146 |
* editableFeatureSource que ya estar? creado. |
|
147 |
* |
|
148 |
* @param x par?metro x del punto que se pase en esta transici?n. |
|
149 |
* @param y par?metro y del punto que se pase en esta transici?n. |
|
150 |
*/ |
|
151 |
public void addPoint(double x, double y,InputEvent event) { |
|
152 |
SymmetryCADToolState actualState = (SymmetryCADToolState) _fsm.getPreviousState(); |
|
153 |
String status = actualState.getName(); |
|
154 |
if (status.equals("Symmetry.FirstPoint")) { |
|
155 |
firstPoint = new Point2D.Double(x, y); |
|
156 |
} else if (status.equals("Symmetry.SecondPoint")) { |
|
157 |
secondPoint = new Point2D.Double(x,y); |
|
158 |
} |
|
159 |
} |
|
144 |
if (selection.getSize() == 0 |
|
145 |
&& !CADExtension |
|
146 |
.getCADTool() |
|
147 |
.getClass() |
|
148 |
.getName() |
|
149 |
.equals( |
|
150 |
"com.iver.cit.gvsig.gui.cad.tools.SelectionCADTool")) { |
|
151 |
CADExtension.setCADTool("_selection", false); |
|
152 |
((SelectionCADTool) CADExtension.getCADTool()) |
|
153 |
.setNextTool("_symmetry"); |
|
154 |
} |
|
155 |
} catch (ReadException e) { |
|
156 |
// TODO Auto-generated catch block |
|
157 |
e.printStackTrace(); |
|
158 |
} catch (DataException e) { |
|
159 |
// TODO Auto-generated catch block |
|
160 |
e.printStackTrace(); |
|
161 |
} |
|
162 |
} |
|
160 | 163 |
|
161 |
/**
|
|
162 |
* M?todo para dibujar la lo necesario para el estado en el que nos
|
|
163 |
* encontremos.
|
|
164 |
*
|
|
165 |
* @param g Graphics sobre el que dibujar.
|
|
166 |
* @param x par?metro x del punto que se pase para dibujar.
|
|
167 |
* @param y par?metro x del punto que se pase para dibujar.
|
|
168 |
*/
|
|
169 |
public void drawOperation(Graphics g, double x, double y) {
|
|
170 |
SymmetryCADToolState actualState = _fsm.getState();
|
|
171 |
String status = actualState.getName();
|
|
172 |
|
|
173 |
if (status.equals("Symmetry.SecondPoint")) {
|
|
174 |
Point2D pAux=new Point2D.Double(x,y);
|
|
175 |
drawSymmetry(g,pAux);
|
|
176 |
}else if (status.equals("Symmetry.CutOrCopy")){
|
|
177 |
drawSymmetry(g,secondPoint);
|
|
164 |
/**
|
|
165 |
* Equivale al transition del prototipo pero sin pasarle como par?metro el
|
|
166 |
* editableFeatureSource que ya estar? creado.
|
|
167 |
*
|
|
168 |
* @param x
|
|
169 |
* par?metro x del punto que se pase en esta transici?n.
|
|
170 |
* @param y
|
|
171 |
* par?metro y del punto que se pase en esta transici?n.
|
|
172 |
*/
|
|
173 |
public void addPoint(double x, double y, InputEvent event) {
|
|
174 |
SymmetryCADToolState actualState = (SymmetryCADToolState) _fsm
|
|
175 |
.getPreviousState(); |
|
176 |
String status = actualState.getName();
|
|
177 |
if (status.equals("Symmetry.FirstPoint")) {
|
|
178 |
firstPoint = new Point2D.Double(x, y);
|
|
179 |
} else if (status.equals("Symmetry.SecondPoint")) {
|
|
180 |
secondPoint = new Point2D.Double(x, y);
|
|
178 | 181 |
} |
179 |
} |
|
180 |
private void drawSymmetry(Graphics g,Point2D pAux) { |
|
181 |
|
|
182 |
VectorialLayerEdited vle=getVLE(); |
|
183 |
FeatureSet selection=null; |
|
184 |
try { |
|
185 |
selection = (FeatureSet)vle.getFeatureStore().getSelection(); |
|
186 |
} catch (ReadException e1) { |
|
187 |
// TODO Auto-generated catch block |
|
188 |
e1.printStackTrace(); |
|
189 | 182 |
} |
190 |
ViewPort vp=vle.getLayer().getMapContext().getViewPort(); |
|
191 | 183 |
|
192 |
GeneralPathX gpx=new GeneralPathX(); |
|
193 |
gpx.moveTo(firstPoint.getX(),firstPoint.getY()); |
|
194 |
gpx.lineTo(pAux.getX(),pAux.getY()); |
|
195 |
DrawOperationContext doc=new DrawOperationContext(); |
|
196 |
doc.setGraphics((Graphics2D)g); |
|
197 |
doc.setViewPort(getCadToolAdapter().getMapControl().getViewPort()); |
|
198 |
doc.setSymbol(DefaultCADTool.axisReferencesSymbol); |
|
199 |
try { |
|
200 |
geomFactory.createPolyline2D(gpx).invokeOperation(Draw.CODE,doc); |
|
201 |
} catch (GeometryOperationNotSupportedException e) { |
|
202 |
e.printStackTrace(); |
|
203 |
} catch (GeometryOperationException e) { |
|
204 |
e.printStackTrace(); |
|
184 |
/** |
|
185 |
* M?todo para dibujar la lo necesario para el estado en el que nos |
|
186 |
* encontremos. |
|
187 |
* |
|
188 |
* @param g |
|
189 |
* Graphics sobre el que dibujar. |
|
190 |
* @param x |
|
191 |
* par?metro x del punto que se pase para dibujar. |
|
192 |
* @param y |
|
193 |
* par?metro x del punto que se pase para dibujar. |
|
194 |
*/ |
|
195 |
public void drawOperation(Graphics g, double x, double y) { |
|
196 |
SymmetryCADToolState actualState = _fsm.getState(); |
|
197 |
String status = actualState.getName(); |
|
198 |
|
|
199 |
if (status.equals("Symmetry.SecondPoint")) { |
|
200 |
Point2D pAux = new Point2D.Double(x, y); |
|
201 |
drawSymmetry(g, pAux); |
|
202 |
} else if (status.equals("Symmetry.CutOrCopy")) { |
|
203 |
drawSymmetry(g, secondPoint); |
|
204 |
} |
|
205 | 205 |
} |
206 |
// geomFactory.createPolyline2D(gpx).draw((Graphics2D)g,vp,DefaultCADTool.axisReferencesSymbol); |
|
207 |
Iterator iterator=selection.iterator(); |
|
208 |
while (iterator.hasNext()) { |
|
209 |
Feature feature = (Feature) iterator.next(); |
|
210 | 206 |
|
211 |
// } |
|
212 |
// for (int i = 0; i < selectedRow.size(); i++) { |
|
213 |
// DefaultRowEdited row=(DefaultRowEdited) selectedRow.get(i); |
|
214 |
// DefaultFeature fea = (DefaultFeature) row.getLinkedRow(); |
|
207 |
private void drawSymmetry(Graphics g, Point2D pAux) { |
|
215 | 208 |
|
216 |
Geometry geom = ((Geometry)feature.getDefaultGeometry()).cloneGeometry(); |
|
217 |
Handler[] handlers = geom.getHandlers(Geometry.SELECTHANDLER); |
|
209 |
VectorialLayerEdited vle = getVLE(); |
|
210 |
FeatureSet selection = null; |
|
211 |
try { |
|
212 |
selection = (FeatureSet) vle.getFeatureStore().getSelection(); |
|
213 |
} catch (ReadException e1) { |
|
214 |
// TODO Auto-generated catch block |
|
215 |
e1.printStackTrace(); |
|
216 |
} catch (DataException e) { |
|
217 |
// TODO Auto-generated catch block |
|
218 |
e.printStackTrace(); |
|
219 |
} |
|
220 |
ViewPort vp = vle.getLayer().getMapContext().getViewPort(); |
|
218 | 221 |
|
222 |
GeneralPathX gpx = new GeneralPathX(); |
|
223 |
gpx.moveTo(firstPoint.getX(), firstPoint.getY()); |
|
224 |
gpx.lineTo(pAux.getX(), pAux.getY()); |
|
225 |
DrawOperationContext doc = new DrawOperationContext(); |
|
226 |
doc.setGraphics((Graphics2D) g); |
|
227 |
doc.setViewPort(getCadToolAdapter().getMapControl().getViewPort()); |
|
228 |
doc.setSymbol(DefaultCADTool.axisReferencesSymbol); |
|
229 |
try { |
|
230 |
geomFactory.createPolyline2D(gpx).invokeOperation(Draw.CODE, doc); |
|
231 |
} catch (GeometryOperationNotSupportedException e) { |
|
232 |
e.printStackTrace(); |
|
233 |
} catch (GeometryOperationException e) { |
|
234 |
e.printStackTrace(); |
|
235 |
} |
|
236 |
// geomFactory.createPolyline2D(gpx).draw((Graphics2D)g,vp,DefaultCADTool.axisReferencesSymbol); |
|
237 |
Iterator iterator = null; |
|
238 |
try { |
|
239 |
iterator = selection.iterator(); |
|
240 |
} catch (DataException e1) { |
|
241 |
// TODO Auto-generated catch block |
|
242 |
e1.printStackTrace(); |
|
243 |
} |
|
244 |
while (iterator.hasNext()) { |
|
245 |
Feature feature = (Feature) iterator.next(); |
|
246 |
|
|
247 |
// } |
|
248 |
// for (int i = 0; i < selectedRow.size(); i++) { |
|
249 |
// DefaultRowEdited row=(DefaultRowEdited) selectedRow.get(i); |
|
250 |
// DefaultFeature fea = (DefaultFeature) row.getLinkedRow(); |
|
251 |
|
|
252 |
Geometry geom = ((Geometry) feature.getDefaultGeometry()) |
|
253 |
.cloneGeometry(); |
|
254 |
Handler[] handlers = geom.getHandlers(Geometry.SELECTHANDLER); |
|
255 |
|
|
219 | 256 |
for (int j = 0; j < handlers.length; j++) { |
220 | 257 |
Handler h = (Handler) handlers[j]; |
221 | 258 |
Point2D p = h.getPoint(); |
222 |
Point2D[] ps = UtilFunctions.getPerpendicular(firstPoint, |
|
223 |
pAux, p); |
|
224 |
Point2D inter = UtilFunctions.getIntersection(ps[0], |
|
225 |
ps[1], firstPoint, pAux); |
|
226 |
if (inter!=null) { |
|
227 |
Point2D dif = new Point2D.Double(inter.getX() - |
|
228 |
p.getX(), inter.getY() - p.getY()); |
|
229 |
h.set(inter.getX() + dif.getX(), |
|
230 |
inter.getY() + dif.getY()); |
|
259 |
Point2D[] ps = UtilFunctions.getPerpendicular(firstPoint, pAux, |
|
260 |
p); |
|
261 |
Point2D inter = UtilFunctions.getIntersection(ps[0], ps[1], |
|
262 |
firstPoint, pAux); |
|
263 |
if (inter != null) { |
|
264 |
Point2D dif = new Point2D.Double(inter.getX() - p.getX(), |
|
265 |
inter.getY() - p.getY()); |
|
266 |
h.set(inter.getX() + dif.getX(), inter.getY() + dif.getY()); |
|
231 | 267 |
} |
232 | 268 |
} |
233 |
// DrawOperationContext doc=new DrawOperationContext();
|
|
234 |
doc.setGraphics((Graphics2D)g); |
|
269 |
// DrawOperationContext doc=new DrawOperationContext();
|
|
270 |
doc.setGraphics((Graphics2D) g);
|
|
235 | 271 |
doc.setViewPort(getCadToolAdapter().getMapControl().getViewPort()); |
236 | 272 |
doc.setSymbol(DefaultCADTool.axisReferencesSymbol); |
237 |
try {
|
|
238 |
geom.cloneGeometry().invokeOperation(Draw.CODE,doc);
|
|
273 |
try {
|
|
274 |
geom.cloneGeometry().invokeOperation(Draw.CODE, doc);
|
|
239 | 275 |
} catch (GeometryOperationNotSupportedException e) { |
240 | 276 |
e.printStackTrace(); |
241 | 277 |
} catch (GeometryOperationException e) { |
242 | 278 |
e.printStackTrace(); |
243 | 279 |
} |
244 |
// geom.draw((Graphics2D)g,vp,DefaultCADTool.selectionSymbol); |
|
280 |
// geom.draw((Graphics2D)g,vp,DefaultCADTool.selectionSymbol); |
|
281 |
} |
|
245 | 282 |
} |
246 |
} |
|
247 | 283 |
|
248 |
/**
|
|
284 |
/**
|
|
249 | 285 |
* Add a diferent option. |
250 | 286 |
* |
251 | 287 |
* @param s |
252 | 288 |
* Diferent option. |
253 | 289 |
*/ |
254 |
public void addOption(String s) {
|
|
255 |
SymmetryCADToolState actualState = (SymmetryCADToolState) _fsm
|
|
290 |
public void addOption(String s) {
|
|
291 |
SymmetryCADToolState actualState = (SymmetryCADToolState) _fsm
|
|
256 | 292 |
.getPreviousState(); |
257 | 293 |
String status = actualState.getName(); |
258 | 294 |
VectorialLayerEdited vle = getVLE(); |
259 |
FeatureStore featureStore=null; |
|
295 |
FeatureStore featureStore = null; |
|
296 |
FeatureSet selection = null; |
|
260 | 297 |
try { |
261 | 298 |
featureStore = vle.getFeatureStore(); |
262 |
} catch (ReadException e1) { |
|
299 |
selection = (FeatureSet) featureStore.getSelection(); |
|
300 |
} catch (DataException e1) { |
|
263 | 301 |
// TODO Auto-generated catch block |
264 | 302 |
e1.printStackTrace(); |
265 | 303 |
} |
266 |
FeatureSet selection = (FeatureSet)featureStore.getSelection(); |
|
267 |
// ArrayList selectedRowAux=new ArrayList(); |
|
304 |
// ArrayList selectedRowAux=new ArrayList(); |
|
268 | 305 |
|
269 |
// VectorialEditableAdapter vea = vle.getVEA();
|
|
306 |
// VectorialEditableAdapter vea = vle.getVEA();
|
|
270 | 307 |
if (status.equals("Symmetry.CutOrCopy")) { |
271 | 308 |
PluginServices.getMDIManager().setWaitCursor(); |
272 | 309 |
try { |
273 |
featureStore.getCommandsRecord().startComplex();
|
|
274 |
Iterator iterator=selection.iterator();
|
|
310 |
featureStore.beginEditingGroup(getName());
|
|
311 |
Iterator iterator = selection.iterator();
|
|
275 | 312 |
while (iterator.hasNext()) { |
276 | 313 |
Feature feature = (Feature) iterator.next(); |
277 | 314 |
|
278 |
// }
|
|
279 |
// for (int i = 0; i < selectedRow.size(); i++) {
|
|
280 |
// DefaultRowEdited row = (DefaultRowEdited) selectedRow
|
|
281 |
// .get(i);
|
|
282 |
// DefaultFeature fea = (DefaultFeature) row.getLinkedRow()
|
|
283 |
// .cloneRow();
|
|
315 |
// }
|
|
316 |
// for (int i = 0; i < selectedRow.size(); i++) {
|
|
317 |
// DefaultRowEdited row = (DefaultRowEdited) selectedRow
|
|
318 |
// .get(i);
|
|
319 |
// DefaultFeature fea = (DefaultFeature) row.getLinkedRow()
|
|
320 |
// .cloneRow();
|
|
284 | 321 |
|
285 |
Geometry geom = (Geometry)feature.getDefaultGeometry(); |
|
322 |
Geometry geom = (Geometry) feature.getDefaultGeometry() |
|
323 |
.cloneGeometry(); |
|
286 | 324 |
Handler[] handlers = geom |
287 | 325 |
.getHandlers(Geometry.SELECTHANDLER); |
288 | 326 |
|
... | ... | |
301 | 339 |
|
302 | 340 |
if (s.equals(PluginServices.getText(this, "cut")) |
303 | 341 |
|| s.equals("s") || s.equals("S")) { |
304 |
featureStore.update(feature); |
|
305 |
// vea.modifyRow(row.getIndex(), fea, |
|
306 |
// getName(), EditionEvent.GRAPHIC); |
|
342 |
EditableFeature eFeature = feature.getEditable(); |
|
343 |
eFeature.setGeometry(featureStore |
|
344 |
.getDefaultFeatureType() |
|
345 |
.getDefaultGeometryAttributeName(), geom); |
|
346 |
featureStore.update(eFeature); |
|
347 |
// vea.modifyRow(row.getIndex(), fea, |
|
348 |
// getName(), EditionEvent.GRAPHIC); |
|
307 | 349 |
|
308 |
// selectedRowAux.add(new DefaultRowEdited(fea,
|
|
309 |
// IRowEdited.STATUS_MODIFIED, row.getIndex()));
|
|
350 |
// selectedRowAux.add(new DefaultRowEdited(fea,
|
|
351 |
// IRowEdited.STATUS_MODIFIED, row.getIndex()));
|
|
310 | 352 |
} else { |
311 |
featureStore.insert(feature); |
|
312 |
// int index=addGeometry(geom,fea.getAttributes()); |
|
313 |
// selectedRowAux.add(new DefaultRowEdited(fea, |
|
314 |
// IRowEdited.STATUS_ADDED, index)); |
|
353 |
// EditableFeature eFeature = featureStore |
|
354 |
// .createNewFeature(featureStore |
|
355 |
// .getDefaultFeatureType(), feature); |
|
356 |
// eFeature.setGeometry(featureStore |
|
357 |
// .getDefaultFeatureType() |
|
358 |
// .getDefaultGeometryAttributeName(), geom); |
|
359 |
// featureStore.insert(eFeature); |
|
360 |
insertGeometry(geom); |
|
361 |
// int index=addGeometry(geom,fea.getAttributes()); |
|
362 |
// selectedRowAux.add(new DefaultRowEdited(fea, |
|
363 |
// IRowEdited.STATUS_ADDED, index)); |
|
315 | 364 |
refresh(); |
316 | 365 |
} |
317 | 366 |
|
318 | 367 |
} |
319 | 368 |
|
320 |
featureStore.getCommandsRecord().endComplex(getName()); |
|
321 |
// vle.setSelectionCache(VectorialLayerEdited.SAVEPREVIOUS, selectedRowAux); |
|
322 |
//clearSelection(); |
|
323 |
//selectedRow.addAll(selectedRowAux); |
|
369 |
featureStore.endEditingGroup(); |
|
370 |
// vle.setSelectionCache(VectorialLayerEdited.SAVEPREVIOUS, |
|
371 |
// selectedRowAux); |
|
372 |
// clearSelection(); |
|
373 |
// selectedRow.addAll(selectedRowAux); |
|
324 | 374 |
} catch (ReadException e) { |
325 |
NotificationManager.addError(e.getMessage(),e); |
|
375 |
NotificationManager.addError(e.getMessage(), e);
|
|
326 | 376 |
} catch (DataException e) { |
327 | 377 |
// TODO Auto-generated catch block |
328 | 378 |
e.printStackTrace(); |
329 | 379 |
} |
330 | 380 |
PluginServices.getMDIManager().restoreCursor(); |
331 | 381 |
} |
332 |
}
|
|
382 |
}
|
|
333 | 383 |
|
334 |
/*
|
|
384 |
/*
|
|
335 | 385 |
* (non-Javadoc) |
336 | 386 |
* |
337 | 387 |
* @see com.iver.cit.gvsig.gui.cad.CADTool#addvalue(double) |
338 | 388 |
*/ |
339 |
public void addValue(double d) {
|
|
389 |
public void addValue(double d) {
|
|
340 | 390 |
|
341 |
}
|
|
391 |
}
|
|
342 | 392 |
|
343 | 393 |
public String getName() { |
344 |
return PluginServices.getText(this,"symmetry_"); |
|
394 |
return PluginServices.getText(this, "symmetry_");
|
|
345 | 395 |
} |
346 | 396 |
|
347 | 397 |
public String toString() { |
Also available in: Unified diff