Revision 6225

View differences:

trunk/extensions/extAddEventTheme/src/com/iver/gvsig/addeventtheme/gui/AddEventThemePanel.java
47 47
import java.util.ArrayList;
48 48

  
49 49
import javax.swing.DefaultComboBoxModel;
50
import javax.swing.JButton;
51 50
import javax.swing.JComboBox;
52 51
import javax.swing.JDialog;
53 52
import javax.swing.JLabel;
54 53
import javax.swing.JPanel;
55 54

  
56 55
import org.cresques.cts.IProjection;
56
import org.gvsig.gui.beans.AcceptCancelPanel;
57
import org.gvsig.gui.beans.swing.JButton;
57 58

  
58 59
import com.hardcode.driverManager.DriverLoadException;
59 60
import com.hardcode.gdbms.engine.data.DataSource;
......
87 88
    private JComboBox tableComboBox = null;
88 89
    private JComboBox xComboBox = null;
89 90
    private JComboBox yComboBox = null;
90
    private JButton okButton = null;
91
    //private JButton okButton = null;
92
    private AcceptCancelPanel acceptPanel = null;
91 93
    private FMap mapContext;
92 94
    private ArrayList tableList;
93 95
    private String firstCoordinate;
......
126 128
     */
127 129
    private void initialize() {
128 130
        yLabel = new JLabel();
129
        yLabel.setBounds(6, 68, 36, 24);
131
        yLabel.setBounds(6, 68, 90, 23);
130 132
        yLabel.setText(secondCoordinate + ":");
131 133
        xLabel = new JLabel();
132
        xLabel.setBounds(6, 37, 36, 24);
134
        xLabel.setBounds(6, 37, 90, 23);
133 135
        xLabel.setText(firstCoordinate + ":");
134 136
        tableLabel = new JLabel();
135
        tableLabel.setBounds(6, 6, 36, 24);
137
        tableLabel.setBounds(6, 6, 90, 23);
136 138
        tableLabel.setText(PluginServices.getText(this,"Tabla") + ":");
137 139
        this.setLayout(null);
138
        this.setSize(221, 131);
140
        this.setSize(400, 135);
139 141
        this.add(tableLabel, null);
140 142
        this.add(xLabel, null);
141 143
        this.add(yLabel, null);
142 144
        this.add(getTableComboBox(), null);
143 145
        this.add(getXComboBox(), null);
144 146
        this.add(getYComboBox(), null);
145
        this.add(getOkButton(), null);
147
        this.add(getAcceptPanel(), null);
146 148
    }
147 149

  
148 150
    private String[] getTableNames() {
......
244 246
    		tableComboBox = new JComboBox();
245 247
            DefaultComboBoxModel defaultModel = new DefaultComboBoxModel(getTableNames());
246 248
            tableComboBox.setModel(defaultModel);
247
    		tableComboBox.setBounds(43, 6, 161, 24);
249
    		tableComboBox.setBounds(92, 6, 290, 23);
248 250
    		tableComboBox.addItemListener(new java.awt.event.ItemListener() {
249 251
    			public void itemStateChanged(java.awt.event.ItemEvent e) {
250 252
    				System.out.println("itemStateChanged()"); // TODO Auto-generated Event stub itemStateChanged()
......
270 272
    		xComboBox = new JComboBox();
271 273
            DefaultComboBoxModel defaultModel = new DefaultComboBoxModel(getFieldNames());
272 274
            xComboBox.setModel(defaultModel);
273
    		xComboBox.setBounds(43, 37, 161, 24);
275
    		xComboBox.setBounds(92, 37, 290, 23);
274 276
    	}
275 277
    	return xComboBox;
276 278
    }
......
285 287
    		yComboBox = new JComboBox();
286 288
            DefaultComboBoxModel defaultModel = new DefaultComboBoxModel(getFieldNames());
287 289
            yComboBox.setModel(defaultModel);
288
    		yComboBox.setBounds(43, 68, 161, 24);
290
    		yComboBox.setBounds(92, 68, 290, 23);
289 291
    	}
290 292
    	return yComboBox;
291 293
    }
......
295 297
     *
296 298
     * @return javax.swing.JButton
297 299
     */
298
    private JButton getOkButton() {
299
    	if (okButton == null) {
300
    		okButton = new JButton();
301
    		okButton.setBounds(104, 100, 100, 24);
302
    		okButton.addActionListener(new java.awt.event.ActionListener() {
303
    			public void actionPerformed(java.awt.event.ActionEvent e) {
304
    				System.out.println("actionPerformed()"); // TODO Auto-generated Event stub actionPerformed()
305
                    createNewLayerFromDataSource();
306
                    // y sale.
307
                    if (PluginServices.getMainFrame() == null)
308
                        ((JDialog) (getParent().getParent().getParent().getParent())).dispose();
309
                    else
310
                        PluginServices.getMDIManager().closeView(AddEventThemePanel.this);
311
    			}
312
    		});
313
    		okButton.setText(PluginServices.getText(this,"Aceptar"));
300
    private AcceptCancelPanel getAcceptPanel() {
301
    	if (acceptPanel == null) {
302
    		acceptPanel = new AcceptCancelPanel(
303
    				new java.awt.event.ActionListener() {
304
    	    			public void actionPerformed(java.awt.event.ActionEvent e) {
305
    	    				System.out.println("actionPerformed()"); // TODO Auto-generated Event stub actionPerformed()
306
    	                    createNewLayerFromDataSource();
307
    	                    // y sale.
308
    	                    if (PluginServices.getMainFrame() == null)
309
    	                        ((JDialog) (getParent().getParent().getParent().getParent())).dispose();
310
    	                    else
311
    	                        PluginServices.getMDIManager().closeView(AddEventThemePanel.this);
312
    	    			}
313
    	    		},
314
    				new java.awt.event.ActionListener() {
315
    	    			public void actionPerformed(java.awt.event.ActionEvent e) {
316
    	                    if (PluginServices.getMainFrame() == null)
317
    	                        ((JDialog) (getParent().getParent().getParent().getParent())).dispose();
318
    	                    else
319
    	                        PluginServices.getMDIManager().closeView(AddEventThemePanel.this);
320
    	    			}
321
    	    		}
322
    				);
323
    		acceptPanel.setBounds(0, 100, getWidth()-6, 30);
314 324
    	}
315
    	return okButton;
325
    	return acceptPanel;
316 326
    }
317 327
}  //  @jve:decl-index=0:visual-constraint="10,10"

Also available in: Unified diff