Revision 10945 trunk/libraries/libUIComponent/src/org/gvsig/gui/beans/progressPanel/ProgressPanel.java
ProgressPanel.java | ||
---|---|---|
30 | 30 |
import javax.swing.JTextPane; |
31 | 31 |
|
32 | 32 |
import org.gvsig.gui.beans.buttonsPanel.ButtonsPanel; |
33 |
|
|
34 | 33 |
/** |
35 | 34 |
* <code>ProgressPanel</code>. Muestra una ventana de di?logo para representar |
36 | 35 |
* una barra de progreso con su ventana de registro. |
... | ... | |
49 | 48 |
private JProgressBar jProgressBar = null; |
50 | 49 |
private JScrollPane jScrollPane = null; |
51 | 50 |
private JTextPane jTextPane = null; |
52 |
private String realText = "";
|
|
51 |
private LogControl text = new LogControl();
|
|
53 | 52 |
|
54 | 53 |
/** |
55 | 54 |
* Constructor |
56 | 55 |
*/ |
57 | 56 |
public ProgressPanel() { |
58 |
// TODO Auto-generated constructor stub |
|
59 | 57 |
initialize(); |
60 | 58 |
} |
61 | 59 |
|
... | ... | |
192 | 190 |
return jTextPane; |
193 | 191 |
} |
194 | 192 |
|
193 |
private void updateLog() { |
|
194 |
jTextPane.setText(text.getText()); |
|
195 |
} |
|
196 |
|
|
195 | 197 |
public void addLineLog(String line) { |
196 |
realText = jTextPane.getText(); |
|
197 |
jTextPane.setText(realText + line + "\n"); |
|
198 |
|
|
198 |
text.addLine(line); |
|
199 |
updateLog(); |
|
199 | 200 |
} |
200 | 201 |
|
201 | 202 |
public void replaceLastLineLog(String line) { |
202 |
jTextPane.setText(realText + line + "\n"); |
|
203 |
text.replaceLastLine(line); |
|
204 |
updateLog(); |
|
203 | 205 |
} |
204 |
|
|
206 |
|
|
207 |
public void setLog(String value) { |
|
208 |
text.setText(value); |
|
209 |
updateLog(); |
|
210 |
} |
|
211 |
|
|
205 | 212 |
public int getPercent() { |
206 | 213 |
return jProgressBar.getValue(); |
207 | 214 |
} |
Also available in: Unified diff