Statistics
| Revision:

root / trunk / extensions / extRasterTools-SE / src / org / gvsig / rastertools / histogram / HistogramProcess.java @ 10997

History | View | Annotate | Download (2.18 KB)

1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
*
3
* Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
4
*
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License
7
* as published by the Free Software Foundation; either version 2
8
* of the License, or (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
*/
19
package org.gvsig.rastertools.histogram;
20

    
21
import org.gvsig.gui.beans.incrementabletask.IIncrementable;
22
import org.gvsig.raster.util.Histogram;
23
import org.gvsig.raster.util.HistogramException;
24
import org.gvsig.raster.util.IHistogramable;
25

    
26
public class HistogramProcess extends Thread implements IIncrementable {
27
        IHistogramable iHistogramable = null;
28
        Histogram histogram = null;
29
        
30
        public HistogramProcess(IHistogramable iHistogramable) {
31
                this.iHistogramable = iHistogramable;
32
                this.start();
33
        }
34
        
35
        public void run() {
36
                try {
37
                        histogram = iHistogramable.getHistogram();
38
                } catch (HistogramException e) {
39
                        e.printStackTrace();
40
                }
41
        }
42
        
43
        public Histogram getLastHistogram() {
44
                return histogram;
45
        }
46
        /*
47
         * (non-Javadoc)
48
         * @see org.gvsig.gui.beans.IncrementableTask.IIncrementable#getLabel()
49
         */
50
        public String getLabel() {
51
                return "Generando histograma, por favor, espere...";
52
        }
53

    
54
        /*
55
         * (non-Javadoc)
56
         * @see org.gvsig.gui.beans.IncrementableTask.IIncrementable#getLog()
57
         */
58
        public String getLog() {
59
                return "Calculando histograma...";
60
        }
61

    
62
        /*
63
         * (non-Javadoc)
64
         * @see org.gvsig.gui.beans.IncrementableTask.IIncrementable#getPercent()
65
         */
66
        public int getPercent() {
67
                return iHistogramable.getPercent();
68
        }
69

    
70
        /*
71
         * (non-Javadoc)
72
         * @see org.gvsig.gui.beans.IncrementableTask.IIncrementable#getTitle()
73
         */
74
        public String getTitle() {
75
                return "Calculando histograma";
76
        }
77
}