Package org.openstreetmap.josm.data.osm

Examples of org.openstreetmap.josm.data.osm.OsmPrimitive


    }

    protected void initMultiFetchReader(MultiFetchServerObjectReader reader) {
        getProgressMonitor().indeterminateSubTask(tr("Initializing nodes to download ..."));
        for (PrimitiveId id : ids) {
            OsmPrimitive osm = layer.data.getPrimitiveById(id);
            if (osm == null) {
                switch (id.getType()) {
                    case NODE:
                        osm = new Node(id.getUniqueId());
                        break;
View Full Code Here


        reset();
        if (value == null)
            return this;

        renderForeground(isSelected);
        OsmPrimitive primitive = (OsmPrimitive) value;
        renderBackground(getModel(table), primitive, isSelected);
        renderPrimitive(primitive);
        return this;
    }
View Full Code Here

        return new FilteredCollection<>(
                c.getParticipatingPrimitives(),
                new Predicate<OsmPrimitive>(){
                    @Override
                    public boolean evaluate(OsmPrimitive o) {
                        OsmPrimitive p = currentLayer.data.getPrimitiveById(o);
                        return p != null && p.isUsable();
                    }
                }
        );
    }
View Full Code Here

        @Override
        public void mouseClicked(MouseEvent evt) {
            if (! (SwingUtilities.isLeftMouseButton(evt) && evt.getClickCount() > 1))
                return;
            int row = rowAtPoint(evt.getPoint());
            OsmPrimitive primitive = model.getPrimitive(row);
            memberTableModel.selectMembersReferringTo(Collections.singleton(primitive));
        }
View Full Code Here

        public void run() {
            int idx = memberTable.getSelectedRow();
            if (idx < 0)
                return;
            OsmPrimitive primitive = memberTableModel.getReferredPrimitive(idx);
            if (!(primitive instanceof Relation))
                return;
            Relation r = (Relation) primitive;
            if (r.isIncomplete())
                return;
View Full Code Here

                DataSet ds = getLayer().data;
                List<OsmPrimitive> toAdd = new ArrayList<>();
                boolean hasNewInOtherLayer = false;

                for (PrimitiveData primitive: primitives) {
                    OsmPrimitive primitiveInDs = ds.getPrimitiveById(primitive);
                    if (primitiveInDs != null) {
                        toAdd.add(primitiveInDs);
                    } else if (!primitive.isNew()) {
                        OsmPrimitive p = primitive.getType().newInstance(primitive.getUniqueId(), true);
                        ds.addPrimitive(p);
                        toAdd.add(p);
                    } else {
                        hasNewInOtherLayer = true;
                        break;
View Full Code Here

            if (Main.main == null || !Main.main.hasEditLayer()) return;
            OsmDataLayer layer = Main.main.getEditLayer();
            Set<HistoryOsmPrimitive> selected = model.getSelectedPrimitives();
            Set<OsmPrimitive> target = new HashSet<>();
            for (HistoryOsmPrimitive p : model.getSelectedPrimitives()) {
                OsmPrimitive op = layer.data.getPrimitiveById(p.getPrimitiveId());
                if (op != null) {
                    target.add(op);
                }
            }
            if (target.isEmpty()) {
View Full Code Here

            if (Main.main == null || !Main.main.hasEditLayer()) return;
            OsmDataLayer layer = Main.main.getEditLayer();
            Set<HistoryOsmPrimitive> selected = model.getSelectedPrimitives();
            Set<OsmPrimitive> target = new HashSet<>();
            for (HistoryOsmPrimitive p : model.getSelectedPrimitives()) {
                OsmPrimitive op = layer.data.getPrimitiveById(p.getPrimitiveId());
                if (op != null) {
                    target.add(op);
                }
            }
            if (target.isEmpty()) {
View Full Code Here

        displaylist.repaint();
    }

    @Override
    public void tagsChanged(TagsChangedEvent event) {
        OsmPrimitive prim = event.getPrimitive();
        if (!(prim instanceof Relation))
            return;
        // trigger a sort of the relation list because the display name may have changed
        //
        List<Relation> sel = model.getSelectedRelations();
View Full Code Here

                    Set<OsmPrimitive> newSel = new HashSet<>();
                    DataSet ds = Main.main.getCurrentDataSet();
                    if (ds == null) // e.g. download failed
                        return;
                    for (SimplePrimitiveId id : toSelect) {
                        final OsmPrimitive p = ds.getPrimitiveById(id);
                        if (p != null) {
                            newSel.add(p);
                        }
                    }
                    toSelect.clear();
View Full Code Here

TOP

Related Classes of org.openstreetmap.josm.data.osm.OsmPrimitive

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.