Package org.openstreetmap.josm.gui.preferences

Examples of org.openstreetmap.josm.gui.preferences.SourceEntry


            /* Migration code can be removed ~ Nov. 2014 */
            if (addedMapcssStyle) {
                // change title of the XML entry
                // only do this once. If the user changes it afterward, do not touch
                if (!Main.pref.getBoolean("mappaint.style.migration.changedXmlName", false)) {
                    SourceEntry josmXml = Utils.find(list, new Predicate<SourceEntry>() {
                        @Override
                        public boolean evaluate(SourceEntry se) {
                            return "resource://styles/standard/elemstyles.xml".equals(se.url);
                        }
                    });
                    if (josmXml != null) {
                        josmXml.title = tr("JOSM default (XML; old version)");
                        changed = true;
                    }
                    Main.pref.put("mappaint.style.migration.changedXmlName", true);
                }
            }

            /* Migration code can be removed ~ Nov. 2014 */
            if (!Main.pref.getBoolean("mappaint.style.migration.switchedToMapCSS", false)) {
                SourceEntry josmXml = Utils.find(list, new Predicate<SourceEntry>() {
                    @Override
                    public boolean evaluate(SourceEntry se) {
                        return "resource://styles/standard/elemstyles.xml".equals(se.url);
                    }
                });
                SourceEntry josmMapCSS = Utils.find(list, new Predicate<SourceEntry>() {
                    @Override
                    public boolean evaluate(SourceEntry se) {
                        return "resource://styles/standard/elemstyles.mapcss".equals(se.url);
                    }
                });
View Full Code Here


            return res;
        }

        @Override
        public SourceEntry deserialize(Map<String, String> s) {
            return new SourceEntry(s.get("url"), s.get("ptoken"), s.get("title"), Boolean.parseBoolean(s.get("active")));
        }
View Full Code Here

            return res;
        }

        @Override
        public SourceEntry deserialize(Map<String, String> s) {
            return new SourceEntry(s.get("url"), null, s.get("title"), true);
        }
View Full Code Here

                // Only way to get full path (http://stackoverflow.com/a/7802029/2257172)
                Path fullPath = ((Path)key.watchable()).resolve(filename);

                synchronized(this) {
                    StyleSource style = styleMap.get(fullPath);
                    SourceEntry rule = ruleMap.get(fullPath);
                    if (style != null) {
                        Main.info("Map style "+style.getDisplayString()+" has been modified. Reloading style...");
                        Main.worker.submit(new MapPaintStyleLoader(Collections.singleton(style)));
                    } else if (rule != null) {
                        Main.info("Validator rule "+rule.getDisplayString()+" has been modified. Reloading rule...");
                        MapCSSTagChecker tagChecker = OsmValidator.getTest(MapCSSTagChecker.class);
                        if (tagChecker != null) {
                            try {
                                tagChecker.addMapCSS(rule.url);
                            } catch (IOException | ParseException e) {
View Full Code Here

            protected void finish() {
                SwingUtilities.invokeLater(new Runnable() {
                    @Override
                    public void run() {
                        if (!error && !canceled) {
                            SourceEntry se = new SourceEntry(s);
                            se.url = file.getPath();
                            MapPaintStyles.addStyle(se);
                            tblStyles.getSelectionModel().setSelectionInterval(model.getRowCount() - 1 , model.getRowCount() - 1);
                            model.ensureSelectedIsVisible();
                        }
View Full Code Here

            return res;
        }

        @Override
        public SourceEntry deserialize(Map<String, String> s) {
            return new SourceEntry(s.get("url"), null, s.get("title"), Boolean.parseBoolean(s.get("active")));
        }
View Full Code Here

TOP

Related Classes of org.openstreetmap.josm.gui.preferences.SourceEntry

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.