root / trunk / applications / appgvSIG / src-test / com / iver / cit / gvsig / panelGroup / samples / SamplePanelWithoutGroupLabel.java @ 17547
History | View | Annotate | Download (3.77 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 com.iver.cit.gvsig.panelGroup.samples; |
21 |
|
22 |
import java.awt.Color; |
23 |
import java.awt.Dimension; |
24 |
import java.io.Serializable; |
25 |
|
26 |
import javax.swing.JScrollPane; |
27 |
import javax.swing.JTextArea; |
28 |
|
29 |
import org.gvsig.gui.beans.panelGroup.panels.AbstractPanel; |
30 |
|
31 |
/**
|
32 |
* <p>Sample of {@link AbstractPanel AbstractPanel}.</p>
|
33 |
*
|
34 |
* @version 23/10/2007
|
35 |
* @author Pablo Piqueras Bartolom? (pablo.piqueras@iver.es)
|
36 |
*/
|
37 |
public class SamplePanelWithoutGroupLabel extends AbstractPanel implements Serializable { |
38 |
private static final long serialVersionUID = -5449402170753829090L; |
39 |
|
40 |
/**
|
41 |
* <p>Element for the interface.</p>
|
42 |
*/
|
43 |
private JTextArea jTextArea = null; |
44 |
|
45 |
/**
|
46 |
* @see AbstractPanel#AbstractPanel()
|
47 |
*/
|
48 |
public SamplePanelWithoutGroupLabel() {
|
49 |
super();
|
50 |
initialize(); |
51 |
} |
52 |
|
53 |
/**
|
54 |
* @see AbstractPanel#AbstractPanel(String, String, String)
|
55 |
*/
|
56 |
public SamplePanelWithoutGroupLabel(String id, String label, String labelGroup) { |
57 |
super(id, label, labelGroup);
|
58 |
initialize(); |
59 |
} |
60 |
|
61 |
@Override
|
62 |
protected void initialize() { |
63 |
add(new JScrollPane(getJTextArea())); |
64 |
setToolTipText(getID()); |
65 |
|
66 |
setID(Samples_ExtensionPointsOfIPanels.PANELS3_IDS[0]);
|
67 |
setLabel(Samples_ExtensionPointsOfIPanels.PANELS3_LABELS[0]);
|
68 |
setPreferredSize(new Dimension(Samples_ExtensionPointsOfIPanels.PANELS_DEFAULT_WIDTH, Samples_ExtensionPointsOfIPanels.PANELS_DEFAULT_HEIGHT)); |
69 |
resetChangedStatus(); |
70 |
} |
71 |
|
72 |
/**
|
73 |
* This method initializes jTextArea
|
74 |
*
|
75 |
* @return JTextArea
|
76 |
*/
|
77 |
private JTextArea getJTextArea() { |
78 |
if (jTextArea == null) { |
79 |
jTextArea = new JTextArea(5, 40); |
80 |
jTextArea.setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup()); |
81 |
jTextArea.setEditable(false);
|
82 |
jTextArea.setBackground(Color.WHITE);
|
83 |
} |
84 |
|
85 |
return jTextArea;
|
86 |
} |
87 |
|
88 |
@Override
|
89 |
public void setID(String id) { |
90 |
super.setID(id);
|
91 |
|
92 |
setToolTipText(getID()); |
93 |
getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup()); |
94 |
} |
95 |
|
96 |
@Override
|
97 |
public void setLabel(String label) { |
98 |
super.setLabel(label);
|
99 |
|
100 |
getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup()); |
101 |
} |
102 |
|
103 |
@Override
|
104 |
public void setLabelGroup(String labelGroup) { |
105 |
super.setLabelGroup(labelGroup);
|
106 |
|
107 |
getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup()); |
108 |
} |
109 |
|
110 |
public void accept() { |
111 |
} |
112 |
|
113 |
public void apply() { |
114 |
} |
115 |
|
116 |
public void cancel() { |
117 |
} |
118 |
|
119 |
public void selected() { |
120 |
System.out.println("I'm the IPanel: " + toString() + "\n and I've been selected. My information is: " + |
121 |
"\n\tID: " + getID() + "\n\tLABEL_GROUP: " + getLabelGroup() + "\n\tLABEL: " + getLabel() + "\n\tCLASS: " + getClass() + |
122 |
"\n\tMy Preferred Size: " + getPreferredSize() + "\n\tAnd My size: " + getSize()); |
123 |
} |
124 |
} |