Package org.openstreetmap.josm.data.osm.history

Examples of org.openstreetmap.josm.data.osm.history.HistoryOsmPrimitive


        public boolean isCellEditable(int row, int column) {
            return false;
        }

        public boolean hasTag(String key) {
            HistoryOsmPrimitive primitive = getPointInTime(pointInTimeType);
            if (primitive == null)
                return false;
            return primitive.hasTag(key);
        }
View Full Code Here


                return false;
            return primitive.hasTag(key);
        }

        public String getValue(String key) {
            HistoryOsmPrimitive primitive = getPointInTime(pointInTimeType);
            if (primitive == null)
                return null;
            return primitive.get(key);
        }
View Full Code Here

            return primitive.get(key);
        }

        public boolean oppositeHasTag(String key) {
            PointInTimeType opposite = pointInTimeType.opposite();
            HistoryOsmPrimitive primitive = getPointInTime(opposite);
            if (primitive == null)
                return false;
            return primitive.hasTag(key);
        }
View Full Code Here

            return primitive.hasTag(key);
        }

        public String getOppositeValue(String key) {
            PointInTimeType opposite = pointInTimeType.opposite();
            HistoryOsmPrimitive primitive = getPointInTime(opposite);
            if (primitive == null)
                return null;
            return primitive.get(key);
        }
View Full Code Here

            putValue(SMALL_ICON, ImageProvider.get("about"));
        }

        @Override
        protected String createInfoUrl(Object infoObject) {
            HistoryOsmPrimitive primitive = (HistoryOsmPrimitive) infoObject;
            return getBaseBrowseUrl() + "/changeset/" + primitive.getChangesetId();
        }
View Full Code Here

            putValue(SMALL_ICON, ImageProvider.get("about"));
        }

        @Override
        protected String createInfoUrl(Object infoObject) {
            HistoryOsmPrimitive hp = (HistoryOsmPrimitive) infoObject;
            return hp.getUser() == null ? null : getBaseUserUrl() + "/" + hp.getUser().getName();
        }
View Full Code Here

            return null;
        return model.getPointInTime(pointInTimeType);
    }

    protected String getInfoText() {
        HistoryOsmPrimitive primitive = getPrimitive();
        if (primitive == null)
            return "";
        String text;
        if (model.isLatest(primitive)) {
            OsmDataLayer editLayer = Main.main.getEditLayer();
            text = tr("<html>Version <strong>{0}</strong> currently edited in layer ''{1}''</html>",
                    Long.toString(primitive.getVersion()),
                    editLayer == null ? tr("unknown") : editLayer.getName()
                    );
        } else {
            String date = "?";
            if (primitive.getTimestamp() != null) {
                date = DateUtils.formatDateTime(primitive.getTimestamp(), DateFormat.SHORT, DateFormat.SHORT);
            }
            text = tr(
                    "<html>Version <strong>{0}</strong> created on <strong>{1}</strong></html>",
                    Long.toString(primitive.getVersion()), date);
        }
        return text;
    }
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();
            }
View Full Code Here

            this.model = model;
            this.role = role;
        }

        protected void refresh() {
            HistoryOsmPrimitive p = getPrimitive();
            HistoryOsmPrimitive  opposite = getOppositePrimitive();
            if (!(p instanceof HistoryNode)) return;
            if (!(opposite instanceof HistoryNode)) return;
            HistoryNode node = (HistoryNode)p;
            HistoryNode oppositeNode = (HistoryNode) opposite;
View Full Code Here

            lblDistance.setBorder(BorderFactory.createEmptyBorder(2,2,2,2));
        }

        @Override
        protected void refresh() {
            HistoryOsmPrimitive p = getPrimitive();
            HistoryOsmPrimitive opposite = getOppositePrimitive();
            if (!(p instanceof HistoryNode)) return;
            if (!(opposite instanceof HistoryNode)) return;
            HistoryNode node = (HistoryNode) p;
            HistoryNode oppositeNode = (HistoryNode) opposite;
View Full Code Here

TOP

Related Classes of org.openstreetmap.josm.data.osm.history.HistoryOsmPrimitive

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.