1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package buildings_tools;
|
---|
3 |
|
---|
4 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
5 |
|
---|
6 | import java.util.Map.Entry;
|
---|
7 |
|
---|
8 | import javax.swing.JCheckBox;
|
---|
9 | import javax.swing.JLabel;
|
---|
10 |
|
---|
11 | import org.openstreetmap.josm.gui.tagging.TagEditorModel;
|
---|
12 | import org.openstreetmap.josm.gui.tagging.TagEditorPanel;
|
---|
13 | import org.openstreetmap.josm.tools.GBC;
|
---|
14 |
|
---|
15 | public 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 | }
|
---|