source: osm/applications/editors/josm/plugins/buildings_tools/src/buildings_tools/AdvancedSettingsDialog.java@ 30045

Last change on this file since 30045 was 30045, checked in by donvip, 11 years ago

[josm_building_tools] - see #josm7328 - bring code quality closer to JOSM core standards

File size: 1.6 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package buildings_tools;
3
4import static org.openstreetmap.josm.tools.I18n.tr;
5
6import java.util.Map.Entry;
7
8import javax.swing.JCheckBox;
9import javax.swing.JLabel;
10
11import org.openstreetmap.josm.gui.tagging.TagEditorModel;
12import org.openstreetmap.josm.gui.tagging.TagEditorPanel;
13import org.openstreetmap.josm.tools.GBC;
14
15public class AdvancedSettingsDialog extends MyDialog {
16 private final TagEditorModel tagsModel = new TagEditorModel();
17
18 private final JCheckBox cBigMode = new JCheckBox(tr("Big buildings mode"));
19 private final JCheckBox cSoftCur = new JCheckBox(tr("Rotate crosshair"));
20
21 public AdvancedSettingsDialog() {
22 super(tr("Advanced settings"));
23
24 panel.add(new JLabel(tr("Buildings tags:")), GBC.eol().fill(GBC.HORIZONTAL));
25
26 for (Entry<String, String> entry : ToolSettings.getTags().entrySet()) {
27 tagsModel.add(entry.getKey(), entry.getValue());
28 }
29 panel.add(new TagEditorPanel(tagsModel, null), GBC.eop().fill(GBC.BOTH));
30
31 panel.add(cBigMode, GBC.eol().fill(GBC.HORIZONTAL));
32 panel.add(cSoftCur, GBC.eol().fill(GBC.HORIZONTAL));
33
34 cBigMode.setSelected(ToolSettings.isBBMode());
35 cSoftCur.setSelected(ToolSettings.isSoftCursor());
36
37 setupDialog();
38 showDialog();
39 }
40
41 public final void saveSettings() {
42 tagsModel.applyToTags(ToolSettings.getTags(), false);
43 ToolSettings.saveTags();
44 ToolSettings.setBBMode(cBigMode.isSelected());
45 ToolSettings.setSoftCursor(cSoftCur.isSelected());
46 }
47}
Note: See TracBrowser for help on using the repository browser.