gvsig-raster / org.gvsig.raster.tools / trunk / org.gvsig.raster.tools / org.gvsig.raster.tools.app / org.gvsig.raster.tools.app.basic / src / main / java / org / gvsig / raster / tools / app / basic / tool / roi / ui / ROIsTablePanel.java @ 1174
History | View | Annotate | Download (17.3 KB)
1 |
/* gvSIG. Geographic Information System of the Valencian Government
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 |
* of the Valencian Government (CIT)
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 2
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
*/
|
22 |
package org.gvsig.raster.tools.app.basic.tool.roi.ui; |
23 |
|
24 |
import java.awt.BorderLayout; |
25 |
import java.awt.Color; |
26 |
import java.awt.FlowLayout; |
27 |
import java.awt.Image; |
28 |
import java.util.ArrayList; |
29 |
import java.util.Iterator; |
30 |
import java.util.LinkedHashMap; |
31 |
import java.util.List; |
32 |
|
33 |
import javax.swing.JButton; |
34 |
import javax.swing.JPanel; |
35 |
import javax.swing.JToggleButton; |
36 |
import javax.swing.border.EmptyBorder; |
37 |
import javax.swing.border.LineBorder; |
38 |
import javax.swing.table.DefaultTableModel; |
39 |
|
40 |
import org.gvsig.andami.IconThemeHelper; |
41 |
import org.gvsig.andami.PluginServices; |
42 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
43 |
import org.gvsig.app.project.documents.view.gui.AbstractViewPanel; |
44 |
import org.gvsig.app.project.documents.view.toolListeners.StatusBarListener; |
45 |
import org.gvsig.fmap.dal.coverage.exception.GridException; |
46 |
import org.gvsig.fmap.dal.coverage.grid.Grid; |
47 |
import org.gvsig.fmap.dal.coverage.grid.ROI; |
48 |
import org.gvsig.fmap.dal.exception.DataException; |
49 |
import org.gvsig.fmap.dal.feature.EditableFeature; |
50 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
51 |
import org.gvsig.fmap.geom.Geometry; |
52 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
53 |
import org.gvsig.fmap.mapcontext.MapContextManager; |
54 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
55 |
import org.gvsig.fmap.mapcontext.layers.vectorial.GraphicLayer; |
56 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
57 |
import org.gvsig.fmap.mapcontrol.MapControl; |
58 |
import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior; |
59 |
import org.gvsig.fmap.mapcontrol.tools.Behavior.MouseMovementBehavior; |
60 |
import org.gvsig.fmap.mapcontrol.tools.Behavior.PointBehavior; |
61 |
import org.gvsig.fmap.mapcontrol.tools.Behavior.PolygonBehavior; |
62 |
import org.gvsig.fmap.mapcontrol.tools.Behavior.PolylineBehavior; |
63 |
import org.gvsig.gui.beans.table.TableContainer; |
64 |
import org.gvsig.gui.beans.table.exceptions.NotInitializeException; |
65 |
import org.gvsig.gui.beans.table.models.IModel; |
66 |
import org.gvsig.metadata.exceptions.MetadataException; |
67 |
import org.gvsig.raster.fmap.layers.FLyrRaster; |
68 |
import org.gvsig.raster.fmap.roi.VectorialROI; |
69 |
import org.gvsig.raster.tools.app.basic.RasterToolsUtil; |
70 |
import org.gvsig.raster.tools.app.basic.tool.roi.ROIFeatureManager; |
71 |
import org.gvsig.raster.tools.app.basic.tool.roi.ui.listener.DrawMouseViewListener; |
72 |
import org.gvsig.raster.tools.app.basic.tool.roi.ui.listener.ROIsTablePanelListener; |
73 |
|
74 |
/**
|
75 |
* Panel con la tabla de ROIs.
|
76 |
*
|
77 |
* @author Diego Guerrero Sevilla (diego.guerrero@uclm.es)
|
78 |
*
|
79 |
*/
|
80 |
public class ROIsTablePanel extends JPanel { |
81 |
private static final long serialVersionUID = 2138437448356198224L; |
82 |
private ROIsManagerPanel managerPanel = null; |
83 |
private ROIsTablePanelListener listener = null; |
84 |
private JPanel controlPanel = null; |
85 |
private JPanel tableButtonsPanel = null; |
86 |
private JPanel toolsPanel = null; |
87 |
private TableContainer tableContainer = null; |
88 |
private JButton newButton = null; |
89 |
private JButton deleteButton = null; |
90 |
private JButton exportButton = null; |
91 |
private JButton importButton = null; |
92 |
private JToggleButton pointToolButton = null; |
93 |
private JToggleButton lineToolButton = null; |
94 |
private JToggleButton polygonToolButton = null; |
95 |
private FLayer fLayer = null; |
96 |
private MapControl mapControl = null; |
97 |
private AbstractViewPanel view = null; |
98 |
private GraphicLayer graphicLayer = null; |
99 |
private LinkedHashMap<String, ROI> rois = null; |
100 |
private Grid grid = null; |
101 |
private Image curImage = null; |
102 |
private String previousTool = null; |
103 |
private MapContextManager mapContextManager = MapContextLocator.getMapContextManager();
|
104 |
private ROIFeatureManager roiFeatureManager = null; |
105 |
|
106 |
public ROIsTablePanel(ROIsManagerPanel managerPanel) {
|
107 |
super();
|
108 |
|
109 |
this.managerPanel = managerPanel;
|
110 |
setBorder(new LineBorder(Color.GRAY)); |
111 |
setLayout(new BorderLayout()); |
112 |
add(getTable(), BorderLayout.CENTER);
|
113 |
add(getControlPanel(), BorderLayout.SOUTH);
|
114 |
|
115 |
initialize(); |
116 |
} |
117 |
|
118 |
private void initialize() { |
119 |
listener = new ROIsTablePanelListener(this); |
120 |
getNewButton().addActionListener(listener); |
121 |
getDeleteButton().addActionListener(listener); |
122 |
getImportButton().addActionListener(listener); |
123 |
getExportButton().addActionListener(listener); |
124 |
getPointToolButton().addActionListener(listener); |
125 |
getLineToolButton().addActionListener(listener); |
126 |
getPolygonToolButton().addActionListener(listener); |
127 |
|
128 |
getTable().getTable().getJTable().getSelectionModel() |
129 |
.addListSelectionListener(listener); |
130 |
getTable().getTable().getJTable().getModel().addTableModelListener( |
131 |
listener); |
132 |
|
133 |
getPolygonToolButton().setSelected(true);
|
134 |
setToolsEnabled(false);
|
135 |
} |
136 |
|
137 |
public ROIFeatureManager getRoiFeatureManager() {
|
138 |
return roiFeatureManager;
|
139 |
} |
140 |
|
141 |
public ROIsManagerPanel getManagerPanel() {
|
142 |
return managerPanel;
|
143 |
} |
144 |
|
145 |
public void setToolsEnabled(boolean b) { |
146 |
getPointToolButton().setEnabled(b); |
147 |
getLineToolButton().setEnabled(b); |
148 |
getPolygonToolButton().setEnabled(b); |
149 |
} |
150 |
|
151 |
public TableContainer getTable() {
|
152 |
if (tableContainer == null) { |
153 |
String[] columnNames = { PluginServices.getText(this, "nombre"), |
154 |
PluginServices.getText(this, "poligonos"), |
155 |
PluginServices.getText(this, "lineas"), |
156 |
PluginServices.getText(this, "puntos"), |
157 |
PluginServices.getText(this, "color")}; |
158 |
int[] columnWidths = { 50, 25, 25, 25, 45 }; |
159 |
tableContainer = new TableContainer(columnNames, columnWidths);
|
160 |
tableContainer.setModel("ROIsTableModel");
|
161 |
tableContainer.initialize(); |
162 |
tableContainer.setControlVisible(false);
|
163 |
tableContainer.setBorder(new EmptyBorder(5, 5, 0, 5)); |
164 |
} |
165 |
return tableContainer;
|
166 |
} |
167 |
|
168 |
public JPanel getControlPanel() { |
169 |
if (controlPanel == null) { |
170 |
controlPanel = new JPanel(); |
171 |
controlPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
172 |
|
173 |
controlPanel.add(getTableButtonsPanel()); |
174 |
|
175 |
controlPanel.add(getToolsPanel()); |
176 |
} |
177 |
return controlPanel;
|
178 |
} |
179 |
|
180 |
public JButton getDeleteButton() { |
181 |
if (deleteButton == null) { |
182 |
deleteButton = new JButton(PluginServices.getText(this, "borrar")); |
183 |
} |
184 |
return deleteButton;
|
185 |
} |
186 |
|
187 |
public JButton getNewButton() { |
188 |
if (newButton == null) { |
189 |
newButton = new JButton(PluginServices.getText(this, "nuevo")); |
190 |
} |
191 |
return newButton;
|
192 |
} |
193 |
|
194 |
public FLayer getFLayer() {
|
195 |
return fLayer;
|
196 |
} |
197 |
|
198 |
public void setFLayer(FLayer layer) throws GridException { |
199 |
fLayer = layer; |
200 |
/*
|
201 |
FLyrRasterSE rasterLayer = (FLyrRasterSE) layer;
|
202 |
IRasterDataSource dsetCopy = null;
|
203 |
dsetCopy = rasterLayer.getDataSource().newDataset();
|
204 |
BufferFactory bufferFactory = new BufferFactory(dsetCopy);
|
205 |
if (!RasterBuffer.loadInMemory(dsetCopy))
|
206 |
bufferFactory.setReadOnly(true);
|
207 |
bufferFactory.setAllDrawableBands();
|
208 |
|
209 |
int bands[] = null;
|
210 |
bands = new int[rasterLayer.getBandCount()];
|
211 |
for (int i = 0; i < rasterLayer.getBandCount(); i++)
|
212 |
bands[i] = i;
|
213 |
try {
|
214 |
grid = new Grid(bufferFactory, bands);
|
215 |
} catch (RasterBufferInvalidException e) {
|
216 |
e.printStackTrace();
|
217 |
}
|
218 |
*/
|
219 |
|
220 |
if (view == null) { |
221 |
IWindow[] list = PluginServices.getMDIManager().getAllWindows();
|
222 |
for (int i = 0; i < list.length; i++) { |
223 |
if (list[i] instanceof AbstractViewPanel) |
224 |
view = (AbstractViewPanel) list[i]; |
225 |
} |
226 |
if (view == null) |
227 |
return;
|
228 |
mapControl = view.getMapControl(); |
229 |
graphicLayer = view.getMapControl().getMapContext() |
230 |
.getGraphicsLayer(); |
231 |
|
232 |
/*
|
233 |
* Guardar la herramienta actual para recuperarla m?s tarde, por
|
234 |
* ejemplo al cerrar el contenedor del este panel.
|
235 |
*/
|
236 |
previousTool = mapControl.getCurrentTool(); |
237 |
|
238 |
// Listener de eventos de movimiento que pone las coordenadas del
|
239 |
// rat?n en la barra de estado
|
240 |
StatusBarListener sbl = new StatusBarListener(mapControl);
|
241 |
|
242 |
DrawMouseViewListener drawMouseViewListener = new DrawMouseViewListener(this); |
243 |
mapControl.addBehavior("drawPolygonROI", new Behavior[] { |
244 |
new PolygonBehavior(drawMouseViewListener),
|
245 |
new MouseMovementBehavior(sbl) });
|
246 |
mapControl.addBehavior("drawLineROI", new Behavior[] { |
247 |
new PolylineBehavior(drawMouseViewListener),
|
248 |
new MouseMovementBehavior(sbl) });
|
249 |
mapControl.addBehavior("drawPointROI", new Behavior[] { |
250 |
new PointBehavior(drawMouseViewListener),
|
251 |
new MouseMovementBehavior(sbl) });
|
252 |
} |
253 |
|
254 |
try {
|
255 |
roiFeatureManager = new ROIFeatureManager(fLayer.getMetadataID()
|
256 |
.toString()); |
257 |
} catch (MetadataException e) {
|
258 |
throw new GridException("Can't create ROI",e); |
259 |
} |
260 |
|
261 |
/*
|
262 |
* Caragar las ROIs asociadas a la capa, si las hay:
|
263 |
*/
|
264 |
clearROIs(); |
265 |
loadROIs(); |
266 |
} |
267 |
|
268 |
/**
|
269 |
* Elimina todas las filas de la tabla de rois as? como la ROI y objetos
|
270 |
* FGraphic asociados (borr?ndolos tambi?n de la vista) a cada una.
|
271 |
*
|
272 |
*/
|
273 |
public void clearROIs() { |
274 |
try {
|
275 |
getTable().removeAllRows(); |
276 |
} catch (NotInitializeException e) {
|
277 |
RasterToolsUtil.messageBoxError("error_tabla_rois", this, e); |
278 |
} |
279 |
|
280 |
boolean repaint = roiFeatureManager.clear(graphicLayer);
|
281 |
|
282 |
if (repaint)
|
283 |
getMapControl().rePaintDirtyLayers(); |
284 |
getRois().clear(); |
285 |
} |
286 |
|
287 |
/**
|
288 |
* Cargar las ROIs asociadas a la capa, si las hay.
|
289 |
*
|
290 |
* @throws GridException
|
291 |
*
|
292 |
*/
|
293 |
private void loadROIs() throws GridException { |
294 |
ArrayList<ROI> roisArray = ((FLyrRaster) fLayer).getRois();
|
295 |
loadROIs(roisArray); |
296 |
} |
297 |
|
298 |
private void loadROIs(List<ROI> roisArray) throws GridException { |
299 |
if (roisArray != null) { |
300 |
ISymbol symbol = null;
|
301 |
int nPoints, nPolygons, nLines;
|
302 |
|
303 |
FeatureStore store = graphicLayer.getFeatureStore(); |
304 |
try {
|
305 |
store.edit(); |
306 |
|
307 |
for (Iterator<ROI> iter = roisArray.iterator(); iter.hasNext();) { |
308 |
ROI roi = (ROI) iter.next(); |
309 |
|
310 |
nPoints = 0;
|
311 |
nPolygons = 0;
|
312 |
nLines = 0;
|
313 |
|
314 |
Object row[] = ((IModel) getTable().getModel()).getNewLine(); |
315 |
row[0] = roi.getName();
|
316 |
row[4] = roi.getColor();
|
317 |
|
318 |
addROI(roi); |
319 |
VectorialROI vectorialROI = (VectorialROI) roi; |
320 |
for (Iterator<Geometry> iterator = vectorialROI.getGeometries().iterator(); iterator.hasNext();) { |
321 |
Geometry geometry = (Geometry) iterator.next(); |
322 |
symbol = mapContextManager.getSymbolManager().createSymbol(geometry.getType(), roi.getColor()); |
323 |
switch (geometry.getType()) {
|
324 |
case Geometry.TYPES.POINT:
|
325 |
nPoints++; |
326 |
break;
|
327 |
case Geometry.TYPES.SURFACE:
|
328 |
nPolygons++; |
329 |
break;
|
330 |
case Geometry.TYPES.CURVE:
|
331 |
nLines++; |
332 |
break;
|
333 |
} |
334 |
EditableFeature feature = roiFeatureManager.addROIFeature(vectorialROI, graphicLayer, geometry, symbol); |
335 |
|
336 |
store.insert(feature); |
337 |
} |
338 |
row[1] = new Integer(nPolygons); |
339 |
row[2] = new Integer(nLines); |
340 |
row[3] = new Integer(nPoints); |
341 |
//row[5] = new Integer((int)roi.getValues());
|
342 |
((DefaultTableModel) getTable().getModel()).addRow(row);
|
343 |
} |
344 |
store.finishEditing(); |
345 |
} catch (DataException e) {
|
346 |
throw new GridException("Error loading ROIs from layer " + fLayer.getName(), e); |
347 |
} |
348 |
selectDrawRoiTool(); |
349 |
getMapControl().drawGraphics(); |
350 |
} |
351 |
} |
352 |
|
353 |
public void setROIs(ArrayList<ROI> roisArray) throws GridException { |
354 |
loadROIs(roisArray); |
355 |
} |
356 |
|
357 |
public MapControl getMapControl() {
|
358 |
return mapControl;
|
359 |
} |
360 |
|
361 |
public void selectDrawRoiTool() { |
362 |
if (mapControl != null) |
363 |
if (getPolygonToolButton().isSelected()) {
|
364 |
Image img = IconThemeHelper.getImageIcon("poligoncursor-icon").getImage(); |
365 |
curImage = img; |
366 |
mapControl.setTool("drawPolygonROI");
|
367 |
} else if (getLineToolButton().isSelected()) { |
368 |
Image img = IconThemeHelper.getImageIcon("linecursor-icon").getImage(); |
369 |
curImage = img; |
370 |
mapControl.setTool("drawLineROI");
|
371 |
} else if (getPointToolButton().isSelected()) { |
372 |
Image img = IconThemeHelper.getImageIcon("pointcursor-icon").getImage(); |
373 |
curImage = img; |
374 |
mapControl.setTool("drawPointROI");
|
375 |
} |
376 |
} |
377 |
|
378 |
public Grid getGrid() {
|
379 |
if(grid == null) { |
380 |
FLyrRaster rasterLayer = (FLyrRaster) getFLayer(); |
381 |
try {
|
382 |
grid = rasterLayer.getReadOnlyFullGrid(false);
|
383 |
} catch (GridException e) {
|
384 |
return null; |
385 |
} catch (InterruptedException e) { |
386 |
return null; |
387 |
} |
388 |
/*IRasterDataSource dsetCopy = null;
|
389 |
dsetCopy = rasterLayer.getDataSource().newDataset();
|
390 |
BufferFactory bufferFactory = new BufferFactory(dsetCopy);
|
391 |
bufferFactory.setReadOnly(true);
|
392 |
bufferFactory.setAllDrawableBands();
|
393 |
|
394 |
int bands[] = null;
|
395 |
bands = new int[rasterLayer.getBandCount()];
|
396 |
for (int i = 0; i < rasterLayer.getBandCount(); i++)
|
397 |
bands[i] = i;
|
398 |
try {
|
399 |
grid = RasterLocator.getManager().createGrid(datasource, bands);
|
400 |
//new Grid(bufferFactory, bands);
|
401 |
} catch (RasterBufferInvalidException e) {
|
402 |
e.printStackTrace();
|
403 |
}*/
|
404 |
} |
405 |
return grid;
|
406 |
} |
407 |
|
408 |
private LinkedHashMap<String, ROI> getRois() { |
409 |
if (rois == null) |
410 |
rois = new LinkedHashMap<String, ROI>(); |
411 |
return rois;
|
412 |
} |
413 |
|
414 |
public JPanel getToolsPanel() { |
415 |
if (toolsPanel == null) { |
416 |
toolsPanel = new JPanel(); |
417 |
toolsPanel.setLayout(new FlowLayout(FlowLayout.RIGHT)); |
418 |
toolsPanel.add(getPointToolButton()); |
419 |
toolsPanel.add(getLineToolButton()); |
420 |
toolsPanel.add(getPolygonToolButton()); |
421 |
toolsPanel.add(getExportButton()); |
422 |
toolsPanel.add(getImportButton()); |
423 |
} |
424 |
return toolsPanel;
|
425 |
} |
426 |
|
427 |
public JPanel getTableButtonsPanel() { |
428 |
if (tableButtonsPanel == null) { |
429 |
tableButtonsPanel = new JPanel(); |
430 |
tableButtonsPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
431 |
|
432 |
tableButtonsPanel.add(getNewButton()); |
433 |
|
434 |
tableButtonsPanel.add(getDeleteButton()); |
435 |
} |
436 |
return tableButtonsPanel;
|
437 |
} |
438 |
|
439 |
public JToggleButton getPointToolButton() { |
440 |
if (pointToolButton == null) { |
441 |
pointToolButton = new JToggleButton(); |
442 |
pointToolButton.setIcon(IconThemeHelper.getImageIcon("point-icon"));
|
443 |
} |
444 |
return pointToolButton;
|
445 |
} |
446 |
|
447 |
public JToggleButton getLineToolButton() { |
448 |
if (lineToolButton == null) { |
449 |
lineToolButton = new JToggleButton(); |
450 |
lineToolButton.setIcon(IconThemeHelper.getImageIcon("line-icon"));
|
451 |
} |
452 |
return lineToolButton;
|
453 |
} |
454 |
|
455 |
public JToggleButton getPolygonToolButton() { |
456 |
if (polygonToolButton == null) { |
457 |
polygonToolButton = new JToggleButton(); |
458 |
polygonToolButton.setIcon(IconThemeHelper.getImageIcon("layer-modify-roi"));
|
459 |
} |
460 |
return polygonToolButton;
|
461 |
} |
462 |
|
463 |
public JButton getImportButton() { |
464 |
if (importButton == null) { |
465 |
importButton = new JButton(); |
466 |
importButton.setIcon(IconThemeHelper.getImageIcon( |
467 |
"tfwload-icon"));
|
468 |
importButton.setToolTipText(PluginServices.getText(this,
|
469 |
"cargar_rois"));
|
470 |
} |
471 |
return importButton;
|
472 |
} |
473 |
|
474 |
public JButton getExportButton() { |
475 |
if (exportButton == null) { |
476 |
exportButton = new JButton(); |
477 |
exportButton.setIcon(IconThemeHelper.getImageIcon("layer-saveas"));
|
478 |
exportButton.setToolTipText(PluginServices.getText(this, "salvar_rois")); |
479 |
} |
480 |
return exportButton;
|
481 |
} |
482 |
|
483 |
public Image getToolImage() { |
484 |
return curImage;
|
485 |
} |
486 |
|
487 |
public AbstractViewPanel getView() {
|
488 |
return view;
|
489 |
} |
490 |
|
491 |
public void addROI(ROI roi) { |
492 |
getRois().put(roi.getName(), roi); |
493 |
} |
494 |
|
495 |
public ROI getROI(String roiName) { |
496 |
return (ROI) getRois().get(roiName);
|
497 |
} |
498 |
|
499 |
/**
|
500 |
* Elimina la ROI correspondiente al nombre <code>roiName</code> as? como
|
501 |
* sus objetos FGraphic asociados (borr?ndolos tambi?n de la vista). (NO
|
502 |
* elimina la fila correspondiente en la tabla del panel).
|
503 |
*
|
504 |
* @param roiName
|
505 |
* Nombre de la ROI a eliminar.
|
506 |
*/
|
507 |
public void removeROI(String roiName) { |
508 |
getRois().remove(roiName); |
509 |
boolean repaint = roiFeatureManager.removeROI(roiName, graphicLayer);
|
510 |
if (repaint) {
|
511 |
getMapControl().rePaintDirtyLayers(); |
512 |
} |
513 |
} |
514 |
|
515 |
/**
|
516 |
* Borra de capa GraphicsLayer de mapContext los gr?ficos pertenecientes a
|
517 |
* las rois del panel. Si la GraphicsLayer se queda sin gr?ficos se eliminan
|
518 |
* tambien los s?mbolos de esta.
|
519 |
*/
|
520 |
public void clearRoiGraphics() { |
521 |
roiFeatureManager.clearFeaturesFromGraphicLayer(graphicLayer); |
522 |
|
523 |
// TODO: add support to remove unused symbols??
|
524 |
// if (graphicLayer.getNumGraphics() == 0) {
|
525 |
// graphicLayer.clearSymbolsGraphics();
|
526 |
// }
|
527 |
} |
528 |
|
529 |
public ArrayList<ROI> getROIs() { |
530 |
return new ArrayList<ROI>(getRois().values()); |
531 |
} |
532 |
|
533 |
public void setPreviousTool() { |
534 |
if (previousTool != null) |
535 |
getMapControl().setTool(previousTool); |
536 |
} |
537 |
|
538 |
public void changeRoiName(String currentName, String newName) |
539 |
throws DataException {
|
540 |
getROI(currentName).setName(newName); |
541 |
getRois().put(newName, getRois().remove(currentName)); |
542 |
roiFeatureManager.changeROIName(currentName, newName, graphicLayer); |
543 |
} |
544 |
|
545 |
public void sortTable() { |
546 |
|
547 |
} |
548 |
|
549 |
public GraphicLayer getGraphicLayer() {
|
550 |
return graphicLayer;
|
551 |
} |
552 |
} |