Statistics
| Revision:

root / trunk / libraries / libUIComponent / src / org / gvsig / gui / beans / listview / ListViewItem.java @ 12623

History | View | Annotate | Download (2.93 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.gui.beans.listview;
20

    
21
import java.awt.Rectangle;
22

    
23
/**
24
 * <code>ListViewItem</code> representa un item para ser usado desde
25
 * ListViewComponent
26
 *
27
 * @version 28/06/2007
28
 * @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es)
29
 */
30
public class ListViewItem {
31
        IIconPaint icon          = null;
32
        String     name          = null;
33
        Rectangle  nameRectangle = null;
34
        Rectangle  itemRectangle = null;
35
        boolean    selected      = false;
36
        boolean    showTooltip   = true;
37
        Object     tag           = null;
38

    
39
        /**
40
         * Construye un ListViewItem con un icono y su nombre.
41
         * @param icon
42
         * @param name
43
         */
44
        public ListViewItem(IIconPaint icon, String name) {
45
                this.icon = icon;
46
                this.name = name;
47
        }
48

    
49
        /**
50
         * Obtener el nombre del item
51
         * @return
52
         */
53
        public String getName() {
54
                return name;
55
        }
56

    
57
        /**
58
         * Definir el nombre del item
59
         * @param name
60
         */
61
        public void setName(String name) {
62
                this.name = name;
63
        }
64

    
65
        /**
66
         * Obtener el icono del item
67
         * @return
68
         */
69
        public IIconPaint getIcon() {
70
                return icon;
71
        }
72

    
73
        /**
74
         * Especificar el icono del item
75
         * @param icon
76
         */
77
        public void setIcon(IIconPaint icon) {
78
                this.icon = icon;
79
        }
80

    
81
        /**
82
         * Comprobar si el item esta seleccionado
83
         * @return
84
         */
85
        public boolean isSelected() {
86
                return selected;
87
        }
88

    
89
        /**
90
         * Definir si el item esta seleccionado
91
         * @param selected
92
         */
93
        public void setSelected(boolean selected) {
94
                this.selected = selected;
95
        }
96

    
97
        /**
98
         * Definir algun campo extra necesario por el programador
99
         * @return
100
         */
101
        public Object getTag() {
102
                return tag;
103
        }
104

    
105
        /**
106
         * Obtiene el campo extra
107
         * @return
108
         */
109
        public void setTag(Object tag) {
110
                this.tag = tag;
111
        }
112

    
113
        public boolean isShowTooltip() {
114
                return showTooltip;
115
        }
116

    
117
        public void setShowTooltip(boolean showTooltip) {
118
                this.showTooltip = showTooltip;
119
        }
120

    
121
        public Rectangle getNameRectangle() {
122
                return nameRectangle;
123
        }
124

    
125
        public void setNameRectangle(Rectangle nameRectangle) {
126
                this.nameRectangle = nameRectangle;
127
        }
128

    
129
        public Rectangle getItemRectangle() {
130
                return itemRectangle;
131
        }
132

    
133
        public void setItemRectangle(Rectangle itemRectangle) {
134
                this.itemRectangle = itemRectangle;
135
        }
136
}