@Override protected void evaluate() { if (!isNotEvaluated) return; final Expression expLabel = styleElement.getLabel(); // we can not know so always visible isStaticVisible = VisibilityState.VISIBLE; if (GO2Utilities.isStatic(expLabel)) { label = GO2Utilities.evaluate(expLabel, null, String.class, "No Label"); } else { GO2Utilities.getRequieredAttributsName(expLabel, requieredAttributs); isStatic = false; } cachedFont.getRequieredAttributsName(requieredAttributs); cachedFill.getRequieredAttributsName(requieredAttributs); cachedHalo.getRequieredAttributsName(requieredAttributs); cachedPlacement.getRequieredAttributsName(requieredAttributs); // no attributs needed replace with static empty list. if (requieredAttributs.isEmpty()) { requieredAttributs = EMPTY_ATTRIBUTS; } isNotEvaluated = false; }
public Composite getFontComposite(final Object candidate) { Composite composite; if (cachedFill != null) { composite = cachedFill.getJ2DComposite(candidate); } else { composite = AlphaComposite.SrcOver; } return composite; }
public Paint getFontPaint( final Object candidate, final int x, final int y, final float coeff, final RenderingHints hints) { Paint paint; if (cachedFill != null) { paint = cachedFill.getJ2DPaint(candidate, x, y, coeff, hints); } else { paint = Color.BLACK; } return paint; }
public CachedTextSymbolizer( final TextSymbolizer symbolizer, final SymbolizerRendererService<TextSymbolizer, ? extends CachedSymbolizer<TextSymbolizer>> renderer) { super(symbolizer, renderer); final org.opengis.style.Font font = styleElement.getFont(); cachedFont = CachedFont.cache(font); final Fill fill = styleElement.getFill(); cachedFill = CachedFill.cache(fill); // halo can be null. final Halo halo = styleElement.getHalo(); if (halo != null) { cachedHalo = CachedHalo.cache(halo); } else { cachedHalo = null; } final LabelPlacement placement = styleElement.getLabelPlacement(); if (placement instanceof PointPlacement) { cachedPlacement = CachedPointPlacement.cache((PointPlacement) placement); } else if (placement instanceof LinePlacement) { cachedPlacement = CachedLinePlacement.cache((LinePlacement) placement); } else { throw new IllegalArgumentException( "A text symbolizer must have a placement set of type : PointPlacement or LinePlacement."); } styleElement.getFont(); // symbol.getGeometryPropertyName(); styleElement.getHalo(); styleElement.getLabel(); styleElement.getLabelPlacement(); styleElement.getUnitOfMeasure(); }