|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectDuplicatingStyleVisitor
RescaleStyleVisitor
public class RescaleStyleVisitor
This is a style visitor that will produce a copy of the provided style rescaled by a provided factor.
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.
Field Summary | |
---|---|
protected Unit<Length> |
defaultUnit
|
protected Expression |
scale
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 | |
---|---|
RescaleStyleVisitor(double scale)
|
|
RescaleStyleVisitor(Expression scale)
|
|
RescaleStyleVisitor(FilterFactory2 filterFactory,
double scale)
|
|
RescaleStyleVisitor(FilterFactory2 filterFactory,
Expression scale)
|
Method Summary | |
---|---|
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 option |
protected Expression |
rescaleGraphicSize(Graphic gr)
|
protected void |
rescaleOption(Map<String,String> options,
String key,
double defaultValue)
Rescales the specified vendor option |
protected void |
rescaleOption(Map<String,String> options,
String key,
int defaultValue)
Rescales the specified vendor option |
void |
visit(Graphic gr)
Make graphics (such as used with PointSymbolizer) bigger |
void |
visit(LineSymbolizer sym)
Called when accept is called on a linesymbolizer |
void |
visit(PointSymbolizer sym)
Called when accept is called on a pointsymbolizer |
void |
visit(PolygonSymbolizer sym)
Called when accept is called on a polygon symbolizer |
void |
visit(RasterSymbolizer sym)
Called when accept is called on a rastersymbolizer |
void |
visit(Stroke stroke)
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 textsymbolizer |
Methods 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, copy, 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 |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Expression scale
protected Unit<Length> defaultUnit
Constructor Detail |
---|
public RescaleStyleVisitor(double scale)
public RescaleStyleVisitor(Expression scale)
public RescaleStyleVisitor(FilterFactory2 filterFactory, double scale)
public RescaleStyleVisitor(FilterFactory2 filterFactory, Expression scale)
Method Detail |
---|
protected Expression rescale(Expression 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.
expr
-
public void visit(Stroke stroke)
Based on feedback we may need to change the dash array as well.
visit
in interface StyleVisitor
visit
in class DuplicatingStyleVisitor
stroke
- the stroke to visitpublic void visit(Graphic gr)
visit
in interface StyleVisitor
visit
in class DuplicatingStyleVisitor
gr
- the graphic to visitprotected Expression rescaleGraphicSize(Graphic gr)
public void visit(TextSymbolizer text)
StyleVisitor
visit
in interface StyleVisitor
visit
in class DuplicatingStyleVisitor
text
- the text symbolizer to visitpublic void visit(Symbolizer sym)
StyleVisitor
visit
in interface StyleVisitor
visit
in class DuplicatingStyleVisitor
sym
- the symbolizer to visitpublic void visit(PointSymbolizer sym)
StyleVisitor
visit
in interface StyleVisitor
visit
in class DuplicatingStyleVisitor
sym
- the point symbolizer to visitpublic void visit(LineSymbolizer sym)
StyleVisitor
visit
in interface StyleVisitor
visit
in class DuplicatingStyleVisitor
sym
- the line symbolizer to visitpublic void visit(PolygonSymbolizer sym)
StyleVisitor
visit
in interface StyleVisitor
visit
in class DuplicatingStyleVisitor
sym
- the polygon symbolizer to visitpublic void visit(RasterSymbolizer sym)
StyleVisitor
visit
in interface StyleVisitor
visit
in class DuplicatingStyleVisitor
sym
- the raster symbolizer to visitprotected void rescaleOption(Map<String,String> options, String key, double defaultValue)
options
- key
- defaultAutoWrap
- value
- protected void rescaleOption(Map<String,String> options, String key, int defaultValue)
options
- key
- defaultAutoWrap
- value
- protected void rescaleArrayOption(Map<String,String> options, String key, int defaultValue)
options
- key
- defaultAutoWrap
- value
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |