Revision 26862

View differences:

trunk/extensions/extExpressionField/src/com/iver/cit/gvsig/project/documents/table/gui/EvalExpressionDialog.java
2 2

  
3 3
import java.awt.BorderLayout;
4 4
import java.awt.Component;
5
import java.awt.GridBagConstraints;
6
import java.awt.GridBagLayout;
7
import java.awt.GridLayout;
8
import java.awt.Insets;
5 9
import java.awt.event.MouseEvent;
6 10
import java.awt.event.MouseListener;
7 11
import java.io.File;
......
111 115
        bg.add(getRbNumber());
112 116
        bg.add(getRbString());
113 117
        bg.add(getRbDate());
114
        this.setLayout(new BorderLayout());
118
        this.setLayout(new GridBagLayout());
115 119
        this.setSize(549, 480);
116
        this.add(getTabPrincipal(), java.awt.BorderLayout.CENTER);
117
        this.add(getPMessage(), java.awt.BorderLayout.NORTH);
118
        this.add(getAcceptCancel(), java.awt.BorderLayout.SOUTH);
120
        GridBagConstraints constr = new GridBagConstraints();
121
        constr.gridwidth = GridBagConstraints.REMAINDER;
122
        constr.gridheight = 1;
123
        constr.fill = GridBagConstraints.BOTH;
124
        constr.ipadx=5;
125
        constr.ipady=5;
126
        constr.weightx=1;
127
        constr.weighty=0.3;
128
//        this.add(getTabPrincipal(), java.awt.BorderLayout.CENTER);
129
//        this.add(getPMessage(), java.awt.BorderLayout.NORTH);
130
//        this.add(getAcceptCancel(), java.awt.BorderLayout.SOUTH);
131
        this.add(getPMessage(), constr);
132
        constr.gridheight = 5;
133
        constr.weighty=1;
134
        this.add(getTabPrincipal(), constr);
135
        GridBagConstraints constr2 = new GridBagConstraints();
136
        constr2.gridwidth = GridBagConstraints.REMAINDER;
137
        constr2.gridheight = 1;
138
        constr2.fill = GridBagConstraints.HORIZONTAL;
139
        constr2.anchor = GridBagConstraints.LAST_LINE_END;
140
        constr2.weightx=1;
141
        constr2.weighty=0;
142

  
143
        this.add(getAcceptCancel(), constr2);
144

  
119 145
    }
120 146
    /**
121 147
     * This method initializes pCentral
......
125 151
    private JPanel getPNorth() {
126 152
        if (pNorth == null) {
127 153
            pNorth = new JPanel();
128
            pNorth.setLayout(new BorderLayout());
129
            pNorth.add(getPNorthEast(), java.awt.BorderLayout.EAST);
130
            pNorth.add(getPNorthCenter(), java.awt.BorderLayout.CENTER);
131
            pNorth.add(getPNorthWest(), java.awt.BorderLayout.WEST);
154
            pNorth.setLayout(new GridBagLayout());
155
            GridBagConstraints contr = new GridBagConstraints();
156
            contr.ipadx = 5;
157
            contr.ipady = 5;
158
            contr.fill = GridBagConstraints.BOTH;
159
            contr.weightx =1;
160
            contr.weighty =1;
161
            pNorth.add(getPNorthWest(), contr);
162

  
163
            contr.fill = GridBagConstraints.VERTICAL;
164
            contr.weightx =0;
165
            contr.weighty =1;
166

  
167
            pNorth.add(getPNorthCenter(), contr);
168

  
169
            contr.fill = GridBagConstraints.BOTH;
170
            contr.weightx =0.5;
171
            contr.weighty =1;
172

  
173
            pNorth.add(getPNorthEast(), contr);
174

  
175

  
176

  
177
//            pNorth.add(getPNorthEast(), java.awt.BorderLayout.EAST);
178
//            pNorth.add(getPNorthCenter(), java.awt.BorderLayout.CENTER);
179
//            pNorth.add(getPNorthWest(), java.awt.BorderLayout.WEST);
132 180
        }
133 181

  
134 182
        return pNorth;
......
141 189
     */
