svn-gvsig-desktop / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / project / documents / gui / ListManagerSkin.java @ 28407
History | View | Annotate | Download (4.64 KB)
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2004 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 com.iver.cit.gvsig.project.documents.gui; |
20 |
|
21 |
import java.awt.BorderLayout; |
22 |
import java.awt.Dimension; |
23 |
import java.awt.FlowLayout; |
24 |
import java.awt.GridLayout; |
25 |
|
26 |
import javax.swing.JList; |
27 |
import javax.swing.JPanel; |
28 |
import javax.swing.JScrollPane; |
29 |
|
30 |
import org.gvsig.gui.beans.swing.JButton; |
31 |
|
32 |
import com.iver.andami.PluginServices; |
33 |
import com.iver.utiles.listManager.ListManager; |
34 |
public class ListManagerSkin extends JPanel { |
35 |
|
36 |
private JScrollPane jScrollPane = null; |
37 |
private JPanel jPanel = null; |
38 |
private JButton jButtonDown = null; |
39 |
private JButton jButtonUp = null; |
40 |
private JButton jButtonAdd = null; |
41 |
private JButton jButtonDel = null; |
42 |
|
43 |
private ListManager listManager;// = new ListManager(); |
44 |
|
45 |
private JList jList = null; |
46 |
private JPanel jPanel1 = null; |
47 |
/**
|
48 |
* This method initializes jScrollPane
|
49 |
*
|
50 |
* @return javax.swing.JScrollPane
|
51 |
*/
|
52 |
private JScrollPane getJScrollPane() { |
53 |
if (jScrollPane == null) { |
54 |
jScrollPane = new JScrollPane(); |
55 |
jScrollPane.setViewportView(getJList()); |
56 |
} |
57 |
return jScrollPane;
|
58 |
} |
59 |
/**
|
60 |
* This method initializes jPanel
|
61 |
*
|
62 |
* @return javax.swing.JPanel
|
63 |
*/
|
64 |
private JPanel getJPanel() { |
65 |
if (jPanel == null) { |
66 |
jPanel = new JPanel(); |
67 |
FlowLayout flowLayout = new FlowLayout(); |
68 |
flowLayout.setAlignment(FlowLayout.RIGHT);
|
69 |
jPanel.setLayout(flowLayout); |
70 |
jPanel.add(getJPanel1(), null);
|
71 |
} |
72 |
return jPanel;
|
73 |
} |
74 |
/**
|
75 |
* This method initializes jButton
|
76 |
*
|
77 |
* @return javax.swing.JButton
|
78 |
*/
|
79 |
private JButton getJButtonDown() { |
80 |
if (jButtonDown == null) { |
81 |
jButtonDown = new JButton("abajo"); |
82 |
jButtonDown.setText(PluginServices.getText(this, "abajo")); |
83 |
} |
84 |
return jButtonDown;
|
85 |
} |
86 |
/**
|
87 |
* This method initializes jButton1
|
88 |
*
|
89 |
* @return javax.swing.JButton
|
90 |
*/
|
91 |
private JButton getJButtonUp() { |
92 |
if (jButtonUp == null) { |
93 |
jButtonUp = new JButton("arriba"); |
94 |
jButtonUp.setText(PluginServices.getText(this, "arriba")); |
95 |
} |
96 |
return jButtonUp;
|
97 |
} |
98 |
/**
|
99 |
* This method initializes jButton2
|
100 |
*
|
101 |
* @return javax.swing.JButton
|
102 |
*/
|
103 |
private JButton getJButtonAdd() { |
104 |
if (jButtonAdd == null) { |
105 |
jButtonAdd = new JButton("A?adir"); |
106 |
jButtonAdd.setText(PluginServices.getText(this, "Anadir")); |
107 |
} |
108 |
return jButtonAdd;
|
109 |
} |
110 |
/**
|
111 |
* This method initializes jButton3
|
112 |
*
|
113 |
* @return javax.swing.JButton
|
114 |
*/
|
115 |
private JButton getJButtonDel() { |
116 |
if (jButtonDel == null) { |
117 |
jButtonDel = new JButton("Eliminar"); |
118 |
jButtonDel.setText(PluginServices.getText(this, "Eliminar")); |
119 |
} |
120 |
return jButtonDel;
|
121 |
} |
122 |
/**
|
123 |
* This method initializes jList
|
124 |
*
|
125 |
* @return javax.swing.JList
|
126 |
*/
|
127 |
private JList getJList() { |
128 |
if (jList == null) { |
129 |
jList = new JList(); |
130 |
} |
131 |
return jList;
|
132 |
} |
133 |
/**
|
134 |
* This is the default constructor
|
135 |
*/
|
136 |
public ListManagerSkin(boolean down) { |
137 |
super();
|
138 |
listManager = new ListManager(down);
|
139 |
initialize(); |
140 |
} |
141 |
/**
|
142 |
* This method initializes this
|
143 |
*
|
144 |
* @return void
|
145 |
*/
|
146 |
private void initialize() { |
147 |
this.setLayout(new BorderLayout()); |
148 |
this.setSize(421, 349); |
149 |
this.add(getJScrollPane(), BorderLayout.CENTER); |
150 |
this.add(getJPanel(), BorderLayout.EAST); |
151 |
listManager.setBtnDown(getJButtonDown()); |
152 |
listManager.setBtnUp(getJButtonUp()); |
153 |
listManager.setBtnAdd(getJButtonAdd()); |
154 |
listManager.setBtnDel(getJButtonDel()); |
155 |
listManager.setList(getJList()); |
156 |
listManager.initialize(); |
157 |
|
158 |
} |
159 |
/**
|
160 |
* @return Returns the listManager.
|
161 |
*/
|
162 |
public ListManager getListManager() {
|
163 |
return listManager;
|
164 |
} |
165 |
/**
|
166 |
* This method initializes jPanel1
|
167 |
*
|
168 |
* @return javax.swing.JPanel
|
169 |
*/
|
170 |
private JPanel getJPanel1() { |
171 |
if (jPanel1 == null) { |
172 |
jPanel1 = new JPanel(new GridLayout(6, 1, 5, 5)); |
173 |
|
174 |
jPanel1.setPreferredSize(new Dimension(100,180)); |
175 |
jPanel1.add(getJButtonAdd(), null);
|
176 |
jPanel1.add(getJButtonDel(), null);
|
177 |
jPanel1.add(getJButtonUp(), null);
|
178 |
jPanel1.add(getJButtonDown(), null);
|
179 |
} |
180 |
return jPanel1;
|
181 |
} |
182 |
} // @jve:decl-index=0:visual-constraint="10,10"
|