Revision 38112

View differences:

branches/v2_0_0_prep/libraries/libProjection/src/org/cresques/ui/cts/CSSelectionDialogPanel.java
29 29
import org.cresques.impl.cts.ProjectionPool;
30 30
import org.cresques.ui.DefaultDialogPanel;
31 31

  
32

  
33 32
/**
34 33
 * Dialogo para abrir fichero.
34
 * 
35 35
 * @author "Luis W. Sevilla" <sevilla_lui@gva.es>
36 36
 */
37 37
public class CSSelectionDialogPanel extends DefaultDialogPanel {
38

  
38 39
    final private static long serialVersionUID = -3370601314380922368L;
39 40

  
40
    public CSSelectionDialogPanel() {
41
        super();
42
        init();
43
    }
44

  
45
    /**
46
     * This method initializes this
47
     *
48
     * @return void
49
     */
50
    private void init() {
51
        this.setBounds(0, 0, 350, 260);
52
    }
53

  
54 41
    public CSSelectionPanel getProjPanel() {
55 42
        return (CSSelectionPanel) getContentPanel();
56 43
    }
57 44

  
58 45
    protected JPanel getContentPanel() {
59 46
        if (contentPane == null) {
60
        	contentPane = new CSSelectionPanel(Messages.getText("reference_system"));
61
        	contentPane.setBounds(14, 12, 280, 163);
47
            contentPane =
48
                new CSSelectionPanel(Messages.getText("reference_system"));
62 49

  
63
            ((CSSelectionPanel) contentPane).setProjection(new ProjectionPool().get("EPSG:32619"));
50
            ((CSSelectionPanel) contentPane).setProjection(new ProjectionPool()
51
                .get("EPSG:32619"));
64 52
        }
65 53

  
66 54
        return contentPane;
branches/v2_0_0_prep/libraries/libProjection/src/org/cresques/ui/cts/CSSelectionPanel.java
23 23
 */
24 24
package org.cresques.ui.cts;
25 25

  
26
import java.awt.GridBagConstraints;
27
import java.awt.GridBagLayout;
28
import java.awt.Insets;
29

  
30
import javax.swing.BorderFactory;
31
import javax.swing.JComponent;
26 32
import javax.swing.JLabel;
27 33
import javax.swing.JPanel;
34
import javax.swing.border.TitledBorder;
28 35

  
29 36
import org.cresques.Messages;
30 37
import org.cresques.cts.IProjection;
31 38
import org.cresques.ui.LoadableComboBox;
32 39

  
33

  
34 40
//import es.gva.cit.geoexplorer.ui.LoadableComboBox;
35 41

  
36 42
/**
37 43
 * Panel de edici?n de Sistemas de referencia
44
 * 
38 45
 * @author "Luis W. Sevilla" <sevilla_lui@gva.es>
39 46
 */
40 47
public class CSSelectionPanel extends JPanel {
48

  
41 49
    final private static long serialVersionUID = -3370601314380922368L;
42 50
    private LoadableComboBox datumComboBox = null;
43 51
    private LoadableComboBox projComboBox = null;
......
55 63
        super();
56 64

  
57 65
        if (tit == null) {
58
            //tit = "Sistema de referencia";
59
            //TODO: add com.iver.andami.PluginServices to this project
60
            //change all the labels from fix text got from the internationalitation
61 66
            tit = Messages.getText("reference_system");
62
            if (tit == null) tit="Reference System";
67
            if (tit == null)
68
                tit = "Reference System";
63 69
        }
64 70

  
65 71
        this.tit = tit;
......
69 75

  
70 76
    /**
71 77
     * Inicializa el panel.
78
     * 
72 79
     * @return javax.swing.JPanel
73 80
     */
74 81
    private void initialize() {
75
        setPreferredSize(new java.awt.Dimension(295, 170));
76
        setLayout(null);
82
        setLayout(new GridBagLayout());
83
        GridBagConstraints c = new GridBagConstraints();
84
        c.insets = new Insets(2, 5, 2, 5);
85
        c.gridy = -1;
77 86

  
78
        /*javax.swing.border.Border border = javax.swing.BorderFactory.createCompoundBorder(
79
        javax.swing. BorderFactory.createTitledBorder("Sistema de coordenadas"),
80
        javax.swing.BorderFactory.createEmptyBorder(5,5,5,5)); */
81
        setBorder(javax.swing.BorderFactory.createCompoundBorder(null,
82
                                                                 javax.swing.BorderFactory.createTitledBorder(null,
83
                                                                		 										Messages.getText("reference_system"),
84
                                                                                                              javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
85
                                                                                                              javax.swing.border.TitledBorder.DEFAULT_POSITION,
86
                                                                                                              null,
87
                                                                                                              null)));
87
        setBorder(BorderFactory.createCompoundBorder(null, BorderFactory
88
            .createTitledBorder(null, Messages.getText("reference_system"),
89
                TitledBorder.DEFAULT_JUSTIFICATION,
90
                TitledBorder.DEFAULT_POSITION, null, null)));
88 91

  
89
        jLabel = new JLabel();
90
        jLabel.setBounds(15, 15, 77, 23);
91
        jLabel.setText(Messages.getText("datum") + ":");
92
        add(jLabel, null);
93
        add(getDatumComboBox(), null);
92
        jLabel = new JLabel(Messages.getText("datum") + ":");
93
        addRow(c, jLabel, getDatumComboBox());
94 94

  
95
        jLabel1 = new JLabel();
96
        jLabel1.setBounds(15, 60, 77, 23);
97
        jLabel1.setText(Messages.getText("projection") + ":");
98
        add(jLabel1, null);
99
        add(getProjComboBox(), null);
95
        jLabel1 = new JLabel(Messages.getText("projection") + ":");
96
        addRow(c, jLabel1, getProjComboBox());
100 97

  
101
        jLabel2 = new JLabel();
102
        jLabel2.setBounds(15, 105, 77, 23);
103
        jLabel2.setText(Messages.getText("zone") + ":");
104
        add(jLabel2, null);
105
        add(getHuseComboBox(), null);
98
        jLabel2 = new JLabel(Messages.getText("zone") + ":");
99
        addRow(c, jLabel2, getHuseComboBox());
106 100

  
107 101
        setHuseComboBoxEnabled(false);
108 102
    }
......
136 130

  
137 131
        setDatumComboBoxEnabled(true);
138 132
        getDatumComboBox().setSelectedIndex(model.getSelectedDatum());
139
 
133

  
140 134
        getProjComboBox().removeAllItems();
141 135
        getProjComboBox().loadData(model.getProjectionList());
142 136

  
143 137
        model.setProjection(proj);
144 138
        getProjComboBox().setSelectedIndex(model.getSelectedProj());
145 139
        model.setProjection(proj);
146
        
140

  
147 141
        if (model.getSelectedZone() >= 0) {
148 142
            setHuseComboBoxEnabled(true);
149 143
            getHuseComboBox().removeAllItems();
......
159 153

  
160 154
    /**
161 155
     * Inicializa datumComboBox
162
     *
156
     * 
163 157
     * @return javax.swing.JComboBox
164 158
     */
165 159
    private LoadableComboBox getDatumComboBox() {
166 160
        if (datumComboBox == null) {
167 161
            datumComboBox = new LoadableComboBox();
168
            datumComboBox.setBounds(14, 35, 250, 23);
169 162

  
170
            //			((LoadableComboBox) datumComboBox).loadData(model.getDatumList());
171 163
            datumComboBox.addItemListener(new java.awt.event.ItemListener() {
172
                    public void itemStateChanged(java.awt.event.ItemEvent e) {
173
                        model.setSelectedDatum(e.getItem());
174
                        getProjComboBox().removeAllItems();
175
                        getProjComboBox().loadData(model.getProjectionList());
176
                    }
177
                });
164

  
165
                public void itemStateChanged(java.awt.event.ItemEvent e) {
166
                    model.setSelectedDatum(e.getItem());
167
                    getProjComboBox().removeAllItems();
168
                    getProjComboBox().loadData(model.getProjectionList());
169
                }
170
            });
178 171
        }
179 172

  
180 173
        return datumComboBox;
......
182 175

  
183 176
    /**
184 177
     * Inicializa projComboBox
185
     *
178
     * 
186 179
     * @return javax.swing.JComboBox
187 180
     */
188 181
    private LoadableComboBox getProjComboBox() {
189 182
        if (projComboBox == null) {
190 183
            projComboBox = new LoadableComboBox();
191
            projComboBox.setBounds(14, 80, 250, 23);
184
            // projComboBox.setBounds(14, 80, 250, 23);
192 185
            projComboBox.addItemListener(new java.awt.event.ItemListener() {
193
                    public void itemStateChanged(java.awt.event.ItemEvent e) {
194
                        model.setSelectedProj(e.getItem());
195 186

  
196
                        if (model.getSelectedProjType() == CSSelectionModel.TRANSVERSAL) {
197
                            setHuseComboBoxEnabled(true);
198
                            getHuseComboBox().removeAllItems();
199
                            getHuseComboBox().loadData(model.getZoneList());
187
                public void itemStateChanged(java.awt.event.ItemEvent e) {
188
                    model.setSelectedProj(e.getItem());
200 189

  
201
                        } else {
202
                            setHuseComboBoxEnabled(false);
203
                        }
190
                    if (model.getSelectedProjType() == CSSelectionModel.TRANSVERSAL) {
191
                        setHuseComboBoxEnabled(true);
192
                        getHuseComboBox().removeAllItems();
193
                        getHuseComboBox().loadData(model.getZoneList());
204 194

  
205
                       // if (model.getSelectedProjType() == CSSelectionModel.NONE) {
206
                       //     setDatumComboBoxEnabled(false);
207
                       // } else {
208
                       //     setDatumComboBoxEnabled(true);
209
                       // }
195
                    } else {
196
                        setHuseComboBoxEnabled(false);
210 197
                    }
211
                });
198

  
199
                }
200
            });
212 201
        }
213 202

  
214 203
        return projComboBox;
......
216 205

  
217 206
    /**
218 207
     * Inicializa usoComboBox
219
     *
208
     * 
220 209
     * @return javax.swing.JComboBox
221 210
     */
222 211
    private LoadableComboBox getHuseComboBox() {
223 212
        if (huseComboBox == null) {
224 213
            huseComboBox = new LoadableComboBox();
225
            huseComboBox.setBounds(14, 125, 250, 23);
226 214
            huseComboBox.addItemListener(new java.awt.event.ItemListener() {
227
                    public void itemStateChanged(java.awt.event.ItemEvent e) {
228
                        model.setSelectedZone(e.getItem());
229
                    }
230
                });
215

  
216
                public void itemStateChanged(java.awt.event.ItemEvent e) {
217
                    model.setSelectedZone(e.getItem());
218
                }
219
            });
231 220
        }
232 221

  
233 222
        return huseComboBox;
......
239 228
    public IProjection getProjection() {
240 229
        return model.getProjection();
241 230
    }
231

  
232
    private void addRow(GridBagConstraints c, JComponent label, JComponent text) {
233
        c.anchor = GridBagConstraints.WEST;
234
        c.weightx = 0.0d;
235
        c.gridx = 0;
236
        c.gridy++;
237
        add(label, c);
238

  
239
        c.fill = GridBagConstraints.HORIZONTAL;
240
        c.weightx = 1.0d;
241
        c.gridx = 1;
242
        add(text, c);
243
    }
242 244
}
branches/v2_0_0_prep/libraries/libProjection/src/org/cresques/ui/LoadableComboBox.java
25 25

  
26 26
import javax.swing.JComboBox;
27 27

  
28

  
29 28
/**
30 29
 * @author "Luis W. Sevilla" (sevilla_lui@gva.es)
31 30
 */
32 31
public class LoadableComboBox extends JComboBox {
32

  
33 33
    final private static long serialVersionUID = -3370601314380922368L;
34 34

  
35
    public LoadableComboBox() {
36
        super();
37
        initialize();
38

  
39
        //		addItemListener(this);
40
        //		setSize(new java.awt.Dimension(185, 23));
41
    }
42

  
43 35
    /**
44
     * This method initializes this
45
     *
46
     * @return void
47
     */
48
    private void initialize() {
49
        this.setPreferredSize(new java.awt.Dimension(185, 23));
50
    }
51

  
52
    /**
53 36
     * Carga el vector de strings data con los valores pasados por par?metro
54
     * @param data	vector de strings con los valores
37
     * 
38
     * @param data
39
     *            vector de strings con los valores
55 40
     */
56 41
    public void loadData(String[] data) {
57 42
        if (data == null) {
58 43
            return;
59 44
        }
60 45

  
61
        for (int i = 0; i < data.length; i++)
46
        for (int i = 0; i < data.length; i++) {
62 47
            addItem(data[i]);
48
        }
63 49
    }
64

  
65
    /*        public void itemStateChanged(ItemEvent e) {
66
                if (e.getStateChange() == ItemEvent.SELECTED) {
67
                    //label.setVisible(true);
68
                } else {
69
                    //label.setVisible(false);
70
                }
71
            }*/
72 50
}
branches/v2_0_0_prep/libraries/libProjection/src/org/cresques/ui/DefaultDialogPanel.java
26 26
import java.awt.FlowLayout;
27 27
import java.awt.GridBagConstraints;
28 28
import java.awt.GridBagLayout;
29
import java.awt.event.ComponentEvent;
30
import java.awt.event.ComponentListener;
31 29

  
32 30
import javax.swing.JButton;
33 31
import javax.swing.JPanel;
......
38 36
/**
39 37
 * @author Luis W. Sevilla (sevilla_lui@gva.es)
40 38
 */
41
public class DefaultDialogPanel extends JPanel implements ComponentListener{
39
public class DefaultDialogPanel extends JPanel { // implements
40
                                                 // ComponentListener{
42 41
    final private static long serialVersionUID = -3370601314380922368L;
43 42
    protected JPanel contentPane = null;
44 43
    private JPanel tabPane = null;
45 44
    protected JPanel buttonPane = null;
46 45
    private JButton acceptButton = null;
47 46
    private JButton cancelButton = null;
48
    private int flag = 0;
49 47
    protected int cWidth = 0, difWidth = 0;
50 48
    protected int cHeight = 0, difHeight = 0;
51 49
	protected JPanel pButton = null;
......
73 71
     * @return void
74 72
     */
75 73
    public void initialize() {
76
        //setBounds(0,0,321,230);
77
        //javax.swing.BoxLayout(jContentPane, javax.swing.BoxLayout.Y_AXIS);
78
        //jContentPane.setLayout(new java.awt.GridLayout(2,1));
79 74
        GridBagConstraints gridBagConstraints11 = new GridBagConstraints();
80 75
        gridBagConstraints11.gridx = 0;
81 76
        gridBagConstraints11.insets = new java.awt.Insets(4,0,0,0);
......
87 82
        setLayout(new GridBagLayout());
88 83
        setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
89 84

  
90
        //jContentPane.setSize(30, 24);
91
        this.setPreferredSize(new java.awt.Dimension(320, 165));
92 85
        this.add(getTabPanel(), gridBagConstraints);
93 86
        this.add(getPButton(), gridBagConstraints11);
94
        this.addComponentListener(this);
95

  
96 87
    }
97 88

  
98 89
    /**
......
103 94
        if (contentPane == null) {
104 95
            contentPane = new JPanel();
105 96
            contentPane.setLayout(new GridBagLayout());
106
            contentPane.setBounds(6, 200, 310, 125);
107
            contentPane.setPreferredSize(new java.awt.Dimension(310, 100));
108 97
        }
109 98

  
110 99
        return contentPane;
......
119 108
            tabPane = new JPanel();
120 109
            tabPane.setLayout(new GridBagLayout());
121 110

  
122

  
123
            //tabPane.setBounds(6, 7, 309, 189);
124 111
            tabPane.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.SoftBevelBorder.RAISED));
125 112
            tabPane.add(getContentPanel(), gridBagConstraints2);
126 113
        }
......
140 127
			flowLayout1.setHgap(0);
141 128
			flowLayout1.setVgap(0);
142 129
			pButton = new JPanel();
143
			pButton.setPreferredSize(new java.awt.Dimension(320,25));
144 130
			pButton.setLayout(flowLayout1);
145 131
			pButton.add(getButtonPanel(), null);
146 132
		}
......
198 184

  
199 185
        return cancelButton;
200 186
    }
201

  
202

  
203

  
204
	public void componentHidden(ComponentEvent e) {
205
		// TODO Auto-generated method stub
206

  
207
	}
208

  
209
	public void componentMoved(ComponentEvent e) {
210
		// TODO Auto-generated method stub
211

  
212
	}
213

  
214
	public void componentResized(ComponentEvent e) {
215
		if(e.getSource() == this)
216
			this.resizeWindow();
217
	}
218

  
219
	public void resizeWindow(){
220
		if (flag == 0){
221
			cWidth = this.getSize().width;
222
			cHeight = this.getSize().height;
223
			flag++;
224
		}
225

  
226
		int nWidth = getWidth();
227
		int nHeight = getHeight();
228
		difWidth = nWidth - cWidth;
229
		difHeight = nHeight - cHeight;
230
		this.tabPane.setSize(this.tabPane.getSize().width + difWidth, this.tabPane.getSize().height + difHeight);
231
		this.tabPane.setLocation(this.tabPane.getLocation().x - difWidth/2, this.tabPane.getLocation().y - difHeight/2);
232

  
233
		this.contentPane.setSize(this.contentPane.getSize().width + difWidth, this.contentPane.getSize().height + difHeight);
234
		//this.pButton.setSize(this.getPButton().getWidth() + difWidth/2, 25);
235
		//this.buttonPane.setLocation(this.buttonPane.getLocation().x + difWidth/2, this.buttonPane.getLocation().y + difHeight/2);
236
		this.pButton.setLocation(this.pButton.getLocation().x + difWidth/2, this.pButton.getLocation().y + difHeight/2);
237

  
238
	}
239

  
240
	public void componentShown(ComponentEvent e) {
241
		// TODO Auto-generated method stub
242

  
243
	}
244

  
245

  
246
}  //  @jve:decl-index=0:visual-constraint="12,13"
187
}
branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/gui/panels/ProjChooserPanel.java
9 9
import javax.swing.JPanel;
10 10

  
11 11
import org.cresques.cts.IProjection;
12

  
12 13
import org.gvsig.andami.PluginServices;
13
import org.gvsig.app.gui.panels.crs.ICrsUIFactory;
14 14
import org.gvsig.app.gui.panels.crs.ISelectCrsPanel;
15
import org.gvsig.app.project.documents.view.info.gui.CSSelectionDialog;
16 15
import org.gvsig.gui.beans.swing.JButton;
17 16

  
18

  
19 17
/**
20 18
 * @author Luis W. Sevilla (sevilla_lui@gva.es)
21 19
 */
22 20
public class ProjChooserPanel extends CRSSelectPanel {
23
    private IProjection curProj=null;
24
	private JLabel jLblProj = null;
25
	private JLabel jLblProjName = null;
26
	private JButton jBtnChangeProj = null;
27
	private JPanel jPanelProj = null;
28
	private boolean okPressed = false;
29 21

  
30
	/**
22
    private IProjection curProj = null;
23
    private JLabel jLblProj = null;
24
    private JLabel jLblProjName = null;
25
    private JButton jBtnChangeProj = null;
26
    private JPanel jPanelProj = null;
27
    private boolean okPressed = false;
28

  
29
    /**
31 30
	 *
32 31
	 */
33
	public ProjChooserPanel(IProjection proj) {
34
		super(proj);
35
		setCurProj(proj);
36
		initialize();
37
	}
32
    public ProjChooserPanel(IProjection proj) {
33
        super(proj);
34
        setCurProj(proj);
35
        initialize();
36
    }
38 37

  
39
	/**
40
	 * This method initializes this
41
	 *
42
	 * @return void
43
	 */
44
	private void initialize() {
38
    /**
39
     * This method initializes this
40
     * 
41
     * @return void
42
     */
43
    private void initialize() {
45 44
        this.setLayout(new FlowLayout(FlowLayout.LEFT, 15, 0));
46
        setPreferredSize(new java.awt.Dimension(330,35));
47
        this.setSize(new java.awt.Dimension(330,23));
48
        this.add(getJLblProjName(), null);
49
        this.add(getJLblProj(), null);
50
        this.add(getJBtnChangeProj(), null);
51
		initBtnChangeProj();
52
	}
45
        this.add(getJLblProjName());
46
        this.add(getJLblProj());
47
        this.add(getJBtnChangeProj());
48
        initBtnChangeProj();
49
    }
53 50

  
54
	private void initBtnChangeProj() {
55
		getJBtnChangeProj().addActionListener(new java.awt.event.ActionListener() {
56
			public void actionPerformed(java.awt.event.ActionEvent e) {
57
				okPressed = false;
58
				
59
				ISelectCrsPanel csSelect = getUIFactory().getSelectCrsPanel(curProj, true);
51
    private void initBtnChangeProj() {
52
        getJBtnChangeProj().addActionListener(
53
            new java.awt.event.ActionListener() {
60 54

  
61
		        PluginServices.getMDIManager().addWindow(csSelect);
55
                public void actionPerformed(java.awt.event.ActionEvent e) {
56
                    okPressed = false;
62 57

  
63
		        if (csSelect.isOkPressed()) {
64
		        	curProj = csSelect.getProjection();
65
		        	jLblProj.setText(curProj.getAbrev());
66
		        	okPressed = true;
67
		        	if (actionListener != null) {
68
		        		actionListener.actionPerformed(e);
69
		        	}
70
		        }
71
			}
72
		});
73
	}
58
                    ISelectCrsPanel csSelect =
59
                        getUIFactory().getSelectCrsPanel(curProj, true);
74 60

  
75
	public JLabel getJLblProjName() {
76
		if (jLblProjName == null) {
77
	        jLblProjName = new JLabel("Proyeccion actual");
78
			jLblProjName.setText(PluginServices.getText(this,"__proyeccion_actual")); //$NON-NLS-1$
79
		}
80
		return jLblProjName;
81
	}
61
                    PluginServices.getMDIManager().addWindow(csSelect);
82 62

  
83
	public JLabel getJLabel() {
84
		return getJLblProjName();
85
	}
63
                    if (csSelect.isOkPressed()) {
64
                        curProj = csSelect.getProjection();
65
                        jLblProj.setText(curProj.getAbrev());
66
                        okPressed = true;
67
                        if (actionListener != null) {
68
                            actionListener.actionPerformed(e);
69
                        }
70
                    }
71
                }
72
            });
73
    }
86 74

  
87
	public JLabel getJLblProj() {
88
		if (jLblProj == null) {
89
	        jLblProj = new JLabel();
90
	        if (curProj!=null)
91
				jLblProj.setText(curProj.getAbrev());
92
		}
93
		return jLblProj;
94
	}
95
	public void addBtnChangeProjActionListener(java.awt.event.ActionListener al) {
96
		jBtnChangeProj.addActionListener(al);
97
	}
75
    public JLabel getJLblProjName() {
76
        if (jLblProjName == null) {
77
            jLblProjName = new JLabel("Proyeccion actual");
78
            jLblProjName.setText(PluginServices.getText(this,
79
                "__proyeccion_actual")); //$NON-NLS-1$
80
        }
81
        return jLblProjName;
82
    }
98 83

  
99
	/**
100
	 * This method initializes jButton
101
	 *
102
	 * @return javax.swing.JButton
103
	 */
104
	public JButton getJBtnChangeProj() {
105
		if (jBtnChangeProj == null) {
106
			jBtnChangeProj = new JButton();
107
			jBtnChangeProj.setText("..."); //$NON-NLS-1$
108
			jBtnChangeProj.setPreferredSize(new java.awt.Dimension(26,26));
109
		}
110
		return jBtnChangeProj;
111
	}
112
	/**
113
	 * @return Returns the curProj.
114
	 */
115
	public IProjection getCurProj() {
116
		return curProj;
117
	}
118
	/**
119
	 * @param curProj The curProj to set.
120
	 */
121
	public void setCurProj(IProjection curProj) {
122
		this.curProj = curProj;
123
	}
124
	/**
125
	 * @return Returns the okPressed.
126
	 */
127
	public boolean isOkPressed() {
128
		return okPressed;
129
	}
130
}  //  @jve:decl-index=0:visual-constraint="10,10"
84
    public JLabel getJLabel() {
85
        return getJLblProjName();
86
    }
87

  
88
    public JLabel getJLblProj() {
89
        if (jLblProj == null) {
90
            jLblProj = new JLabel();
91
            if (curProj != null)
92
                jLblProj.setText(curProj.getAbrev());
93
        }
94
        return jLblProj;
95
    }
96

  
97
    public void addBtnChangeProjActionListener(java.awt.event.ActionListener al) {
98
        jBtnChangeProj.addActionListener(al);
99
    }
100

  
101
    /**
102
     * This method initializes jButton
103
     * 
104
     * @return javax.swing.JButton
105
     */
106
    public JButton getJBtnChangeProj() {
107
        if (jBtnChangeProj == null) {
108
            jBtnChangeProj = new JButton();
109
            jBtnChangeProj.setText("..."); //$NON-NLS-1$
110
            jBtnChangeProj.setPreferredSize(new java.awt.Dimension(26, 26));
111
        }
112
        return jBtnChangeProj;
113
    }
114

  
115
    /**
116
     * @return Returns the curProj.
117
     */
118
    public IProjection getCurProj() {
119
        return curProj;
120
    }
121

  
122
    /**
123
     * @param curProj
124
     *            The curProj to set.
125
     */
126
    public void setCurProj(IProjection curProj) {
127
        this.curProj = curProj;
128
    }
129

  
130
    /**
131
     * @return Returns the okPressed.
132
     */
133
    public boolean isOkPressed() {
134
        return okPressed;
135
    }
136
} // @jve:decl-index=0:visual-constraint="10,10"
branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/project/documents/view/info/gui/CSSelectionDialog.java
7 7

  
8 8
import org.cresques.cts.IProjection;
9 9
import org.cresques.ui.cts.CSSelectionDialogPanel;
10

  
10 11
import org.gvsig.andami.PluginServices;
11 12
import org.gvsig.andami.ui.mdiManager.IWindow;
12 13
import org.gvsig.andami.ui.mdiManager.WindowInfo;
13 14
import org.gvsig.app.gui.panels.crs.ISelectCrsPanel;
14 15

  
15

  
16 16
/**
17 17
 * @author Luis W. Sevilla (sevilla_lui@gva.es)
18 18
 */
19
public class CSSelectionDialog
20
	extends CSSelectionDialogPanel implements IWindow, ISelectCrsPanel {
21
	private boolean okPressed = false;
22
	private IProjection lastProj = null;
19
public class CSSelectionDialog extends CSSelectionDialogPanel implements
20
    IWindow, ISelectCrsPanel {
23 21

  
24
	/**
22
    private boolean okPressed = false;
23
    private IProjection lastProj = null;
24

  
25
    /**
25 26
	 *
26 27
	 */
27
	public CSSelectionDialog() {
28
		super();
29
		this.init();
30
	}
31
	/**
32
	 * This method initializes this
33
	 *
34
	 * @return void
35
	 */
36
	private void init() {
37
        this.setBounds(0, 0, 350, 260);
38
        this.setPreferredSize(new Dimension(350, 260));
39
        getAcceptButton().addActionListener(new java.awt.event.ActionListener() {
40
            public void actionPerformed(java.awt.event.ActionEvent e) {
41
                PluginServices.getMDIManager().closeWindow(CSSelectionDialog.this);
42
                okPressed = true;
43
            }
44
        });
45
        getCancelButton().addActionListener(new java.awt.event.ActionListener() {
46
            public void actionPerformed(java.awt.event.ActionEvent e) {
47
                setProjection(lastProj);
48
                PluginServices.getMDIManager().closeWindow(CSSelectionDialog.this);
49
                okPressed = false;
50
            }
51
        });
52
	}
53
	/* (non-Javadoc)
54
	 * @see com.iver.andami.ui.mdiManager.View#getViewInfo()
55
	 */
56
	public WindowInfo getWindowInfo() {
57
		WindowInfo m_viewinfo=new WindowInfo(WindowInfo.MODALDIALOG | WindowInfo.RESIZABLE);
58
   		m_viewinfo.setTitle(PluginServices.getText(this, "selecciona_sistema_de_referencia"));
59
		return m_viewinfo;
60
	}
28
    public CSSelectionDialog() {
29
        super();
30
        this.init();
31
    }
61 32

  
62
	public boolean isOkPressed() { return okPressed; }
33
    /**
34
     * This method initializes this
35
     * 
36
     * @return void
37
     */
38
    private void init() {
39
        getAcceptButton().addActionListener(
40
            new java.awt.event.ActionListener() {
63 41

  
64
	/**
65
	 * @return
66
	 */
67
	public IProjection getProjection() {
68
		return getProjPanel().getProjection();
69
	}
70
	/**
71
	 * @param proj
72
	 */
73
	public void setProjection(IProjection proj) {
74
		lastProj = proj;
75
		getProjPanel().setProjection(proj);
76
	}
42
                public void actionPerformed(java.awt.event.ActionEvent e) {
43
                    PluginServices.getMDIManager().closeWindow(
44
                        CSSelectionDialog.this);
45
                    okPressed = true;
46
                }
47
            });
48
        getCancelButton().addActionListener(
49
            new java.awt.event.ActionListener() {
77 50

  
78
	public Object getWindowProfile() {
79
		return WindowInfo.DIALOG_PROFILE;
80
	}
51
                public void actionPerformed(java.awt.event.ActionEvent e) {
52
                    setProjection(lastProj);
53
                    PluginServices.getMDIManager().closeWindow(
54
                        CSSelectionDialog.this);
55
                    okPressed = false;
56
                }
57
            });
58
    }
59

  
60
    public WindowInfo getWindowInfo() {
61
        WindowInfo m_viewinfo =
62
            new WindowInfo(WindowInfo.MODALDIALOG | WindowInfo.RESIZABLE);
63
        m_viewinfo.setTitle(PluginServices.getText(this,
64
            "selecciona_sistema_de_referencia"));
65
        Dimension dim = getPreferredSize();
66
        m_viewinfo.setWidth(dim.width);
67
        m_viewinfo.setHeight(dim.height);
68
        return m_viewinfo;
69
    }
70

  
71
    public boolean isOkPressed() {
72
        return okPressed;
73
    }
74

  
75
    /**
76
     * @return
77
     */
78
    public IProjection getProjection() {
79
        return getProjPanel().getProjection();
80
    }
81

  
82
    /**
83
     * @param proj
84
     */
85
    public void setProjection(IProjection proj) {
86
        lastProj = proj;
87
        getProjPanel().setProjection(proj);
88
    }
89

  
90
    public Object getWindowProfile() {
91
        return WindowInfo.DIALOG_PROFILE;
92
    }
81 93
}
branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/project/documents/view/gui/ViewProperties.java
24 24
import java.awt.Color;
25 25
import java.awt.Component;
26 26
import java.awt.Dimension;
27
import java.awt.GridLayout;
27
import java.awt.FlowLayout;
28
import java.awt.GridBagConstraints;
29
import java.awt.GridBagLayout;
30
import java.awt.Insets;
28 31
import java.awt.event.ActionListener;
29 32
import java.util.List;
30 33

  
34
import javax.swing.BorderFactory;
31 35
import javax.swing.JButton;
32 36
import javax.swing.JColorChooser;
33 37
import javax.swing.JComboBox;
34
import javax.swing.JLabel;
38
import javax.swing.JComponent;
35 39
import javax.swing.JOptionPane;
36 40
import javax.swing.JPanel;
37 41

  
......
49 53
import org.gvsig.app.project.documents.view.ViewManager;
50 54
import org.gvsig.fmap.mapcontext.MapContext;
51 55
import org.gvsig.gui.beans.AcceptCancelPanel;
56
import org.gvsig.i18n.Messages;
52 57
import org.gvsig.tools.swing.api.ToolsSwingLocator;
53 58

  
54 59
/**
55 60
 * Dialogo donde se muestran las propiedades de una vista
56 61
 * 
57 62
 * @author Fernando Gonz?lez Cort?s
63
 * @author gvSIG Team
58 64
 */
59 65
public class ViewProperties extends JPanel implements SingletonWindow {
60 66

  
61
    /**
62
	 * 
63
	 */
64 67
    private static final long serialVersionUID = 5328865370833315385L;
65
    private javax.swing.JLabel jLabel = null;
68
    private javax.swing.JLabel jLabelName = null;
66 69
    private javax.swing.JTextField txtName = null;
67
    private javax.swing.JLabel jLabel1 = null;
70
    private javax.swing.JLabel jLabelDate = null;
68 71
    private javax.swing.JTextField txtDate = null;
69
    private javax.swing.JLabel jLabel2 = null;
72
    private javax.swing.JLabel jLabelOwner = null;
70 73
    private javax.swing.JTextField txtOwner = null;
71
    private javax.swing.JLabel jLabel4 = null;
74
    private javax.swing.JLabel jLabelMapUnits = null;
72 75
    private javax.swing.JComboBox cmbMapUnits = null;
73
    private javax.swing.JLabel jLabel5 = null;
76
    private javax.swing.JLabel jLabelDistanceUnits = null;
74 77
    private javax.swing.JComboBox cmbDistanceUnits = null;
75
    private javax.swing.JLabel jLabel6 = null;
78
    private javax.swing.JLabel jLabelAreaUnits = null;
76 79
    private javax.swing.JTextArea txtComments = null;
77
    private javax.swing.JLabel jLabel7 = null;
80
    private javax.swing.JLabel jLabelColor = null;
81
    private javax.swing.JLabel jLabelComments = null;
78 82
    private javax.swing.JLabel lblColor = null;
79 83

  
80 84
    private Color backColor = null;
......
82 86
    private JButton btnColor = null;
83 87
    private DefaultViewDocument view = null;
84 88
    private javax.swing.JScrollPane jScrollPane = null;
85
    private javax.swing.JPanel jPanel = null;
86
    private javax.swing.JPanel jPanel1 = null;
87
    private javax.swing.JPanel jPanel2 = null;
88
    private javax.swing.JPanel jPanel3 = null;
89

  
90
    private javax.swing.JLabel jLabel3 = null;
91
    private javax.swing.JLabel jLabelSep1 = null;
92 89
    protected CRSSelectPanel jPanelProj = null;
93 90
    private AcceptCancelPanel okCancelPanel = null;
94 91
    private boolean isAcceppted = false;
95
    private JLabel jLabel8 = null;
96 92
    private JComboBox cmbDistanceArea = null;
97 93

  
98 94
    /**
......
112 108
     * This method initializes this
113 109
     */
114 110
    private void initialize() {
115
        this.setSize(386, 436);
116
        java.awt.FlowLayout layFlowLayout3 = new java.awt.FlowLayout();
117
        layFlowLayout3.setHgap(0);
118
        setLayout(layFlowLayout3);
119
        this.setPreferredSize(new java.awt.Dimension(365, 463));
120
        add(getJPanel(), null);
121
        add(getJPanel1(), null);
122
        add(getJPanel2(), null);
123
        add(getJPanel3(), null);
124
        add(getJLabelSep1(), null);
125
        this.add(getJPanelProj(), null);
126
        this.add(getJLabel6(), null);
127
        add(getJScrollPane(), null);
111
        setLayout(new GridBagLayout());
112
        setBorder(BorderFactory.createEmptyBorder(4, 5, 4, 5));
128 113

  
129
        this.add(getJLabel7(), null);
130
        this.add(getLblColor(), null);
131
        this.add(getBtnColor(), null);
114
        GridBagConstraints c = new GridBagConstraints();
115
        c.insets = new Insets(2, 5, 2, 5);
116
        c.gridy = -1;
132 117

  
133
        add(getJLabel3(), null);
134
        this.add(getOkCancelPanel(), null);
135
        txtName.setText(view.getName());
136
        txtDate.setText(view.getCreationDate());
137
        txtOwner.setText(view.getOwner());
118
        addRow(c, getJLabelName(), getTxtName());
119
        addRow(c, getJLabelDate(), getTxtDate());
120
        addRow(c, getJLabelOwner(), getTxtOwner());
121
        addRow(c, getJLabelMapUnits(), getCmbMapUnits());
122
        addRow(c, getJLabelDistanceUnits(), getCmbDistanceUnits());
123
        addRow(c, getJLabelAreaUnits(), getCmbDistanceArea());
124
        addRow(c, getJLabelColor(), getJPanelColor());
138 125

  
139
        cmbMapUnits.setSelectedIndex(view.getMapContext().getViewPort()
140
            .getMapUnits());
141
        cmbDistanceUnits.setSelectedIndex(view.getMapContext().getViewPort()
142
            .getDistanceUnits());
143
        cmbDistanceArea.setSelectedIndex(view.getMapContext().getViewPort()
144
            .getDistanceArea());
145
        txtComments.setText(view.getComment());
126
        c.anchor = GridBagConstraints.WEST;
127
        c.weightx = 0.0d;
128
        c.gridx = 0;
129
        c.gridy++;
130
        add(getJLabelColor(), c);
146 131

  
147
        lblColor.setBackground(view.getMapContext().getViewPort()
148
            .getBackColor());
132
        c.fill = GridBagConstraints.HORIZONTAL;
133
        c.weightx = 1.0d;
134
        c.gridx = 1;
135
        add(getJPanelColor(), c);
136

  
137
        c.anchor = GridBagConstraints.WEST;
138
        c.weightx = 0.0d;
139
        c.gridx = 0;
140
        c.gridwidth = GridBagConstraints.REMAINDER;
141
        c.gridy++;
142
        c.weightx = 1.0d;
143
        c.fill = GridBagConstraints.HORIZONTAL;
144
        add(getJPanelProj(), c);
145

  
146
        c.anchor = GridBagConstraints.WEST;
147
        c.weightx = 0.0d;
148
        c.gridx = 0;
149
        c.gridy++;
150
        add(getJLabelComments(), c);
151

  
152
        c.fill = GridBagConstraints.BOTH;
153
        c.weightx = 1.0d;
154
        c.gridy++;
155
        c.gridwidth = 2;
156
        add(getJScrollPaneComments(), c);
157

  
158
        c.anchor = GridBagConstraints.EAST;
159
        c.gridx = 0;
160
        c.gridwidth = 2;
161
        c.gridy++;
162
        c.weightx = 1.0d;
163

  
164
        add(getOkCancelPanel(), c);
149 165
    }
150 166

  
167
    private JComponent getJPanelColor() {
168
        JPanel colorPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
169
        colorPanel.add(getLblColor());
170
        colorPanel.add(getBtnColor());
171

  
172
        return colorPanel;
173
    }
174

  
175
    private void addRow(GridBagConstraints c, JComponent label, JComponent text) {
176
        c.anchor = GridBagConstraints.WEST;
177
        c.weightx = 0.0d;
178
        c.gridx = 0;
179
        c.gridy++;
180
        add(label, c);
181

  
182
        c.fill = GridBagConstraints.HORIZONTAL;
183
        c.weightx = 1.0d;
184
        c.gridx = 1;
185
        add(text, c);
186
    }
187

  
151 188
    /**
152 189
     * This method initializes jLabel
153 190
     * 
154 191
     * @return javax.swing.JLabel
155 192
     */
156
    private javax.swing.JLabel getJLabel() {
157
        if (jLabel == null) {
158
            jLabel = new javax.swing.JLabel();
159
            jLabel.setText(PluginServices.getText(this, "nombre") + ":");
193
    private javax.swing.JLabel getJLabelName() {
194
        if (jLabelName == null) {
195
            jLabelName =
196
                new javax.swing.JLabel(Messages.getText("nombre") + ":");
160 197
        }
161 198

  
162
        return jLabel;
199
        return jLabelName;
163 200
    }
164 201

  
165
    private javax.swing.JLabel getJLabelSep1() {
166
        if (jLabelSep1 == null) {
167
            jLabelSep1 = new javax.swing.JLabel();
168
            jLabelSep1.setPreferredSize(new java.awt.Dimension(200, 10));
169
        }
170
        return jLabelSep1;
171
    }
172

  
173 202
    /**
174 203
     * This method initializes txtName
175 204
     * 
......
177 206
     */
178 207
    private javax.swing.JTextField getTxtName() {
179 208
        if (txtName == null) {
180
            txtName = new javax.swing.JTextField();
181
            txtName.setPreferredSize(new java.awt.Dimension(200, 20));
209
            txtName = new javax.swing.JTextField(view.getName());
182 210
        }
183 211

  
184 212
        return txtName;
......
189 217
     * 
190 218
     * @return javax.swing.JLabel
191 219
     */
192
    private javax.swing.JLabel getJLabel1() {
193
        if (jLabel1 == null) {
194
            jLabel1 = new javax.swing.JLabel();
195
            jLabel1
196
                .setText(PluginServices.getText(this, "creation_date") + ":");
220
    private javax.swing.JLabel getJLabelDate() {
221
        if (jLabelDate == null) {
222
            jLabelDate =
223
                new javax.swing.JLabel(Messages.getText("creation_date") + ":");
197 224
        }
198 225

  
199
        return jLabel1;
226
        return jLabelDate;
200 227
    }
201 228

  
202 229
    /**
......
206 233
     */
207 234
    private javax.swing.JTextField getTxtDate() {
208 235
        if (txtDate == null) {
209
            txtDate = new javax.swing.JTextField();
210
            txtDate.setPreferredSize(new java.awt.Dimension(200, 20));
236
            txtDate = new javax.swing.JTextField(view.getCreationDate());
211 237
            txtDate.setEditable(false);
212 238
            txtDate.setBackground(java.awt.Color.white);
213 239
        }
......
220 246
     * 
221 247
     * @return javax.swing.JLabel
222 248
     */
223
    private javax.swing.JLabel getJLabel2() {
224
        if (jLabel2 == null) {
225
            jLabel2 = new javax.swing.JLabel();
226
            jLabel2.setText(PluginServices.getText(this, "owner") + ":");
249
    private javax.swing.JLabel getJLabelOwner() {
250
        if (jLabelOwner == null) {
251
            jLabelOwner =
252
                new javax.swing.JLabel(Messages.getText("owner") + ":");
227 253
        }
228 254

  
229
        return jLabel2;
255
        return jLabelOwner;
230 256
    }
231 257

  
232 258
    /**
......
236 262
     */
237 263
    private javax.swing.JTextField getTxtOwner() {
238 264
        if (txtOwner == null) {
239
            txtOwner = new javax.swing.JTextField();
240
            txtOwner.setPreferredSize(new java.awt.Dimension(200, 20));
265
            txtOwner = new javax.swing.JTextField(view.getOwner());
241 266
        }
242 267

  
243 268
        return txtOwner;
......
248 273
     * 
249 274
     * @return javax.swing.JLabel
250 275
     */
251
    private javax.swing.JLabel getJLabel4() {
252
        if (jLabel4 == null) {
253
            jLabel4 = new javax.swing.JLabel();
254
            jLabel4.setText(PluginServices.getText(this, "map_units") + ":");
255
            jLabel4.setName("jLabel4");
276
    private javax.swing.JLabel getJLabelMapUnits() {
277
        if (jLabelMapUnits == null) {
278
            jLabelMapUnits =
279
                new javax.swing.JLabel(Messages.getText("map_units") + ":");
256 280
        }
257 281

  
258
        return jLabel4;
282
        return jLabelMapUnits;
259 283
    }
260 284

  
261 285
    /**
......
269 293
                .getItemCount()) {
270 294
            cmbMapUnits = new JComboBoxUnits(false);
271 295

  
272
            cmbMapUnits.setPreferredSize(new java.awt.Dimension(200, 20));
273 296
            IProjection proj = view.getProjection();
274 297
            if (!proj.isProjected()) {
275
                cmbMapUnits.setSelectedItem(PluginServices.getText(this,
276
                    "Grados")); // deegree
298
                cmbMapUnits.setSelectedItem(Messages.getText("Grados")); // deegree
277 299
                cmbMapUnits.setEnabled(false);
278 300
            } else {
279 301
                if (!(cmbMapUnits.getItemCount() == MapContext
280 302
                    .getDistanceNames().length)) {
281
                    cmbMapUnits.removeItem(PluginServices.getText(this,
282
                        "Grados")); // deegree
303
                    cmbMapUnits.removeItem(Messages.getText("Grados")); // deegree
283 304
                    view.getMapContext().getViewPort().setMapUnits(1);
284 305
                }
285 306
                cmbMapUnits.setSelectedIndex(view.getMapContext().getViewPort()
......
298 319
     * 
299 320
     * @return javax.swing.JLabel
300 321
     */
301
    private javax.swing.JLabel getJLabel5() {
302
        if (jLabel5 == null) {
303
            jLabel5 = new javax.swing.JLabel();
304
            jLabel5.setText(PluginServices.getText(this, "distance_units")
305
                + ":");
306
            jLabel5.setName("jLabel5");
322
    private javax.swing.JLabel getJLabelDistanceUnits() {
323
        if (jLabelDistanceUnits == null) {
324
            jLabelDistanceUnits =
325
                new javax.swing.JLabel(Messages.getText("distance_units") + ":");
307 326
        }
308 327

  
309
        return jLabel5;
328
        return jLabelDistanceUnits;
310 329
    }
311 330

  
312 331
    /**
332
     * This method initializes jLabel6
333
     * 
334
     * @return javax.swing.JLabel
335
     */
336
    private javax.swing.JLabel getJLabelAreaUnits() {
337
        if (jLabelAreaUnits == null) {
338
            jLabelAreaUnits =
339
                new javax.swing.JLabel(Messages.getText("unidades_area") + ":");
340
        }
341

  
342
        return jLabelAreaUnits;
343
    }
344

  
345
    /**
313 346
     * This method initializes cmbDistanceUnits
314 347
     * 
315 348
     * @return javax.swing.JComboBox
......
319 352
            || MapContext.getDistanceNames().length > cmbDistanceUnits
320 353
                .getItemCount()) {
321 354
            cmbDistanceUnits = new JComboBoxUnits(false);
322
            cmbDistanceUnits.setPreferredSize(new java.awt.Dimension(200, 20));
355
            cmbDistanceUnits.setSelectedIndex(view.getMapContext()
356
                .getViewPort().getDistanceUnits());
323 357
        }
324 358

  
325 359
        return cmbDistanceUnits;
......
330 364
     * 
331 365
     * @return javax.swing.JLabel
332 366
     */
333
    private javax.swing.JLabel getJLabel6() {
334
        if (jLabel6 == null) {
335
            jLabel6 = new javax.swing.JLabel();
336
            jLabel6.setText(PluginServices.getText(this, "comentarios") + ":");
337
            jLabel6.setPreferredSize(new java.awt.Dimension(340, 35));
338
            jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
339
            jLabel6.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
367
    private javax.swing.JLabel getJLabelComments() {
368
        if (jLabelComments == null) {
369
            jLabelComments =
370
                new javax.swing.JLabel(Messages.getText("comentarios") + ":");
371
            jLabelComments
372
                .setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
373
            jLabelComments
374
                .setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
340 375
        }
341 376

  
342
        return jLabel6;
377
        return jLabelComments;
343 378
    }
344 379

  
345 380
    /**
......
349 384
     */
350 385
    private javax.swing.JTextArea getTxtComments() {
351 386
        if (txtComments == null) {
352
            txtComments = new javax.swing.JTextArea();
353
            txtComments.setRows(1);
354
            txtComments.setColumns(28);
387
            txtComments = new javax.swing.JTextArea(view.getComment());
388
            txtComments.setRows(3);
389
            txtComments.setColumns(20);
355 390
        }
356 391

  
357 392
        return txtComments;
......
362 397
     * 
363 398
     * @return javax.swing.JLabel
364 399
     */
365
    private javax.swing.JLabel getJLabel7() {
366
        if (jLabel7 == null) {
367
            jLabel7 = new javax.swing.JLabel();
368
            jLabel7.setText(PluginServices.getText(this, "background_color")
369
                + ":");
370
            jLabel7.setPreferredSize(new java.awt.Dimension(190, 16));
400
    private javax.swing.JLabel getJLabelColor() {
401
        if (jLabelColor == null) {
402
            jLabelColor =
403
                new javax.swing.JLabel(Messages.getText("background_color")
404
                    + ":");
371 405
        }
372 406

  
373
        return jLabel7;
407
        return jLabelColor;
374 408
    }
375 409

  
376 410
    /**
......
380 414
     */
381 415
    private javax.swing.JLabel getLblColor() {
382 416
        if (lblColor == null) {
383
            lblColor = new javax.swing.JLabel();
384
            lblColor.setText("");
417
            lblColor = new javax.swing.JLabel("");
385 418
            lblColor.setPreferredSize(new java.awt.Dimension(30, 16));
386 419
            Color theColor = view.getMapContext().getViewPort().getBackColor();
387 420
            backColor = theColor;
......
412 445
                public void actionPerformed(java.awt.event.ActionEvent e) {
413 446
                    Color ret =
414 447
                        JColorChooser.showDialog(ViewProperties.this,
415
                            PluginServices.getText(this, "background_color"),
448
                            Messages.getText("background_color"),
416 449
                            lblColor.getBackground());
417 450

  
418 451
                    if (ret != null) {
......
433 466
     * 
434 467
     * @return javax.swing.JScrollPane
435 468
     */
436
    private javax.swing.JScrollPane getJScrollPane() {
469
    private javax.swing.JScrollPane getJScrollPaneComments() {
437 470
        if (jScrollPane == null) {
438 471
            jScrollPane = new javax.swing.JScrollPane();
439 472
            jScrollPane.setViewportView(getTxtComments());
440
            jScrollPane.setPreferredSize(new java.awt.Dimension(340, 70));
473
            Dimension dim = getTxtComments().getPreferredSize();
474
            jScrollPane
475
                .setMinimumSize(new Dimension(dim.width, dim.height + 10));
441 476
        }
442 477

  
443 478
        return jScrollPane;
444 479
    }
445 480

  
446 481
    /**
447
     * This method initializes jPanel
448
     * 
449
     * @return javax.swing.JPanel
450
     */
451
    private javax.swing.JPanel getJPanel() {
452
        if (jPanel == null) {
453
            jPanel = new javax.swing.JPanel();
454

  
455
            GridLayout layout = new GridLayout(3, 1);
456
            layout.setVgap(5);
457
            jPanel.setLayout(layout);
458

  
459
            jPanel.add(getJLabel(), null);
460
            jPanel.add(getJLabel1(), null);
461
            jPanel.add(getJLabel2(), null);
462
            jPanel.setPreferredSize(new java.awt.Dimension(140, 80));
463
        }
464

  
465
        return jPanel;
466
    }
467

  
468
    /**
469
     * This method initializes jPanel1
470
     * 
471
     * @return javax.swing.JPanel
472
     */
473
    private javax.swing.JPanel getJPanel1() {
474
        if (jPanel1 == null) {
475
            jPanel1 = new javax.swing.JPanel();
476

  
477
            java.awt.FlowLayout layFlowLayout2 = new java.awt.FlowLayout();
478
            layFlowLayout2.setHgap(5);
479
            layFlowLayout2.setAlignment(java.awt.FlowLayout.LEFT);
480
            jPanel1.setLayout(layFlowLayout2);
481
            jPanel1.add(getTxtName(), null);
482
            jPanel1.add(getTxtDate(), null);
483
            jPanel1.add(getTxtOwner(), null);
484
            jPanel1.setPreferredSize(new java.awt.Dimension(210, 80));
485
        }
486

  
487
        return jPanel1;
488
    }
489

  
490
    /**
491
     * This method initializes jPanel2
492
     * 
493
     * @return javax.swing.JPanel
494
     */
495
    private javax.swing.JPanel getJPanel2() {
496
        if (jPanel2 == null) {
497
            jLabel8 = new JLabel();
498
            jLabel8.setText("unidades_area");
499
            GridLayout gridLayout = new GridLayout();
500
            gridLayout.setRows(3);
501
            jPanel2 = new javax.swing.JPanel();
502

  
503
            jPanel2.setLayout(gridLayout);
504
            jPanel2.setPreferredSize(new java.awt.Dimension(140, 80));
505
            jPanel2.add(getJLabel4(), null);
506
            jPanel2.add(getJLabel5(), null);
507
            jPanel2.add(jLabel8, null);
508
        }
509

  
510
        return jPanel2;
511
    }
512

  
513
    /**
514
     * This method initializes jPanel3
515
     * 
516
     * @return javax.swing.JPanel
517
     */
518
    private javax.swing.JPanel getJPanel3() {
519
        if (jPanel3 == null) {
520
            jPanel3 = new javax.swing.JPanel();
521

  
522
            java.awt.FlowLayout layFlowLayout6 = new java.awt.FlowLayout();
523
            layFlowLayout6.setAlignment(java.awt.FlowLayout.LEFT);
524
            jPanel3.setLayout(layFlowLayout6);
525
            jPanel3.add(getCmbMapUnits(), null);
526
            jPanel3.add(getCmbDistanceUnits(), null);
527
            jPanel3.setPreferredSize(new java.awt.Dimension(210, 80));
528
            jPanel3.add(getCmbDistanceArea(), null);
529
        }
530

  
531
        return jPanel3;
532
    }
533

  
534
    /**
535
     * This method initializes jLabel3
536
     * 
537
     * @return javax.swing.JLabel
538
     */
539
    private javax.swing.JLabel getJLabel3() {
540
        if (jLabel3 == null) {
541
            jLabel3 = new javax.swing.JLabel();
542
            jLabel3.setText("");
543
            jLabel3.setPreferredSize(new java.awt.Dimension(30, 0));
544
        }
545

  
546
        return jLabel3;
547
    }
548

  
549
    /**
550 482
     * @see com.iver.mdiApp.ui.MDIManager.IWindow#getWindowInfo()
551 483
     */
552 484
    public WindowInfo getWindowInfo() {
553 485
        WindowInfo m_viewinfo = new WindowInfo();
554
        m_viewinfo.setTitle(PluginServices.getText(this, "propiedades_vista"));
555
        m_viewinfo.setHeight(410);
486
        this.validate();
487
        m_viewinfo.setTitle(Messages.getText("propiedades_vista"));
488
        Dimension dim = getPreferredSize();
489
        m_viewinfo.setWidth(dim.width);
490
        m_viewinfo.setHeight(dim.height
491
            + getOkCancelPanel().getPreferredSize().height);
556 492
        return m_viewinfo;
557 493
    }
558 494

  
559 495
    /**
560
     * @see com.iver.mdiApp.ui.MDIManager.IWindow#windowActivated()
561
     */
562
    public void viewActivated() {
563
        // FIXME: jjdc este metodo sobra ? esta vacio.
564
    }
565

  
566
    /**
567 496
     * This method initializes jPanel4
568 497
     * 
569 498
     * @return javax.swing.JPanel
......
572 501
        if (jPanelProj == null) {
573 502
            IProjection proj = view.getProjection();
574 503
            jPanelProj = CRSSelectPanel.getPanel(proj);
575
            jPanelProj.setPreferredSize(new java.awt.Dimension(330, 35));           
576 504
        }
577 505
        return jPanelProj;
578 506
    }
......
610 538
                        if (theView.getName().equals(name)) {
611 539
                            JOptionPane.showMessageDialog(
612 540
                                (Component) PluginServices.getMainFrame(),
613
                                PluginServices.getText(this,
614
                                    "elemento_ya_existe"));
541
                                Messages.getText("elemento_ya_existe"));
615 542
                            return;
616 543
                        }
617 544
                    }
......
627 554
                    view.getMapContext().getViewPort()
628 555
                        .setDistanceArea(cmbDistanceArea.getSelectedIndex());
629 556
                    view.setBackColor(backColor);
630
                    
631
                    //Select the projection                    
557

  
558
                    // Select the projection
632 559
                    if (jPanelProj.isOkPressed()) {
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff