Changeset 13623 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2018-04-13T00:07:00+02:00 (7 years ago)
Author:
Don-vip
Message:

more use of IPrimitive instead of OsmPrimitive

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/PrimitiveVisitor.java

    r6920 r13623  
    1313
    1414    /**
    15      * Visiting call for points.
     15     * Visiting call for nodes.
    1616     * @param n The node to inspect.
    1717     */
     
    1919
    2020    /**
    21      * Visiting call for lines.
     21     * Visiting call for ways.
    2222     * @param w The way to inspect.
    2323     */
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java

    r13496 r13623  
    3838import org.openstreetmap.josm.command.SequenceCommand;
    3939import org.openstreetmap.josm.data.osm.DataSet;
     40import org.openstreetmap.josm.data.osm.IPrimitive;
    4041import org.openstreetmap.josm.data.osm.OsmPrimitive;
    4142import org.openstreetmap.josm.data.osm.Relation;
     
    7879 * @since 294
    7980 */
    80 public class TaggingPreset extends AbstractAction implements ActiveLayerChangeListener, AdaptableAction, Predicate<OsmPrimitive> {
     81public class TaggingPreset extends AbstractAction implements ActiveLayerChangeListener, AdaptableAction, Predicate<IPrimitive> {
    8182
    8283    public static final int DIALOG_ANSWER_APPLY = 1;
     
    590591     * @param p the primitive
    591592     * @return {@code true} if this preset matches the primitive
     593     * @since 13623 (signature)
    592594     */
    593595    @Override
    594     public boolean test(OsmPrimitive p) {
     596    public boolean test(IPrimitive p) {
    595597        return matches(EnumSet.of(TaggingPresetType.forPrimitive(p)), p.getKeys(), false);
    596598    }
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresets.java

    r12846 r13623  
    1414import javax.swing.JSeparator;
    1515
    16 import org.openstreetmap.josm.data.osm.OsmPrimitive;
     16import org.openstreetmap.josm.data.osm.IPrimitive;
    1717import org.openstreetmap.josm.gui.MainApplication;
    1818import org.openstreetmap.josm.gui.MenuScroller;
     
    189189     * @param primitive the primitive
    190190     * @return a new collection of all presets matching the given preset.
    191      * @see TaggingPreset#test(OsmPrimitive)
    192      * @since 9265
    193      */
    194     public static Collection<TaggingPreset> getMatchingPresets(final OsmPrimitive primitive) {
     191     * @see TaggingPreset#test(IPrimitive)
     192     * @since 13623 (signature)
     193     */
     194    public static Collection<TaggingPreset> getMatchingPresets(final IPrimitive primitive) {
    195195        return SubclassFilteredCollection.filter(getTaggingPresets(), preset -> preset.test(primitive));
    196196    }
  • trunk/src/org/openstreetmap/josm/tools/RotationAngle.java

    r12756 r13623  
    44import java.util.Locale;
    55
     6import org.openstreetmap.josm.data.osm.IPrimitive;
    67import org.openstreetmap.josm.data.osm.Node;
    78import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    2223    final class WayDirectionRotationAngle implements RotationAngle {
    2324        @Override
    24         public double getRotationAngle(OsmPrimitive p) {
     25        public double getRotationAngle(IPrimitive p) {
    2526            if (!(p instanceof Node)) {
    2627                return 0;
     
    7071
    7172        @Override
    72         public double getRotationAngle(OsmPrimitive p) {
     73        public double getRotationAngle(IPrimitive p) {
    7374            return angle;
    7475        }
     
    111112     * @param p primitive
    112113     * @return rotation angle
     114     * @since 13623 (signature)
    113115     */
    114     double getRotationAngle(OsmPrimitive p);
     116    double getRotationAngle(IPrimitive p);
    115117
    116118    /**
Note: See TracChangeset for help on using the changeset viewer.