Package org.geotools.renderer.lite
Class MetaBufferEstimator
- Object
-
- DefaultFilterVisitor
-
- FilterAttributeExtractor
-
- MetaBufferEstimator
-
- All Implemented Interfaces:
ExpressionVisitor
,FilterVisitor
,StyleVisitor
public class MetaBufferEstimator extends FilterAttributeExtractor implements StyleVisitor
Parses a style or part of it and returns the size of the largest stroke and the biggest point symbolizer whose width is specified with a literal expression.
Also provides an indication whether the stroke width is accurate, or if a non literal width has been found.
-
-
Field Summary
Fields Modifier and Type Field Description protected FilterAttributeExtractor
attributeExtractor
protected int
buffer
protected boolean
estimateAccurate
protected static Logger
LOGGER
The logger for the rendering module.-
Fields inherited from class FilterAttributeExtractor
attributeNames, featureType, propertyNames, usingDynamicProperties, usingVolatileFunctions
-
-
Constructor Summary
Constructors Constructor Description MetaBufferEstimator()
Builds an estimator suitable for styles without expressionsMetaBufferEstimator(Feature sample)
Builds an estimator suitable for styles with expression, will evaluate against the provided feature
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
evaluateWidth(Expression width)
int
getBuffer()
protected double
getDouble(Expression ex)
protected int
getPositiveValue(Expression ex)
protected boolean
isConstant(Expression ex)
boolean
isEstimateAccurate()
protected boolean
isNull(Expression exp)
void
reset()
Should you reuse this extractor multiple time, calling this method will reset the buffer and flagsvoid
visit(AnchorPoint ap)
Called when accept is called on an anchor pointvoid
visit(ChannelSelection cs)
Called when accept is called on a rasterChannelSelection
elementvoid
visit(ColorMap map)
Called when accept is called on a raster color mapvoid
visit(ColorMapEntry entry)
Called when accept is called on a raster color map entryvoid
visit(ContrastEnhancement contrastEnhancement)
Called when accept is called on a raster ContrastEnhancement elementvoid
visit(Displacement dis)
Called when accept is called on a displacementvoid
visit(ExternalGraphic exgr)
Called when accept is called on an external graphicvoid
visit(FeatureTypeConstraint ftc)
Called when accept is called on a FeatureTypeConstraint.void
visit(FeatureTypeStyle fts)
Called when accept is called on a fetauretypestylevoid
visit(Fill fill)
Called when accept is called on a fillvoid
visit(Graphic gr)
Called when accept is called on a graphicvoid
visit(Halo halo)
Called when accept is called on a halovoid
visit(ImageOutline outline)
Called when accept is called on a rasterImageOutline
elementvoid
visit(LinePlacement lp)
Called when accept is called on a Line Placementvoid
visit(LineSymbolizer line)
Called when accept is called on a linesymbolizervoid
visit(Mark mark)
Called when accept is called on a markvoid
visit(NamedLayer layer)
Called when accept is called on a NamedLayer.void
visit(OverlapBehavior ob)
Called when accept is called on a rasterOverlapBehaviorEnum
elementvoid
visit(PointPlacement pp)
Called when accept is called on a Point Placementvoid
visit(PointSymbolizer ps)
Called when accept is called on a pointsymbolizervoid
visit(PolygonSymbolizer poly)
Called when accept is called on a polygon symbolizervoid
visit(RasterSymbolizer rs)
Called when accept is called on a rastersymbolizervoid
visit(Rule rule)
Called when accept is called on a rulevoid
visit(SelectedChannelType sct)
Called when accept is called on a rasterSelectedChannelType
elementvoid
visit(ShadedRelief sr)
Called when accept is called on a rasterShadedRelief
elementvoid
visit(Stroke stroke)
Called when accept is called on a strokevoid
visit(Style style)
Called when accept is called on a Style.void
visit(StyledLayerDescriptor sld)
Called when accept is called on a StyledLayerDescriptor.void
visit(Symbolizer sym)
since it is impossible to create a Symbolizer this method should generate an exception or warning.void
visit(TextSymbolizer text)
Called when accept is called on a textsymbolizervoid
visit(UserLayer layer)
Called when accept is called on a UserLayer.-
Methods inherited from class FilterAttributeExtractor
clear, getAttributeNames, getAttributeNameSet, getPropertyNameSet, isConstantExpression, isUsingDynamincProperties, visit, visit
-
Methods inherited from class DefaultFilterVisitor
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visitNullFilter
-
-
-
-
Field Detail
-
LOGGER
protected static final Logger LOGGER
The logger for the rendering module.
-
attributeExtractor
protected FilterAttributeExtractor attributeExtractor
-
estimateAccurate
protected boolean estimateAccurate
- UML property:
- name="estimateAccurate"
-
buffer
protected int buffer
- UML property:
- name="buffer"
-
-
Constructor Detail
-
MetaBufferEstimator
public MetaBufferEstimator()
Builds an estimator suitable for styles without expressions
-
MetaBufferEstimator
public MetaBufferEstimator(Feature sample)
Builds an estimator suitable for styles with expression, will evaluate against the provided feature
-
-
Method Detail
-
reset
public void reset()
Should you reuse this extractor multiple time, calling this method will reset the buffer and flags
-
getBuffer
public int getBuffer()
- UML property:
- name="buffer"
-
isEstimateAccurate
public boolean isEstimateAccurate()
- UML property:
- name="estimateAccurate"
-
visit
public void visit(Style style)
Description copied from interface:StyleVisitor
Called when accept is called on a Style.- Specified by:
visit
in interfaceStyleVisitor
- Parameters:
style
- The style to visit
-
visit
public void visit(Rule rule)
Description copied from interface:StyleVisitor
Called when accept is called on a rule- Specified by:
visit
in interfaceStyleVisitor
- Parameters:
rule
- the rule to visit
-
visit
public void visit(FeatureTypeStyle fts)
Description copied from interface:StyleVisitor
Called when accept is called on a fetauretypestyle- Specified by:
visit
in interfaceStyleVisitor
- Parameters:
fts
- the feature type styler to visit
-
visit
public void visit(Fill fill)
Description copied from interface:StyleVisitor
Called when accept is called on a fill- Specified by:
visit
in interfaceStyleVisitor
- Parameters:
fill
- the fill to be visited
-
visit
public void visit(Stroke stroke)
Description copied from interface:StyleVisitor
Called when accept is called on a stroke- Specified by:
visit
in interfaceStyleVisitor
- Parameters:
stroke
- the stroke to visit- See Also:
StyleVisitor.visit(org.geotools.api.style.Stroke)
-
isNull
protected boolean isNull(Expression exp)
-
visit
public void visit(Symbolizer sym)
Description copied from interface:StyleVisitor
since it is impossible to create a Symbolizer this method should generate an exception or warning.- Specified by:
visit
in interfaceStyleVisitor
- Parameters:
sym
- the symbolizer to visit- See Also:
StyleVisitor.visit(org.geotools.api.style.Symbolizer)
-
visit
public void visit(RasterSymbolizer rs)
Description copied from interface:StyleVisitor
Called when accept is called on a rastersymbolizer- Specified by:
visit
in interfaceStyleVisitor
- Parameters:
rs
- the raster symbolizer to visit
-
visit
public void visit(PointSymbolizer ps)
Description copied from interface:StyleVisitor
Called when accept is called on a pointsymbolizer- Specified by:
visit
in interfaceStyleVisitor
- Parameters:
ps
- the point symbolizer to visit- See Also:
StyleVisitor.visit(org.geotools.api.style.PointSymbolizer)
-
visit
public void visit(LineSymbolizer line)
Description copied from interface:StyleVisitor
Called when accept is called on a linesymbolizer- Specified by:
visit
in interfaceStyleVisitor
- Parameters:
line
- the line symbolizer to visit- See Also:
StyleVisitor.visit(org.geotools.api.style.LineSymbolizer)
-
visit
public void visit(PolygonSymbolizer poly)
Description copied from interface:StyleVisitor
Called when accept is called on a polygon symbolizer- Specified by:
visit
in interfaceStyleVisitor
- Parameters:
poly
- the polygon symbolizer to visit- See Also:
StyleVisitor.visit(org.geotools.api.style.PolygonSymbolizer)
-
visit
public void visit(TextSymbolizer text)
Description copied from interface:StyleVisitor
Called when accept is called on a textsymbolizer- Specified by:
visit
in interfaceStyleVisitor
- Parameters:
text
- the text symbolizer to visit- See Also:
StyleVisitor.visit(org.geotools.api.style.TextSymbolizer)
-
visit
public void visit(Graphic gr)
Description copied from interface:StyleVisitor
Called when accept is called on a graphic- Specified by:
visit
in interfaceStyleVisitor
- Parameters:
gr
- the graphic to visit- See Also:
StyleVisitor.visit(org.geotools.api.style.Graphic)
-
evaluateWidth
protected void evaluateWidth(Expression width)
-
getPositiveValue
protected int getPositiveValue(Expression ex)
-
getDouble
protected double getDouble(Expression ex)
-
isConstant
protected boolean isConstant(Expression ex)
-
visit
public void visit(Mark mark)
Description copied from interface:StyleVisitor
Called when accept is called on a mark- Specified by:
visit
in interfaceStyleVisitor
- Parameters:
mark
- the mark to visit- See Also:
StyleVisitor.visit(org.geotools.api.style.Mark)
-
visit
public void visit(ExternalGraphic exgr)
Description copied from interface:StyleVisitor
Called when accept is called on an external graphic- Specified by:
visit
in interfaceStyleVisitor
- Parameters:
exgr
- the external graphic to visit- See Also:
StyleVisitor.visit(org.geotools.api.style.ExternalGraphic)
-
visit
public void visit(PointPlacement pp)
Description copied from interface:StyleVisitor
Called when accept is called on a Point Placement- Specified by:
visit
in interfaceStyleVisitor
- Parameters:
pp
- the point placement to visit- See Also:
StyleVisitor.visit(org.geotools.api.style.PointPlacement)
-
visit
public void visit(AnchorPoint ap)
Description copied from interface:StyleVisitor
Called when accept is called on an anchor point- Specified by:
visit
in interfaceStyleVisitor
- Parameters:
ap
- the anchor point to visit- See Also:
StyleVisitor.visit(org.geotools.api.style.AnchorPoint)
-
visit
public void visit(Displacement dis)
Description copied from interface:StyleVisitor
Called when accept is called on a displacement- Specified by:
visit
in interfaceStyleVisitor
- Parameters:
dis
- the displacement to visit- See Also:
StyleVisitor.visit(org.geotools.api.style.Displacement)
-
visit
public void visit(LinePlacement lp)
Description copied from interface:StyleVisitor
Called when accept is called on a Line Placement- Specified by:
visit
in interfaceStyleVisitor
- Parameters:
lp
- the line placement to visit- See Also:
StyleVisitor.visit(org.geotools.api.style.LinePlacement)
-
visit
public void visit(Halo halo)
Description copied from interface:StyleVisitor
Called when accept is called on a halo- Specified by:
visit
in interfaceStyleVisitor
- Parameters:
halo
- the halo to visit- See Also:
StyleVisitor.visit(org.geotools.api.style.Halo)
-
visit
public void visit(StyledLayerDescriptor sld)
Description copied from interface:StyleVisitor
Called when accept is called on a StyledLayerDescriptor.- Specified by:
visit
in interfaceStyleVisitor
- Parameters:
sld
- The StyledLayerDescriptor to visit
-
visit
public void visit(NamedLayer layer)
Description copied from interface:StyleVisitor
Called when accept is called on a NamedLayer.- Specified by:
visit
in interfaceStyleVisitor
- Parameters:
layer
- The NamedLayer to visit
-
visit
public void visit(UserLayer layer)
Description copied from interface:StyleVisitor
Called when accept is called on a UserLayer.- Specified by:
visit
in interfaceStyleVisitor
- Parameters:
layer
- The UserLayer to visit
-
visit
public void visit(FeatureTypeConstraint ftc)
Description copied from interface:StyleVisitor
Called when accept is called on a FeatureTypeConstraint.- Specified by:
visit
in interfaceStyleVisitor
- Parameters:
ftc
- The FeatureTypeConstraint to visit
-
visit
public void visit(ColorMap map)
Description copied from interface:StyleVisitor
Called when accept is called on a raster color map- Specified by:
visit
in interfaceStyleVisitor
- Parameters:
map
- the color map to visit
-
visit
public void visit(ColorMapEntry entry)
Description copied from interface:StyleVisitor
Called when accept is called on a raster color map entry- Specified by:
visit
in interfaceStyleVisitor
- Parameters:
entry
- the color map to visit
-
visit
public void visit(ContrastEnhancement contrastEnhancement)
Description copied from interface:StyleVisitor
Called when accept is called on a raster ContrastEnhancement element- Specified by:
visit
in interfaceStyleVisitor
- Parameters:
contrastEnhancement
- theContrastEnhancement
to visit.
-
visit
public void visit(ImageOutline outline)
Description copied from interface:StyleVisitor
Called when accept is called on a rasterImageOutline
element- Specified by:
visit
in interfaceStyleVisitor
- Parameters:
outline
- theImageOutline
to visit.
-
visit
public void visit(ChannelSelection cs)
Description copied from interface:StyleVisitor
Called when accept is called on a rasterChannelSelection
element- Specified by:
visit
in interfaceStyleVisitor
- Parameters:
cs
- theChannelSelection
to visit.
-
visit
public void visit(OverlapBehavior ob)
Description copied from interface:StyleVisitor
Called when accept is called on a rasterOverlapBehaviorEnum
element- Specified by:
visit
in interfaceStyleVisitor
- Parameters:
ob
- theOverlapBehaviorEnum
to visit.
-
visit
public void visit(SelectedChannelType sct)
Description copied from interface:StyleVisitor
Called when accept is called on a rasterSelectedChannelType
element- Specified by:
visit
in interfaceStyleVisitor
- Parameters:
sct
- theSelectedChannelType
to visit.
-
visit
public void visit(ShadedRelief sr)
Description copied from interface:StyleVisitor
Called when accept is called on a rasterShadedRelief
element- Specified by:
visit
in interfaceStyleVisitor
- Parameters:
sr
- theShadedRelief
to visit.
-
-