|
||||||||||
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.
modules/library/main (gt-main.jar)
Field Summary |
---|
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 |
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(Stroke stroke)
Increase stroke width. |
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, visit, visit, visit, visit, visit |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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 visitpublic void visit(TextSymbolizer text)
StyleVisitor
visit
in interface StyleVisitor
visit
in class DuplicatingStyleVisitor
text
- the text 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
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |