Statistics
| Revision:

root / trunk / libraries / libUIComponent / src / org / gvsig / gui / beans / progresspanel / LogControl.java @ 13136

History | View | Annotate | Download (1.76 KB)

1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2007 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.gui.beans.progresspanel;
20
/**
21
 * <code>LogControl</code>. Objeto para un control b?sico de un log. Para a?adir
22
 * y reemplazar la ?ltima l?nea a?adida.
23
 *
24
 * @version 27/03/2007
25
 * @author BorSanZa - Borja Sanchez Zamorano (borja.sanchez@iver.es)
26
 */
27
public class LogControl {
28
        String text = "";
29

    
30
        /**
31
         * A?ade una l?nea al log.
32
         * @param line
33
         */
34
        public void addLine(String line) {
35
                if (text.length() > 0)
36
                        text += "\n";
37
                text += line;
38
        }
39

    
40
        /**
41
         * Reemplaza la ?ltima l?nea a?adida al log.
42
         * @param line
43
         */
44
        public void replaceLastLine(String line) {
45
                int index = text.lastIndexOf("\n");
46
                if (index < 0)
47
                        index = 0;
48
                text = text.substring(0, index);
49
                addLine(line);
50
        }
51

    
52
        /**
53
         * Establece el texto completo del log.
54
         * @param value
55
         */
56
        public void setText(String value) {
57
                text = value;
58
        }
59

    
60
        /**
61
         * Devuelve el contenido del log.
62
         * @return String
63
         */
64
        public String getText() {
65
                return text;
66
        }
67
}