Hi all,
I have been looking at styling and come up with some issues. The first
is with StyleFactory. As an example consider the schema definition of
Stroke:
<xsd:complexType>
<xsd:sequence>
<xsd:choice minOccurs="0">
<xsd:element ref="sld:GraphicFill"/>
<xsd:element ref="sld:GraphicStroke"/>
</xsd:choice>
<xsd:element ref="sld:CssParameter" minOccurs="0"
maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
This definition implies that specifying the color of the stroke is
optional. And indeed the spec says the default color is black when not
explicitly specified. However the way StyleFactory is written one must
supply a color. If I call:
styleFactory.createStroke(null,...);
An exception is thrown. It would be nice to have some notion of the
defaults for a stroke.
This could look like:
interface Stroke {
static final LiteralExpression COLOR = ConstantExpression.BLACK;
static final LiteralExpression WIDTH = ConstantExpression.ONE;
...
}
Taking this a step further is coming up with an stroke implementation
that contains nothing but defaults useful for types in which "Stroke" is
optional.
interface Stroke {
static final static final Stroke STROKE = new ConstantStroke(){
public Expression getColor() {
return COLOR;
}
public Expression getWidth() {
return WIDTH;
}
...
}
}
Anyone have any thoughts
-Justin
--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel