Revision 30541
trunk/libraries/libUIComponent/src/org/gvsig/gui/beans/progresspanel/ProgressPanel.java | ||
---|---|---|
50 | 50 |
* @version 15/07/2008 |
51 | 51 |
* |
52 | 52 |
* @author BorSanZa - Borja Sanchez Zamorano (borja.sanchez@iver.es) |
53 |
* @author Pablo Piqueras Bartolom? (pablo.piqueras@iver.es) |
|
54 | 53 |
*/ |
55 | 54 |
public class ProgressPanel extends JDialog { |
56 | 55 |
private static final long serialVersionUID = 4321011219898234352L; |
57 | 56 |
|
58 |
private JPanel jPanel = null;
|
|
59 |
private JLabel jLabel = null;
|
|
60 |
private JLabel jLabel1 = null;
|
|
61 |
private JPanel jPanel1 = null;
|
|
62 |
private JPanel njp = null;
|
|
57 |
private JPanel jPanel = null;
|
|
58 |
private JLabel jLabel = null;
|
|
59 |
private JLabel jLabel1 = null;
|
|
60 |
private JPanel jPanel1 = null;
|
|
61 |
private JPanel njp = null;
|
|
63 | 62 |
private DefaultButtonsPanel defaultButtonsPanel = null; |
64 |
private JProgressBar jProgressBar = null; |
|
65 |
private JScrollPane jScrollPane = null; |
|
66 |
private JTextPane jTextPane = null; |
|
67 |
private LogControl text = new LogControl(); |
|
68 |
private long startTime = System.currentTimeMillis(); |
|
63 |
private JProgressBar jProgressBar = null; |
|
64 |
private JScrollPane jScrollPane = null; |
|
65 |
private JTextPane jTextPane = null; |
|
66 |
private LogControl text = new LogControl(); |
|
67 |
private long startTime = System.currentTimeMillis(); |
|
68 |
private boolean showPause = true; |
|
69 | 69 |
|
70 |
private boolean showPause = true; |
|
71 |
|
|
72 | 70 |
/** |
73 | 71 |
* Constructor |
74 | 72 |
*/ |
... | ... | |
82 | 80 |
this.showPause = showPause; |
83 | 81 |
initialize(); |
84 | 82 |
} |
85 |
|
|
83 |
|
|
86 | 84 |
/** |
87 | 85 |
* @see JDialog#JDialog(Dialog, boolean) |
88 | 86 |
*/ |
trunk/libraries/libUIComponent/src/org/gvsig/gui/beans/incrementabletask/IncrementableTask.java | ||
---|---|---|
56 | 56 |
private ArrayList<IncrementableListener> actionCommandListeners = new ArrayList<IncrementableListener>(); |
57 | 57 |
private boolean bDoCallListeners = true; |
58 | 58 |
static private int eventId = Integer.MIN_VALUE; |
59 |
|
|
59 |
|
|
60 | 60 |
/** |
61 | 61 |
* Constructor del IncrementableTask. |
62 | 62 |
* @param incrementable |
... | ... | |
75 | 75 |
iIncrementable = incrementable; |
76 | 76 |
configureProgressPanel(); |
77 | 77 |
} |
78 |
|
|
79 | 78 |
|
80 | 79 |
/** |
81 | 80 |
* Inicio del thread para que la ventana vaya consultando por si sola al |
trunk/libraries/libUIComponent/src/org/gvsig/gui/beans/incrementabletask/IIncrementable.java | ||
---|---|---|
29 | 29 |
* @version 20/08/2008 |
30 | 30 |
* |
31 | 31 |
* @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es) |
32 |
* @author Pablo Piqueras Bartolom? (pablo.piqueras@iver.es) |
|
33 | 32 |
*/ |
34 | 33 |
public interface IIncrementable { |
35 | 34 |
/** |
trunk/libraries/libRaster/src/org/gvsig/raster/util/RasterUtilities.java | ||
---|---|---|
669 | 669 |
dos.writeBytes("" + ext.getMax().getY() + "\n"); |
670 | 670 |
dos.close(); |
671 | 671 |
} |
672 |
|
|
673 |
/** |
|
674 |
* Comprueba si existe un worldfile para la imagen seleccionada. |
|
675 |
* @param fileName |
|
676 |
* @return |
|
677 |
* @throws IOException |
|
678 |
*/ |
|
679 |
public static boolean existsWorldFile(String fileName) throws IOException { |
|
680 |
File tfw = null; |
|
672 | 681 |
|
682 |
String extWorldFile = ".wld"; |
|
683 |
if (fileName.endsWith("tif")) |
|
684 |
extWorldFile = ".tfw"; |
|
685 |
if (fileName.endsWith("jpg") || fileName.endsWith("jpeg")) |
|
686 |
extWorldFile = ".jpgw"; |
|
687 |
|
|
688 |
tfw = new File(fileName.substring(0, fileName.lastIndexOf(".")) + extWorldFile); |
|
689 |
|
|
690 |
return tfw.exists(); |
|
691 |
} |
|
692 |
|
|
673 | 693 |
/** |
674 | 694 |
* Crea un fichero de georeferenciaci?n (world file) para un dataset |
675 | 695 |
* determinado |
trunk/extensions/extRasterTools-SE/src/org/gvsig/raster/RasterProcess.java | ||
---|---|---|
51 | 51 |
private long time = 0; |
52 | 52 |
private boolean progressActive = true; |
53 | 53 |
private IProcessActions queueActions = null; |
54 |
private boolean cancellable = true; |
|
54 | 55 |
|
55 | 56 |
/** |
56 | 57 |
* Crea la ventana de IncrementableTask |
... | ... | |
58 | 59 |
private IncrementableTask getIncrementableTask() { |
59 | 60 |
if (incrementableTask == null) { |
60 | 61 |
incrementableTask = new IncrementableTask(this); |
62 |
incrementableTask.setAskCancel(cancellable); |
|
61 | 63 |
incrementableTask.addIncrementableListener(this); |
62 | 64 |
} |
63 | 65 |
return incrementableTask; |
... | ... | |
68 | 70 |
* @param enabled |
69 | 71 |
*/ |
70 | 72 |
public void setCancelable(boolean enabled) { |
73 |
cancellable = enabled; |
|
71 | 74 |
getIncrementableTask().getButtonsPanel().setEnabled(ButtonsPanel.BUTTON_CANCEL, enabled); |
72 | 75 |
} |
73 | 76 |
|
... | ... | |
236 | 239 |
* procesar? cuando pueda e interrumpir? el proceso. |
237 | 240 |
*/ |
238 | 241 |
public void actionCanceled(IncrementableEvent e) { |
239 |
rasterTask.setEvent(new CancelEvent(this)); |
|
242 |
if(cancellable) |
|
243 |
rasterTask.setEvent(new CancelEvent(this)); |
|
240 | 244 |
} |
241 | 245 |
|
242 | 246 |
/** |
trunk/extensions/extRasterTools-SE/src/org/gvsig/rastertools/reproject/ReprojectProcess.java | ||
---|---|---|
18 | 18 |
*/ |
19 | 19 |
package org.gvsig.rastertools.reproject; |
20 | 20 |
|
21 |
import java.io.IOException; |
|
22 |
|
|
21 | 23 |
import javax.swing.SwingUtilities; |
22 | 24 |
|
23 | 25 |
import org.cresques.cts.IProjection; |
24 | 26 |
import org.gvsig.fmap.raster.layers.FLyrRasterSE; |
25 | 27 |
import org.gvsig.raster.RasterProcess; |
26 | 28 |
import org.gvsig.raster.util.RasterToolsUtil; |
29 |
import org.gvsig.raster.util.RasterUtilities; |
|
27 | 30 |
|
28 | 31 |
import com.iver.andami.PluginServices; |
29 | 32 |
/** |
... | ... | |
51 | 54 |
proj = (IProjection) getParam("projection"); |
52 | 55 |
projsrc = (IProjection) getParam("srcprojection"); |
53 | 56 |
isInTOC = (Boolean) getParam("isintoc"); |
57 |
if(lyr.getFileName() != null) |
|
58 |
for (int i = 0; i < lyr.getFileName().length; i++) { |
|
59 |
try { |
|
60 |
if(!RasterUtilities.existsWorldFile(lyr.getFileName()[i])) |
|
61 |
RasterUtilities.createWorldFile(lyr.getFileName()[i], lyr.getAffineTransform(), (int)lyr.getPxWidth(), (int)lyr.getPxHeight()); |
|
62 |
} catch (IOException e) { |
|
63 |
RasterToolsUtil.debug("Error creando los worldfile", null, e); |
|
64 |
} |
|
65 |
} |
|
54 | 66 |
} |
55 | 67 |
|
56 | 68 |
/** |
... | ... | |
88 | 100 |
} |
89 | 101 |
}); |
90 | 102 |
} catch (ReprojectException e) { |
91 |
if (incrementableTask != null) |
|
103 |
if (incrementableTask != null) {
|
|
92 | 104 |
incrementableTask.processFinalize(); |
93 |
RasterToolsUtil.messageBoxError("error_reprojecting", this, e); |
|
105 |
setProgressActive(false); |
|
106 |
} |
|
107 |
RasterToolsUtil.messageBoxError(e.getMessage(), this, e); |
|
108 |
return; |
|
94 | 109 |
} |
95 | 110 |
} |
96 | 111 |
|
trunk/extensions/extRasterTools-SE/src/org/gvsig/rastertools/reproject/Reproject.java | ||
---|---|---|
152 | 152 |
// warper.setFormat(27); |
153 | 153 |
return warper.warp(epsg, source, pathDest, GeoRasterWriter.getWriter(pathDest).getDriverName()); |
154 | 154 |
} catch (NotSupportedExtensionException e) { |
155 |
throw new ReprojectException("Error al reproyectar.");
|
|
155 |
throw new ReprojectException("error_reprojecting");
|
|
156 | 156 |
} catch (RasterDriverException e) { |
157 |
throw new ReprojectException("Error al reproyectar."); |
|
157 |
throw new ReprojectException("error_reprojecting"); |
|
158 |
} catch (Exception e) { |
|
159 |
throw new ReprojectException("transformation_not_possible"); |
|
158 | 160 |
} |
159 | 161 |
} |
160 | 162 |
|
Also available in: Unified diff