Revision 37609
branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/project/documents/view/gui/ViewProperties.java | ||
---|---|---|
572 | 572 |
if (jPanelProj == null) { |
573 | 573 |
IProjection proj = view.getProjection(); |
574 | 574 |
jPanelProj = CRSSelectPanel.getPanel(proj); |
575 |
jPanelProj.setPreferredSize(new java.awt.Dimension(330, 35)); |
|
576 |
jPanelProj.addActionListener(new java.awt.event.ActionListener() { |
|
577 |
|
|
578 |
public void actionPerformed(java.awt.event.ActionEvent e) { |
|
579 |
if (jPanelProj.isOkPressed()) { |
|
580 |
if (!jPanelProj.getCurProj().isProjected()) { |
|
581 |
getCmbMapUnits().setSelectedItem( |
|
582 |
PluginServices |
|
583 |
.getText(this, "Grados")); |
|
584 |
getCmbMapUnits().setEnabled(false); |
|
585 |
} else { |
|
586 |
if (getCmbMapUnits().getSelectedItem().equals( |
|
587 |
PluginServices |
|
588 |
.getText(this, "Grados"))) { |
|
589 |
getCmbMapUnits().setSelectedIndex(1); |
|
590 |
} |
|
591 |
getCmbMapUnits().setEnabled(true); |
|
592 |
} |
|
593 |
view.setProjection(jPanelProj.getCurProj()); |
|
594 |
} |
|
595 |
} |
|
596 |
}); |
|
575 |
jPanelProj.setPreferredSize(new java.awt.Dimension(330, 35)); |
|
597 | 576 |
} |
598 | 577 |
return jPanelProj; |
599 | 578 |
} |
... | ... | |
648 | 627 |
view.getMapContext().getViewPort() |
649 | 628 |
.setDistanceArea(cmbDistanceArea.getSelectedIndex()); |
650 | 629 |
view.setBackColor(backColor); |
630 |
|
|
631 |
//Select the projection |
|
632 |
if (jPanelProj.isOkPressed()) { |
|
633 |
if (!jPanelProj.getCurProj().isProjected()) { |
|
634 |
getCmbMapUnits().setSelectedItem( |
|
635 |
PluginServices |
|
636 |
.getText(this, "Grados")); |
|
637 |
getCmbMapUnits().setEnabled(false); |
|
638 |
} else { |
|
639 |
if (getCmbMapUnits().getSelectedItem().equals( |
|
640 |
PluginServices |
|
641 |
.getText(this, "Grados"))) { |
|
642 |
getCmbMapUnits().setSelectedIndex(1); |
|
643 |
} |
|
644 |
getCmbMapUnits().setEnabled(true); |
|
645 |
} |
|
646 |
view.setProjection(jPanelProj.getCurProj()); |
|
647 |
} |
|
648 |
|
|
651 | 649 |
isAcceppted = true; |
652 | 650 |
PluginServices.getMDIManager().closeWindow( |
653 | 651 |
ViewProperties.this); |
branches/v2_0_0_prep/libraries/libProjection/src/org/cresques/ui/DefaultDialogPanel.java | ||
---|---|---|
45 | 45 |
protected JPanel buttonPane = null; |
46 | 46 |
private JButton acceptButton = null; |
47 | 47 |
private JButton cancelButton = null; |
48 |
private JButton applyButton = null; |
|
49 | 48 |
private int flag = 0; |
50 | 49 |
protected int cWidth = 0, difWidth = 0; |
51 | 50 |
protected int cHeight = 0, difHeight = 0; |
... | ... | |
155 | 154 |
*/ |
156 | 155 |
protected JPanel getButtonPanel() { |
157 | 156 |
if (buttonPane == null) { |
158 |
GridBagConstraints gridBagConstraints4 = new GridBagConstraints(); |
|
159 |
gridBagConstraints4.gridx = 2; |
|
160 |
gridBagConstraints4.insets = new java.awt.Insets(0,3,0,0); |
|
161 |
gridBagConstraints4.gridy = 0; |
|
162 | 157 |
GridBagConstraints gridBagConstraints3 = new GridBagConstraints(); |
163 | 158 |
gridBagConstraints3.gridx = 1; |
164 | 159 |
gridBagConstraints3.insets = new java.awt.Insets(0,3,0,3); |
... | ... | |
171 | 166 |
buttonPane.setLayout(new GridBagLayout()); |
172 | 167 |
buttonPane.add(getAcceptButton(), gridBagConstraints1); |
173 | 168 |
buttonPane.add(getCancelButton(), gridBagConstraints3); |
174 |
buttonPane.add(getApplyButton(), gridBagConstraints4); |
|
175 | 169 |
} |
176 | 170 |
|
177 | 171 |
return buttonPane; |
... | ... | |
205 | 199 |
return cancelButton; |
206 | 200 |
} |
207 | 201 |
|
208 |
/** |
|
209 |
* This method initializes Apply Button |
|
210 |
* |
|
211 |
* @return javax.swing.JButton |
|
212 |
*/ |
|
213 |
public JButton getApplyButton() { |
|
214 |
if (applyButton == null) { |
|
215 |
applyButton = new JButton(Messages.getText("Aplicar")); |
|
216 |
} |
|
217 | 202 |
|
218 |
return applyButton; |
|
219 |
} |
|
220 | 203 |
|
221 | 204 |
public void componentHidden(ComponentEvent e) { |
222 | 205 |
// TODO Auto-generated method stub |
Also available in: Unified diff