Package org.openstreetmap.josm.data.osm

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


        Set<Changeset> changesets = new HashSet<>();
        for (OsmPrimitive p: primitives) {
            if (p.getChangesetId() <= 0) {
                continue;
            }
            changesets.add(new Changeset(p.getChangesetId()));
        }
        setChangesets(changesets);
    }
View Full Code Here


        Set<Changeset> changesets = new HashSet<>();
        for (OsmPrimitive p: ds.allPrimitives()) {
            if (p.getChangesetId() <=0 ) {
                continue;
            }
            changesets.add(new Changeset(p.getChangesetId()));
        }
        setChangesets(changesets);
    }
View Full Code Here

     */
    public List<Changeset> getSelectedOpenChangesets() {
        List<Changeset> ret = new ArrayList<>();
        for (int i=0; i< getSize(); i++) {
            if (selectionModel.isSelectedIndex(i)) {
                Changeset cs = data.get(i);
                if (cs.isOpen()) {
                    ret.add(cs);
                }
            }
        }
        return ret;
View Full Code Here

        }
        for(Changeset cs: event.getRemovedChangesets()) {
            int idx = data.indexOf(cs);
            if (idx >= 0) {
                // replace with an incomplete changeset
                data.set(idx, new Changeset(cs.getId()));
            }
        }
        fireContentsChanged(this, 0, getSize());
        setSelectedChangesets(sel);
    }
View Full Code Here

    /* ---------------------------------------------------------------------------- */
    @Override
    public void propertyChange(PropertyChangeEvent evt) {
        if(!evt.getPropertyName().equals(ChangesetCacheManagerModel.CHANGESET_IN_DETAIL_VIEW_PROP))
            return;
        Changeset cs = (Changeset)evt.getNewValue();
        setCurrentChangeset(cs);
    }
View Full Code Here

    @Override
    public void update(Observable o, Object arg) {
        lblInfo.setText(getInfoText());

        HistoryOsmPrimitive primitive = getPrimitive();
        Changeset cs = primitive.getChangeset();

        if (!model.isLatest(primitive)) {
            User user = primitive.getUser();
            String url = AbstractInfoAction.getBaseBrowseUrl() + "/changeset/" + primitive.getChangesetId();
            lblChangeset.setUrl(url);
            lblChangeset.setDescription(Long.toString(primitive.getChangesetId()));

            String username = "";
            if (user != null) {
                username = user.getName();
            }
            lblUser.setDescription(username);
            try {
                if (user != null && user != User.getAnonymous()) {
                    lblUser.setUrl(getUserUrl(username));
                } else {
                    lblUser.setUrl(null);
                }
            } catch(UnsupportedEncodingException e) {
                Main.error(e);
                lblUser.setUrl(null);
            }
        } else {
            String username = JosmUserIdentityManager.getInstance().getUserName();
            if (username == null) {
                lblUser.setDescription(tr("anonymous"));
                lblUser.setUrl(null);
            } else {
                lblUser.setDescription(username);
                try {
                    lblUser.setUrl(getUserUrl(username));
                } catch(UnsupportedEncodingException e) {
                    Main.error(e);
                    lblUser.setUrl(null);
                }
            }
            lblChangeset.setDescription(tr("none"));
            lblChangeset.setUrl(null);
        }

        final Changeset oppCs = model.getPointInTime(pointInTimeType.opposite()).getChangeset();
        updateText(cs, "comment", lblChangesetComment, null, oppCs, lblChangesetComment);
        updateText(cs, "source", lblChangesetSource, lblSource, oppCs, pnlChangesetSource);
    }
View Full Code Here

    /* ---------------------------------------------------------------------------- */
    @Override
    public void propertyChange(PropertyChangeEvent evt) {
        if (!evt.getPropertyName().equals(ChangesetCacheManagerModel.CHANGESET_IN_DETAIL_VIEW_PROP))
            return;
        Changeset cs = (Changeset)evt.getNewValue();
        if (cs == null) {
            model.clear();
        } else {
            model.initFromPrimitive(cs);
        }
View Full Code Here

     *
     */
    class ChangesetListItemStateListener implements ItemListener {
        @Override
        public void itemStateChanged(ItemEvent e) {
            Changeset cs = (Changeset)cbOpenChangesets.getSelectedItem();
            if (cs == null) return;
            if (rbExisting.isSelected()) {
                firePropertyChange(SELECTED_CHANGESET_PROP, null, cs);
            }
        }
View Full Code Here

            } else if (rbExisting.isSelected()) {
                cbOpenChangesets.setEnabled(true);
                if (cbOpenChangesets.getSelectedItem() == null) {
                    model.selectFirstChangeset();
                }
                Changeset cs = (Changeset)cbOpenChangesets.getSelectedItem();
                if (cs == null) return;
                changesetCommentModel.setComment(cs.get("comment"));
                firePropertyChange(SELECTED_CHANGESET_PROP, null, cs);
            }
        }
View Full Code Here

            refreshEnabledState();
        }

        @Override
        public void actionPerformed(ActionEvent e) {
            Changeset cs = (Changeset)cbOpenChangesets.getSelectedItem();
            if (cs == null) return;
            CloseChangesetTask task = new CloseChangesetTask(Collections.singletonList(cs));
            Main.worker.submit(task);
        }
View Full Code Here

TOP

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

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.