|
|||||||||
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 context sensitive SLD content editor.
This class is intended to be used by a StyleConfigurator providing SLD style content.
An SLD 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.
Concepts:
This class also provides the ability to look up symbolizers by class against the "default rule". This allows configurators interested in a particular symbolizer to 'track' the instance of it as the default rule is changed.
This base implementation works against the "first" rule in the Style. When providing a SLDConfigurator specific subclass (say for themeing) you may wish to connect the "defaultRule" up to the current rule.
You may also supply context sensitive overrrides for color, simply override the methods such as color( LineSymbolizer line ) to return the correct default when a line is null.
Constructor Summary | |
---|---|
SLDContentManager()
Creates the SLD content manager. |
|
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 |
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()
|
|
|
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(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, Style style)
styleBuilder
- The builder object used to create style content.style
- The SLD style itself.Method Detail |
---|
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 FeatureTypeStyle getDefaultFeatureTypeStyle()
public FeatureTypeStyle getFeatureTypeStyle(java.lang.String name)
name
- The name of the feature type style.
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 |