142 190
    private JPanel getPCentral() {
143 191
        if (pCentral == null) {
192
        	StringBuilder tit = new StringBuilder();
193
        	tit.append(PluginServices.getText(this,"expression"));
194
        	tit.append(" ");
195
        	tit.append(PluginServices.getText(this, "column"));
196
        	tit.append(" : ");
197
        	tit.append(evalExpression.getFieldDescriptorSelected().getFieldAlias());
144 198
            pCentral = new JPanel();
199
            pCentral.setLayout(new GridBagLayout());
145 200
            pCentral.setBorder(javax.swing.BorderFactory.createTitledBorder(
146
                    null, PluginServices.getText(this,"expression"),
201
                    null, tit.toString(),
147 202
                    javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
148 203
                    javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
149
            lblColumn = new JLabel();
150
            pCentral.add(lblColumn, null);
151

  
152
            pCentral.add(getJScrollPane(), null);
153
            lblColumn.setText(PluginServices.getText(this, "column") + " : " +
154
                evalExpression.getFieldDescriptorSelected().getFieldAlias());
155
            pCentral.add(getBClear(), null);
204
//            lblColumn = new JLabel();
205
//            pCentral.add(lblColumn, null);
206
//
207
            GridBagConstraints contr = new GridBagConstraints();
208
            contr.gridwidth = GridBagConstraints.REMAINDER;
209
            contr.gridheight = 1;
210
            contr.fill = GridBagConstraints.BOTH;
211
            contr.ipadx = 5;
212
            contr.ipady = 5;
213
            contr.weightx=1;
214
            contr.weighty=1;
215
            pCentral.add(getJScrollPane(), contr);
216
//            lblColumn.setText(PluginServices.getText(this, "column") + " : " +
217
//                evalExpression.getFieldDescriptorSelected().getFieldAlias());
218
            GridBagConstraints contr1 = new GridBagConstraints();
219
            contr1.gridwidth = 1;
220
            contr1.gridheight = 1;
221
            contr1.fill = GridBagConstraints.NONE;
222
            contr1.ipadx = 5;
223
            contr1.ipady = 5;
224
            contr1.anchor = GridBagConstraints.CENTER;
225
            pCentral.add(getBClear(), contr1);
156 226
        }
157 227

  
158 228
        return pCentral;
......
290 360
		if (pMessage == null) {
291 361

  
292 362
			pMessage = new JPanel();
363
			pMessage.setLayout(new GridLayout());
293 364
			pMessage.setBorder(javax.swing.BorderFactory.createTitledBorder(null, PluginServices.getText(this,"information"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
294
			pMessage.setPreferredSize(new java.awt.Dimension(550,120));
365
//			pMessage.setPreferredSize(new java.awt.Dimension(550,120));
295 366
			pMessage.add(getJScrollPane3(), null);
296 367
		}
297 368
		return pMessage;
......
343 414
            }
344 415
        }
345 416
        getListCommand().repaint();
417
        getJScrollPane2().repaint();
418
        getJScrollPane2().doLayout();
419
        this.doLayout();
346 420

  
347 421
    }
348 422
    /**
......
386 460
    }
387 461

  
388 462
    public WindowInfo getWindowInfo() {
389
         WindowInfo wi = new WindowInfo(WindowInfo.MODALDIALOG);
463
         WindowInfo wi = new WindowInfo(WindowInfo.MODALDIALOG+WindowInfo.RESIZABLE);
390 464
        wi.setTitle(PluginServices.getText(this, "calculate_expression"));
391 465

  
466

  
392 467
        return wi;
393 468
    }
394 469

  
......
399 474
     */
400 475
    private JPanel getPNorthEast() {
401 476
        if (pNorthEast == null) {
402
            pNorthEast = new JPanel();
477
            pNorthEast = new JPanel(new GridLayout());
403 478
            pNorthEast.setBorder(javax.swing.BorderFactory.createTitledBorder(
404 479
                    null, PluginServices.getText(this,"commands"),
405 480
                    javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
......
439 514
     */
440 515
    private JPanel getPNorthWest() {
441 516
        if (pNorthWest == null) {
442
            pNorthWest = new JPanel();
517
            pNorthWest = new JPanel(new GridLayout());
443 518
            pNorthWest.setBorder(javax.swing.BorderFactory.createTitledBorder(
444 519
                    null, PluginServices.getText(this,"field"),
445 520
                    javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
......
685 760
		if (pPrincipal == null) {
686 761
			pPrincipal = new JPanel();
687 762
			pPrincipal.setLayout(new BorderLayout());
688
			pPrincipal.setPreferredSize(new java.awt.Dimension(540,252));
763
//			pPrincipal.setPreferredSize(new java.awt.Dimension(540,252));
689 764
			pPrincipal.add(getPNorth(), java.awt.BorderLayout.NORTH);
690 765
			pPrincipal.add(getPCentral(), java.awt.BorderLayout.CENTER);
691 766

  
......
713 788
	 */
714 789
	private JPanel getPAdvancedNorth() {
715 790
		if (pAdvancedNorth == null) {
716
			pAdvancedNorth = new JPanel();
717
			pAdvancedNorth.setPreferredSize(new java.awt.Dimension(873,100));
791
			pAdvancedNorth = new JPanel(new GridBagLayout());
792
//			pAdvancedNorth.setPreferredSize(new java.awt.Dimension(873,100));
718 793
			pAdvancedNorth.setBorder(javax.swing.BorderFactory.createTitledBorder(null, PluginServices.getText(this,"expressions_from_file"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
719
			pAdvancedNorth.add(getJTextField(), null);
794
			GridBagConstraints contr = new GridBagConstraints();
795
			contr.anchor = GridBagConstraints.FIRST_LINE_START;
796
			contr.fill = GridBagConstraints.HORIZONTAL;
797
			contr.weighty =0;
798
			contr.weightx =1;
799
			contr.insets = new Insets(3,3,3,3);
800
			contr.ipadx=5;
801
			contr.ipady=5;
802

  
803
			pAdvancedNorth.add(getJTextField(), contr);
804
			contr.fill = GridBagConstraints.NONE;
805
			contr.weighty =0;
806
			contr.weightx =0;
720 807
			pAdvancedNorth.add(getBFile(), null);
721 808
			pAdvancedNorth.add(getBEval(), null);
722 809
		}

Also available in: Unified diff