public RenderThemeBuilder(GraphicFactory graphicFactory, DisplayModel displayModel, String elementName, XmlPullParser pullParser) throws XmlPullParserException { this.displayModel = displayModel; this.baseStrokeWidth = 1f; this.baseTextSize = 1f; this.mapBackground = graphicFactory.createColor(Color.WHITE); extractValues(graphicFactory, elementName, pullParser); }
private void extractValues(GraphicFactory graphicFactory, String elementName, XmlPullParser pullParser) throws XmlPullParserException { for (int i = 0; i < pullParser.getAttributeCount(); ++i) { String name = pullParser.getAttributeName(i); String value = pullParser.getAttributeValue(i); if (XMLNS.equals(name)) { continue; } else if (XMLNS_XSI.equals(name)) { continue; } else if (XSI_SCHEMALOCATION.equals(name)) { continue; } else if (VERSION.equals(name)) { this.version = Integer.valueOf(XmlUtils.parseNonNegativeInteger(name, value)); } else if (MAP_BACKGROUND.equals(name)) { this.mapBackground = XmlUtils.getColor(graphicFactory, value, displayModel.getThemeCallback()); } else if (MAP_BACKGROUND_OUTSIDE.equals(name)) { this.mapBackgroundOutside = XmlUtils.getColor(graphicFactory, value, displayModel.getThemeCallback()); this.hasBackgroundOutside = true; } else if (BASE_STROKE_WIDTH.equals(name)) { this.baseStrokeWidth = XmlUtils.parseNonNegativeFloat(name, value); } else if (BASE_TEXT_SIZE.equals(name)) { this.baseTextSize = XmlUtils.parseNonNegativeFloat(name, value); } else { throw XmlUtils.createXmlPullParserException(elementName, name, value, i); } } validate(elementName); }
if ("rendertheme".equals(qName)) { checkState(qName, Element.RENDER_THEME); this.renderTheme = new RenderThemeBuilder(this.graphicFactory, this.displayModel, qName, pullParser).build(); } else if (ELEMENT_NAME_RULE.equals(qName)) { checkState(qName, Element.RULE);
if ("rendertheme".equals(qName)) { checkState(qName, Element.RENDER_THEME); this.renderTheme = new RenderThemeBuilder(this.graphicFactory, this.displayModel, qName, pullParser).build(); } else if (ELEMENT_NAME_RULE.equals(qName)) { checkState(qName, Element.RULE);
public RenderThemeBuilder(GraphicFactory graphicFactory, DisplayModel displayModel, String elementName, XmlPullParser pullParser) throws XmlPullParserException { this.displayModel = displayModel; this.baseStrokeWidth = 1f; this.baseTextSize = 1f; this.mapBackground = graphicFactory.createColor(Color.WHITE); extractValues(graphicFactory, elementName, pullParser); }
private void extractValues(GraphicFactory graphicFactory, String elementName, XmlPullParser pullParser) throws XmlPullParserException { for (int i = 0; i < pullParser.getAttributeCount(); ++i) { String name = pullParser.getAttributeName(i); String value = pullParser.getAttributeValue(i); if (XMLNS.equals(name)) { continue; } else if (XMLNS_XSI.equals(name)) { continue; } else if (XSI_SCHEMALOCATION.equals(name)) { continue; } else if (VERSION.equals(name)) { this.version = Integer.valueOf(XmlUtils.parseNonNegativeInteger(name, value)); } else if (MAP_BACKGROUND.equals(name)) { this.mapBackground = XmlUtils.getColor(graphicFactory, value, displayModel.getThemeCallback()); } else if (MAP_BACKGROUND_OUTSIDE.equals(name)) { this.mapBackgroundOutside = XmlUtils.getColor(graphicFactory, value, displayModel.getThemeCallback()); this.hasBackgroundOutside = true; } else if (BASE_STROKE_WIDTH.equals(name)) { this.baseStrokeWidth = XmlUtils.parseNonNegativeFloat(name, value); } else if (BASE_TEXT_SIZE.equals(name)) { this.baseTextSize = XmlUtils.parseNonNegativeFloat(name, value); } else { throw XmlUtils.createXmlPullParserException(elementName, name, value, i); } } validate(elementName); }