<!ATTLIST extension
point CDATA #REQUIRED>
A style is used for rendering purposes. Renderers use style objects when rendering Layer data. A style can be any object. Extenders are expected to create the style object itself, as well as an implementation of StyleContent which is uses a factory for the style. Style objects are placed onto a Layer blackboard so they can be accessed by other entities such as Renderers and StyleConfigurators.
<!ELEMENT style EMPTY>
<!ATTLIST style
id CDATA #REQUIRED
name CDATA #REQUIRED
class CDATA #REQUIRED>
A Style provided by a plugin author. Styles are only useful if they can be rendered so a style that extends this extension point should also have an associated renderer that know how to use the style.
SLDStyle is the Style included with uDig. It is essentially a adapter for Geotool's Style objects. The StyleMemento created by SLDStyle contains two properties: a type property which is set to SLDStyle and a version property which at the time of the UDIG version 1.0 release is set to 1.0. The StyleMemento contains an SLD document formatted string in its text field. The SLD document can be retrieved using the getTextData() method call. SLDEditor is the default Style Editor class has been included since the 0.5 release.
The following the code SLDStyle uses to create its StyleMemento:
//Write Style to a string in SLD format
SLDTransformer transformer=new SLDTransformer();
String out=null;
try {
out = transformer.transform(this);
} catch (TransformerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//create and fill out StyleMemento object
StyleMemento memo=new StyleMemento("SLDStyle", getName(), "net.refractions.udig.project.SLDStyle");
memo.putTextData(out);
memo.putString("type","SLDStyle");
memo.putString("version","1.0");
return memo;
Refractions Research Inc. 2004