svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.app / org.gvsig.app.mainplugin / src / main / java / org / gvsig / app / project / documents / gui / ListManagerSkin.java @ 40558
History | View | Annotate | Download (5.47 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
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 3
|
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 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
package org.gvsig.app.project.documents.gui; |
25 |
|
26 |
import java.awt.BorderLayout; |
27 |
import java.awt.Dimension; |
28 |
import java.awt.FlowLayout; |
29 |
import java.awt.GridLayout; |
30 |
|
31 |
import javax.swing.JList; |
32 |
import javax.swing.JPanel; |
33 |
import javax.swing.JScrollPane; |
34 |
|
35 |
import org.gvsig.andami.PluginServices; |
36 |
import org.gvsig.gui.beans.swing.JButton; |
37 |
import org.gvsig.utils.listManager.ListManager; |
38 |
|
39 |
public class ListManagerSkin extends JPanel { |
40 |
|
41 |
private static final long serialVersionUID = 5194138202300759734L; |
42 |
private JScrollPane jScrollPane = null; |
43 |
private JPanel jPanel = null; |
44 |
private JButton jButtonDown = null; |
45 |
private JButton jButtonUp = null; |
46 |
private JButton jButtonAdd = null; |
47 |
private JButton jButtonDel = null; |
48 |
|
49 |
private ListManager listManager;// = new ListManager(); |
50 |
|
51 |
private JList jList = null; |
52 |
private JPanel jPanel1 = null; |
53 |
|
54 |
/**
|
55 |
* This method initializes jScrollPane
|
56 |
*
|
57 |
* @return javax.swing.JScrollPane
|
58 |
*/
|
59 |
private JScrollPane getJScrollPane() { |
60 |
if (jScrollPane == null) { |
61 |
jScrollPane = new JScrollPane(); |
62 |
jScrollPane.setViewportView(getJList()); |
63 |
} |
64 |
return jScrollPane;
|
65 |
} |
66 |
|
67 |
/**
|
68 |
* This method initializes jPanel
|
69 |
*
|
70 |
* @return javax.swing.JPanel
|
71 |
*/
|
72 |
private JPanel getJPanel() { |
73 |
if (jPanel == null) { |
74 |
jPanel = new JPanel(); |
75 |
FlowLayout flowLayout = new FlowLayout(); |
76 |
flowLayout.setAlignment(FlowLayout.RIGHT);
|
77 |
jPanel.setLayout(flowLayout); |
78 |
jPanel.add(getJPanel1(), null);
|
79 |
} |
80 |
return jPanel;
|
81 |
} |
82 |
|
83 |
/**
|
84 |
* This method initializes jButton
|
85 |
*
|
86 |
* @return javax.swing.JButton
|
87 |
*/
|
88 |
private JButton getJButtonDown() { |
89 |
if (jButtonDown == null) { |
90 |
jButtonDown = new JButton("abajo"); |
91 |
jButtonDown.setText(PluginServices.getText(this, "abajo")); |
92 |
} |
93 |
return jButtonDown;
|
94 |
} |
95 |
|
96 |
/**
|
97 |
* This method initializes jButton1
|
98 |
*
|
99 |
* @return javax.swing.JButton
|
100 |
*/
|
101 |
private JButton getJButtonUp() { |
102 |
if (jButtonUp == null) { |
103 |
jButtonUp = new JButton("arriba"); |
104 |
jButtonUp.setText(PluginServices.getText(this, "arriba")); |
105 |
} |
106 |
return jButtonUp;
|
107 |
} |
108 |
|
109 |
/**
|
110 |
* This method initializes jButton2
|
111 |
*
|
112 |
* @return javax.swing.JButton
|
113 |
*/
|
114 |
private JButton getJButtonAdd() { |
115 |
if (jButtonAdd == null) { |
116 |
jButtonAdd = new JButton("A?adir"); |
117 |
jButtonAdd.setText(PluginServices.getText(this, "Anadir")); |
118 |
} |
119 |
return jButtonAdd;
|
120 |
} |
121 |
|
122 |
/**
|
123 |
* This method initializes jButton3
|
124 |
*
|
125 |
* @return javax.swing.JButton
|
126 |
*/
|
127 |
private JButton getJButtonDel() { |
128 |
if (jButtonDel == null) { |
129 |
jButtonDel = new JButton("Eliminar"); |
130 |
jButtonDel.setText(PluginServices.getText(this, "Eliminar")); |
131 |
} |
132 |
return jButtonDel;
|
133 |
} |
134 |
|
135 |
/**
|
136 |
* This method initializes jList
|
137 |
*
|
138 |
* @return javax.swing.JList
|
139 |
*/
|
140 |
private JList getJList() { |
141 |
if (jList == null) { |
142 |
jList = new JList(); |
143 |
} |
144 |
return jList;
|
145 |
} |
146 |
|
147 |
/**
|
148 |
* This is the default constructor
|
149 |
*/
|
150 |
public ListManagerSkin(boolean down) { |
151 |
super();
|
152 |
listManager = new ListManager(down);
|
153 |
initialize(); |
154 |
} |
155 |
|
156 |
/**
|
157 |
* This method initializes this
|
158 |
*
|
159 |
* @return void
|
160 |
*/
|
161 |
private void initialize() { |
162 |
this.setLayout(new BorderLayout()); |
163 |
this.setSize(421, 349); |
164 |
this.add(getJScrollPane(), BorderLayout.CENTER); |
165 |
this.add(getJPanel(), BorderLayout.EAST); |
166 |
listManager.setBtnDown(getJButtonDown()); |
167 |
listManager.setBtnUp(getJButtonUp()); |
168 |
listManager.setBtnAdd(getJButtonAdd()); |
169 |
listManager.setBtnDel(getJButtonDel()); |
170 |
listManager.setList(getJList()); |
171 |
listManager.initialize(); |
172 |
|
173 |
} |
174 |
|
175 |
/**
|
176 |
* @return Returns the listManager.
|
177 |
*/
|
178 |
public ListManager getListManager() {
|
179 |
return listManager;
|
180 |
} |
181 |
|
182 |
/**
|
183 |
* This method initializes jPanel1
|
184 |
*
|
185 |
* @return javax.swing.JPanel
|
186 |
*/
|
187 |
private JPanel getJPanel1() { |
188 |
if (jPanel1 == null) { |
189 |
jPanel1 = new JPanel(new GridLayout(6, 1, 5, 5)); |
190 |
|
191 |
jPanel1.setPreferredSize(new Dimension(100, 180)); |
192 |
jPanel1.add(getJButtonAdd(), null);
|
193 |
jPanel1.add(getJButtonDel(), null);
|
194 |
jPanel1.add(getJButtonUp(), null);
|
195 |
jPanel1.add(getJButtonDown(), null);
|
196 |
} |
197 |
return jPanel1;
|
198 |
} |
199 |
} // @jve:decl-index=0:visual-constraint="10,10"
|