svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.utils / src / main / java / org / gvsig / utils / swing / threads / DefaultCancellableMonitorable.java @ 40561
History | View | Annotate | Download (2.74 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
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 3
|
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 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
/* CVS MESSAGES:
|
25 |
*
|
26 |
* $Id: DefaultCancellableMonitorable.java 29631 2009-06-29 16:56:19Z jpiera $
|
27 |
* $Log$
|
28 |
* Revision 1.1 2006-05-22 10:31:55 fjp
|
29 |
* Monitorable tasks easy
|
30 |
*
|
31 |
* Revision 1.4 2006/05/15 14:56:23 azabala
|
32 |
* A?adida la posibilidad de modificar el paso actual (para que en tareas que constan de varios pasos, para cada paso se pueda mostrar una barra llenandose)
|
33 |
*
|
34 |
* Revision 1.3 2006/03/14 19:29:15 azabala
|
35 |
* *** empty log message ***
|
36 |
*
|
37 |
* Revision 1.2 2006/03/09 18:43:29 azabala
|
38 |
* *** empty log message ***
|
39 |
*
|
40 |
* Revision 1.1 2006/03/09 18:41:32 azabala
|
41 |
* *** empty log message ***
|
42 |
*
|
43 |
*
|
44 |
*/
|
45 |
package org.gvsig.utils.swing.threads; |
46 |
/**
|
47 |
* Default very easy implementation of
|
48 |
* CancellableMonitorable
|
49 |
* @author azabala
|
50 |
*
|
51 |
*/
|
52 |
public class DefaultCancellableMonitorable implements CancellableMonitorable { |
53 |
|
54 |
private boolean canceled = false; |
55 |
private int currentStep = 0; |
56 |
private int initialStep = 0; |
57 |
private int lastStep = 0; |
58 |
private boolean determinated = false; |
59 |
|
60 |
|
61 |
|
62 |
|
63 |
public boolean isCanceled() { |
64 |
return canceled;
|
65 |
} |
66 |
|
67 |
public void reportStep() { |
68 |
currentStep++; |
69 |
} |
70 |
|
71 |
public int getCurrentStep() { |
72 |
return currentStep;
|
73 |
} |
74 |
|
75 |
public void setInitialStep(int step) { |
76 |
initialStep = step; |
77 |
} |
78 |
|
79 |
public void setFinalStep(int step) { |
80 |
lastStep = step; |
81 |
} |
82 |
|
83 |
public void setDeterminatedProcess(boolean determinated) { |
84 |
this.determinated = determinated;
|
85 |
} |
86 |
|
87 |
public boolean isDeterminatedProcess() { |
88 |
return determinated;
|
89 |
} |
90 |
|
91 |
public void setCanceled(boolean canceled) { |
92 |
this.canceled = canceled;
|
93 |
} |
94 |
|
95 |
public void reset() { |
96 |
canceled = false;
|
97 |
currentStep = 0;
|
98 |
initialStep = 0;
|
99 |
lastStep = 0;
|
100 |
determinated = false;
|
101 |
} |
102 |
|
103 |
public int getInitialStep() { |
104 |
return initialStep;
|
105 |
} |
106 |
|
107 |
public int getFinalStep() { |
108 |
return lastStep;
|
109 |
} |
110 |
|
111 |
public void setCurrentStep(int currentStep) { |
112 |
this.currentStep = currentStep;
|
113 |
} |
114 |
|
115 |
} |
116 |
|