Changeset 15390 in josm for trunk/src/org


Ignore:
Timestamp:
2019-09-29T23:59:43+02:00 (5 years ago)
Author:
Don-vip
Message:

remove deprecated code

Location:
trunk/src/org/openstreetmap/josm
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/command/RemoveNodesCommand.java

    r15077 r15390  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
    6 import java.util.HashSet;
    7 import java.util.List;
    86import java.util.Set;
    97
     
    2119 */
    2220public class RemoveNodesCommand extends AbstractNodesCommand<Set<Node>> {
    23 
    24     /**
    25      * Constructs a new {@code RemoveNodesCommand}.
    26      * @param way The way to modify. Must not be null, and belong to a data set
    27      * @param rmNodes The list of nodes to remove
    28      * @deprecated Use {@link #RemoveNodesCommand(Way, Set)}
    29      */
    30     @Deprecated
    31     public RemoveNodesCommand(Way way, List<Node> rmNodes) {
    32         super(way.getDataSet(), way, new HashSet<>(rmNodes));
    33     }
    3421
    3522    /**
  • trunk/src/org/openstreetmap/josm/data/gpx/GpxDistance.java

    r15035 r15390  
    22package org.openstreetmap.josm.data.gpx;
    33
    4 import java.util.ArrayList;
    5 import java.util.List;
    6 
    7 import org.openstreetmap.josm.data.coor.EastNorth;
    8 import org.openstreetmap.josm.data.coor.LatLon;
    94import org.openstreetmap.josm.data.osm.Node;
    105import org.openstreetmap.josm.data.osm.OsmPrimitive;
    11 import org.openstreetmap.josm.data.osm.Relation;
    12 import org.openstreetmap.josm.data.osm.Way;
    136import org.openstreetmap.josm.tools.Geometry;
    147
     
    3629                .min().orElse(Double.MAX_VALUE);
    3730    }
    38 
    39     /**
    40      * Get the distance between an object and a waypoint
    41      * @param p OsmPrimitive to get the distance to the WayPoint
    42      * @param waypoint WayPoint to get the distance from
    43      * @return The shortest distance between p and waypoint
    44      * @deprecated Use {@code Geometry.getDistance(p, new Node(waypoint.getCoor()))}
    45      * instead
    46      */
    47     @Deprecated
    48     public static double getDistance(OsmPrimitive p, WayPoint waypoint) {
    49         return Geometry.getDistance(p, new Node(waypoint.getCoor()));
    50     }
    51 
    52     /**
    53      * Get the shortest distance between a relation and a waypoint
    54      * @param relation Relation to get the distance from
    55      * @param waypoint WayPoint to get the distance to
    56      * @return The distance between the relation and the waypoint
    57      * @deprecated Use {@code Geometry.getDistance(relation, new Node(waypoint.getCoor()))}
    58      * instead
    59      */
    60     @Deprecated
    61     public static double getDistanceRelation(Relation relation, WayPoint waypoint) {
    62         double shortestDistance = Double.MAX_VALUE;
    63         List<Node> nodes = new ArrayList<>(relation.getMemberPrimitives(Node.class));
    64         List<Way> ways = new ArrayList<>(relation.getMemberPrimitives(Way.class));
    65         List<Relation> relations = new ArrayList<>(relation.getMemberPrimitives(Relation.class));
    66         if (nodes.isEmpty() && ways.isEmpty() && relations.isEmpty()) return Double.MAX_VALUE;
    67         for (Relation nrelation : relations) {
    68             double distance = getDistanceRelation(nrelation, waypoint);
    69             if (distance < shortestDistance) shortestDistance = distance;
    70         }
    71         for (Way way : ways) {
    72             double distance = getDistanceWay(way, waypoint);
    73             if (distance < shortestDistance) shortestDistance = distance;
    74         }
    75         for (Node node : nodes) {
    76             double distance = getDistanceNode(node, waypoint);
    77             if (distance < shortestDistance) shortestDistance = distance;
    78         }
    79         return shortestDistance;
    80     }
    81 
    82     /**
    83      * Get the shortest distance between a way and a waypoint
    84      * @param way Way to get the distance from
    85      * @param waypoint WayPoint to get the distance to
    86      * @return The distance between the way and the waypoint
    87      * @deprecated Use {@code Geometry.getDistanceWayNode(way, new Node(waypoint.getCoor()))} instead
    88      */
    89     @Deprecated
    90     public static double getDistanceWay(Way way, WayPoint waypoint) {
    91         if (way == null || waypoint == null) return Double.MAX_VALUE;
    92         return Geometry.getDistanceWayNode(way, new Node(waypoint.getCoor()));
    93     }
    94 
    95     /**
    96      * Get the distance between a node and a waypoint
    97      * @param node Node to get the distance from
    98      * @param waypoint WayPoint to get the distance to
    99      * @return The distance between the two points
    100      * @deprecated Use {@code Geometry.getDistance(node, new Node(waypoint.getCoor()))}
    101      * instead
    102      */
    103     @Deprecated
    104     public static double getDistanceNode(Node node, WayPoint waypoint) {
    105         if (node == null || waypoint == null) return Double.MAX_VALUE;
    106         return Geometry.getDistance(node, new Node(waypoint.getCoor()));
    107     }
    108 
    109     /**
    110      * Get the distance between coordinates (provided by EastNorth) and a waypoint
    111      * @param en The EastNorth to get the distance to
    112      * @param waypoint WayPoint to get the distance to
    113      * @return The distance between the two points
    114      * @deprecated Use {@code Geometry.getDistance(new Node(en), new Node(waypoint.getCoor()))} instead
    115      */
    116     @Deprecated
    117     public static double getDistanceEastNorth(EastNorth en, WayPoint waypoint) {
    118         if (en == null || waypoint == null) return Double.MAX_VALUE;
    119         return Geometry.getDistance(new Node(en), new Node(waypoint.getCoor()));
    120     }
    121 
    122     /**
    123      * Get the distance between coordinates (latitude longitude) and a waypoint
    124      * @param latlon LatLon to get the distance from
    125      * @param waypoint WayPoint to get the distance to
    126      * @return The distance between the two points
    127      * @deprecated Use {@code Geometry.getDistance(new Node(latlon), new Node(waypoint.getCoor()))} instead
    128      */
    129     @Deprecated
    130     public static double getDistanceLatLon(LatLon latlon, WayPoint waypoint) {
    131         if (latlon == null || waypoint == null || waypoint.getCoor() == null) return Double.MAX_VALUE;
    132         return Geometry.getDistance(new Node(latlon), new Node(waypoint.getCoor()));
    133     }
    13431}
  • trunk/src/org/openstreetmap/josm/data/osm/FilterModel.java

    r15226 r15390  
    281281    }
    282282
    283     /**
    284      * Sets/replaces the filter for a given row.
    285      * @param rowIndex The row index
    286      * @param filter The filter that should be placed in that row
    287      * @return the filter previously at the specified position
    288      * @deprecated Use {@link #setValue}
    289      */
    290     @Deprecated
    291     public Filter setFilter(int rowIndex, Filter filter) {
    292         return setValue(rowIndex, filter);
    293     }
    294 
    295283    @Override
    296284    public Filter setValue(int rowIndex, Filter filter) {
     
    298286        updateFilterMatcher();
    299287        return result;
    300     }
    301 
    302     /**
    303      * Gets the filter by row index
    304      * @param rowIndex The row index
    305      * @return The filter in that row
    306      * @deprecated Use {@link #getValue}
    307      */
    308     @Deprecated
    309     public Filter getFilter(int rowIndex) {
    310         return getValue(rowIndex);
    311288    }
    312289
  • trunk/src/org/openstreetmap/josm/data/osm/MultipolygonBuilder.java

    r15160 r15390  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
    6 import java.awt.Rectangle;
    76import java.awt.geom.Area;
    87import java.util.ArrayList;
     
    4140        /** the area in east/north space */
    4241        public final Area area;
    43         /** the integer bounds,
    44          * @deprecated better use area.getBounds2D()
    45          *  */
    46         @Deprecated
    47         public final Rectangle bounds;
    4842
    4943        /**
     
    5751            this.nodes = this.getNodes();
    5852            this.area = Geometry.getArea(nodes);
    59             this.bounds = area.getBounds();
    6053        }
    6154
  • trunk/src/org/openstreetmap/josm/gui/dialogs/FilterTableModel.java

    r15226 r15390  
    164164
    165165    /**
    166      * Moves down the filter in the given row.
    167      * @param rowIndex The filter row
    168      * @deprecated Use {@link #moveDown(int...)}
    169      */
    170     @Deprecated
    171     public void moveDownFilter(int rowIndex) {
    172         moveDown(rowIndex);
    173     }
    174 
    175     /**
    176      * Moves up the filter in the given row
    177      * @param rowIndex The filter row
    178      * @deprecated Use {@link #moveUp(int...)}
    179      */
    180     @Deprecated
    181     public void moveUpFilter(int rowIndex) {
    182         moveUp(rowIndex);
    183     }
    184 
    185     /**
    186166     * Removes the filter that is displayed in the given row
    187167     * @param rowIndex The index of the filter to remove
     
    193173            fireTableRowsDeleted(rowIndex, rowIndex);
    194174        }
    195     }
    196 
    197     /**
    198      * Sets/replaces the filter for a given row.
    199      * @param rowIndex The row index
    200      * @param filter The filter that should be placed in that row
    201      * @deprecated Use {@link #setValue}
    202      */
    203     @Deprecated
    204     public void setFilter(int rowIndex, Filter filter) {
    205         setValue(rowIndex, filter);
    206175    }
    207176
     
    213182        fireTableRowsUpdated(rowIndex, rowIndex);
    214183        return result;
    215     }
    216 
    217     /**
    218      * Gets the filter by row index
    219      * @param rowIndex The row index
    220      * @return The filter in that row
    221      * @deprecated Use {@link #getValue}
    222      */
    223     @Deprecated
    224     public Filter getFilter(int rowIndex) {
    225         return getValue(rowIndex);
    226184    }
    227185
  • trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java

    r15366 r15390  
    3434import javax.swing.ListSelectionModel;
    3535import javax.swing.UIManager;
    36 import javax.swing.event.ListDataEvent;
    37 import javax.swing.event.ListSelectionEvent;
    3836import javax.swing.table.AbstractTableModel;
    3937import javax.swing.table.DefaultTableCellRenderer;
     
    360358    }
    361359
    362     /**
    363      * Wires <code>listener</code> to <code>listSelectionModel</code> in such a way, that
    364      * <code>listener</code> receives a {@link IEnabledStateUpdating#updateEnabledState()}
    365      * on every {@link ListSelectionEvent}.
    366      *
    367      * @param listener  the listener
    368      * @param listSelectionModel  the source emitting {@link ListSelectionEvent}s
    369      * @deprecated Use {@link TableHelper#adaptTo}
    370      */
    371     @Deprecated
    372     protected void adaptTo(final IEnabledStateUpdating listener, ListSelectionModel listSelectionModel) {
    373         TableHelper.adaptTo(listener, listSelectionModel);
    374     }
    375 
    376     /**
    377      * Wires <code>listener</code> to <code>listModel</code> in such a way, that
    378      * <code>listener</code> receives a {@link IEnabledStateUpdating#updateEnabledState()}
    379      * on every {@link ListDataEvent}.
    380      *
    381      * @param listener the listener
    382      * @param listModel the source emitting {@link ListDataEvent}s
    383      * @deprecated Use {@link TableHelper#adaptTo}
    384      */
    385     @Deprecated
    386     protected void adaptTo(final IEnabledStateUpdating listener, LayerListModel listModel) {
    387         TableHelper.adaptTo(listener, listModel);
    388     }
    389 
    390360    @Override
    391361    public void destroy() {
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java

    r15348 r15390  
    382382
    383383    /**
    384      * Displays image for the given data.
    385      * @param data geo image data
    386      * @param entry image entry
    387      * @deprecated Use {@link #displayImage}
    388      */
    389     @Deprecated
    390     public static void showImage(ImageData data, ImageEntry entry) {
    391         getInstance().displayImage(data, entry);
    392     }
    393 
    394     /**
    395384     * Enables (or disables) the "Previous" button.
    396385     * @param value {@code true} to enable the button, {@code false} otherwise
Note: See TracChangeset for help on using the changeset viewer.