|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.refractions.udig.style.sld.SLDContentManager
public class SLDContentManager
A helpful class for sifting through an SLD Style object while implementing an editor. Consider it a wrapper that allows you to easily edit (it will completely write any and all changes directly to the wrapped style).
Used by a StyleConfigurator or IStyledEditorPage working with SLD style content on the blackboard.
A Style object can contain any number of FeatureTypeStyle objects, which can in turn contain any number of Rule objects, which can in turn contain any number of Symbolizer objects.
The SLDContentManager provides support for the following concepts:
To help keep everything straight here are a couple of naming conventions:
This class also provides the ability to look up symbolizers by class against the "default" rule (ie the rule with the name "default"). This allows an SLDConfigurator interested in a particular symbolizer to 'track' the instance of it as the default rule is changed.
| Constructor Summary | |
|---|---|
SLDContentManager()
Creates an empty SLDContentManager that is set up around a default style. |
|
SLDContentManager(StyleBuilder styleBuilder)
Creates an empty SLDContentManager that is setup around a default style |
|
SLDContentManager(StyleBuilder styleBuilder,
Style style)
Creates the SLD content manager. |
|
| Method Summary | ||
|---|---|---|
void |
addSymbolizer(Rule rule,
Symbolizer symbolizer)
Adds a symbolizer to a rule. |
|
void |
addSymbolizer(Symbolizer symbolizer)
Adds a symbolizer to the default rule. |
|
java.awt.Color |
color(LineSymbolizer line)
|
|
FeatureTypeStyle |
createFeatureTypeStyle(java.lang.String name)
Creates a new feature type style for the object, and adds it to the style. |
|
Rule |
createRule()
Creates an empty rule. |
|
Rule |
createRule(FeatureTypeStyle ftStyle)
Creates a new rule for a specific feature type style. |
|
FeatureTypeStyle |
featureTypeStyle(java.lang.String name)
|
|
FeatureTypeStyle |
getDefaultFeatureTypeStyle()
Returns the the first feature type style for the SLD style. |
|
Rule |
getDefaultRule()
|
|
FeatureTypeStyle |
getFeatureTypeStyle(java.lang.String name)
Returns a feature type style with specific name, or null if no such feature type style exists. |
|
Style |
getStyle()
|
|
StyleBuilder |
getStyleBuilder()
|
|
StyleFactory |
getStyleFactory()
|
|
|
getSymbolizer(java.lang.Class<T> theClass)
Returns the first symbolizer of a particular class from the default rule or none if no such symbolizer exists. |
|
|
getSymbolizer(Rule rule,
java.lang.Class<T> theClass)
Returns the first symbolizer of a particular class for a rule or none if no such symbolizer exists. |
|
void |
init(Style style)
|
|
void |
init(StyleBuilder styleBuilder,
Style style)
Initializes the content manager with a new style. |
|
double |
opacity(LineSymbolizer line)
|
|
void |
removeSymbolizer(Symbolizer symbolizer)
|
|
double |
width(LineSymbolizer line)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SLDContentManager()
public SLDContentManager(StyleBuilder styleBuilder)
styleBuilder - StyleBuilder used to create the default style
public SLDContentManager(StyleBuilder styleBuilder,
Style style)
styleBuilder - The builder object used to create style content.style - The SLD style itself.| Method Detail |
|---|
public void init(Style style)
public void init(StyleBuilder styleBuilder,
Style style)
styleBuilder - The builder object used to create style content.style - The SLD style itself.public Style getStyle()
public StyleBuilder getStyleBuilder()
public StyleFactory getStyleFactory()
public FeatureTypeStyle getDefaultFeatureTypeStyle()
Please note a feature type style is created if it does not exist.
public FeatureTypeStyle getFeatureTypeStyle(java.lang.String name)
name - The name of the feature type style.
public FeatureTypeStyle featureTypeStyle(java.lang.String name)
public Rule getDefaultRule()
public FeatureTypeStyle createFeatureTypeStyle(java.lang.String name)
name - The name of feature type style.
public Rule createRule()
public Rule createRule(FeatureTypeStyle ftStyle)
ftStyle - The feature type style for the rule.
public <T> T getSymbolizer(Rule rule,
java.lang.Class<T> theClass)
rule - The rule containing the symbolizer to be returned.theClass - The typed class of the symbolizer.
public <T extends Symbolizer> T getSymbolizer(java.lang.Class<T> theClass)
theClass - The typed class of the symbolizer.
public void addSymbolizer(Symbolizer symbolizer)
symbolizer - The symbolizer to add.
public void addSymbolizer(Rule rule,
Symbolizer symbolizer)
rule - The rule.symbolizer - The symbolizerpublic void removeSymbolizer(Symbolizer symbolizer)
public java.awt.Color color(LineSymbolizer line)
public double width(LineSymbolizer line)
public double opacity(LineSymbolizer line)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||