gvsig-raster / org.gvsig.raster.wmts / trunk / org.gvsig.raster.wmts / org.gvsig.raster.wmts.swing / org.gvsig.raster.wmts.swing.impl / src / main / java / org / gvsig / raster / wmts / swing / impl / panel / main / DescriptionPanel.java @ 2613
History | View | Annotate | Download (5.59 KB)
1 |
/* gvSIG. Geographic Information System of the Valencian Government
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 |
* of the Valencian Government (CIT)
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 2
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
*/
|
22 |
package org.gvsig.raster.wmts.swing.impl.panel.main; |
23 |
|
24 |
import java.awt.FlowLayout; |
25 |
import java.awt.GridBagConstraints; |
26 |
import java.awt.GridBagLayout; |
27 |
|
28 |
import javax.swing.JLabel; |
29 |
import javax.swing.JPanel; |
30 |
import javax.swing.JScrollPane; |
31 |
import javax.swing.JTextArea; |
32 |
|
33 |
import org.gvsig.i18n.Messages; |
34 |
|
35 |
/**
|
36 |
* Connect panel
|
37 |
* @author Nacho Brodin (nachobrodin@gmail.com)
|
38 |
*/
|
39 |
public class DescriptionPanel extends JPanel { |
40 |
private static final long serialVersionUID = 1L; |
41 |
private JTextArea txtAbstract = null; |
42 |
private JScrollPane jScrollPane = null; |
43 |
private JPanel jPanelTxt = null; |
44 |
//private NextPrevPanel nextPrevPanel = null;
|
45 |
private JPanel jPanelName = null; |
46 |
private JLabel jLabelName = null; |
47 |
private JLabel lblTitle = null; |
48 |
|
49 |
public DescriptionPanel() {
|
50 |
init(); |
51 |
} |
52 |
|
53 |
public void init() { |
54 |
setLayout(new GridBagLayout()); |
55 |
|
56 |
GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); |
57 |
gridBagConstraints1.fill = GridBagConstraints.BOTH;
|
58 |
gridBagConstraints1.anchor = GridBagConstraints.WEST;
|
59 |
gridBagConstraints1.gridx = 0;
|
60 |
gridBagConstraints1.gridy = 0;
|
61 |
gridBagConstraints1.weightx = 1.0;
|
62 |
gridBagConstraints1.weighty = 1.0;
|
63 |
gridBagConstraints1.insets = new java.awt.Insets(2,2,2,2); |
64 |
add(getJPanelTxt(), gridBagConstraints1); |
65 |
|
66 |
/*gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL;
|
67 |
gridBagConstraints1.anchor = GridBagConstraints.CENTER;
|
68 |
gridBagConstraints1.gridy = 1;
|
69 |
gridBagConstraints1.weighty = 0.0;
|
70 |
gridBagConstraints1.insets = new java.awt.Insets(10,2,10,2);
|
71 |
add(getNextPrevPanel(), gridBagConstraints1);*/
|
72 |
} |
73 |
|
74 |
/**
|
75 |
* This method initializes jPanel
|
76 |
*
|
77 |
* @return javax.swing.JPanel
|
78 |
*/
|
79 |
/*public NextPrevPanel getNextPrevPanel() {
|
80 |
if (nextPrevPanel == null) {
|
81 |
nextPrevPanel = new NextPrevPanel();
|
82 |
}
|
83 |
return nextPrevPanel;
|
84 |
}*/
|
85 |
|
86 |
/**
|
87 |
* This method initializes jPanel
|
88 |
*
|
89 |
* @return javax.swing.JPanel
|
90 |
*/
|
91 |
private javax.swing.JPanel getJPanelTxt() {
|
92 |
if (jPanelTxt == null) { |
93 |
jPanelTxt = new javax.swing.JPanel();
|
94 |
jPanelTxt.setLayout(new GridBagLayout()); |
95 |
jPanelTxt.setBorder(javax.swing.BorderFactory.createTitledBorder( |
96 |
null, Messages.getText("description"), |
97 |
javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, |
98 |
javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null)); |
99 |
GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); |
100 |
gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL;
|
101 |
gridBagConstraints1.anchor = GridBagConstraints.WEST;
|
102 |
gridBagConstraints1.gridx = 0;
|
103 |
gridBagConstraints1.gridy = 0;
|
104 |
gridBagConstraints1.weightx = 1.0;
|
105 |
gridBagConstraints1.weighty = 0.0;
|
106 |
gridBagConstraints1.insets = new java.awt.Insets(2,2,2,2); |
107 |
jPanelTxt.add(getJPanelName(), gridBagConstraints1); |
108 |
|
109 |
gridBagConstraints1.fill = GridBagConstraints.BOTH;
|
110 |
gridBagConstraints1.anchor = GridBagConstraints.CENTER;
|
111 |
gridBagConstraints1.gridx = 0;
|
112 |
gridBagConstraints1.gridy = 1;
|
113 |
gridBagConstraints1.weightx = 1.0;
|
114 |
gridBagConstraints1.weighty = 1.0;
|
115 |
jPanelTxt.add(getJScrollPane(), gridBagConstraints1); |
116 |
} |
117 |
|
118 |
return jPanelTxt;
|
119 |
} |
120 |
|
121 |
/**
|
122 |
* This method initializes jPanel
|
123 |
*
|
124 |
* @return javax.swing.JPanel
|
125 |
*/
|
126 |
private javax.swing.JPanel getJPanelName() {
|
127 |
if (jPanelName == null) { |
128 |
jPanelName = new javax.swing.JPanel();
|
129 |
jPanelName.setLayout(new FlowLayout(FlowLayout.LEFT, 2, 1)); |
130 |
jPanelName.add(getJLabelName()); |
131 |
jPanelName.add(getJLabelTitle()); |
132 |
} |
133 |
return jPanelName;
|
134 |
} |
135 |
|
136 |
/**
|
137 |
* This method initializes txtAbstract
|
138 |
* @return javax.swing.JTextArea
|
139 |
*/
|
140 |
public javax.swing.JTextArea getTxtAbstract() {
|
141 |
if (txtAbstract == null) { |
142 |
txtAbstract = new javax.swing.JTextArea();
|
143 |
txtAbstract.setWrapStyleWord(true);
|
144 |
txtAbstract.setColumns(30);
|
145 |
txtAbstract.setLineWrap(true);
|
146 |
} |
147 |
return txtAbstract;
|
148 |
} |
149 |
|
150 |
/**
|
151 |
* This method initializes jScrollPane
|
152 |
* @return javax.swing.JScrollPane
|
153 |
*/
|
154 |
private javax.swing.JScrollPane getJScrollPane() {
|
155 |
if (jScrollPane == null) { |
156 |
jScrollPane = new javax.swing.JScrollPane();
|
157 |
jScrollPane.setViewportView(getTxtAbstract()); |
158 |
} |
159 |
|
160 |
return jScrollPane;
|
161 |
} |
162 |
|
163 |
/**
|
164 |
* This method initializes jLabelName
|
165 |
*
|
166 |
* @return javax.swing.JLabel
|
167 |
*/
|
168 |
private javax.swing.JLabel getJLabelName() {
|
169 |
if (jLabelName == null) { |
170 |
jLabelName = new javax.swing.JLabel();
|
171 |
jLabelName.setText(Messages.getText("name") + ":"); |
172 |
} |
173 |
|
174 |
return jLabelName;
|
175 |
} |
176 |
|
177 |
/**
|
178 |
* This method initializes lblTitle
|
179 |
*
|
180 |
* @return javax.swing.JLabel
|
181 |
*/
|
182 |
public javax.swing.JLabel getJLabelTitle() {
|
183 |
if (lblTitle == null) { |
184 |
lblTitle = new javax.swing.JLabel();
|
185 |
lblTitle.setText("-");
|
186 |
} |
187 |
|
188 |
return lblTitle;
|
189 |
} |
190 |
} |