use of org.geotools.styling.LineSymbolizer in project sldeditor by robward-scisys.
the class SLDTreeLeafFactoryTest method testGetFill.
/**
* Test method for
* {@link com.sldeditor.common.tree.leaf.SLDTreeLeafFactory#getFill(org.opengis.style.Symbolizer)}.
*/
@Test
public void testGetFill() {
PolygonSymbolizer polygonSymbolizer = DefaultSymbols.createDefaultPolygonSymbolizer();
PointSymbolizer pointSymbolizer = DefaultSymbols.createDefaultPointSymbolizer();
// CHECKSTYLE:OFF
LineSymbolizer lineSymbolizer = DefaultSymbols.createDefaultLineSymbolizer();
TextSymbolizer textSymbolizer = DefaultSymbols.createDefaultTextSymbolizer();
// CHECKSTYLE:ON
assertNull(SLDTreeLeafFactory.getInstance().getFill(null));
assertTrue(SLDTreeLeafFactory.getInstance().getFill(polygonSymbolizer) != null);
assertTrue(SLDTreeLeafFactory.getInstance().getFill(pointSymbolizer) != null);
// Returns default fill
assertTrue(SLDTreeLeafFactory.getInstance().getFill(lineSymbolizer) != null);
assertTrue(SLDTreeLeafFactory.getInstance().getFill(textSymbolizer) != null);
}
use of org.geotools.styling.LineSymbolizer in project sldeditor by robward-scisys.
the class SLDTreeLeafFactoryTest method testHasStroke.
/**
* Test method for
* {@link com.sldeditor.common.tree.leaf.SLDTreeLeafFactory#hasStroke(org.opengis.style.Symbolizer)}.
*/
@Test
public void testHasStroke() {
PolygonSymbolizer polygonSymbolizer = DefaultSymbols.createDefaultPolygonSymbolizer();
PointSymbolizer pointSymbolizer = DefaultSymbols.createDefaultPointSymbolizer();
// CHECKSTYLE:OFF
LineSymbolizer lineSymbolizer = DefaultSymbols.createDefaultLineSymbolizer();
TextSymbolizer textSymbolizer = DefaultSymbols.createDefaultTextSymbolizer();
// CHECKSTYLE:ON
assertFalse(SLDTreeLeafFactory.getInstance().hasStroke(null));
assertTrue(SLDTreeLeafFactory.getInstance().hasStroke(polygonSymbolizer));
assertFalse(SLDTreeLeafFactory.getInstance().hasStroke(pointSymbolizer));
assertTrue(SLDTreeLeafFactory.getInstance().hasStroke(lineSymbolizer));
assertFalse(SLDTreeLeafFactory.getInstance().hasStroke(textSymbolizer));
}
use of org.geotools.styling.LineSymbolizer in project sldeditor by robward-scisys.
the class SLDTreeLeafLineTest method testGetStroke.
/**
* Test method for {@link com.sldeditor.common.tree.leaf.SLDTreeLeafLine#getStroke(org.opengis.style.Symbolizer)}.
*/
@Test
public void testGetStroke() {
SLDTreeLeafLine leaf = new SLDTreeLeafLine();
assertNull(leaf.getStroke(null));
PolygonSymbolizer polygonSymbolizer = DefaultSymbols.createDefaultPolygonSymbolizer();
assertNull(leaf.getStroke(polygonSymbolizer));
LineSymbolizer lineSymbolizer = DefaultSymbols.createDefaultLineSymbolizer();
Stroke stroke = leaf.getStroke(lineSymbolizer);
assertEquals(stroke, lineSymbolizer.getStroke());
}
use of org.geotools.styling.LineSymbolizer in project sldeditor by robward-scisys.
the class NewLineSLDTest method testNewLineSLD.
/**
* Test new line sld.
*/
@Test
public void testNewLineSLD() {
NewLineSLD newData = new NewLineSLD();
StyledLayerDescriptor sld = newData.create();
assertTrue(sld.layers().size() == 1);
StyledLayer styledLayer = sld.layers().get(0);
NamedLayer namedLayer = (NamedLayer) styledLayer;
Symbolizer symbolizer = namedLayer.styles().get(0).featureTypeStyles().get(0).rules().get(0).symbolizers().get(0);
assertTrue(symbolizer instanceof LineSymbolizer);
}
use of org.geotools.styling.LineSymbolizer in project polymap4-core by Polymap4.
the class DefaultStyles method createLineStyle.
/**
* Create a Style to draw line features as thin blue lines
*/
public static Style createLineStyle(Style style) {
Stroke stroke = sf.createStroke(ff.literal(Color.DARK_GRAY), ff.literal(0.5));
/*
* Setting the geometryPropertyName arg to null signals that we want to
* draw the default geometry of features
*/
LineSymbolizer sym = sf.createLineSymbolizer(stroke, null);
Rule rule = sf.createRule();
rule.symbolizers().add(sym);
rule.setName("Rule for LineSymbolizer");
style.featureTypeStyles().get(0).rules().add(rule);
return style;
}
Aggregations