/** * Matches a closed way with the given parameters against this RenderTheme. * * @param renderCallback the callback implementation which will be executed on each match. * @param renderContext * @param way */ public void matchClosedWay(RenderCallback renderCallback, final RenderContext renderContext, PolylineContainer way) { matchWay(renderCallback, renderContext, Closed.YES, way); }
/** * @return a new {@code Rule} instance. */ public Rule build() { if (this.valueList.remove(STRING_NEGATION)) { AttributeMatcher attributeMatcher = new NegativeMatcher(this.keyList, this.valueList); return new NegativeRule(this, attributeMatcher); } AttributeMatcher keyMatcher = getKeyMatcher(this.keyList); AttributeMatcher valueMatcher = getValueMatcher(this.valueList); keyMatcher = RuleOptimizer.optimize(keyMatcher, this.ruleStack); valueMatcher = RuleOptimizer.optimize(valueMatcher, this.ruleStack); return new PositiveRule(this, keyMatcher, valueMatcher); }
@Test public void isCoveredByTest() { AttributeMatcher attributeMatcher1 = new ValueMatcher(Arrays.asList(VALUE1)); AttributeMatcher attributeMatcher2 = new ValueMatcher(Arrays.asList(VALUE1)); Assert.assertTrue(attributeMatcher1.isCoveredBy(attributeMatcher1)); Assert.assertTrue(attributeMatcher1.isCoveredBy(attributeMatcher2)); Assert.assertTrue(attributeMatcher1.isCoveredBy(AnyMatcher.INSTANCE)); Assert.assertFalse(AnyMatcher.INSTANCE.isCoveredBy(attributeMatcher1)); }
@Test public void isCoveredByTest() { AttributeMatcher attributeMatcher1 = new KeyMatcher(Arrays.asList(KEY1)); AttributeMatcher attributeMatcher2 = new KeyMatcher(Arrays.asList(KEY1)); Assert.assertTrue(attributeMatcher1.isCoveredBy(attributeMatcher1)); Assert.assertTrue(attributeMatcher1.isCoveredBy(attributeMatcher2)); Assert.assertTrue(attributeMatcher1.isCoveredBy(AnyMatcher.INSTANCE)); Assert.assertFalse(AnyMatcher.INSTANCE.isCoveredBy(attributeMatcher1)); }
public void apply(Rule r) { for (Rule subRule : r.subRules) { this.apply(subRule); } } }
@Override public boolean isCoveredBy(ElementMatcher elementMatcher) { return elementMatcher.matches(Element.WAY); }
@Override public boolean isCoveredBy(ClosedMatcher closedMatcher) { return closedMatcher.matches(Closed.NO); }
/** * @return a new {@code RenderTheme} instance. */ public RenderTheme build() { return new RenderTheme(this); }
public void traverseRules(Rule.RuleVisitor visitor) { for (Rule rule : this.rulesList) { rule.apply(visitor); } }
MapWorker(RendererJob rendererJob) { this.rendererJob = rendererJob; this.rendererJob.renderThemeFuture.incrementRefCount(); }
public RuleBuilder(String elementName, XmlPullParser pullParser, Stack<Rule> ruleStack) throws XmlPullParserException { this.ruleStack = ruleStack; this.closed = Closed.ANY; this.zoomMin = 0; this.zoomMax = Byte.MAX_VALUE; extractValues(elementName, pullParser); }
public RenderThemeFuture(GraphicFactory graphicFactory, XmlRenderTheme xmlRenderTheme, DisplayModel displayModel) { super(new RenderThemeCallable(graphicFactory, xmlRenderTheme, displayModel)); }
/** * Matches a linear way with the given parameters against this RenderTheme. * * @param renderCallback the callback implementation which will be executed on each match. * @param renderContext * @param way */ public void matchLinearWay(RenderCallback renderCallback, final RenderContext renderContext, PolylineContainer way) { matchWay(renderCallback, renderContext, Closed.NO, way); }
void apply(RuleVisitor v) { v.apply(this); }
@Override public boolean isCoveredBy(ElementMatcher elementMatcher) { return elementMatcher.matches(Element.NODE); }
@Override public boolean isCoveredBy(ClosedMatcher closedMatcher) { return closedMatcher.matches(Closed.YES); }