Ignore:
Timestamp:
2017-09-09T23:32:37+02:00 (4 years ago)
Author:
bastiK
Message:

replace abstract class AbstractVisitor by interface OsmPrimitiveVisitor; deprecate Visitor

  • data.osm.visitor.Visitor awkwardly mixes OsmPrimitive types and Changeset class; this may have been used in the past, but is no longer needed; AbstractVisitor should have been a super-interface of Visitor in the first place
  • hopefully, this is binary compatible and plugins can be updated gracefully
Location:
trunk/src/org/openstreetmap/josm/gui
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java

    r12672 r12809  
    5151import org.openstreetmap.josm.data.osm.RelationMember;
    5252import org.openstreetmap.josm.data.osm.Way;
    53 import org.openstreetmap.josm.data.osm.visitor.AbstractVisitor;
    54 import org.openstreetmap.josm.data.osm.visitor.Visitor;
     53import org.openstreetmap.josm.data.osm.visitor.OsmPrimitiveVisitor;
    5554import org.openstreetmap.josm.data.preferences.ColorProperty;
    5655import org.openstreetmap.josm.gui.HelpAwareOptionPane;
     
    253252            return;
    254253        g.setColor(preferencesColor);
    255         Visitor conflictPainter = new ConflictPainter(nc, g);
     254        OsmPrimitiveVisitor conflictPainter = new ConflictPainter(nc, g);
    256255        synchronized (this) {
    257256            for (OsmPrimitive o : lstConflicts.getSelectedValuesList()) {
     
    542541     * Paints conflicts.
    543542     */
    544     public static class ConflictPainter extends AbstractVisitor {
     543    public static class ConflictPainter implements OsmPrimitiveVisitor {
    545544        // Manage a stack of visited relations to avoid infinite recursion with cyclic relations (fix #7938)
    546545        private final Set<Relation> visited = new HashSet<>();
  • trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java

    r12743 r12809  
    3535import org.openstreetmap.josm.data.osm.history.HistoryRelation;
    3636import org.openstreetmap.josm.data.osm.history.HistoryWay;
    37 import org.openstreetmap.josm.data.osm.visitor.AbstractVisitor;
     37import org.openstreetmap.josm.data.osm.visitor.OsmPrimitiveVisitor;
    3838import org.openstreetmap.josm.gui.MainApplication;
    3939import org.openstreetmap.josm.gui.layer.Layer;
     
    645645     *
    646646     */
    647     static class HistoryPrimitiveBuilder extends AbstractVisitor {
     647    static class HistoryPrimitiveBuilder implements OsmPrimitiveVisitor {
    648648        private HistoryOsmPrimitive clone;
    649649
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r12718 r12809  
    7676import org.openstreetmap.josm.data.osm.event.DataSetListenerAdapter;
    7777import org.openstreetmap.josm.data.osm.event.DataSetListenerAdapter.Listener;
    78 import org.openstreetmap.josm.data.osm.visitor.AbstractVisitor;
    7978import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
     79import org.openstreetmap.josm.data.osm.visitor.OsmPrimitiveVisitor;
    8080import org.openstreetmap.josm.data.osm.visitor.paint.MapRendererFactory;
    8181import org.openstreetmap.josm.data.osm.visitor.paint.Rendering;
     
    243243     * A listener that counts the number of primitives it encounters
    244244     */
    245     public static final class DataCountVisitor extends AbstractVisitor {
     245    public static final class DataCountVisitor implements OsmPrimitiveVisitor {
    246246        /**
    247247         * Nodes that have been visited
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java

    r12620 r12809  
    1919import org.openstreetmap.josm.data.osm.RelationMember;
    2020import org.openstreetmap.josm.data.osm.Way;
    21 import org.openstreetmap.josm.data.osm.visitor.AbstractVisitor;
     21import org.openstreetmap.josm.data.osm.visitor.OsmPrimitiveVisitor;
    2222import org.openstreetmap.josm.data.osm.visitor.paint.relations.MultipolygonCache;
    2323import org.openstreetmap.josm.gui.mappaint.Environment;
     
    143143         *
    144144         */
    145         private class MatchingReferrerFinder extends AbstractVisitor {
     145        private class MatchingReferrerFinder implements OsmPrimitiveVisitor {
    146146            private final Environment e;
    147147
     
    195195        }
    196196
    197         private abstract static class AbstractFinder extends AbstractVisitor {
     197        private abstract static class AbstractFinder implements OsmPrimitiveVisitor {
    198198            protected final Environment e;
    199199
     
    241241            }
    242242
    243             private final AbstractVisitor innerVisitor = new AbstractFinder(e) {
     243            private final OsmPrimitiveVisitor innerVisitor = new AbstractFinder(e) {
    244244                @Override
    245245                public void visit(Relation r) {
Note: See TracChangeset for help on using the changeset viewer.