Revision 4216 trunk/extensions/extRasterTools/src/com/iver/cit/gvsig/fmap/rasterTools/saveRaster/operations/RasterizerLayer.java
RasterizerLayer.java | ||
---|---|---|
64 | 64 |
import com.iver.cit.gvsig.fmap.layers.FLayers; |
65 | 65 |
import com.iver.cit.gvsig.fmap.layers.FLyrRaster; |
66 | 66 |
import com.iver.cit.gvsig.fmap.operations.Cancellable; |
67 |
import com.iver.cit.gvsig.gui.layout.FLayoutUtilities;
|
|
67 |
import com.iver.cit.gvsig.rasterTools.saveRaster.gui.ProgressSaveRasterPanel;
|
|
68 | 68 |
|
69 | 69 |
/** |
70 | 70 |
* @author Nacho Brodin <brodin_ign@gva.es> |
... | ... | |
76 | 76 |
*/ |
77 | 77 |
public class RasterizerLayer extends Rasterizer{ |
78 | 78 |
|
79 |
private ViewPort viewPort = null; |
|
80 |
private ViewPort viewPortBlock = null; |
|
81 |
private FLayers flayers = null; |
|
82 |
private Color backgroundColor = null; |
|
83 |
private JProgressBar progressBar = null;
|
|
84 |
private double incrProgressBar = 0; |
|
85 |
private boolean firstRead = true; |
|
86 |
private int nBlocks = 0; |
|
87 |
private double percentMax = 100.0D; |
|
88 |
private double incrTemp = 0; |
|
79 |
private ViewPort viewPort = null;
|
|
80 |
private ViewPort viewPortBlock = null;
|
|
81 |
private FLayers flayers = null;
|
|
82 |
private Color backgroundColor = null;
|
|
83 |
private ProgressSaveRasterPanel progressBar = null;
|
|
84 |
private double incrProgressBar = 0;
|
|
85 |
private boolean firstRead = true;
|
|
86 |
private int nBlocks = 0;
|
|
87 |
private double percentMax = 100.0D;
|
|
88 |
private double incrTemp = 0;
|
|
89 | 89 |
|
90 | 90 |
/** |
91 | 91 |
* Calculo del viewPort |
... | ... | |
225 | 225 |
calcViewPort(viewPortBlock); |
226 | 226 |
|
227 | 227 |
if(progressBar != null){ |
228 |
this.incrTemp = (incrTemp - ((int)incrTemp)) + progressBar.getValue() + incrProgressBar; |
|
229 |
if(((int)incrTemp) != progressBar.getValue()) |
|
230 |
progressBar.setValue((int)incrTemp); |
|
231 |
//System.out.println("===>progressBar.getValue()="+incrProgressBar+" "+incrTemp+" "+Math.floor(incrTemp)+" "+progressBar.getValue()); |
|
228 |
this.incrTemp = (incrTemp - ((int)incrTemp)) + progressBar.getJProgressBar().getValue() + incrProgressBar; |
|
229 |
if(((int)incrTemp) != progressBar.getJProgressBar().getValue()){ |
|
230 |
progressBar.getJProgressBar().setValue((int)incrTemp); |
|
231 |
if(incrTemp <= 100) |
|
232 |
progressBar.getLabelPercent().setText(((int)incrTemp)+"%"); |
|
233 |
} |
|
232 | 234 |
} |
233 | 235 |
|
234 | 236 |
contBlocks++; |
... | ... | |
242 | 244 |
* Asigna la barra de progreso |
243 | 245 |
* @param bar Barra de progreso |
244 | 246 |
*/ |
245 |
public void setProgressBar(JProgressBar bar, double percentMax){
|
|
246 |
this.progressBar = bar;
|
|
247 |
public void setProgressBar(ProgressSaveRasterPanel progress, double percentMax){
|
|
248 |
this.progressBar = progress;
|
|
247 | 249 |
if(percentMax != 0){ |
248 | 250 |
this.percentMax = percentMax; |
249 | 251 |
incrProgressBar = percentMax/((double)nBlocks); |
Also available in: Unified diff