Changeset 13954 in josm


Ignore:
Timestamp:
2018-06-18T19:56:34+02:00 (9 months ago)
Author:
Don-vip
Message:

use IPrimitive in *InfoWebActions

Location:
trunk/src/org/openstreetmap/josm/actions
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/AbstractInfoAction.java

    r13926 r13954  
    1414import org.openstreetmap.josm.Main;
    1515import org.openstreetmap.josm.data.notes.Note;
    16 import org.openstreetmap.josm.data.osm.AbstractPrimitive;
    17 import org.openstreetmap.josm.data.osm.DataSet;
     16import org.openstreetmap.josm.data.osm.IPrimitive;
    1817import org.openstreetmap.josm.data.osm.OsmData;
    1918import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    101100
    102101    protected void launchInfoBrowsersForSelectedPrimitivesAndNote() {
    103         List<OsmPrimitive> primitivesToShow = new ArrayList<>();
    104         DataSet ds = getLayerManager().getActiveDataSet();
     102        List<IPrimitive> primitivesToShow = new ArrayList<>();
     103        OsmData<?, ?, ?, ?> ds = getLayerManager().getActiveData();
    105104        if (ds != null) {
    106105            primitivesToShow.addAll(ds.getAllSelected());
     
    111110        // filter out new primitives which are not yet uploaded to the server
    112111        //
    113         primitivesToShow.removeIf(AbstractPrimitive::isNew);
     112        primitivesToShow.removeIf(IPrimitive::isNew);
    114113
    115114        if (primitivesToShow.isEmpty() && noteToShow == null) {
  • trunk/src/org/openstreetmap/josm/actions/HistoryInfoWebAction.java

    r10378 r13954  
    88
    99import org.openstreetmap.josm.Main;
    10 import org.openstreetmap.josm.data.osm.OsmPrimitive;
     10import org.openstreetmap.josm.data.osm.IPrimitive;
    1111import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
    1212import org.openstreetmap.josm.tools.Shortcut;
     
    3232    @Override
    3333    protected String createInfoUrl(Object infoObject) {
    34         if (infoObject instanceof OsmPrimitive) {
    35             OsmPrimitive primitive = (OsmPrimitive) infoObject;
    36             return Main.getBaseBrowseUrl() + '/' + OsmPrimitiveType.from(primitive).getAPIName() + '/' + primitive.getId() + "/history";
     34        if (infoObject instanceof IPrimitive) {
     35            IPrimitive primitive = (IPrimitive) infoObject;
     36            return Main.getBaseBrowseUrl() + '/' + OsmPrimitiveType.from(primitive).getAPIName() + '/' + primitive.getOsmId() + "/history";
    3737        } else {
    3838            return null;
  • trunk/src/org/openstreetmap/josm/actions/InfoWebAction.java

    r12630 r13954  
    1010import org.openstreetmap.josm.Main;
    1111import org.openstreetmap.josm.data.notes.Note;
     12import org.openstreetmap.josm.data.osm.IPrimitive;
    1213import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1314import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
     
    3536    @Override
    3637    protected String createInfoUrl(Object infoObject) {
    37         if (infoObject instanceof OsmPrimitive) {
    38             OsmPrimitive primitive = (OsmPrimitive) infoObject;
    39             return Main.getBaseBrowseUrl() + '/' + OsmPrimitiveType.from(primitive).getAPIName() + '/' + primitive.getId();
     38        if (infoObject instanceof IPrimitive) {
     39            IPrimitive primitive = (IPrimitive) infoObject;
     40            return Main.getBaseBrowseUrl() + '/' + OsmPrimitiveType.from(primitive).getAPIName() + '/' + primitive.getOsmId();
    4041        } else if (infoObject instanceof Note) {
    4142            Note note = (Note) infoObject;
Note: See TracChangeset for help on using the changeset viewer.