Revision 44386 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/SelectFormatPanelView.java
SelectFormatPanelView.java | ||
---|---|---|
1 | 1 |
package org.gvsig.export.swing.impl.panels; |
2 | 2 |
|
3 |
import com.jeta.open.i18n.I18NUtils; |
|
4 | 3 |
import com.jgoodies.forms.layout.CellConstraints; |
5 | 4 |
import com.jgoodies.forms.layout.FormLayout; |
6 | 5 |
import java.awt.BorderLayout; |
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; |
13 |
import javax.swing.JButton; |
|
12 | 14 |
import javax.swing.JFrame; |
13 | 15 |
import javax.swing.JLabel; |
14 | 16 |
import javax.swing.JList; |
... | ... | |
23 | 25 |
JList lstServices = new JList(); |
24 | 26 |
JTextArea txtDescription = new JTextArea(); |
25 | 27 |
JLabel lblEmpty = new JLabel(); |
28 |
JButton btnBookmark = new JButton(); |
|
29 |
JButton btnHistory = new JButton(); |
|
26 | 30 |
|
27 | 31 |
/** |
28 | 32 |
* Default constructor |
... | ... | |
33 | 37 |
} |
34 | 38 |
|
35 | 39 |
/** |
40 |
* Main method for panel |
|
41 |
*/ |
|
42 |
public static void main(String[] args) |
|
43 |
{ |
|
44 |
JFrame frame = new JFrame(); |
|
45 |
frame.setSize(600, 400); |
|
46 |
frame.setLocation(100, 100); |
|
47 |
frame.getContentPane().add(new SelectFormatPanelView()); |
|
48 |
frame.setVisible(true); |
|
49 |
|
|
50 |
frame.addWindowListener( new WindowAdapter() |
|
51 |
{ |
|
52 |
public void windowClosing( WindowEvent evt ) |
|
53 |
{ |
|
54 |
System.exit(0); |
|
55 |
} |
|
56 |
}); |
|
57 |
} |
|
58 |
|
|
59 |
/** |
|
36 | 60 |
* Adds fill components to empty cells in the first row and first column of the grid. |
37 | 61 |
* This ensures that the grid spacing will be the same as shown in the designer. |
38 | 62 |
* @param cols an array of column indices in the first row where fill components should be added. |
... | ... | |
114 | 138 |
public JPanel createPanel() |
115 | 139 |
{ |
116 | 140 |
JPanel jpanel1 = new JPanel(); |
117 |
FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE,FILL:DEFAULT:GROW(0.8),CENTER:DEFAULT:NONE,FILL:DEFAULT:GROW(0.2),CENTER:DEFAULT:NONE");
|
|
141 |
FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE,CENTER:7PX:NONE,FILL:DEFAULT:GROW(0.5),CENTER:DEFAULT:NONE,FILL:DEFAULT:GROW(0.1),CENTER:DEFAULT:NONE");
|
|
118 | 142 |
CellConstraints cc = new CellConstraints(); |
119 | 143 |
jpanel1.setLayout(formlayout1); |
120 | 144 |
|
... | ... | |
123 | 147 |
jscrollpane1.setViewportView(lstServices); |
124 | 148 |
jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); |
125 | 149 |
jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); |
126 |
jpanel1.add(jscrollpane1,cc.xy(2,2));
|
|
150 |
jpanel1.add(jscrollpane1,cc.xy(2,3));
|
|
127 | 151 |
|
128 | 152 |
txtDescription.setEditable(false); |
129 | 153 |
txtDescription.setName("txtDescription"); |
... | ... | |
133 | 157 |
jscrollpane2.setViewportView(txtDescription); |
134 | 158 |
jscrollpane2.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); |
135 | 159 |
jscrollpane2.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); |
136 |
jpanel1.add(jscrollpane2,cc.xy(2,4));
|
|
160 |
jpanel1.add(jscrollpane2,cc.xy(2,5));
|
|
137 | 161 |
|
138 | 162 |
lblEmpty.setName("lblEmpty"); |
139 |
jpanel1.add(lblEmpty,cc.xy(2,5));
|
|
163 |
jpanel1.add(lblEmpty,cc.xy(2,6));
|
|
140 | 164 |
|
141 |
addFillComponents(jpanel1,new int[]{ 1,2,3 },new int[]{ 1,2,3,4,5 }); |
|
165 |
jpanel1.add(createPanel1(),new CellConstraints(2,1,1,1,CellConstraints.RIGHT,CellConstraints.DEFAULT)); |
|
166 |
addFillComponents(jpanel1,new int[]{ 1,2,3 },new int[]{ 1,2,3,4,5,6 }); |
|
142 | 167 |
return jpanel1; |
143 | 168 |
} |
144 | 169 |
|
170 |
public JPanel createPanel1() |
|
171 |
{ |
|
172 |
JPanel jpanel1 = new JPanel(); |
|
173 |
FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:7PX:NONE,FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE"); |
|
174 |
CellConstraints cc = new CellConstraints(); |
|
175 |
jpanel1.setLayout(formlayout1); |
|
176 |
|
|
177 |
btnBookmark.setName("btnBookmark"); |
|
178 |
EmptyBorder emptyborder1 = new EmptyBorder(0,0,0,0); |
|
179 |
btnBookmark.setBorder(emptyborder1); |
|
180 |
jpanel1.add(btnBookmark,cc.xy(3,1)); |
|
181 |
|
|
182 |
btnHistory.setName("btnHistory"); |
|
183 |
EmptyBorder emptyborder2 = new EmptyBorder(0,0,0,0); |
|
184 |
btnHistory.setBorder(emptyborder2); |
|
185 |
jpanel1.add(btnHistory,cc.xy(1,1)); |
|
186 |
|
|
187 |
addFillComponents(jpanel1,new int[]{ 2 },new int[0]); |
|
188 |
return jpanel1; |
|
189 |
} |
|
190 |
|
|
145 | 191 |
/** |
146 | 192 |
* Initializer |
147 | 193 |
*/ |
Also available in: Unified diff