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 Expression
This 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 Expression
rescale
(Expression expr) Used to rescale the provided expr.protected void
rescaleArrayOption
(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 Expression
protected void
rescaleOption
(Map<String, String> options, String key, double defaultValue) Rescales the specified vendor optionprotected void
rescaleOption
(Map<String, String> options, String key, int defaultValue) Rescales the specified vendor optionvoid
Make graphics (such as used with PointSymbolizer) biggervoid
visit
(LineSymbolizer sym) Called when accept is called on a linesymbolizervoid
visit
(PointSymbolizer sym) Called when accept is called on a pointsymbolizervoid
visit
(PolygonSymbolizer sym) Called when accept is called on a polygon symbolizervoid
visit
(RasterSymbolizer sym) Called when accept is called on a rastersymbolizervoid
Increase stroke width.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 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:
visit
in interfaceStyleVisitor
- Overrides:
visit
in classDuplicatingStyleVisitor
- Parameters:
stroke
- the stroke to visit
-
visit
Make graphics (such as used with PointSymbolizer) bigger- Specified by:
visit
in interfaceStyleVisitor
- Overrides:
visit
in classDuplicatingStyleVisitor
- Parameters:
gr
- the graphic to visit
-
rescaleGraphicSize
-
visit
Description copied from interface:StyleVisitor
Called when accept is called on a textsymbolizer- Specified by:
visit
in interfaceStyleVisitor
- Overrides:
visit
in classDuplicatingStyleVisitor
- Parameters:
text
- the text symbolizer to visit
-
visit
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
- Overrides:
visit
in classDuplicatingStyleVisitor
- Parameters:
sym
- the symbolizer to visit
-
visit
Description copied from interface:StyleVisitor
Called when accept is called on a pointsymbolizer- Specified by:
visit
in interfaceStyleVisitor
- Overrides:
visit
in classDuplicatingStyleVisitor
- Parameters:
sym
- the point symbolizer to visit
-
visit
Description copied from interface:StyleVisitor
Called when accept is called on a linesymbolizer- Specified by:
visit
in interfaceStyleVisitor
- Overrides:
visit
in classDuplicatingStyleVisitor
- Parameters:
sym
- the line symbolizer to visit
-
visit
Description copied from interface:StyleVisitor
Called when accept is called on a polygon symbolizer- Specified by:
visit
in interfaceStyleVisitor
- Overrides:
visit
in classDuplicatingStyleVisitor
- Parameters:
sym
- the polygon symbolizer to visit
-
visit
Description copied from interface:StyleVisitor
Called when accept is called on a rastersymbolizer- Specified by:
visit
in interfaceStyleVisitor
- Overrides:
visit
in 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
-