|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.brewer.color.StyleGenerator
Generates a style/featureTypeStyle using ColorBrewer.
WARNING: this is unstable and subject to change.
Field Summary | |
static int |
ELSEMODE_IGNORE
|
static int |
ELSEMODE_INCLUDEASMAX
|
static int |
ELSEMODE_INCLUDEASMIN
|
Constructor Summary | |
StyleGenerator(java.awt.Color[] colors,
ClassificationFunction function,
java.lang.String typeId)
Creates an instance of the StyleGenerator with the components it needs. |
Method Summary | |
FeatureTypeStyle |
createFeatureTypeStyle()
|
ClassificationFunction |
getClassifier()
|
FeatureCollection |
getCollection()
|
java.awt.Color[] |
getColors()
|
Stroke |
getDefaultStroke()
|
Expression |
getExpression()
|
int |
getNumClasses()
|
double |
getOpacity()
|
static boolean |
isRanged(java.lang.String styleExpression)
Determines if a string is an instance of a ranged expression or unique values. |
static void |
modifyFTS(FeatureTypeStyle fts,
int ruleIndex,
java.lang.String styleExpression)
|
void |
setClassifier(ClassificationFunction function)
|
void |
setCollection(FeatureCollection collection)
|
void |
setColors(java.awt.Color[] colors)
|
void |
setDefaultStroke(Stroke defaultStroke)
|
void |
setElseMode(int elseMode)
|
void |
setExpression(Expression expression)
|
void |
setNumClasses(int numClasses)
|
void |
setOpacity(double opacity)
|
void |
setTitleSpacer(java.lang.String titleSpacer)
Sets the text displayed between ranged values (by default " to "). |
void |
setTypeId(java.lang.String typeId)
Sets the semantic type identifier, which will be prefixed with "colorbrewer:" |
static Filter |
toExplicitFilter(java.lang.String styleExpression,
Expression attribExpr)
Creates a filter with each value explicitly defined. |
static Filter |
toExplicitFilter(java.lang.String styleExpression,
FeatureType featureType,
java.lang.String attributeTypeName)
Creates a filter with each value explicitly defined. |
static Filter[] |
toFilter(java.lang.String[] styleExpression,
FeatureType[] featureType,
java.lang.String[] attributeTypeName)
Converts an array of styleExpressions and attributes into Filters styleExpression[0] = "1..5"; styleExpression[1] = "5..10"; styleExpression[2] = "11, -13"; ---> filter[0] = [[1 <= attr] AND [attr < 5]] filter[1] = [[6 <= attr] AND [attr <= 10]] filter[2] = [[attr = 11] OR [attr = -13]]
|
static Filter |
toRangedFilter(java.lang.String styleExpression,
FeatureType featureType,
java.lang.String attributeTypeName,
boolean upperBoundClosed)
Creates a filter for a range of values. |
static java.lang.String |
toStyleExpression(Filter filter)
|
static java.lang.String[] |
toStyleExpression(Filter[] filter)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ELSEMODE_IGNORE
public static final int ELSEMODE_INCLUDEASMIN
public static final int ELSEMODE_INCLUDEASMAX
Constructor Detail |
public StyleGenerator(java.awt.Color[] colors, ClassificationFunction function, java.lang.String typeId)
colors
- function
- classificationFunction containing our desired breakstypeId
- "colorbrewer:"+typeId = SemanticTypeIdentifierMethod Detail |
public FeatureCollection getCollection()
public void setCollection(FeatureCollection collection)
public java.awt.Color[] getColors()
public void setColors(java.awt.Color[] colors)
public Expression getExpression()
public void setExpression(Expression expression)
public int getNumClasses()
public void setNumClasses(int numClasses)
public double getOpacity()
public void setOpacity(double opacity)
public Stroke getDefaultStroke()
public void setDefaultStroke(Stroke defaultStroke)
public ClassificationFunction getClassifier()
public void setClassifier(ClassificationFunction function)
public void setTypeId(java.lang.String typeId)
typeId
- public void setTitleSpacer(java.lang.String titleSpacer)
titleSpacer
- public void setElseMode(int elseMode)
public FeatureTypeStyle createFeatureTypeStyle() throws IllegalFilterException
IllegalFilterException
public static void modifyFTS(FeatureTypeStyle fts, int ruleIndex, java.lang.String styleExpression) throws IllegalFilterException
IllegalFilterException
public static java.lang.String toStyleExpression(Filter filter)
public static java.lang.String[] toStyleExpression(Filter[] filter)
public static Filter[] toFilter(java.lang.String[] styleExpression, FeatureType[] featureType, java.lang.String[] attributeTypeName) throws IllegalFilterException
Converts an array of styleExpressions and attributes into Filters
styleExpression[0] = "1..5";
styleExpression[1] = "5..10";
styleExpression[2] = "11, -13";
--->
filter[0] = [[1 <= attr] AND [attr < 5]]
filter[1] = [[6 <= attr] AND [attr <= 10]]
filter[2] = [[attr = 11] OR [attr = -13]]
styleExpression
- strings of ranged expressions "lowValue..highValue" or
explicit values "value1, value2"
IllegalFilterException
public static Filter toRangedFilter(java.lang.String styleExpression, FeatureType featureType, java.lang.String attributeTypeName, boolean upperBoundClosed) throws IllegalFilterException
Creates a filter for a range of values.
Examples:
"1..5", closed=true --> [[1 <= attr] AND [attr <= 5]]
"1..10", closed=false --> [[1 <= attr] AND [attr < 10]]
styleExpression
- the ranged style expression (minValue..maxValue)upperBoundClosed
- is the upper bound include the max value? (true: <=, false: <)
IllegalFilterException
public static boolean isRanged(java.lang.String styleExpression)
public static Filter toExplicitFilter(java.lang.String styleExpression, FeatureType featureType, java.lang.String attributeTypeName) throws IllegalFilterException
Creates a filter with each value explicitly defined.
Examples:
"LIB" --> [PARTY = LIB]
"LIB, NDP" --> [[PARTY = LIB] OR [PARTY = NDP]]
styleExpression
- the list of attribute values, separated by commas (and
optional spaces)
IllegalFilterException
public static Filter toExplicitFilter(java.lang.String styleExpression, Expression attribExpr) throws IllegalFilterException
Creates a filter with each value explicitly defined.
Examples:
"LIB" --> [PARTY = LIB]
"LIB, NDP" --> [[PARTY = LIB] OR [PARTY = NDP]]
styleExpression
- the list of attribute values, separated by commas (and
optional spaces)attribExpr
- an Expression to compare each value with (simple case = attributeExpression)
IllegalFilterException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |