root / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / project / documents / gui / ListManagerSkin.java @ 13797
History | View | Annotate | Download (4.64 KB)
1 | 7304 | caballero | /* 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 | 13541 | bsanchez | import java.awt.Dimension; |
23 | 7304 | caballero | 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 | 13541 | bsanchez | private JButton jButtonDown = null; |
39 | private JButton jButtonUp = null; |
||
40 | private JButton jButtonAdd = null; |
||
41 | private JButton jButtonDel = null; |
||
42 | 7304 | caballero | |
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 | 13541 | bsanchez | FlowLayout flowLayout = new FlowLayout(); |
68 | flowLayout.setAlignment(FlowLayout.RIGHT);
|
||
69 | jPanel.setLayout(flowLayout); |
||
70 | 7304 | caballero | jPanel.add(getJPanel1(), null);
|
71 | } |
||
72 | return jPanel;
|
||
73 | } |
||
74 | /**
|
||
75 | * This method initializes jButton
|
||
76 | *
|
||
77 | * @return javax.swing.JButton
|
||
78 | */
|
||
79 | 13541 | bsanchez | private JButton getJButtonDown() { |
80 | if (jButtonDown == null) { |
||
81 | jButtonDown = new JButton("abajo"); |
||
82 | jButtonDown.setText(PluginServices.getText(this, "abajo")); |
||
83 | 7304 | caballero | } |
84 | 13541 | bsanchez | return jButtonDown;
|
85 | 7304 | caballero | } |
86 | /**
|
||
87 | * This method initializes jButton1
|
||
88 | *
|
||
89 | * @return javax.swing.JButton
|
||
90 | */
|
||
91 | 13541 | bsanchez | private JButton getJButtonUp() { |
92 | if (jButtonUp == null) { |
||
93 | jButtonUp = new JButton("arriba"); |
||
94 | jButtonUp.setText(PluginServices.getText(this, "arriba")); |
||
95 | 7304 | caballero | } |
96 | 13541 | bsanchez | return jButtonUp;
|
97 | 7304 | caballero | } |
98 | /**
|
||
99 | * This method initializes jButton2
|
||
100 | *
|
||
101 | * @return javax.swing.JButton
|
||
102 | */
|
||
103 | 13541 | bsanchez | private JButton getJButtonAdd() { |
104 | if (jButtonAdd == null) { |
||
105 | jButtonAdd = new JButton("A?adir"); |
||
106 | jButtonAdd.setText(PluginServices.getText(this, "Anadir")); |
||
107 | 7304 | caballero | } |
108 | 13541 | bsanchez | return jButtonAdd;
|
109 | 7304 | caballero | } |
110 | /**
|
||
111 | * This method initializes jButton3
|
||
112 | *
|
||
113 | * @return javax.swing.JButton
|
||
114 | */
|
||
115 | 13541 | bsanchez | private JButton getJButtonDel() { |
116 | if (jButtonDel == null) { |
||
117 | jButtonDel = new JButton("Eliminar"); |
||
118 | jButtonDel.setText(PluginServices.getText(this, "Eliminar")); |
||
119 | 7304 | caballero | } |
120 | 13541 | bsanchez | return jButtonDel;
|
121 | 7304 | caballero | } |
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 | 13541 | bsanchez | 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 | 7304 | caballero | 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 | 13541 | bsanchez | 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 | 7304 | caballero | } |
180 | return jPanel1;
|
||
181 | } |
||
182 | } // @jve:decl-index=0:visual-constraint="10,10" |