Statistics
| Revision:

root / trunk / libraries / libUIComponent / src-test-ui / org / gvsig / gui / beans / panelGroup / samples / SampleInfoPanel.java @ 15734

History | View | Annotate | Download (3.15 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

    
20
package org.gvsig.gui.beans.panelGroup.samples;
21

    
22
import java.awt.Color;
23
import java.io.Serializable;
24

    
25
import javax.swing.JScrollPane;
26
import javax.swing.JTextArea;
27

    
28
import org.gvsig.gui.beans.panelGroup.panels.AbstractPanel;
29

    
30
/**
31
 * <p>Sample of {@link AbstractPanel AbstractPanel}.</p>
32
 * 
33
 * @version 16/10/2007
34
 * @author Pablo Piqueras Bartolom? (pablo.piqueras@iver.es) 
35
 */
36
public class SampleInfoPanel extends AbstractPanel implements Serializable {
37
        private static final long serialVersionUID = 3175919090844856980L;
38

    
39
        /**
40
         * <p>Element for the interface.</p>
41
         */
42
        private JTextArea jTextArea = null;
43
        
44
        /**
45
         * @see AbstractPanel#AbstractPanel()
46
         */
47
        public SampleInfoPanel() {
48
                super();
49
                initialize();
50
        }
51
        
52
        /**
53
         * @see AbstractPanel#AbstractPanel(String, String, String)
54
         */
55
        public SampleInfoPanel(String id, String label, String labelGroup) {
56
                super(id, label, labelGroup);
57
                initialize();
58
        }
59
        
60
        @Override
61
        protected void initialize() {
62
                add(new JScrollPane(getJTextArea()));
63
                setToolTipText(getID());
64
        }
65
        
66
        /**
67
         * This method initializes jTextArea
68
         *
69
         * @return JTextArea
70
         */
71
        private JTextArea getJTextArea() {
72
                if (jTextArea == null) {
73
                        jTextArea = new JTextArea(5, 40);
74
                        jTextArea.setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
75
                        jTextArea.setEditable(false);
76
                        jTextArea.setBackground(Color.RED);
77
                }
78

    
79
                return jTextArea;
80
        }
81
        
82
        @Override
83
        public void setID(String id) {
84
                super.setID(id);
85
                
86
                setToolTipText(getID());
87
                getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
88
        }
89

    
90
        @Override
91
        public void setLabel(String label) {
92
                super.setLabel(label);
93
                
94
                getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
95
        }
96

    
97
        @Override
98
        public void setLabelGroup(String labelGroup) {
99
                super.setLabelGroup(labelGroup);
100
                
101
                getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
102
        }
103

    
104
        @Override
105
        public void accept() {
106
        }
107

    
108
        @Override
109
        public void apply() {
110
        }
111

    
112
        @Override
113
        public void cancel() {
114
        }
115

    
116
        @Override
117
        public void selected() {
118
        }
119
}