Changeset 9561 in osm


Ignore:
Timestamp:
2008-08-08T12:02:07+02:00 (16 years ago)
Author:
stoecker
Message:

continued TagChecker validator plugin

Location:
applications/editors/josm/plugins
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/lang/de/de.po

    r9521 r9561  
    1111"Project-Id-Version: de\n"
    1212"Report-Msgid-Bugs-To: \n"
    13 "POT-Creation-Date: 2008-08-07 10:17+0200\n"
    14 "PO-Revision-Date: 2008-08-07 10:35+0200\n"
     13"POT-Creation-Date: 2008-08-08 09:46+0200\n"
     14"PO-Revision-Date: 2008-08-08 10:22+0200\n"
    1515"Last-Translator: Dirk Stöcker <openstreetmap@dstoecker.de>\n"
    1616"Language-Team:  <de@li.org>\n"
     
    551551#: ../colorscheme/src/at/dallermassl/josm/plugin/colorscheme/ColorSchemePreference.java:79
    552552#: ../wmsplugin/src/wmsplugin/WMSPreferenceEditor.java:55
    553 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:404
     553#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:457
    554554msgid "Add"
    555555msgstr "Hinzufügen"
     
    14041404#: ../../core/src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java:566
    14051405#: ../grid/src/grid/GridPlugin.java:43 ../grid/src/grid/GridPlugin.java:49
    1406 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:414
     1406#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:467
    14071407msgid "Edit"
    14081408msgstr "Bearbeiten"
     
    14351435#: ../colorscheme/src/at/dallermassl/josm/plugin/colorscheme/ColorSchemePreference.java:93
    14361436#: ../wmsplugin/src/wmsplugin/WMSPreferenceEditor.java:75
    1437 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:445
     1437#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:498
    14381438msgid "Delete"
    14391439msgstr "Löschen"
     
    14831483#: ../../core/src/org/openstreetmap/josm/gui/dialogs/RelationEditor.java:247
    14841484#: ../../core/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java:65
    1485 #: ../validator/src/org/openstreetmap/josm/plugins/validator/ValidatorDialog.java:78
     1485#: ../validator/src/org/openstreetmap/josm/plugins/validator/ValidatorDialog.java:75
    14861486msgid "Select"
    14871487msgstr "Auswahl"
     
    28462846#: ../../core/src/org/openstreetmap/josm/gui/preferences/AdvancedPreference.java:116
    28472847#: ../../core/src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java:552
    2848 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:433
     2848#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:486
    28492849msgid "Please select the row to edit."
    28502850msgstr "Bitte wählen sie eine Zeile zum Bearbeiten."
     
    28542854#: ../../core/src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java:557
    28552855#: ../wmsplugin/src/wmsplugin/WMSPreferenceEditor.java:80
    2856 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:449
     2856#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:502
    28572857msgid "Please select the row to delete."
    28582858msgstr "Bitte wählen Sie die zu löschende Zeile."
     
    28712871
    28722872#: ../../core/src/org/openstreetmap/josm/gui/preferences/TaggingPresetPreference.java:91
    2873 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:460
     2873#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:513
    28742874msgid "Delete the selected source from the list."
    28752875msgstr "Ausgewählte Quelle löschen."
     
    31743174#: ../../core/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java:74
    31753175#: ../../core/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java:66
    3176 #: ../validator/src/org/openstreetmap/josm/plugins/validator/ValidatorDialog.java:79
     3176#: ../validator/src/org/openstreetmap/josm/plugins/validator/ValidatorDialog.java:76
    31773177msgid "Set the selected elements on the map to the selected items in the list above."
    31783178msgstr ""
     
    71087108"talking to the plugin."
    71097109msgstr ""
    7110 "Das Fernbedienungsplugin lauscht am Port 8111 des lokalen Rechners (localhost). "
    7111 "Dieser Port ist nicht konfigurierbar, weil er von externen Anwendungen adressiert "
    7112 "werden muss, welche das Plugin nutzen."
     7110"Das Fernbedienungsplugin lauscht am Port 8111 des lokalen Rechners "
     7111"(localhost). Dieser Port ist nicht konfigurierbar, weil er von externen "
     7112"Anwendungen adressiert werden muss, welche das Plugin nutzen."
    71137113
    71147114#: ../remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RemoteControlPreferences.java:42
     
    71167116msgstr "Erlaubte Aktionen"
    71177117
    7118 #: ../slippy_map_chooser/src/OsmMapControl.java:63
    7119 msgid "left"
    7120 msgstr "links"
    7121 
    7122 #: ../slippy_map_chooser/src/SlippyMapChooser.java:83
     7118#: ../slippy_map_chooser/src/SlippyMapChooser.java:63
    71237119msgid ""
    71247120"Zoom: Mousewheel or double click.   Move map: Hold right mousebutton and "
     
    71287124"Maus bewegen.   Auswahl: Klick."
    71297125
    7130 #: ../slippy_map_chooser/src/SlippyMapChooser.java:84
     7126#: ../slippy_map_chooser/src/SlippyMapChooser.java:66
    71317127msgid "Slippy map"
    71327128msgstr "Schnelle Karte"
     
    71527148msgstr "Raster Ebene:"
    71537149
    7154 #: ../validator/src/org/openstreetmap/josm/plugins/validator/ValidatorDialog.java:66
     7150#: ../validator/src/org/openstreetmap/josm/plugins/validator/ValidatorDialog.java:63
    71557151#: ../validator/src/org/openstreetmap/josm/plugins/validator/ErrorLayer.java:36
    71567152#: ../validator/src/org/openstreetmap/josm/plugins/validator/ErrorLayer.java:101
     
    71587154msgstr "Ergebnisse der Datenprüfung"
    71597155
    7160 #: ../validator/src/org/openstreetmap/josm/plugins/validator/ValidatorDialog.java:66
     7156#: ../validator/src/org/openstreetmap/josm/plugins/validator/ValidatorDialog.java:63
    71617157msgid "Open the validation window."
    71627158msgstr "Fenster mit dem Ergebnis der Prüfung öffnen."
    71637159
    7164 #: ../validator/src/org/openstreetmap/josm/plugins/validator/ValidatorDialog.java:82
     7160#: ../validator/src/org/openstreetmap/josm/plugins/validator/ValidatorDialog.java:79
    71657161msgid "Validate"
    71667162msgstr "Prüfen"
    71677163
    7168 #: ../validator/src/org/openstreetmap/josm/plugins/validator/ValidatorDialog.java:82
     7164#: ../validator/src/org/openstreetmap/josm/plugins/validator/ValidatorDialog.java:79
    71697165msgid "Validate the data."
    71707166msgstr "Überprüfe die Daten."
    71717167
    7172 #: ../validator/src/org/openstreetmap/josm/plugins/validator/ValidatorDialog.java:83
     7168#: ../validator/src/org/openstreetmap/josm/plugins/validator/ValidatorDialog.java:80
    71737169msgid "Fix"
    71747170msgstr "Repariere"
    71757171
    7176 #: ../validator/src/org/openstreetmap/josm/plugins/validator/ValidatorDialog.java:83
     7172#: ../validator/src/org/openstreetmap/josm/plugins/validator/ValidatorDialog.java:80
    71777173msgid "Fix the selected errors."
    71787174msgstr "Korrigiere die Fehler in den Daten."
    71797175
    7180 #: ../validator/src/org/openstreetmap/josm/plugins/validator/ValidatorDialog.java:88
     7176#: ../validator/src/org/openstreetmap/josm/plugins/validator/ValidatorDialog.java:85
    71817177msgid "Ignore"
    71827178msgstr "Ignoriere"
    71837179
    7184 #: ../validator/src/org/openstreetmap/josm/plugins/validator/ValidatorDialog.java:88
     7180#: ../validator/src/org/openstreetmap/josm/plugins/validator/ValidatorDialog.java:85
    71857181msgid "Ignore the selected errors next time."
    71867182msgstr "Ignoriere die Fehler beim nächsten Mal."
     
    73407336msgstr "Knoten ohne Zusatzinformation oder ohne Verbindung"
    73417337
    7342 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:113
     7338#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:129
    73437339msgid "Properties checker :"
    73447340msgstr "Eigenschaftsprüfer:"
    73457341
    7346 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:114
     7342#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:130
    73477343msgid "This plugin checks for errors in property keys and values."
    73487344msgstr "Dieses Plugin prüft auf Fehler in Schlüsseln und Werten"
    73497345
    7350 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:192
     7346#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:221
    73517347#, java-format
    73527348msgid ""
     
    73577353"{0}"
    73587354
    7359 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:246
     7355#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:274
     7356msgid "Illegal tag/value combinations"
     7357msgstr "Ungültige Schlüssel/Wert-Kombinationen"
     7358
     7359#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:288
    73607360msgid "Tags with empty values"
    73617361msgstr "Tags mit leerem Wert"
    73627362
    7363 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:251
     7363#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:293
    73647364#, java-format
    73657365msgid "Invalid property key ''{0}''"
    73667366msgstr "Ungültiger Schlüssel \"{0}\""
    73677367
    7368 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:256
     7368#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:298
    73697369#, java-format
    73707370msgid "Invalid white space in property key ''{0}''"
    73717371msgstr "Ungültiger Leerraum in Schlüssel \"{0}\""
    73727372
    7373 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:261
     7373#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:303
    73747374msgid "Property values start or end with white space"
    73757375msgstr "Werte beginnen oder enden mit Leerraum"
    73767376
    7377 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:269
     7377#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:311
    73787378msgid "Unknown property values"
    73797379msgstr "Unbekannter Werte"
    73807380
    7381 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:278
     7381#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:320
    73827382msgid "FIXMES"
    73837383msgstr "FIXMEs"
    73847384
    7385 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:389
     7385#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:434
    73867386msgid "Check property keys."
    73877387msgstr "Schlüssel prüfen."
    73887388
    7389 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:390
     7389#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:435
    73907390msgid "Validate that property keys are valid checking against list of words."
    73917391msgstr "Überprüft Schlüssel auf Gültigkeit durch Abgleich mit einer Liste."
    73927392
    7393 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:407
    7394 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:427
    7395 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:437
     7393#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:442
     7394msgid "Use complex property checker."
     7395msgstr "Nutze komplexen Eigenschaftsprüfer."
     7396
     7397#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:443
     7398msgid "Validate property values and tags using complex rules."
     7399msgstr "Prüft die Gültigkeit von Werten und Schlüsseln anhand von komplexen Regeln."
     7400
     7401#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:460
     7402#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:480
     7403#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:490
    73967404msgid "TagChecker source"
    73977405msgstr "Schlüsselprüferdatenquellen"
    73987406
    7399 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:457
     7407#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:510
    74007408msgid ""
    74017409"The sources (url or filename) of spell check (see http://wiki.openstreetmap."
     
    74057413"openstreetmap.org/index.php/User:JLS/speller) oder Schlüsselprüfung."
    74067414
    7407 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:458
     7415#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:511
    74087416msgid "Add a new source to the list."
    74097417msgstr "Eine neue Quelle zur Liste hinzufügen."
    74107418
    7411 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:459
     7419#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:512
    74127420msgid "Edit the selected source."
    74137421msgstr "Ausgewählte Quelle bearbeiten."
    74147422
    7415 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:462
     7423#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:515
    74167424msgid "Data sources"
    74177425msgstr "Datenquellen"
    74187426
    7419 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:486
     7427#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:535
    74207428msgid "Check property values."
    74217429msgstr "Werte überprüfen."
    74227430
    7423 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:487
     7431#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:536
    74247432msgid "Validate that property values are valid checking against presets."
    74257433msgstr "Prüft die Gültigkeit von Werten anhand von Presets."
    74267434
    7427 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:495
     7435#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:543
    74287436msgid "Check for FIXMES."
    74297437msgstr "Prüfe auf FIXMEs"
    74307438
    7431 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:496
     7439#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:544
    74327440msgid "Looks for nodes or ways with FIXME in any property value."
    74337441msgstr ""
     
    74357443"haben."
    74367444
    7437 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:504
     7445#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:551
    74387446msgid "Use default data file."
    74397447msgstr "Standarddatendatei nutzen."
    74407448
    7441 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:505
     7449#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:552
    74427450msgid "Use the default data file (recommended)."
    74437451msgstr "Nutzung der Standarddatendatei (empfohlen)."
    74447452
    7445 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:509
     7453#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:555
    74467454msgid "Use default spellcheck file."
    74477455msgstr "Standarddatei für Schreibprüfung nutzen."
    74487456
    7449 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:510
     7457#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:556
    74507458msgid "Use the default spellcheck file (recommended)."
    74517459msgstr "Nutzung der Standarddatei für die Schreibfehlerprüfung (empfohlen)."
    74527460
    7453 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:575
     7461#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java:633
    74547462msgid "Fix properties"
    74557463msgstr "Eigenschaften korrigieren"
     
    74757483msgstr "Verdrehtes Land: Land nicht auf der linken Seite"
    74767484
    7477 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/OverlappingWays.java:33
     7485#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/OverlappingWays.java:34
    74787486msgid "Overlapping ways."
    74797487msgstr "Wege überlappen sich."
    74807488
    7481 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/OverlappingWays.java:34
     7489#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/OverlappingWays.java:35
    74827490msgid ""
    74837491"This test checks that a connection between two nodes is not used by more "
     
    74877495"als einem Weg verwendet wird."
    74887496
    7489 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/OverlappingWays.java:96
     7497#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/OverlappingWays.java:94
    74907498msgid "Overlapping areas"
    74917499msgstr "Überlappende Flächen"
    74927500
    7493 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/OverlappingWays.java:98
     7501#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/OverlappingWays.java:96
    74947502msgid "Overlapping highways (with area)"
    74957503msgstr "Überlappende Straßen (mit Fläche)"
    74967504
    7497 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/OverlappingWays.java:100
     7505#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/OverlappingWays.java:98
    74987506msgid "Overlapping railways (with area)"
    74997507msgstr "Überlappende Schienen (mit Fläche)"
    75007508
    7501 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/OverlappingWays.java:102
     7509#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/OverlappingWays.java:100
    75027510msgid "Overlapping ways (with area)"
    75037511msgstr "Überlappende Wege (mit Fläche)"
    75047512
    7505 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/OverlappingWays.java:105
     7513#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/OverlappingWays.java:103
    75067514msgid "Overlapping highways"
    75077515msgstr "Überlappende Straßen"
    75087516
    7509 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/OverlappingWays.java:107
     7517#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/OverlappingWays.java:105
    75107518msgid "Overlapping railways"
    75117519msgstr "Überlappende Schienen"
    75127520
    7513 #: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/OverlappingWays.java:109
     7521#: ../validator/src/org/openstreetmap/josm/plugins/validator/tests/OverlappingWays.java:107
    75147522msgid "Overlapping ways"
    75157523msgstr "Überlappende Wege"
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/ValidatorDialog.java

    r9454 r9561  
    22
    33import static org.openstreetmap.josm.tools.I18n.tr;
     4import static org.openstreetmap.josm.tools.I18n.marktr;
    45
    56import java.awt.BorderLayout;
     
    2526import org.openstreetmap.josm.data.osm.DataSet;
    2627import org.openstreetmap.josm.data.osm.OsmPrimitive;
     28import org.openstreetmap.josm.gui.SideButton;
    2729import org.openstreetmap.josm.gui.dialogs.ToggleDialog;
    2830import org.openstreetmap.josm.plugins.validator.util.Bag;
     
    4850        public Collection<String> ignoredErrors = new TreeSet<String>();
    4951
    50         /** The fix button */
    51         private JButton fixButton;
    52 
    53         /** The ignore button */
    54         private JButton ignoreButton;
    55 
    56         /** The select button */
    57         private JButton selectButton;
     52        private SideButton fixButton; /** The fix button */
     53        private SideButton ignoreButton; /** The ignore button */
     54        private SideButton selectButton; /** The select button */
    5855
    5956        /** Last selected element */
     
    7673                JPanel buttonPanel = new JPanel(new GridLayout(1,3));
    7774
    78                 selectButton = Util.createButton(tr("Select"), "select", "mapmode/selection/select",
     75                selectButton = new SideButton(marktr("Select"), "select", "Validator",
    7976                tr("Set the selected elements on the map to the selected items in the list above."), this);
    8077                selectButton.setEnabled(false);
    8178                buttonPanel.add(selectButton);
    82                 buttonPanel.add(Util.createButton(tr("Validate"), "validate", "dialogs/refresh", tr("Validate the data."), this));
    83                 fixButton = Util.createButton(tr("Fix"), "fix", "dialogs/fix", tr("Fix the selected errors."), this);
     79                buttonPanel.add(new SideButton(marktr("Validate"), "refresh", "Validator", tr("Validate the data."), this));
     80                fixButton = new SideButton(marktr("Fix"), "fix", "Validator", tr("Fix the selected errors."), this);
    8481                fixButton.setEnabled(false);
    8582                buttonPanel.add(fixButton);
    8683                if(Main.pref.getBoolean(PreferenceEditor.PREF_USE_IGNORE, true))
    8784                {
    88                         ignoreButton = Util.createButton(tr("Ignore"), "ignore", "dialogs/delete", tr("Ignore the selected errors next time."), this);
     85                        ignoreButton = new SideButton(marktr("Ignore"), "delete", "Validator", tr("Ignore the selected errors next time."), this);
    8986                        ignoreButton.setEnabled(false);
    9087                        buttonPanel.add(ignoreButton);
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/OverlappingWays.java

    r9021 r9561  
    77import org.openstreetmap.josm.data.coor.LatLon;
    88import org.openstreetmap.josm.data.osm.OsmPrimitive;
     9import org.openstreetmap.josm.data.osm.OsmUtils;
    910import org.openstreetmap.josm.data.osm.Way;
    1011import org.openstreetmap.josm.data.osm.WaySegment;
     
    6566                                for (WaySegment ws : duplicated)
    6667                                {
    67                                         String ar;
    68 
    6968                                        if (ws.way.get("highway") != null)
    7069                                                highway++;
    7170                                        else if (ws.way.get("railway") != null)
    7271                                                railway++;
    73                                         ar = ws.way.get("area");
    74                                         if (ar != null && ("true".equalsIgnoreCase(ar) || "yes".equalsIgnoreCase(ar) || "1".equals(ar)))
     72                                        if (OsmUtils.getOsmBoolean(ws.way.get("area")))
    7573                                                area++;
    7674                                        if (ws.way.get("landuse") != null || ws.way.get("natural") != null
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java

    r9279 r9561  
    33import static org.openstreetmap.josm.tools.I18n.tr;
    44
    5 import java.awt.GridBagLayout;
    65import java.awt.event.ActionEvent;
    76import java.awt.event.ActionListener;
    8 import java.io.*;
     7import java.awt.GridBagLayout;
     8import java.io.BufferedReader;
     9import java.io.File;
     10import java.io.FileInputStream;
     11import java.io.FileNotFoundException;
     12import java.io.FileReader;
     13import java.io.InputStream;
     14import java.io.InputStreamReader;
     15import java.io.IOException;
     16import java.io.UnsupportedEncodingException;
    917import java.net.URL;
    10 import java.util.*;
     18import java.util.ArrayList;
     19import java.util.Collection;
     20import java.util.Collections;
     21import java.util.HashMap;
     22import java.util.List;
     23import java.util.Map;
    1124import java.util.Map.Entry;
    12 
    13 import javax.swing.*;
    14 
     25import java.util.StringTokenizer;
     26
     27import javax.swing.DefaultListModel;
     28import javax.swing.JButton;
     29import javax.swing.JCheckBox;
     30import javax.swing.JLabel;
     31import javax.swing.JList;
     32import javax.swing.JOptionPane;
     33import javax.swing.JScrollPane;
     34import javax.swing.JPanel;
     35
     36import org.openstreetmap.josm.command.ChangePropertyCommand;
     37import org.openstreetmap.josm.command.Command;
     38import org.openstreetmap.josm.command.SequenceCommand;
     39import org.openstreetmap.josm.data.osm.Node;
     40import org.openstreetmap.josm.data.osm.OsmPrimitive;
     41import org.openstreetmap.josm.data.osm.Way;
     42import org.openstreetmap.josm.gui.preferences.TaggingPresetPreference;
     43import org.openstreetmap.josm.gui.tagging.TaggingPreset;
    1544import org.openstreetmap.josm.Main;
    16 import org.openstreetmap.josm.command.*;
    17 import org.openstreetmap.josm.data.osm.*;
    18 import org.openstreetmap.josm.gui.tagging.TaggingPreset;
    19 import org.openstreetmap.josm.gui.tagging.TaggingPreset.*;
    20 import org.openstreetmap.josm.gui.preferences.TaggingPresetPreference;
    21 import org.openstreetmap.josm.plugins.validator.*;
     45import org.openstreetmap.josm.plugins.validator.OSMValidatorPlugin;
     46import org.openstreetmap.josm.plugins.validator.PreferenceEditor;
     47import org.openstreetmap.josm.plugins.validator.Severity;
     48import org.openstreetmap.josm.plugins.validator.Test;
     49import org.openstreetmap.josm.plugins.validator.TestError;
     50import org.openstreetmap.josm.plugins.validator.tests.ChangePropertyKeyCommand;
    2251import org.openstreetmap.josm.plugins.validator.util.Bag;
    2352import org.openstreetmap.josm.plugins.validator.util.Util;
     
    4170        /** The spell check preset values */
    4271        protected static Bag<String, String> presetsValueData;
     72        /** The TagChecker data */
     73        protected static List<CheckerData> checkerData = new ArrayList<CheckerData>();
    4374
    4475        /** The preferences prefix */
    4576        protected static final String PREFIX = PreferenceEditor.PREFIX + "." + TagChecker.class.getSimpleName();
    4677
    47         /** Preference name for checking values */
    4878        public static final String PREF_CHECK_VALUES = PREFIX + ".checkValues";
    49         /** Preference name for checking values */
    5079        public static final String PREF_CHECK_KEYS = PREFIX + ".checkKeys";
    51         /** Preference name for checking FIXMES */
     80        public static final String PREF_CHECK_COMPLEX = PREFIX + ".checkComplex";
    5281        public static final String PREF_CHECK_FIXMES = PREFIX + ".checkFixmes";
    53         /** Preference name for sources */
     82
    5483        public static final String PREF_SOURCES = PREFIX + ".sources";
    55         /** Preference name for sources */
    5684        public static final String PREF_USE_DATA_FILE = PREFIX + ".usedatafile";
    57         /** Preference name for sources */
    5885        public static final String PREF_USE_SPELL_FILE = PREFIX + ".usespellfile";
    59         /** Preference name for keys upload check */
     86
    6087        public static final String PREF_CHECK_KEYS_BEFORE_UPLOAD = PREFIX + ".checkKeysBeforeUpload";
    61         /** Preference name for values upload check */
    6288        public static final String PREF_CHECK_VALUES_BEFORE_UPLOAD = PREFIX + ".checkValuesBeforeUpload";
    63         /** Preference name for fixmes upload check */
     89        public static final String PREF_CHECK_COMPLEX_BEFORE_UPLOAD = PREFIX + ".checkComplexBeforeUpload";
    6490        public static final String PREF_CHECK_FIXMES_BEFORE_UPLOAD = PREFIX + ".checkFixmesBeforeUpload";
    6591
    66         /** Whether to check keys */
    6792        protected boolean checkKeys = false;
    68         /** Whether to check values */
    6993        protected boolean checkValues = false;
    70         /** Whether to check for fixmes in values */
     94        protected boolean checkComplex = false;
    7195        protected boolean checkFixmes = false;
    7296
    73         /** Preferences checkbox for keys */
    7497        protected JCheckBox prefCheckKeys;
    75         /** Preferences checkbox for values */
    7698        protected JCheckBox prefCheckValues;
    77         /** Preferences checkbox for FIXMES */
     99        protected JCheckBox prefCheckComplex;
    78100        protected JCheckBox prefCheckFixmes;
    79         /** The preferences checkbox for validation of keys on upload */
     101
    80102        protected JCheckBox prefCheckKeysBeforeUpload;
    81         /** The preferences checkbox for validation of values on upload */
    82103        protected JCheckBox prefCheckValuesBeforeUpload;
    83         /** The preferences checkbox for validation of fixmes on upload */
     104        protected JCheckBox prefCheckComplexBeforeUpload;
    84105        protected JCheckBox prefCheckFixmesBeforeUpload;
    85         /** The add button */
     106
     107        protected JCheckBox prefUseDataFile;
     108        protected JCheckBox prefUseSpellFile;
     109
    86110        protected JButton addSrcButton;
    87         /** The edit button */
    88111        protected JButton editSrcButton;
    89         /** The delete button */
    90112        protected JButton deleteSrcButton;
    91113
    92         protected static int EMPTY_VALUES = 0; /** Empty values error */
    93         protected static int INVALID_KEY = 1; /** Invalid key error */
    94         protected static int INVALID_VALUE = 2; /** Invalid value error */
    95         protected static int FIXME = 3; /** fixme error */
    96         protected static int INVALID_SPACE = 3; /** space in value (start/end) */
     114        protected static int EMPTY_VALUES = 0;
     115        protected static int INVALID_KEY = 1;
     116        protected static int INVALID_VALUE = 2;
     117        protected static int FIXME = 3;
     118        protected static int INVALID_SPACE = 3;
     119        protected static int TAG_CHECK = 4;
    97120
    98121        /** List of sources for spellcheck data */
    99122        protected JList Sources;
    100 
    101         /** Whether this test must check the keys before upload. Used by peferences */
    102         protected boolean testKeysBeforeUpload;
    103         /** Whether this test must check the values before upload. Used by peferences */
    104         protected boolean testValuesBeforeUpload;
    105         /** Whether this test must check form fixmes in values before upload. Used by peferences */
    106         protected boolean testFixmesBeforeUpload;
    107123
    108124        /**
     
    165181
    166182                        String okValue = null;
     183                        Boolean tagcheckerfile = false;
    167184                        do
    168185                        {
    169186                                String line = reader.readLine();
    170                                 if( line == null || line.length() == 0 )
     187                                if( line == null || (!tagcheckerfile && line.length() == 0) )
    171188                                        break;
    172189                                if( line.startsWith("#") )
    173                                         continue;
    174        
    175                                 if( line.charAt(0) == '+' )
     190                                {
     191                                        if(line.startsWith("# JOSM TagChecker"))
     192                                                tagcheckerfile = true;
     193                                }
     194                                else if(tagcheckerfile)
     195                                {
     196                                        CheckerData d = new CheckerData();
     197                                        String err = d.getData(line);
     198
     199                                        if(err == null)
     200                                                checkerData.add(d);
     201                                        else
     202                                                System.err.println("Invalid tagchecker line - "+err+":" + line);
     203                                }
     204                                else if( line.charAt(0) == '+' )
    176205                                {
    177206                                        okValue = line.substring(1);
     
    237266                Bag<OsmPrimitive, String> withErrors = new Bag<OsmPrimitive, String>();
    238267
     268                if(checkComplex)
     269                {
     270                        for(CheckerData d : checkerData)
     271                        {
     272                                if(d.match(p))
     273                                {
     274                                        errors.add( new TestError(this, Severity.WARNING, tr("Illegal tag/value combinations"), p, TAG_CHECK) );
     275                                        withErrors.add(p, "TC");
     276                                        break;
     277                                }
     278                        }
     279                }
     280
    239281                Map<String, String> props = (p.keys == null) ? Collections.<String, String>emptyMap() : p.keys;
    240282                for(Entry<String, String> prop: props.entrySet() )
     
    304346                XmlObjectParser parser = new XmlObjectParser();
    305347                parser.mapOnStart("item", TaggingPreset.class);
    306                 parser.map("text", Text.class);
    307                 parser.map("check", Check.class);
    308                 parser.map("combo", Combo.class);
    309                 parser.map("label", Label.class);
    310                 parser.map("key", Key.class);
     348                parser.map("text", TaggingPreset.Text.class);
     349                parser.map("check", TaggingPreset.Check.class);
     350                parser.map("combo", TaggingPreset.Combo.class);
     351                parser.map("label", TaggingPreset.Label.class);
     352                parser.map("key", TaggingPreset.Key.class);
    311353                parser.start(in);
    312354               
     
    314356                {
    315357                        Object obj = parser.next();
    316                         if (obj instanceof Combo) {
    317                                 Combo combo = (Combo)obj;
     358                        if (obj instanceof TaggingPreset.Combo) {
     359                                TaggingPreset.Combo combo = (TaggingPreset.Combo)obj;
    318360                                for(String value : combo.values.split(",") )
    319361                                        presetsValueData.add(combo.key, value);
     
    366408                        checkValues = checkValues && Main.pref.getBoolean(PREF_CHECK_VALUES_BEFORE_UPLOAD, true);
    367409
     410                checkComplex = Main.pref.getBoolean(PREF_CHECK_COMPLEX);
     411                if( isBeforeUpload )
     412                        checkComplex = checkValues && Main.pref.getBoolean(PREF_CHECK_COMPLEX_BEFORE_UPLOAD, true);
     413
    368414                checkFixmes = Main.pref.getBoolean(PREF_CHECK_FIXMES);
    369415                if( isBeforeUpload )
     
    374420        public void visit(Collection<OsmPrimitive> selection)
    375421        {
    376                 if( checkKeys || checkValues)
     422                if( checkKeys || checkValues || checkComplex)
    377423                        super.visit(selection);
    378424        }
     
    385431
    386432                testPanel.add( new JLabel(name), GBC.eol().insets(3,0,0,0) );
    387                
    388                 boolean checkKeys = Main.pref.getBoolean(PREF_CHECK_KEYS, true);
    389                 prefCheckKeys = new JCheckBox(tr("Check property keys."), checkKeys);
     433
     434                prefCheckKeys = new JCheckBox(tr("Check property keys."), Main.pref.getBoolean(PREF_CHECK_KEYS, true));
    390435                prefCheckKeys.setToolTipText(tr("Validate that property keys are valid checking against list of words."));
    391436                testPanel.add(prefCheckKeys, GBC.std().insets(20,0,0,0));
     
    394439                prefCheckKeysBeforeUpload.setSelected(Main.pref.getBoolean(PREF_CHECK_KEYS_BEFORE_UPLOAD, true));
    395440                testPanel.add(prefCheckKeysBeforeUpload, a);
     441
     442                prefCheckComplex = new JCheckBox(tr("Use complex property checker."), Main.pref.getBoolean(PREF_CHECK_COMPLEX, true));
     443                prefCheckComplex.setToolTipText(tr("Validate property values and tags using complex rules."));
     444                testPanel.add(prefCheckComplex, GBC.std().insets(20,0,0,0));
     445
     446                prefCheckComplexBeforeUpload = new JCheckBox();
     447                prefCheckComplexBeforeUpload.setSelected(Main.pref.getBoolean(PREF_CHECK_COMPLEX_BEFORE_UPLOAD, true));
     448                testPanel.add(prefCheckComplexBeforeUpload, a);
    396449
    397450                Sources = new JList(new DefaultListModel());
     
    468521                buttonPanel.add(deleteSrcButton, GBC.std().insets(0,5,0,0));
    469522
    470                 ActionListener disableCheckKeysActionListener = new ActionListener(){
     523                ActionListener disableCheckActionListener = new ActionListener(){
    471524                        public void actionPerformed(ActionEvent e) {
    472                                 boolean selected = prefCheckKeys.isSelected() || prefCheckKeysBeforeUpload.isSelected();
    473                                 Sources.setEnabled( selected );
    474                                 addSrcButton.setEnabled(selected);
    475                                 editSrcButton.setEnabled(selected);
    476                                 deleteSrcButton.setEnabled(selected);
     525                                handlePrefEnable();
    477526                        }
    478527                };
    479                 prefCheckKeys.addActionListener(disableCheckKeysActionListener);
    480                 prefCheckKeysBeforeUpload.addActionListener(disableCheckKeysActionListener);
    481 
    482                 Sources.setEnabled( checkKeys );
    483                 buttonPanel.setEnabled( checkKeys );
    484 
    485                 boolean checkValues = Main.pref.getBoolean(PREF_CHECK_VALUES, true);
    486                 prefCheckValues = new JCheckBox(tr("Check property values."), checkValues);
     528                prefCheckKeys.addActionListener(disableCheckActionListener);
     529                prefCheckKeysBeforeUpload.addActionListener(disableCheckActionListener);
     530                prefCheckComplex.addActionListener(disableCheckActionListener);
     531                prefCheckComplexBeforeUpload.addActionListener(disableCheckActionListener);
     532
     533                handlePrefEnable();
     534
     535                prefCheckValues = new JCheckBox(tr("Check property values."), Main.pref.getBoolean(PREF_CHECK_VALUES, true));
    487536                prefCheckValues.setToolTipText(tr("Validate that property values are valid checking against presets."));
    488537                testPanel.add(prefCheckValues, GBC.std().insets(20,0,0,0));
     
    492541                testPanel.add(prefCheckValuesBeforeUpload, a);
    493542
    494                 boolean checkFixmes = Main.pref.getBoolean(PREF_CHECK_FIXMES, true);
    495                 prefCheckFixmes = new JCheckBox(tr("Check for FIXMES."), checkFixmes);
     543                prefCheckFixmes = new JCheckBox(tr("Check for FIXMES."), Main.pref.getBoolean(PREF_CHECK_FIXMES, true));
    496544                prefCheckFixmes.setToolTipText(tr("Looks for nodes or ways with FIXME in any property value."));
    497545                testPanel.add(prefCheckFixmes, GBC.std().insets(20,0,0,0));
     
    501549                testPanel.add(prefCheckFixmesBeforeUpload, a);
    502550
    503                 boolean useDataFile = Main.pref.getBoolean(PREF_USE_DATA_FILE, true);
    504                 JCheckBox prefUseDataFile = new JCheckBox(tr("Use default data file."), checkValues);
     551                prefUseDataFile = new JCheckBox(tr("Use default data file."), Main.pref.getBoolean(PREF_USE_DATA_FILE, true));
    505552                prefUseDataFile.setToolTipText(tr("Use the default data file (recommended)."));
    506553                testPanel.add(prefUseDataFile, GBC.eol().insets(20,0,0,0));
    507554
    508                 boolean useSpellFile = Main.pref.getBoolean(PREF_USE_SPELL_FILE, true);
    509                 JCheckBox prefUseSpellFile = new JCheckBox(tr("Use default spellcheck file."), checkValues);
     555                prefUseSpellFile = new JCheckBox(tr("Use default spellcheck file."), Main.pref.getBoolean(PREF_USE_SPELL_FILE, true));
    510556                prefUseSpellFile.setToolTipText(tr("Use the default spellcheck file (recommended)."));
    511557                testPanel.add(prefUseSpellFile, GBC.eol().insets(20,0,0,0));
    512558        }
    513559
     560        public void handlePrefEnable()
     561        {
     562                boolean selected = prefCheckKeys.isSelected() || prefCheckKeysBeforeUpload.isSelected()
     563                || prefCheckComplex.isSelected() || prefCheckComplexBeforeUpload.isSelected();
     564                Sources.setEnabled( selected );
     565                addSrcButton.setEnabled(selected);
     566                editSrcButton.setEnabled(selected);
     567                deleteSrcButton.setEnabled(selected);
     568        }
     569
    514570        @Override
    515571        public void ok()
    516572        {
    517                 enabled = prefCheckKeys.isSelected() || prefCheckValues.isSelected() || prefCheckFixmes.isSelected();
    518                 testBeforeUpload = prefCheckKeysBeforeUpload.isSelected() || prefCheckValuesBeforeUpload.isSelected() || prefCheckFixmesBeforeUpload.isSelected();
     573                enabled = prefCheckKeys.isSelected() || prefCheckValues.isSelected() || prefCheckComplex.isSelected() || prefCheckFixmes.isSelected();
     574                testBeforeUpload = prefCheckKeysBeforeUpload.isSelected() || prefCheckValuesBeforeUpload.isSelected() || prefCheckFixmesBeforeUpload.isSelected() || prefCheckComplexBeforeUpload.isSelected();
    519575
    520576                Main.pref.put(PREF_CHECK_VALUES, prefCheckValues.isSelected());
     577                Main.pref.put(PREF_CHECK_COMPLEX, prefCheckComplex.isSelected());
    521578                Main.pref.put(PREF_CHECK_KEYS, prefCheckKeys.isSelected());
    522579                Main.pref.put(PREF_CHECK_FIXMES, prefCheckFixmes.isSelected());
    523580                Main.pref.put(PREF_CHECK_VALUES_BEFORE_UPLOAD, prefCheckValuesBeforeUpload.isSelected());
     581                Main.pref.put(PREF_CHECK_COMPLEX_BEFORE_UPLOAD, prefCheckComplexBeforeUpload.isSelected());
    524582                Main.pref.put(PREF_CHECK_KEYS_BEFORE_UPLOAD, prefCheckKeysBeforeUpload.isSelected());
    525583                Main.pref.put(PREF_CHECK_FIXMES_BEFORE_UPLOAD, prefCheckFixmesBeforeUpload.isSelected());
    526                 Main.pref.put(PREF_USE_DATA_FILE, prefCheckFixmesBeforeUpload.isSelected());
    527                 Main.pref.put(PREF_USE_SPELL_FILE, prefCheckFixmesBeforeUpload.isSelected());
     584                Main.pref.put(PREF_USE_DATA_FILE, prefUseDataFile.isSelected());
     585                Main.pref.put(PREF_USE_SPELL_FILE, prefUseSpellFile.isSelected());
    528586                String sources = "";
    529587                if( Sources.getModel().getSize() > 0 )
     
    587645                return false;
    588646        }
     647
     648        private static class CheckerData {
     649                public String getData(String data)
     650                {
     651System.out.println(data);
     652                        return "not implemented yet";
     653                }
     654                public Boolean match(OsmPrimitive osm)
     655                {
     656                        return false;
     657                }
     658        }
    589659}
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/util/Util.java

    r9454 r9561  
    3737        }
    3838
    39         /**
    40          * Utility method for creating buttons
    41          * @param name The name of the button
    42          * @param icon Icon of the button
    43          * @param tooltip Tooltip
    44          * @param action The action performed when clicking the button
    45          * @return The created button
    46          */
    47     public static JButton createButton(String name, String actionname, String icon, String tooltip, ActionListener action)
    48     {
    49                 JButton button = new JButton(name, ImageProvider.get(icon));
    50                 button.setActionCommand(actionname);
    51                 button.addActionListener(action);
    52                 button.setToolTipText(tr(tooltip));
    53                 button.setMargin(new Insets(1,1,1,1));
    54                 button.setIconTextGap(2);
    55                 button.putClientProperty("help", "Dialog/SelectionList/" + actionname);
    56                 return button;
    57         }
    58    
    59    
    6039        /**
    6140         * Returns the version
Note: See TracChangeset for help on using the changeset viewer.