Changeset 22904 in osm
- Timestamp:
- 2010-08-31T12:29:48+02:00 (14 years ago)
- Location:
- applications/editors/josm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/buildings_tools/src/buildings_tools/AdvancedSettingsDialog.java
r22529 r22904 2 2 3 3 import static org.openstreetmap.josm.tools.I18n.tr; 4 import static buildings_tools.BuildingSizeDialog.addLabelled;5 4 6 5 import java.awt.GridBagLayout; 7 6 import java.awt.Insets; 7 import java.util.Map.Entry; 8 8 9 9 import javax.swing.JCheckBox; 10 import javax.swing.JLabel; 10 11 import javax.swing.JPanel; 11 import javax.swing.JTextField;12 12 13 13 import org.openstreetmap.josm.Main; 14 14 import org.openstreetmap.josm.gui.ExtendedDialog; 15 import org.openstreetmap.josm.gui.tagging.TagEditorModel; 16 import org.openstreetmap.josm.gui.tagging.TagEditorPanel; 15 17 import org.openstreetmap.josm.tools.GBC; 16 18 17 19 public class AdvancedSettingsDialog extends ExtendedDialog { 18 // TODO: Replace tag textbox to full-fledged tag editor19 JTextField tBTag = new JTextField(); 20 JCheckBox cBigMode = new JCheckBox(tr("Big buildings mode"));21 JCheckBox cSoftCur = new JCheckBox(tr("Rotate crosshair"));20 private TagEditorModel tagsModel = new TagEditorModel(); 21 22 private JCheckBox cBigMode = new JCheckBox(tr("Big buildings mode")); 23 private JCheckBox cSoftCur = new JCheckBox(tr("Rotate crosshair")); 22 24 23 25 public AdvancedSettingsDialog() { … … 29 31 30 32 final JPanel panel = new JPanel(new GridBagLayout()); 31 addLabelled(panel, tr("Building tag:"), tBTag); 33 panel.add(new JLabel(tr("Buildings tags:")), GBC.eol().fill(GBC.HORIZONTAL)); 34 35 for (Entry<String, String> entry : ToolSettings.getTags().entrySet()) { 36 tagsModel.add(entry.getKey(), entry.getValue()); 37 } 38 panel.add(new TagEditorPanel(tagsModel), GBC.eop().fill(GBC.BOTH)); 39 32 40 panel.add(cBigMode, GBC.eol().fill(GBC.HORIZONTAL)); 33 41 panel.add(cSoftCur, GBC.eol().fill(GBC.HORIZONTAL)); 34 42 35 tBTag.setText(ToolSettings.getTag());36 43 cBigMode.setSelected(ToolSettings.isBBMode()); 37 44 cSoftCur.setSelected(ToolSettings.isSoftCursor()); 38 45 39 46 setContent(panel); 47 40 48 setupDialog(); 41 49 setVisible(true); 42 }43 44 public String getTag() {45 return tBTag.getText();46 50 } 47 51 … … 55 59 56 60 public void saveSettings() { 57 ToolSettings.setTag(getTag());61 tagsModel.applyToTags(ToolSettings.getTags()); 58 62 ToolSettings.setBBMode(isBBMode()); 59 63 ToolSettings.setSoftCursor(isSoftCursor()); -
applications/editors/josm/plugins/buildings_tools/src/buildings_tools/Building.java
r21876 r22904 248 248 } 249 249 w.addNode(nodes[0]); 250 w. put("building", ToolSettings.getTag());250 w.setKeys(ToolSettings.getTags()); 251 251 Collection<Command> cmds = new LinkedList<Command>(); 252 252 for (int i = 0; i < 4; i++) { -
applications/editors/josm/plugins/buildings_tools/src/buildings_tools/DrawBuildingAction.java
r21875 r22904 42 42 @SuppressWarnings("serial") 43 43 public class DrawBuildingAction extends MapMode implements MapViewPaintable, AWTEventListener, SelectionChangedListener { 44 enum Mode {44 private enum Mode { 45 45 None, Drawing, DrawingWidth, DrawingAngFix 46 46 } … … 65 65 super(tr("Draw buildings"), "building", tr("Draw buildings"), 66 66 Shortcut.registerShortcut("mapmode:buildings", 67 tr("Mode: {0}", tr("Draw buildings")),68 KeyEvent.VK_W, Shortcut.GROUP_EDIT),67 tr("Mode: {0}", tr("Draw buildings")), 68 KeyEvent.VK_W, Shortcut.GROUP_EDIT), 69 69 mapFrame, getCursor()); 70 70 … … 134 134 Main.map.mapView.addMouseMotionListener(this); 135 135 Main.map.mapView.addTemporaryLayer(this); 136 DataSet. selListeners.add(this);136 DataSet.addSelectionListener(this); 137 137 updateSnap(getCurrentDataSet().getSelected()); 138 138 try { … … 148 148 Main.map.mapView.removeMouseMotionListener(this); 149 149 Main.map.mapView.removeTemporaryLayer(this); 150 DataSet. selListeners.remove(this);150 DataSet.removeSelectionListener(this); 151 151 try { 152 152 Toolkit.getDefaultToolkit().removeAWTEventListener(this); -
applications/editors/josm/plugins/buildings_tools/src/buildings_tools/ToolSettings.java
r21875 r22904 1 1 package buildings_tools; 2 3 import java.util.HashMap; 4 import java.util.Map; 2 5 3 6 import org.openstreetmap.josm.Main; … … 7 10 private static double lenstep = 0; 8 11 private static boolean useAddr; 9 private static String tag = "yes";12 private static final Map<String, String> tags = new HashMap<String, String>(); 10 13 private static boolean autoSelect; 14 15 static { 16 tags.put("building", "yes"); 17 } 11 18 12 19 public static void setAddrDialog(boolean _useAddr) { … … 31 38 } 32 39 33 public static void setTag(String newtag) { 34 tag = newtag; 35 } 36 37 public static String getTag() { 38 return tag; 40 public static Map<String, String> getTags() { 41 return tags; 39 42 } 40 43
Note:
See TracChangeset
for help on using the changeset viewer.