Revision 44408 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

View differences:

SelectAttributesPanelView.java
1 1
package org.gvsig.export.swing.impl.panels;
2

  
2 3
import com.jeta.open.i18n.I18NUtils;
3 4
import com.jgoodies.forms.layout.CellConstraints;
4 5
import com.jgoodies.forms.layout.FormLayout;
......
6 7
import java.awt.ComponentOrientation;
7 8
import java.awt.Container;
8 9
import java.awt.Dimension;
9
import java.awt.event.WindowAdapter;
10
import java.awt.event.WindowEvent;
11 10
import javax.swing.Box;
12 11
import javax.swing.ImageIcon;
12
import javax.swing.JButton;
13 13
import javax.swing.JFrame;
14 14
import javax.swing.JLabel;
15 15
import javax.swing.JPanel;
16 16
import javax.swing.JScrollPane;
17 17
import javax.swing.JTable;
18
import javax.swing.JTextField;
19
import javax.swing.border.EmptyBorder;
18 20

  
19 21

  
20 22
public class SelectAttributesPanelView extends JPanel
......
22 24
   JLabel lblHeader = new JLabel();
23 25
   JPanel jplAttributes = new JPanel();
24 26
   JTable tblAttributes = new JTable();
27
   JButton btnFilter = new JButton();
28
   JTextField txtFilter = new JTextField();
29
   JButton btnCheckAll = new JButton();
30
   JButton btnUncheckAll = new JButton();
25 31

  
26 32
   /**
27 33
    * Default constructor
......
32 38
   }
33 39

  
34 40
   /**
35
    * Main method for panel
36
    */
37
   public static void main(String[] args)
38
   {
39
      JFrame frame = new JFrame();
40
      frame.setSize(600, 400);
41
      frame.setLocation(100, 100);
42
      frame.getContentPane().add(new SelectAttributesPanelView());
43
      frame.setVisible(true);
44

  
45
      frame.addWindowListener( new WindowAdapter()
46
      {
47
         public void windowClosing( WindowEvent evt )
48
         {
49
            System.exit(0);
50
         }
51
      });
52
   }
53

  
54
   /**
55 41
    * Adds fill components to empty cells in the first row and first column of the grid.
56 42
    * This ensures that the grid spacing will be the same as shown in the designer.
57 43
    * @param cols an array of column indices in the first row where fill components should be added.
......
133 119
   public JPanel createPanel()
134 120
   {
135 121
      JPanel jpanel1 = new JPanel();
136
      FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:8DLU: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:53DLU:NONE,CENTER:2DLU:NONE");
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");
137 123
      CellConstraints cc = new CellConstraints();
138 124
      jpanel1.setLayout(formlayout1);
139 125

  
140 126
      lblHeader.setName("lblHeader");
141 127
      lblHeader.setText("_Select_name_type_size_and_attributes_to_export");
142
      jpanel1.add(lblHeader,cc.xywh(2,2,3,1));
128
      jpanel1.add(lblHeader,cc.xywh(2,2,2,1));
143 129

  
144 130
      jplAttributes.setAutoscrolls(true);
145 131
      jplAttributes.setName("jplAttributes");
146
      jpanel1.add(jplAttributes,cc.xy(4,5));
132
      jpanel1.add(jplAttributes,cc.xy(3,9));
147 133

  
148 134
      tblAttributes.setName("tblAttributes");
135
      tblAttributes.setShowVerticalLines(false);
149 136
      JScrollPane jscrollpane1 = new JScrollPane();
150 137
      jscrollpane1.setViewportView(tblAttributes);
151 138
      jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
152 139
      jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
153
      jpanel1.add(jscrollpane1,cc.xy(4,4));
140
      jpanel1.add(jscrollpane1,cc.xy(3,6));
154 141

  
155
      addFillComponents(jpanel1,new int[]{ 1,2,3,4,5 },new int[]{ 1,2,3,4,5,6 });
142
      jpanel1.add(createPanel1(),cc.xy(3,4));
143
      jpanel1.add(createPanel2(),cc.xy(3,8));
144
      addFillComponents(jpanel1,new int[]{ 1,2,3,4 },new int[]{ 1,2,3,4,5,6,7,8,9,10 });
156 145
      return jpanel1;
157 146
   }
158 147

  
148
   public JPanel createPanel1()
149
   {
150
      JPanel jpanel1 = new JPanel();
151
      FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE");
152
      CellConstraints cc = new CellConstraints();
153
      jpanel1.setLayout(formlayout1);
154

  
155
      btnFilter.setActionCommand("JButton");
156
      btnFilter.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-filter.png"));
157
      btnFilter.setName("btnFilter");
158
      EmptyBorder emptyborder1 = new EmptyBorder(2,2,2,2);
159
      btnFilter.setBorder(emptyborder1);
160
      jpanel1.add(btnFilter,cc.xy(3,1));
161

  
162
      txtFilter.setName("txtFilter");
163
      jpanel1.add(txtFilter,cc.xy(1,1));
164

  
165
      addFillComponents(jpanel1,new int[]{ 2 },new int[0]);
166
      return jpanel1;
167
   }
168

  
169
   public JPanel createPanel2()
170
   {
171
      JPanel jpanel1 = new JPanel();
172
      FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0)","CENTER:DEFAULT:NONE");
173
      CellConstraints cc = new CellConstraints();
174
      jpanel1.setLayout(formlayout1);
175

  
176
      btnCheckAll.setActionCommand("JButton");
177
      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
      btnCheckAll.setName("btnCheckAll");
179
      EmptyBorder emptyborder1 = new EmptyBorder(0,0,0,0);
180
      btnCheckAll.setBorder(emptyborder1);
181
      jpanel1.add(btnCheckAll,cc.xy(1,1));
182

  
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));
189

  
190
      addFillComponents(jpanel1,new int[]{ 3 },new int[0]);
191
      return jpanel1;
192
   }
193

  
159 194
   /**
160 195
    * Initializer
161 196
    */

Also available in: Unified diff