[Imports] [Talk-us] GNIS tag removal proposal

Bryce Nesbitt bryce2 at obviously.com
Wed Sep 11 08:00:55 UTC 2013


Here's a patch to JOSM to warn the human editor about tags that are about
to disappear.  What do you think?


--- src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
(revision
6232)
+++ src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
(working
copy)
@@ -280,6 +276,26 @@

 propertyTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
         propertyTable.getTableHeader().setReorderingAllowed(false);

+        // Style the key column
+        propertyTable.getColumnModel().getColumn(0).setCellRenderer(new
DefaultTableCellRenderer(){
+            @Override public Component
getTableCellRendererComponent(JTable table, Object value,
+
boolean isSelected, boolean hasFocus, int row, int column) {
+                Component cc = super.getTableCellRendererComponent(table,
value, isSelected, false, row, column);
+                if (value == null)
+                    return this;
+                String myvalue = (String)value;
+                if (OsmPrimitive.getDiscardableKeys().contains(myvalue) ) {
+                    cc.setFont(cc.getFont().deriveFont(Font.ITALIC));
+                    cc.setBackground(Color.RED);
+                } else {
+                    cc.setFont(cc.getFont().deriveFont(Font.PLAIN));
+                    cc.setBackground(Color.WHITE);
+                }
+                return cc;
+            }
+        });
+
+        // Style the value column
         propertyTable.getColumnModel().getColumn(1).setCellRenderer(new
DefaultTableCellRenderer(){
             @Override public Component
getTableCellRendererComponent(JTable table, Object value,
                     boolean isSelected, boolean hasFocus, int row, int
column) {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/imports/attachments/20130911/7a9a1e9c/attachment.html>


More information about the Imports mailing list