From d2b65e4a0f21ea7fd6de748ff3a2e678eba33551 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sun, 7 Oct 2012 13:57:01 +0200 Subject: [PATCH] Fix naming of rendering style display --- .../net/osmand/render/RenderingRulesStorage.java | 15 +++++++++++---- .../osmand/render/high-contrast-roads.render.xml | 2 +- .../net/osmand/swing/NativeSwingRendering.java | 5 ++--- .../net/osmand/plus/render/RendererRegistry.java | 2 +- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/DataExtractionOSM/src/net/osmand/render/RenderingRulesStorage.java b/DataExtractionOSM/src/net/osmand/render/RenderingRulesStorage.java index edc0d907fd..7a94ead6c8 100644 --- a/DataExtractionOSM/src/net/osmand/render/RenderingRulesStorage.java +++ b/DataExtractionOSM/src/net/osmand/render/RenderingRulesStorage.java @@ -54,6 +54,7 @@ public class RenderingRulesStorage { protected Map renderingConstants= new LinkedHashMap(); private String renderingName; + private String internalRenderingName; public static interface RenderingRulesStorageResolver { @@ -61,9 +62,10 @@ public class RenderingRulesStorage { RenderingRulesStorage resolve(String name, RenderingRulesStorageResolver ref) throws SAXException; } - public RenderingRulesStorage(){ + public RenderingRulesStorage(String name){ // register empty string as 0 getDictionaryValue(""); + this.renderingName = name; } @@ -88,6 +90,10 @@ public class RenderingRulesStorage { return renderingName; } + public String getInternalRenderingName() { + return internalRenderingName; + } + public void parseRulesFromXmlInputStream(InputStream is, RenderingRulesStorageResolver resolver) throws SAXException, IOException { try { @@ -220,6 +226,7 @@ public class RenderingRulesStorage { private RenderingRulesStorage dependsStorage; + public RenderingRulesHandler(SAXParser parser, RenderingRulesStorageResolver resolver){ this.parser = parser; this.resolver = resolver; @@ -326,7 +333,7 @@ public class RenderingRulesStorage { PROPS = new RenderingRuleStorageProperties(dependsStorage.PROPS); } - renderingName = attributes.getValue("name"); + internalRenderingName = attributes.getValue("name"); } else if("renderer".equals(name)){ //$NON-NLS-1$ throw new SAXException("Rendering style is deprecated and no longer supported."); @@ -423,11 +430,11 @@ public class RenderingRulesStorage { public static void main(String[] args) throws SAXException, IOException { - RenderingRulesStorage storage = new RenderingRulesStorage(); + RenderingRulesStorage storage = new RenderingRulesStorage("test"); final RenderingRulesStorageResolver resolver = new RenderingRulesStorageResolver() { @Override public RenderingRulesStorage resolve(String name, RenderingRulesStorageResolver ref) throws SAXException { - RenderingRulesStorage depends = new RenderingRulesStorage(); + RenderingRulesStorage depends = new RenderingRulesStorage("test"); try { depends.parseRulesFromXmlInputStream(RenderingRulesStorage.class.getResourceAsStream(name+".render.xml"), ref); diff --git a/DataExtractionOSM/src/net/osmand/render/high-contrast-roads.render.xml b/DataExtractionOSM/src/net/osmand/render/high-contrast-roads.render.xml index 44f20d244a..02dfb7ca00 100644 --- a/DataExtractionOSM/src/net/osmand/render/high-contrast-roads.render.xml +++ b/DataExtractionOSM/src/net/osmand/render/high-contrast-roads.render.xml @@ -1,4 +1,4 @@ - +