public class BasicUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.text.DecimalFormat |
df |
Constructor and Description |
---|
BasicUtils() |
Modifier and Type | Method and Description |
---|---|
static ISymbol |
combineSymbols(java.util.List<ISymbol> gsyms,
int geotype) |
static DataTypesManager |
datMan() |
static java.lang.Integer |
getAlphaValue(SLDParameterValue valu)
Returns null if no data found
|
static java.awt.Color |
getColor(SLDExpression valu) |
static java.awt.Color |
getColor(SLDParameterValue valu)
Returns null if no data found
|
static java.util.List<SLDLiteral> |
getComparisonLiterals(java.util.List<SLDRule> rules) |
static java.lang.Double |
getDouble(SLDParameterValue valu)
Returns null if no data found
|
static ISymbol |
getElseSymbol(java.util.List<SLDRule> rules) |
static java.lang.String |
getFirstPropertyName(java.util.List<SLDRule> rules) |
static SLDUserStyle |
getFirstUserStyle(SLDLayer layer) |
static java.lang.String |
getFormat(java.net.URL u) |
static int |
getGeometryTypeForSymbols(java.util.List<SLDSymbol> list)
Geometry.TYPES.POINT
Geometry.TYPES.CURVE
Geometry.TYPES.SURFACE
or
Geometry.TYPES.NULL if there is not consistency in the list
|
static SLDLiteral |
getLiteral(java.util.List<SLDExpression> exps) |
static java.lang.Object |
getValue(SLDLiteral lit,
DataType dt)
Coerces literal value using the dataType
Returns null if coercion was not possible
|
static java.util.Map<java.lang.Object,ISymbol> |
getValueToSymbol(java.util.List<SLDRule> rules,
DataType dt,
java.lang.String pname)
Translates rules to a value-symbol correspondence.
|
static DataType |
guessDataType(java.util.List<SLDLiteral> lits)
Gets data type from literals.
|
static boolean |
isElse(SLDRule rule) |
static boolean |
isNumeric(SLDLiteral lit) |
static MapContextManager |
mapMan() |
static java.awt.Color |
parseColor(java.lang.String colorStr)
Input must be like "#fa5e02", "0x000", etc
|
static SLDConverterManager |
sldMan() |
static SLDSupportManager |
supMan() |
static SymbolManager |
syMan() |
static SymbologyManager |
symMan() |
static java.awt.Color |
toColor(SLDExpression color) |
static java.lang.Double |
toDouble(SLDExpression width) |
static java.lang.String |
toHexadecimal(java.awt.Color co,
int length,
java.lang.String prefix)
Examples:
#ff0000
0x000000cd9983
Returns null is color is null
|
static java.lang.String |
valueToString(java.lang.Object val) |
public static SLDConverterManager sldMan()
public static SLDSupportManager supMan()
public static SymbologyManager symMan()
public static SymbolManager syMan()
public static MapContextManager mapMan()
public static DataTypesManager datMan()
public static java.lang.String getFirstPropertyName(java.util.List<SLDRule> rules)
public static DataType guessDataType(java.util.List<SLDLiteral> lits)
lits
- public static java.lang.Object getValue(SLDLiteral lit, DataType dt)
lit
- dt
- public static java.util.List<SLDLiteral> getComparisonLiterals(java.util.List<SLDRule> rules)
public static boolean isElse(SLDRule rule)
public static boolean isNumeric(SLDLiteral lit)
public static SLDUserStyle getFirstUserStyle(SLDLayer layer)
public static int getGeometryTypeForSymbols(java.util.List<SLDSymbol> list)
public static java.lang.Double toDouble(SLDExpression width) throws UnsupportedSLDObjectException
UnsupportedSLDObjectException
public static java.awt.Color parseColor(java.lang.String colorStr)
hex
- public static java.lang.String toHexadecimal(java.awt.Color co, int length, java.lang.String prefix)
co
- length
- prefix
- public static java.awt.Color getColor(SLDParameterValue valu)
valu
- UnsupportedSLDObjectException
public static java.awt.Color getColor(SLDExpression valu)
public static java.lang.Double getDouble(SLDParameterValue valu) throws UnsupportedSLDObjectException
valu
- UnsupportedSLDObjectException
public static java.lang.Integer getAlphaValue(SLDParameterValue valu) throws UnsupportedSLDObjectException
valu
- UnsupportedSLDObjectException
public static java.awt.Color toColor(SLDExpression color) throws UnsupportedSLDObjectException
UnsupportedSLDObjectException
public static java.lang.String getFormat(java.net.URL u)
public static ISymbol getElseSymbol(java.util.List<SLDRule> rules) throws UnsupportedSLDObjectException
UnsupportedSLDObjectException
public static java.util.Map<java.lang.Object,ISymbol> getValueToSymbol(java.util.List<SLDRule> rules, DataType dt, java.lang.String pname) throws UnsupportedSLDObjectException
rules
- dt
- UnsupportedSLDObjectException
CoercionException
public static SLDLiteral getLiteral(java.util.List<SLDExpression> exps)
public static java.lang.String valueToString(java.lang.Object val)