Changeset 32556 in osm for applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionNewLocation.java
- Timestamp:
- 2016-07-04T14:18:17+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionNewLocation.java
r32329 r32556 1 // License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others1 // License: GPL. For details, see LICENSE file. 2 2 package cadastre_fr; 3 3 … … 23 23 private static final long serialVersionUID = 1L; 24 24 25 private static final String departements[] = { 25 // CHECKSTYLE.OFF: LineLength 26 // CHECKSTYLE.OFF: SingleSpaceSeparator 27 28 private static final String[] departements = { 26 29 "", tr("(optional)"), 27 30 "001", "01 - Ain", "002", "02 - Aisne", "003", "03 - Allier", "004", "04 - Alpes de Haute-Provence", "005", "05 - Hautes-Alpes", … … 48 51 }; 49 52 53 // CHECKSTYLE.ON: SingleSpaceSeparator 54 // CHECKSTYLE.ON: LineLength 55 50 56 public MenuActionNewLocation() { 51 super(tr("Change location"), "cadastre_small", tr("Set a new location for the next request"), null, false, "cadastrefr/newlocation", true); 57 super(tr("Change location"), "cadastre_small", tr("Set a new location for the next request"), null, false, 58 "cadastrefr/newlocation", true); 52 59 } 53 60 … … 66 73 JPanel p = new JPanel(new GridBagLayout()); 67 74 JLabel labelLocation = new JLabel(tr("Commune")); 68 final JTextField inputTown = new JTextField( 75 final JTextField inputTown = new JTextField(Main.pref.get("cadastrewms.location")); 69 76 inputTown.setToolTipText(tr("<html>Enter the town,village or city name.<br>" 70 77 + "Use the syntax and punctuation known by www.cadastre.gouv.fr .</html>")); 71 JLabel labelDepartement = 78 JLabel labelDepartement = new JLabel(tr("Departement")); 72 79 final JComboBox<String> inputDepartement = new JComboBox<>(); 73 for (int i =1; i<departements.length; i+=2) {80 for (int i = 1; i < departements.length; i += 2) { 74 81 inputDepartement.addItem(departements[i]); 75 82 } 76 83 inputDepartement.setToolTipText(tr("<html>Departement number (optional)</html>")); 77 84 if (!Main.pref.get("cadastrewms.codeDepartement").equals("")) { 78 for (int i =0; i < departements.length; i=i+2)85 for (int i = 0; i < departements.length; i += 2) { 79 86 if (departements[i].equals(Main.pref.get("cadastrewms.codeDepartement"))) 80 87 inputDepartement.setSelectedIndex(i/2); 88 } 81 89 } 82 90 p.add(labelSectionNewLocation, GBC.eol()); … … 119 127 Main.info("Add new layer with Location:" + inputTown.getText()); 120 128 } else if (existingLayers != null && existingLayers.size() > 0 && Main.getLayerManager().getActiveLayer() instanceof WMSLayer) { 121 wmsLayer = (WMSLayer)Main.getLayerManager().getActiveLayer(); 129 wmsLayer = (WMSLayer) Main.getLayerManager().getActiveLayer(); 122 130 } 123 131
Note:
See TracChangeset
for help on using the changeset viewer.