Ignore:
Timestamp:
2010-01-09T15:03:13+01:00 (15 years ago)
Author:
jttt
Message:

Added multipolygon tests, fixed some warnings

Location:
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/GridLayer.java

    r18593 r19335  
    138138     * Visitor that highlights all cells the selected primitives go through
    139139     */
    140     class HighlightCellVisitor extends AbstractVisitor
     140    static class HighlightCellVisitor extends AbstractVisitor
    141141    {
    142142        /** The MapView */
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/OSMValidatorPlugin.java

    r19224 r19335  
    3939import org.openstreetmap.josm.plugins.validator.tests.DuplicateWay;
    4040import org.openstreetmap.josm.plugins.validator.tests.DuplicatedWayNodes;
     41import org.openstreetmap.josm.plugins.validator.tests.MultipolygonTest;
    4142import org.openstreetmap.josm.plugins.validator.tests.NameMismatch;
    4243import org.openstreetmap.josm.plugins.validator.tests.NodesWithSameName;
     
    8081    /**
    8182     * All available tests
    82      * TODO: is there any way to find out automagically all available tests?
     83     * TODO: is there any way to find out automatically all available tests?
    8384     */
    8485    @SuppressWarnings("unchecked")
     
    99100            DuplicateWay.class, // ID 1401 .. 1499
    100101            NameMismatch.class, // ID  1501 ..  1599
     102            MultipolygonTest.class, // ID  1601 ..  1699
    101103    };
    102104
     
    134136                }
    135137            } catch (final FileNotFoundException e) {
     138                // Ignore
    136139            } catch (final IOException e) {
    137140                e.printStackTrace();
     
    157160
    158161    private ValidateUploadHook uploadHook;
    159    
     162
    160163    @Override
    161164    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
     
    166169            if (Main.pref.hasKey(PreferenceEditor.PREF_DEBUG + ".grid"))
    167170                Main.main.addLayer(new GridLayer(tr("Grid")));
    168             MapView.addLayerChangeListener(this);           
     171            MapView.addLayerChangeListener(this);
    169172        } else
    170173                MapView.removeLayerChangeListener(this);
     
    273276            } catch (InvocationTargetException ite) {
    274277                ite.getCause().printStackTrace();
    275                 JOptionPane.showMessageDialog(Main.parent, 
     278                JOptionPane.showMessageDialog(Main.parent,
    276279                                tr("Error initializing test {0}:\n {1}", test.getClass()
    277280                        .getSimpleName(), ite.getCause().getMessage()),
     
    280283            } catch (Exception e) {
    281284                e.printStackTrace();
    282                 JOptionPane.showMessageDialog(Main.parent, 
     285                JOptionPane.showMessageDialog(Main.parent,
    283286                                tr("Error initializing test {0}:\n {1}", test.getClass()
    284287                        .getSimpleName(), e),
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/Test.java

    r18928 r19335  
    33import static org.openstreetmap.josm.tools.I18n.tr;
    44
     5import java.awt.GridBagConstraints;
    56import java.util.ArrayList;
    67import java.util.Collection;
     
    3233{
    3334    /** Name of the test */
    34     protected String name;
     35    protected final String name;
    3536
    3637    /** Description of the test */
    37     protected String description;
     38    protected final String description;
    3839
    3940    /** Whether this test is enabled. Enabled by default */
     
    7778    public Test(String name)
    7879    {
    79         this.name = name;
     80        this(name, null);
    8081    }
    8182
     
    162163
    163164        GBC a = GBC.eol();
    164         a.anchor = GBC.EAST;
     165        a.anchor = GridBagConstraints.EAST;
    165166        checkBeforeUpload = new JCheckBox();
    166167        checkBeforeUpload.setSelected(testBeforeUpload);
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/ValidatorDialog.java

    r19226 r19335  
    438438        if (!Main.pref.getBoolean(PreferenceEditor.PREF_FILTER_BY_SELECTION, false))
    439439            return;
    440         if (newSelection == null || newSelection.size() == 0)
     440        if (newSelection.isEmpty())
    441441            tree.setFilter(null);
    442442        HashSet<OsmPrimitive> filter = new HashSet<OsmPrimitive>(newSelection);
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/CrossingWays.java

    r18344 r19335  
    166166     * @author frsantos
    167167     */
    168     private class ExtendedSegment
     168    private static class ExtendedSegment
    169169    {
    170170        public Node n1, n2;
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/DuplicateWay.java

    r18092 r19335  
    2828{
    2929
    30     private class WayPair {
     30    private static class WayPair {
    3131        public List<LatLon> coor;
    3232        public Map<String, String> keys;
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java

    r19229 r19335  
    886886        protected static int TAG_CHECK_INFO   = 1270;
    887887
    888         private class CheckerElement {
     888        private static class CheckerElement {
    889889            public Object tag;
    890890            public Object value;
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/UnconnectedWays.java

    r18848 r19335  
    226226//            return !w.containsNode(n)
    227227//            && line.ptSegDist(n.getEastNorth().east(), n.getEastNorth().north()) < dist;
    228             if (w == null)
     228            if (w == null) {
    229229                Main.debug("way null");
     230                return false;
     231            }
    230232            if (w.containsNode(n))
    231233                return false;
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/util/Entities.java

    r13497 r19335  
    341341        if (firstAmp < 0)
    342342            return str;
    343         String res = new String(str.substring(0, firstAmp));
     343        String res = str.substring(0, firstAmp);
    344344        int len = str.length();
    345345        for (int i = firstAmp; i < len; i++) {
Note: See TracChangeset for help on using the changeset viewer.