Revision 44860 trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.impl/src/main/java/org/gvsig/export/swing/impl/panels/SelectAttributesPanelView.java
SelectAttributesPanelView.java | ||
---|---|---|
1 | 1 |
package org.gvsig.export.swing.impl.panels; |
2 |
|
|
3 | 2 |
import com.jeta.open.i18n.I18NUtils; |
4 | 3 |
import com.jgoodies.forms.layout.CellConstraints; |
5 | 4 |
import com.jgoodies.forms.layout.FormLayout; |
... | ... | |
7 | 6 |
import java.awt.ComponentOrientation; |
8 | 7 |
import java.awt.Container; |
9 | 8 |
import java.awt.Dimension; |
9 |
import java.awt.event.WindowAdapter; |
|
10 |
import java.awt.event.WindowEvent; |
|
10 | 11 |
import javax.swing.Box; |
11 | 12 |
import javax.swing.ImageIcon; |
12 | 13 |
import javax.swing.JButton; |
... | ... | |
26 | 27 |
JTable tblAttributes = new JTable(); |
27 | 28 |
JButton btnFilter = new JButton(); |
28 | 29 |
JTextField txtFilter = new JTextField(); |
30 |
JButton btnUncheckAll = new JButton(); |
|
29 | 31 |
JButton btnCheckAll = new JButton(); |
30 |
JButton btnUncheckAll = new JButton();
|
|
32 |
JLabel lblMessage = new JLabel();
|
|
31 | 33 |
|
32 | 34 |
/** |
33 | 35 |
* Default constructor |
... | ... | |
38 | 40 |
} |
39 | 41 |
|
40 | 42 |
/** |
43 |
* Main method for panel |
|
44 |
*/ |
|
45 |
public static void main(String[] args) |
|
46 |
{ |
|
47 |
JFrame frame = new JFrame(); |
|
48 |
frame.setSize(600, 400); |
|
49 |
frame.setLocation(100, 100); |
|
50 |
frame.getContentPane().add(new SelectAttributesPanelView()); |
|
51 |
frame.setVisible(true); |
|
52 |
|
|
53 |
frame.addWindowListener( new WindowAdapter() |
|
54 |
{ |
|
55 |
public void windowClosing( WindowEvent evt ) |
|
56 |
{ |
|
57 |
System.exit(0); |
|
58 |
} |
|
59 |
}); |
|
60 |
} |
|
61 |
|
|
62 |
/** |
|
41 | 63 |
* Adds fill components to empty cells in the first row and first column of the grid. |
42 | 64 |
* This ensures that the grid spacing will be the same as shown in the designer. |
43 | 65 |
* @param cols an array of column indices in the first row where fill components should be added. |
... | ... | |
119 | 141 |
public JPanel createPanel() |
120 | 142 |
{ |
121 | 143 |
JPanel jpanel1 = new JPanel(); |
122 |
FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:8DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE","CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:4DLU:NONE,FILL:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:53DLU:NONE,CENTER:2DLU:NONE");
|
|
144 |
FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:8DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE","CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:4DLU:NONE,FILL:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:20DLU:NONE,CENTER:2DLU:NONE");
|
|
123 | 145 |
CellConstraints cc = new CellConstraints(); |
124 | 146 |
jpanel1.setLayout(formlayout1); |
125 | 147 |
|
... | ... | |
169 | 191 |
public JPanel createPanel2() |
170 | 192 |
{ |
171 | 193 |
JPanel jpanel1 = new JPanel(); |
172 |
FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0)","CENTER:DEFAULT:NONE");
|
|
194 |
FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0)","CENTER:DEFAULT:NONE,CENTER:69PX:NONE");
|
|
173 | 195 |
CellConstraints cc = new CellConstraints(); |
174 | 196 |
jpanel1.setLayout(formlayout1); |
175 | 197 |
|
198 |
btnUncheckAll.setActionCommand("JButton"); |
|
199 |
btnUncheckAll.setIcon(loadImage("org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.impl/src/main/resources/images/export-to/common-check-off.png")); |
|
200 |
btnUncheckAll.setName("btnUncheckAll"); |
|
201 |
EmptyBorder emptyborder1 = new EmptyBorder(0,0,0,0); |
|
202 |
btnUncheckAll.setBorder(emptyborder1); |
|
203 |
jpanel1.add(btnUncheckAll,cc.xy(2,1)); |
|
204 |
|
|
176 | 205 |
btnCheckAll.setActionCommand("JButton"); |
177 | 206 |
btnCheckAll.setIcon(loadImage("org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.impl/src/main/resources/images/export-to/common-check-on.png")); |
178 | 207 |
btnCheckAll.setName("btnCheckAll"); |
179 |
EmptyBorder emptyborder1 = new EmptyBorder(0,0,0,0);
|
|
180 |
btnCheckAll.setBorder(emptyborder1);
|
|
208 |
EmptyBorder emptyborder2 = new EmptyBorder(0,0,0,0);
|
|
209 |
btnCheckAll.setBorder(emptyborder2);
|
|
181 | 210 |
jpanel1.add(btnCheckAll,cc.xy(1,1)); |
182 | 211 |
|
183 |
btnUncheckAll.setActionCommand("JButton"); |
|
184 |
btnUncheckAll.setIcon(loadImage("org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.impl/src/main/resources/images/export-to/common-check-off.png")); |
|
185 |
btnUncheckAll.setName("btnUncheckAll"); |
|
186 |
EmptyBorder emptyborder2 = new EmptyBorder(0,0,0,0); |
|
187 |
btnUncheckAll.setBorder(emptyborder2); |
|
188 |
jpanel1.add(btnUncheckAll,cc.xy(2,1)); |
|
212 |
lblMessage.setName("lblMessage"); |
|
213 |
jpanel1.add(lblMessage,cc.xywh(1,2,4,1)); |
|
189 | 214 |
|
190 |
addFillComponents(jpanel1,new int[]{ 3 },new int[0]); |
|
215 |
addFillComponents(jpanel1,new int[]{ 3,4 },new int[0]);
|
|
191 | 216 |
return jpanel1; |
192 | 217 |
} |
193 | 218 |
|
Also available in: Unified diff