Revision 10626 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/legend/CreateSpatialIndexMonitorableTask.java

View differences:

CreateSpatialIndexMonitorableTask.java
45 45
*
46 46
* $Id$
47 47
* $Log$
48
* Revision 1.1  2006-09-15 10:41:30  caballero
48
* Revision 1.2  2007-03-06 16:37:08  caballero
49
* Exceptions
50
*
51
* Revision 1.1  2006/09/15 10:41:30  caballero
49 52
* extensibilidad de documentos
50 53
*
51 54
* Revision 1.2  2006/05/22 10:35:41  fjp
......
58 61
*/
59 62
package com.iver.cit.gvsig.project.documents.view.legend;
60 63

  
64
import com.hardcode.gdbms.driver.exceptions.ReadDriverException;
61 65
import com.iver.andami.PluginServices;
62
import com.iver.cit.gvsig.fmap.DriverException;
63 66
import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
64 67
import com.iver.cit.gvsig.fmap.layers.FLyrVect;
65 68
import com.iver.utiles.swing.threads.CancellableMonitorable;
......
67 70
import com.iver.utiles.swing.threads.IMonitorableTask;
68 71

  
69 72
public class CreateSpatialIndexMonitorableTask implements IMonitorableTask{
70
	
73

  
71 74
	String MAIN_MESSAGE;
72 75
	String HULL_MESSAGE = PluginServices.getText(this, "Indexando");
73 76
	String OF = "de";
74
	
77

  
75 78
	FLyrVect layer;
76 79
	/**
77 80
	 * It monitors advance of indexing process
......
81 84
	 * flag to tell if the process is finished
82 85
	 */
83 86
	private boolean finished = false;
84
	
87

  
85 88
	/**
86 89
	 * Default constructor
87 90
	 * @throws DriverIOException
88 91
	 * @throws DriverException
89 92
	 */
90
	public CreateSpatialIndexMonitorableTask(FLyrVect layer) throws DriverIOException,
91
													DriverException{
93
	public CreateSpatialIndexMonitorableTask(FLyrVect layer) throws ReadDriverException{
92 94
		this.layer = layer;
93
		MAIN_MESSAGE = PluginServices.getText(this, "Indexando_espacialmente") + 
95
		MAIN_MESSAGE = PluginServices.getText(this, "Indexando_espacialmente") +
94 96
								layer.getName();
95 97
		cancelMonitor = createCancelMonitor();
96 98
	}
97
	
99

  
98 100
	/**
99 101
	 * Creates a CancellableMonitorable instance to monitor
100 102
	 * progress and to cancel the process.
......
103 105
	 * @throws DriverException
104 106
	 */
105 107
	private CancellableMonitorable createCancelMonitor()
106
				throws DriverIOException, DriverException {
107
		DefaultCancellableMonitorable monitor = 
108
				throws ReadDriverException {
109
		DefaultCancellableMonitorable monitor =
108 110
			new DefaultCancellableMonitorable();
109 111
		monitor.setInitialStep(0);
110 112
		monitor.setDeterminatedProcess(true);
......
112 114
		monitor.setFinalStep(numSteps);
113 115
		return monitor;
114 116
	}
115
	
117

  
116 118
	public void run() throws Exception {
117 119
		((FLyrVect)layer).createSpatialIndex(cancelMonitor);
118 120
		finished = true;
119 121
	}
120
	
122

  
121 123
	public int getInitialStep() {
122 124
		return cancelMonitor.getInitialStep();
123 125
	}
......
136 138

  
137 139
	public String getNote() {
138 140
		return HULL_MESSAGE + " " +
139
		getCurrentStep()+ " " + 
141
		getCurrentStep()+ " " +
140 142
		OF  + " "+
141 143
		getFinishStep();
142 144
	}

Also available in: Unified diff