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