Class RescaleStyleVisitor
- All Implemented Interfaces:
StyleVisitor
- Direct Known Subclasses:
DpiRescaleStyleVisitor
The provided scale will be use to modify all line widths, font sizes and so forth. We may need to go the extra distance and play with the min/max scale on rules, and if there is any DPI specific madness going on we are going to cry.
According to the specification we are supposed to use environmental variables to make our styles render in a resolution independent manner. The current GeoTools environment variable visitor only does processing for mapscale but does not have a dpi substitution. On the plus side this visitor accepts a general Expression and you are free to use an environmental variable expression in order to make sure a normal base style is tweaked in all the right spots.
- Author:
- Jody Garnett (Refractions Research)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Unit<Length>protected ExpressionThis is the scale used as a multiplication factory for everything that has a size.Fields inherited from class DuplicatingStyleVisitor
copyFilter, ff, pages, sf, STRICT -
Constructor Summary
ConstructorsConstructorDescriptionRescaleStyleVisitor(double scale) RescaleStyleVisitor(Expression scale) RescaleStyleVisitor(FilterFactory filterFactory, double scale) RescaleStyleVisitor(FilterFactory filterFactory, Expression scale) -
Method Summary
Modifier and TypeMethodDescriptionprotected List<Expression>rescale(List<Expression> expressions) Rescale a list of expressions, can handle null.protected Expressionrescale(Expression expr) Used to rescale the provided expr.protected voidrescaleArrayOption(Map<String, String> options, String key, int defaultValue) Rescales the specified vendor optionprotected List<Expression>rescaleDashArray(List<Expression> expressions) Rescale using listMultiply, if there is only one entry.protected Expressionprotected voidrescaleOption(Map<String, String> options, String key, double defaultValue) Rescales the specified vendor optionprotected voidrescaleOption(Map<String, String> options, String key, int defaultValue) Rescales the specified vendor optionvoidMake graphics (such as used with PointSymbolizer) biggervoidvisit(LineSymbolizer sym) Called when accept is called on a linesymbolizervoidvisit(PointSymbolizer sym) Called when accept is called on a pointsymbolizervoidvisit(PolygonSymbolizer sym) Called when accept is called on a polygon symbolizervoidvisit(RasterSymbolizer sym) Called when accept is called on a rastersymbolizervoidIncrease stroke width.voidvisit(Symbolizer sym) since it is impossible to create a Symbolizer this method should generate an exception or warning.voidvisit(TextSymbolizer text) Called when accept is called on a textsymbolizerMethods inherited from class DuplicatingStyleVisitor
copy, copy, copy, copy, copy, copy, copy, copy, copy, copy, copy, copy, copy, copy, copy, copy, copy, copy, copy, copy, copy, copy, copy, copy, copy, copy, copy, copyExpressions, copyFonts, getCopy, setStrict, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
-
Field Details
-
scale
This is the scale used as a multiplication factory for everything that has a size. -
defaultUnit
protected Unit<Length> defaultUnit
-
-
Constructor Details
-
RescaleStyleVisitor
public RescaleStyleVisitor(double scale) -
RescaleStyleVisitor
-
RescaleStyleVisitor
-
RescaleStyleVisitor
-
-
Method Details
-
rescale
Used to rescale the provided expr.We do optimize the case where the provided expression is a literal; no sense doing a calculation each time if we don't have to.
- Returns:
- expr multiplied by the provided scale
-
rescale
Rescale a list of expressions, can handle null. -
rescaleDashArray
Rescale using listMultiply, if there is only one entry. -
visit
Increase stroke width.Based on feedback we may need to change the dash array as well.
- Specified by:
visitin interfaceStyleVisitor- Overrides:
visitin classDuplicatingStyleVisitor- Parameters:
stroke- the stroke to visit
-
visit
Make graphics (such as used with PointSymbolizer) bigger- Specified by:
visitin interfaceStyleVisitor- Overrides:
visitin classDuplicatingStyleVisitor- Parameters:
gr- the graphic to visit
-
rescaleGraphicSize
-
visit
Description copied from interface:StyleVisitorCalled when accept is called on a textsymbolizer- Specified by:
visitin interfaceStyleVisitor- Overrides:
visitin classDuplicatingStyleVisitor- Parameters:
text- the text symbolizer to visit
-
visit
Description copied from interface:StyleVisitorsince it is impossible to create a Symbolizer this method should generate an exception or warning.- Specified by:
visitin interfaceStyleVisitor- Overrides:
visitin classDuplicatingStyleVisitor- Parameters:
sym- the symbolizer to visit
-
visit
Description copied from interface:StyleVisitorCalled when accept is called on a pointsymbolizer- Specified by:
visitin interfaceStyleVisitor- Overrides:
visitin classDuplicatingStyleVisitor- Parameters:
sym- the point symbolizer to visit
-
visit
Description copied from interface:StyleVisitorCalled when accept is called on a linesymbolizer- Specified by:
visitin interfaceStyleVisitor- Overrides:
visitin classDuplicatingStyleVisitor- Parameters:
sym- the line symbolizer to visit
-
visit
Description copied from interface:StyleVisitorCalled when accept is called on a polygon symbolizer- Specified by:
visitin interfaceStyleVisitor- Overrides:
visitin classDuplicatingStyleVisitor- Parameters:
sym- the polygon symbolizer to visit
-
visit
Description copied from interface:StyleVisitorCalled when accept is called on a rastersymbolizer- Specified by:
visitin interfaceStyleVisitor- Overrides:
visitin classDuplicatingStyleVisitor- Parameters:
sym- the raster symbolizer to visit
-
rescaleOption
Rescales the specified vendor option -
rescaleOption
Rescales the specified vendor option -
rescaleArrayOption
Rescales the specified vendor option
-