Class StyleWrapper
- java.lang.Object
-
- org.hortonmachine.gears.utils.style.StyleWrapper
-
public class StyleWrapper extends Object
A wrapper for theStyleobject to ease gui use.- Author:
- Andrea Antonello (www.hydrologis.com)
-
-
Constructor Summary
Constructors Constructor Description StyleWrapper(org.geotools.styling.Style style)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFeatureTypeStyle(FeatureTypeStyleWrapper ftsW)voidclear()Clear all theFeatureTypeStyles andFeatureTypeStyleWrappers.List<FeatureTypeStyleWrapper>getFeatureTypeStylesWrapperList()Getter for the list ofFeatureTypeStyleWrappers.RuleWrappergetFirstRule()Facility to get the first rule, if available.TextSymbolizerWrappergetFirstTextSymbolizer()Facility to get the firstTextSymbolizer, if available.StringgetName()org.geotools.styling.StylegetStyle()voidremoveFeatureTypeStyle(FeatureTypeStyleWrapper ftsW)Remove aFeatureTypeStyleWrapperfrom the list.voidsetName(String name)voidswap(int src, int dest)Swap two elements of the list.StringtoString()StringtoXml()Converts a style to its string representation to be written to file.
-
-
-
Method Detail
-
getName
public String getName()
-
setName
public void setName(String name)
-
getFeatureTypeStylesWrapperList
public List<FeatureTypeStyleWrapper> getFeatureTypeStylesWrapperList()
Getter for the list ofFeatureTypeStyleWrappers.- Returns:
- an unmodifiable list of
FeatureTypeStyleWrapper. To add or remove items use#addFeatureTypeStyle(FeatureTypeStyle)andremoveFeatureTypeStyle(FeatureTypeStyleWrapper).
-
getFirstRule
public RuleWrapper getFirstRule()
Facility to get the first rule, if available.- Returns:
- the first rule or
null.
-
getFirstTextSymbolizer
public TextSymbolizerWrapper getFirstTextSymbolizer()
Facility to get the firstTextSymbolizer, if available.- Returns:
- the first textsymbolizer or
null.
-
removeFeatureTypeStyle
public void removeFeatureTypeStyle(FeatureTypeStyleWrapper ftsW)
Remove aFeatureTypeStyleWrapperfrom the list.- Parameters:
ftsW- theFeatureTypeStyleto remove.
-
addFeatureTypeStyle
public void addFeatureTypeStyle(FeatureTypeStyleWrapper ftsW)
-
clear
public void clear()
Clear all theFeatureTypeStyles andFeatureTypeStyleWrappers.
-
toXml
public String toXml() throws Exception
Converts a style to its string representation to be written to file.- Parameters:
style- the style to convert.- Returns:
- the style string.
- Throws:
Exception
-
getStyle
public org.geotools.styling.Style getStyle()
-
swap
public void swap(int src, int dest)Swap two elements of the list.- Parameters:
src- the position first element.dest- the position second element.
-
-