|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectschmitzm.geotools.styling.StylingUtil
public class StylingUtil
Diese Klasse enthaelt Hilfsfunktionen zum GeoTools-Styling
Field Summary | |
---|---|
static SLDTransformer |
SLDTRANSFORMER
Standard-Instanz eines SLDTransformer . |
static StyleBuilder |
STYLE_BUILDER
Standard-Instanz eines StyleBuilder . |
static StyleFactory |
STYLE_FACTORY
Standard-Instanz einer StyleFactory |
static StyleFactory |
styleFactory
Deprecated. wurde ersetzt durch STYLE_FACTORY |
static Color |
TRANSPARENT_COLOR
transparent color |
Constructor Summary | |
---|---|
StylingUtil()
|
Method Summary | |
---|---|
static ColorMap |
addColorMapEntryAndSort(ColorMap colorMap,
ColorMapEntry colorMapEntry)
Unless ColorMap is not sorted automatically, this method calls
sortColorMap(ColorMap) after inserting the color map entry. |
static void |
applyColorMapProperties(ColorMap sourceColorMap,
ColorMap destColormap)
Applies general properties (color map type and extended colors) to a ColorMap . |
static ColorMap |
clearColorMapLabels(ColorMap colorMap)
Removes all label information from the ColorMapEntry s of the
given ColorMap |
static Graphic |
clone(Graphic graphic)
Clons a Graphic element |
static Style |
clone(Style style)
Clones a Style by converting it to XML and reading it back in. |
static Symbolizer |
clone(Symbolizer sym)
Clones a Symbolizer using the DuplicatingStyleVisitor . |
static ColorMap |
cloneColorMap(ColorMap colorMap)
Kopiert eine ColorMap . |
static ColorMapEntry |
cloneColorMapEntry(ColorMapEntry colorMapEntry)
Kopiert einen ColorMapEntry . |
static boolean |
colorMapEntriesEqual(ColorMapEntry cme1,
ColorMapEntry cme2)
Prueft, ob zwei ColorMapEntry -Instanzen gleich sind. |
static ColorMapEntry |
ColorMapEntry(ColorMapEntry colorMapEntry)
Kopiert einen ColorMapEntry . |
static boolean |
colorMapsEqual(ColorMap cm1,
ColorMap cm2)
Prueft, ob zwei ColorMap -Instanzen gleich sind. |
static void |
copyAllValues(TextSymbolizer from,
TextSymbolizer to)
Copies all Values from one TextSymbolizer to another
TextSymbolizer |
static Style |
correctPropertyNames(Style style,
SimpleFeatureType schema)
Since GT2.6, the AttributeNames are case sensitive. |
static FeatureTypeStyle |
createBlinkFeatureTypeStyle(Object geoObject)
|
static BrewerPalette |
createBrewerPalette(String name,
Color[] colors)
Creates a new BrewerPalette with only one scheme (which includes
all colors). |
static ColorMapEntry |
createColorMapEntry(String label,
Double quantity,
Color color,
double opacity)
Erzeugt einen ColorMapEntry . |
static Style |
createDefaultStyle(Object object)
Erstellt einen Default-Style fuer die Klassen/Interfaces: StyledFeaturesInterface, GridCoverage2D, FeatureCollection, FeatureSource und GeometryAttributeType. |
static GridSampleDimension |
createDiscreteGridSampleDimension(String name,
ColorMap colorMap,
double[] noDataValues,
Erzeugt eine GridSampleDimension aus einer ColorMap . |
static Category |
createNoDataCategory(double geoValue)
Erzeugt eine Category fuer die NoData-Werte transparent
dargestellt werden. |
static Category |
createNoDataCategory(int value,
double geoValue)
Erzeugt eine Category fuer die NoData-Werte transparent
dargestellt werden. |
static FeatureTypeStyle |
createSelectionStyle(Object geoObject)
|
static Style |
createStyleFromColorMap(ColorMap colorMap,
String name)
Creates a Style for a Grid layer from a ColorMap
Title will be set to GridUtil.UNTITLED_RASTER_STYLE_TITLE |
static Style |
createStyleFromColorMap(ColorMap colorMap,
String name,
String title)
Creates a Style for a Grid layer from a ColorMap |
static Style |
createStyleFromSLD(Element element)
Erzeugt einen Style aus einem JDOM-Element,
des eine SLD-Definition enthaelt |
static Style |
createStyleSimple(Object geoObject,
Color color,
Color color2)
|
static MemoryFeatureCollection |
filterSLDVisibleOnly(
SLD Rules können die Paramter MinScaleDenominator und MaxScaleDenominator enthalten. |
static |
filterSLDVisibleOnly(
SLD Rules können die Paramter MinScaleDenominator und MaxScaleDenominator enthalten. |
static ColorMapEntry |
findColorMapEntry(ColorMap colorMap,
double value)
Ermittelt fuer einen Wert den ColorMapEntry aus einer
ColorMap . |
static Color |
getColorFromColorMapEntry(ColorMapEntry entry)
Liefert die Farbe eines Farbpaletten-Eintrag. |
static Color |
getColorFromExpression(Expression expression)
Liefert die Farbe eines Farbpaletten-Eintrag. |
static ColorMap |
getColorMapFromStyle(Style style)
Liefert die Farbpalette zu einem Style, wenn der Style aus einem RasterSymbolizer erzeugt wurde. |
static List<ColorMap> |
getColorMapsFromStyle(Style style)
Liefert alle Farbpaletten aus einem Style, wenn irgendo RasterSymbolizer enthalten sind. |
static int |
getColorMapType(String typeStr)
Returns the color map type specified by a given string. |
static Color |
getFillColor(Fill fill)
|
static PropertyName |
getFirstPropertyName(SimpleFeatureType ft,
TextSymbolizer textSymbolizer)
Geopublisher allows to use one or two attributes for labelling, like
Returns the first attribute found in the label expression of the given
TextSymbolizer . |
static Color |
getGraphicColor(Graphic graphic)
|
static Color |
getLineSymbolizerColor(LineSymbolizer ps)
|
static double |
getMaxScaleDenominator(Double avgNn)
Super smart metod ;-) Needs to be extended to look at the graphic width and Geometry type. |
static double |
getMaxScaleDenominator(Double avgNn,
FeatureUtil.GeometryForm form)
Super smart metod ;-) Needs to be extended to look at the graphic width and Geometry type. |
static Double |
getOpacityFromColorMapEntry(ColorMapEntry entry)
Liefert die Transparenz eines Farbpaletten-Eintrag. |
static Double |
getOpacityFromExpression(Expression expression)
Liefert die Transparenz eines Farbpaletten-Eintrag. |
static Color |
getPointSymbolizerColor(PointSymbolizer ps)
|
static Color |
getPolygonSymbolizerColor(PolygonSymbolizer ps)
|
static Double |
getQuantityFromColorMapEntry(ColorMapEntry entry)
Liefert den Wert eines Farbpaletten-Eintrag. |
static Double |
getQuantityFromExpression(Expression expression)
Liefert den Wert eines Farbpaletten-Eintrag. |
static List<RasterSymbolizer> |
getRasterSymbolizers(Style style)
Returns all RasterSymbolizer that are contained in a
Style . |
static PropertyName |
getSecondPropertyName(SimpleFeatureType ft,
TextSymbolizer textSymbolizer)
Geopublisher allows to use one or two attributes for labelling, like
Returns the second attribute found in the label expression of the given
TextSymbolizer or null . |
static FeatureTypeStyle |
getSelectionFeatureTypeStyle(Style style)
Returns null or any FeatureTypeStyle that is
SELECTION related. |
static Color |
getStrokeColor(Stroke stroke)
|
static Color |
getSymbolizerColor(Symbolizer symb)
|
static TextSymbolizer |
getTextSymbolizer(Style style,
SimpleFeature f)
|
static List<TextSymbolizer> |
getTextSymbolizers(Style style)
|
static List<TextSymbolizer> |
getTextSymbolizers(Symbolizer[] symbolizers)
|
static List<TextSymbolizer> |
getVisibleTextSymbolizers(Style style)
|
static boolean |
isStyleDifferent(Style style1,
File style2file)
Compares a given Style and a File containg a Style . |
static boolean |
isStyleDifferent(Style style1,
Style style2)
Compares a given Style and a File containg a Style . |
static Style[] |
loadSLD(File sldFile)
Loads Style s from a SLD File |
static Style[] |
loadSLD(InputStream inputStream)
Loads Style s from a SLD InputStream |
static Style[] |
loadSLD(URL url)
Loads Style s from a SLD InputStream |
static ColorMap |
removeColorMapEntry(ColorMap colorMap,
ColorMapEntry colorMapEntry)
Unless ColorMap has no methods to remove an entry this method
creates a new ColorMap with the identical entries except the one
to remove. |
static ColorMap |
removeColorMapEntry(ColorMap colorMap,
int idx)
Unless ColorMap has no methods to remove an entry this method
creates a new ColorMap with the identical entries except the one
to remove. |
static Style |
removeSelectionFeatureTypeStyle(Style style)
Creates a copy of the given Style , removing any
FeatureTypeStyle s that are only SELECTION related. |
static void |
replaceFillColor(Fill fill,
Color oldColor,
Color newColor)
Replaces the "main" color in a given Fill element |
static void |
replaceGraphicColor(Graphic graphic,
Color oldColor,
Color newColor)
Replaces the "main" color in a given Graphic element |
static void |
replaceLineSymbolizerColor(LineSymbolizer ps,
Color oldColor,
Color newColor)
Replaces the "main" color in a given LineSymbolizer element |
static void |
replacePointSymbolizerColor(PointSymbolizer ps,
Color oldColor,
Color newColor)
Replaces the "main" color in a given PointSymbolizer element |
static void |
replacePolygonSymbolizerColor(PolygonSymbolizer ps,
Color oldColor,
Color newColor)
Replaces the "main" color in a given PolygonSymbolizer element |
static void |
replaceStrokeColor(Stroke stroke,
Color oldColor,
Color newColor)
Replaces the "main" color in a given Stroke element |
static void |
replaceSymbolizerColor(Symbolizer symb,
Color oldColor,
Color newColor)
Replaces the "main" color in a given Symbolizer element |
static boolean |
saveStyleToSLD(Style style,
File exportFile)
Saves the Style to OGC SLD using UTF-8 as charset. |
static boolean |
saveStyleToSLD(Style origStyle,
File exportFile,
Charset charset)
Saves the Style to OGC SLD. |
static void |
setColorForColorMapEntry(ColorMapEntry entry,
Color color)
Setzt die Farbe eines Farbpaletten-Eintrag. |
static void |
setDoublePropertyName(TextSymbolizer symbolizer,
PropertyName literalLabelField1,
PropertyName literalLabelField2)
AtlasStyler has a fixed system that allows to use one or two label attributes. |
static void |
setOpacityForColorMapEntry(ColorMapEntry entry,
double opacity)
Setzt die Transparenz eines Farbpaletten-Eintrag. |
static void |
setQuantityForColorMapEntry(ColorMapEntry entry,
double quantity)
Setzt den Wert eines Farbpaletten-Eintrag. |
static ColorMap |
sortColorMap(ColorMap colorMap)
Sorts a ColorMap according to the value of its entries. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Color TRANSPARENT_COLOR
public static final StyleBuilder STYLE_BUILDER
StyleBuilder
.
public static final SLDTransformer SLDTRANSFORMER
SLDTransformer
.
public static final StyleFactory STYLE_FACTORY
StyleFactory
public static final StyleFactory styleFactory
STYLE_FACTORY
StyleFactory
Constructor Detail |
---|
public StylingUtil()
Method Detail |
---|
public static Style createDefaultStyle(Object object)
object
- GridCoverage2D
,
org.geotools.coverage.grid.io.AbstractGridCoverage2DReader
oder FeatureCollection
null
falls kein Style generiert werden kannpublic static Category createNoDataCategory(double geoValue)
Category
fuer die NoData-Werte transparent
dargestellt werden.
geoValue
- Geo-Wert, der NoData repraesentiertpublic static Category createNoDataCategory(int value, double geoValue)
Category
fuer die NoData-Werte transparent
dargestellt werden.
value
- Sample-Wert der CategorygeoValue
- Geo-Wert, der NoData repraesentiertpublic static GridSampleDimension createDiscreteGridSampleDimension(String name, ColorMap colorMap, double[] noDataValues,unit)
GridSampleDimension
aus einer ColorMap
.
name
- Name fuer die GridSampleDimension
colorMap
- fuer jeden Eintrag der ColorMap
wird eine
Category
erzeugtnoDataValues
- Werte fuer die zusaetzliche Categorys
erstellt werden, welche die transparent dargestellt werden
(wenn null
wird keine zusaetzliche Category
erstellt)unit
- Einheit der Werte in der GridSampleDimension
(kann
null
sein)public static ColorMap getColorMapFromStyle(Style style)
RasterSymbolizer
erzeugt wurde.
style
- Style Wenn null
, dann wird style auf
GridUtil
.createDefaultStyle() gesetzt
null
wenn der Style nicht auf einem
RasterSymbolizer
basiert.public static List<ColorMap> getColorMapsFromStyle(Style style)
RasterSymbolizer
enthalten sind.
style
- Style Wenn null
, dann wird style auf
GridUtil
.createDefaultStyle() gesetzt
public static ColorMapEntry findColorMapEntry(ColorMap colorMap, double value)
ColorMapEntry
aus einer
ColorMap
.
value
- Wert
null
, wenn in der ColorMap
kein expliziter
Eintrag fuer den Wert hinterlegt istpublic static void applyColorMapProperties(ColorMap sourceColorMap, ColorMap destColormap)
ColorMap
.
sourceColorMap
- color map the properties are taken fromdestColormap
- color map the properties are setpublic static ColorMap removeColorMapEntry(ColorMap colorMap, int idx)
ColorMap
has no methods to remove an entry this method
creates a new ColorMap
with the identical entries except the one
to remove.
colorMap
- the color map to remove entries fromidx
- the entry index to removepublic static ColorMap removeColorMapEntry(ColorMap colorMap, ColorMapEntry colorMapEntry)
ColorMap
has no methods to remove an entry this method
creates a new ColorMap
with the identical entries except the one
to remove.
colorMap
- the color map to remove entries fromcolorMapEntry
- the entry to removepublic static ColorMap addColorMapEntryAndSort(ColorMap colorMap, ColorMapEntry colorMapEntry)
ColorMap
is not sorted automatically, this method calls
sortColorMap(ColorMap)
after inserting the color map entry.
colorMap
- the color map to extendcolorMapEntry
- the new entrypublic static ColorMap sortColorMap(ColorMap colorMap)
ColorMap
according to the value of its entries.
colorMap
- the color map to sortpublic static int getColorMapType(String typeStr)
typeStr
- a stringColorMap#getType()
public static ColorMap cloneColorMap(ColorMap colorMap)
ColorMap
.
null
wenn die uebergebene ColorMap null
istpublic static ColorMapEntry cloneColorMapEntry(ColorMapEntry colorMapEntry)
ColorMapEntry
.
null
wenn der uebergebene ColorMapEntry
null
istpublic static boolean colorMapsEqual(ColorMap cm1, ColorMap cm2)
ColorMap
-Instanzen gleich sind.
cm1
- eine Farbpalettecm2
- eine andere Farbpalettepublic static boolean colorMapEntriesEqual(ColorMapEntry cme1, ColorMapEntry cme2)
ColorMapEntry
-Instanzen gleich sind. Dies ist der
Fall, wenn ihnen der gleiche Wert, die gleiche Farbe, die gleiche
Transparenz und das gleiche Label zugeordnet ist.
cme1
- ein Farbpaletten-Eintragcme2
- ein anderer Farbpaletten-Eintragpublic static ColorMapEntry createColorMapEntry(String label, Double quantity, Color color, double opacity)
ColorMapEntry
.
label
- Label fuer den Farbpaletten-Eintragquantity
- Wert fuer den Farbpaletten-Eintragcolor
- Farbe fuer den Farbpaletten-Eintragopacity
- Transparenz fuer die Farbe des Farbpaletten-Eintragpublic static ColorMapEntry ColorMapEntry(ColorMapEntry colorMapEntry)
ColorMapEntry
.
null
wenn der uebergebene ColorMapEntry
null
istpublic static Double getQuantityFromExpression(Expression expression)
expression
- Expression, die einen String oder einen Double liefert
null
, wenn null
uebergeben wirdpublic static Double getQuantityFromColorMapEntry(ColorMapEntry entry)
entry
- Farbpaletten-Eintrag
null
, wenn null
uebergeben wirdpublic static void setQuantityForColorMapEntry(ColorMapEntry entry, double quantity)
entry
- Farbpaletten-Eintragquantity
- neuer Wertpublic static Double getOpacityFromExpression(Expression expression)
expression
- Expression, die einen String oder einen Double liefert
null
uebergeben wirdpublic static Double getOpacityFromColorMapEntry(ColorMapEntry entry)
entry
- Farbpaletten-Eintrag
null
uebergeben wirdpublic static void setOpacityForColorMapEntry(ColorMapEntry entry, double opacity)
entry
- Farbpaletten-Eintragopacity
- Transparenzwertpublic static Color getColorFromExpression(Expression expression)
expression
- Expression, die einen String liefertpublic static Color getColorFromColorMapEntry(ColorMapEntry entry)
entry
- Farbpaletten-Eintragpublic static void setColorForColorMapEntry(ColorMapEntry entry, Color color)
entry
- Farbpaletten-Eintragcolor
- eine Farbepublic static Style createStyleFromSLD(Element element)
Style
aus einem JDOM-Element,
des eine SLD-Definition enthaelt
element
- Element mit SLD-Definitionpublic static Style createStyleFromColorMap(ColorMap colorMap, String name, String title)
Style
for a Grid
layer from a ColorMap
colorMap
- If null, then defaultStyle for Grid will be usedname
- The name to give to the Style. null will result in name=
GridUtil.UNNAMED_RASTER_STYLE_NAME
or
GridUtil#DEFAULT_RASTER_STYLE_NAME} (if no colorMap is given).title
- The Title to give to the Style. null will result in title=
GridUtil.UNTITLED_RASTER_STYLE_TITLE
or
GridUtil.DEFAULT_RASTER_STYLE_TITLE
(if no colorMap is
given)
Style
that you can be applyed to a
GridCoverage
.public static ColorMap clearColorMapLabels(ColorMap colorMap)
ColorMapEntry
s of the
given ColorMap
public static Style createStyleFromColorMap(ColorMap colorMap, String name)
Style
for a Grid
layer from a ColorMap
Title will be set to GridUtil.UNTITLED_RASTER_STYLE_TITLE
colorMap
- If null, then defaultStyle for Grid will be usedname
- The name to give to the Style. null will result in name
GridUtil.UNTITLED_RASTER_STYLE_TITLE
GridCoverage
.
Style has name GridUtil.DEFAULT_RASTER_STYLE_NAME
if no
colormap was provided.public static Style[] loadSLD(URL url)
Style
s from a SLD InputStream
url
- URL
to read the SLD from
Array
of Style
s, can be length==0 if no
UserStyles in SLD file. null if file not existspublic static Style[] loadSLD(InputStream inputStream)
Style
s from a SLD InputStream
inputStream
- InputStream
to read the SLD from
Array
of Style
s, can be length==0. null if
file not existspublic static Style[] loadSLD(File sldFile) throws FileNotFoundException
Style
s from a SLD File
sldFile
- File
to read the SLD from
Array
of Style
s, can be length==0
FileNotFoundException
public static final boolean saveStyleToSLD(Style origStyle, File exportFile, Charset charset) throws TransformerException, IOException
Style
to OGC SLD. Overwrites any existing file. If a
FeatureTypeStyle for selection is used, it is automatically removed. This
method also checks, whether the style is actually differing from any
existing style in the File.
origStyle
- Style
to save. Any selectino related FeatureTypeStyle
will be removed.charset
- The charset to use for the XML, e.g. . If null
, non is set and the
system default is used.
TransformerException
IOException
public static Style removeSelectionFeatureTypeStyle(Style style)
Style
, removing any
FeatureTypeStyle
s that are only SELECTION related.
FeatureMapLayerSelectionSynchronizer#SELECTION_STYLING_FTS_NAME}
public static FeatureTypeStyle getSelectionFeatureTypeStyle(Style style)
null
or any FeatureTypeStyle
that is
SELECTION related.
FeatureMapLayerSelectionSynchronizer#SELECTION_STYLING_FTS_NAME}
public static boolean isStyleDifferent(Style style1, File style2file)
File
containg a Style
.
style1
- The first Style
style2file
- A File
pointing to the second Style
true
is they are different, ignoring any XML
fomatting.public static boolean isStyleDifferent(Style style1, Style style2)
File
containg a Style
.
style1
- The first Style
style2
- The second Style
to compare to
true
is they are different, ignoring any XML
fomatting.public static final boolean saveStyleToSLD(Style style, File exportFile) throws TransformerException, IOException
Style
to OGC SLD using UTF-8 as charset. Overwrites any
existing file.
style
- Style
to save
TransformerException
IOException
public static MemoryFeatureCollection filterSLDVisibleOnly(fc, Style style, Double scaleDenominator)
PolygonSymbolizer
zählt nicht der Rand,
sondern nur ob eine Füllung vorhanden ist! Man kann dann zwar leider
nicht auf ein Rand eines Polygons ohne Fill klicken, aber dafür kann man
durch die ungefüllte Fläche klicken.
fc
- Die zu filternde FeatureCollection. Diese wird nicht
verändert.style
- Der Style, mit dem die Features gerendert werden (z.b.
layer.getStyle() )scaleDenominator
- Der aktuelle ScaleDenomitor für den die Sichtbarkeit ermittelt
wird.
RendererUtilities.calculateOGCScale
public static TextSymbolizer getTextSymbolizer(Style style, SimpleFeature f)
style
- A Style
to search for the first TextSymbolizer
that will be used for the given SimpleFeature
.
null
or the first TextSymbolizer
found in
the style that applies to the SimpleFeature
.public static List<TextSymbolizer> getVisibleTextSymbolizers(Style style)
style
- A Style
to search for all TextSymbolizer
s . No
guarantee, that any one of them will ever be used for any
feature (think about filters).
List
or all TextSymbolizer
s found in the
Style
.public static List<TextSymbolizer> getTextSymbolizers(Style style)
style
- A Style
to search for all TextSymbolizer
s . No
guarantee, that any one of them will ever be used for any
feature (think about filters).
List
or all TextSymbolizer
s found in the
Style
.public static List<TextSymbolizer> getTextSymbolizers(Symbolizer[] symbolizers)
symbolizers
- List of Symbolizers to search for all TextSymbolizer
s
. No guarantee, that any one of them will ever be used for any
feature (think about filters).
List
or all TextSymbolizer
s found in the given
symbolizers.public static Style clone(Style style)
style
- the Style
to be copied.public static Symbolizer clone(Symbolizer sym)
Symbolizer
using the DuplicatingStyleVisitor
.
public static Graphic clone(Graphic graphic)
Graphic
element
graphicFill
-
public static BrewerPalette createBrewerPalette(String name, Color[] colors)
BrewerPalette
with only one scheme (which includes
all colors). The suitablity of the palette is set to "unknown" for all
viewer types.
name
- name for the palette (also the description is set to this
value)colors
- colors for the palettepublic static FeatureTypeStyle createSelectionStyle(Object geoObject)
geoObject
- GridCoverage2D
, AbstractGridCoverage2DReader
,
FeatureCollection
, GeometryAttributeType
or
FeatureSource
Style
that is suitable to identify features of the
given type as selected items.public static Style createStyleSimple(Object geoObject, Color color, Color color2)
public static void replaceSymbolizerColor(Symbolizer symb, Color oldColor, Color newColor)
Symbolizer
element
public static void replaceLineSymbolizerColor(LineSymbolizer ps, Color oldColor, Color newColor)
LineSymbolizer
element
public static void replacePointSymbolizerColor(PointSymbolizer ps, Color oldColor, Color newColor)
PointSymbolizer
element
public static void replacePolygonSymbolizerColor(PolygonSymbolizer ps, Color oldColor, Color newColor)
PolygonSymbolizer
element
oldColor
- newColor
- ps
- public static void replaceStrokeColor(Stroke stroke, Color oldColor, Color newColor)
Stroke
element
stroke
- oldColor
- newColor
- public static void replaceFillColor(Fill fill, Color oldColor, Color newColor)
Fill
element
fill
- oldColor
- newColor
- public static void replaceGraphicColor(Graphic graphic, Color oldColor, Color newColor)
Graphic
element
public static Color getGraphicColor(Graphic graphic)
graphic
- If null
returns null
Color
used in the Graphic
or null, if an
ExternalGraphic
is used.public static Color getStrokeColor(Stroke stroke)
Color
used in a Stroke
.public static Color getFillColor(Fill fill)
Color
used in a Fill
.public static Color getSymbolizerColor(Symbolizer symb)
Color
used in a Symbolizer
.public static Color getLineSymbolizerColor(LineSymbolizer ps)
Color
used in a LineSymbolizer
.public static Color getPolygonSymbolizerColor(PolygonSymbolizer ps)
Color
used in a PolygonSymbolizer
.public static Color getPointSymbolizerColor(PointSymbolizer ps)
Color
used in a PointSymbolizer
.public static void copyAllValues(TextSymbolizer from, TextSymbolizer to)
TextSymbolizer
to another
TextSymbolizer
from
- TextSymbolizer
sourceto
- TextSymbolizer
target. May not be null
.public static List<RasterSymbolizer> getRasterSymbolizers(Style style)
RasterSymbolizer
that are contained in a
Style
. RasterSymbolizer
from FeatureTypeStyle
s
that are selection related are ignored.
public static double getMaxScaleDenominator(Double avgNn)
geometryDescriptor
- avgNn
- public static double getMaxScaleDenominator(Double avgNn, FeatureUtil.GeometryForm form)
geometryDescriptor
- avgNn
- public staticfilterSLDVisibleOnly( fc, Style style, XMapPane xMapPane)
fc
- Die zu filternde FeatureCollection. Diese wird nicht
verändert.style
- Der Style, mit dem die Features gerendert werden (z.b.
layer.getStyle() )
public static Style correctPropertyNames(Style style, SimpleFeatureType schema)
public static PropertyName getSecondPropertyName(SimpleFeatureType ft, TextSymbolizer textSymbolizer)
ORTSRATSBE : ORB_SCHLUE
Returns the second attribute found in the label expression of the given
TextSymbolizer
or null
.
public static PropertyName getFirstPropertyName(SimpleFeatureType ft, TextSymbolizer textSymbolizer)
ORTSRATSBE : ORB_SCHLUE
Returns the first attribute found in the label expression of the given
TextSymbolizer
. If non is found for some reason, the method tries
to return the first attribute from the schema. We expect the layer to
have some attributes, because otherwise AS shouldn't even create the
LabellingTab.
public static void setDoublePropertyName(TextSymbolizer symbolizer, PropertyName literalLabelField1, PropertyName literalLabelField2)
symbolizer
- the TextSymbolizer
to call setLabel(Expression) on.literalLabelField1
- may not be null!literalLabelField2
- may be null
public static FeatureTypeStyle createBlinkFeatureTypeStyle(Object geoObject)
FeatureTypeStyle
that can be used style the given
geoObject during a blink or highlight process.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |