use of org.geotools.styling.PolygonSymbolizer in project sldeditor by robward-scisys.
the class SLDTreeLeafFactoryTest method testUpdateStroke.
/**
* Test method for
* {@link com.sldeditor.common.tree.leaf.SLDTreeLeafFactory#updateStroke(boolean, org.opengis.style.Symbolizer)}.
*/
@Test
public void testUpdateStroke() {
assertNull(SLDTreeLeafFactory.getInstance().updateStroke(true, null));
PolygonSymbolizer polygonSymbolizer = DefaultSymbols.createDefaultPolygonSymbolizer();
assertEquals(SLDTreeLeafFactory.getInstance().updateStroke(false, polygonSymbolizer), styleFactory.getDefaultStroke());
assertTrue(SLDTreeLeafFactory.getInstance().updateStroke(true, polygonSymbolizer) != null);
PointSymbolizer pointSymbolizer = DefaultSymbols.createDefaultPointSymbolizer();
assertEquals(SLDTreeLeafFactory.getInstance().updateStroke(false, pointSymbolizer), styleFactory.getDefaultStroke());
assertTrue(SLDTreeLeafFactory.getInstance().updateStroke(true, pointSymbolizer) != null);
LineSymbolizer lineSymbolizer = DefaultSymbols.createDefaultLineSymbolizer();
assertEquals(SLDTreeLeafFactory.getInstance().updateStroke(false, lineSymbolizer), styleFactory.getDefaultStroke());
assertEquals(SLDTreeLeafFactory.getInstance().updateStroke(true, lineSymbolizer), styleFactory.getDefaultStroke());
TextSymbolizer textSymbolizer = DefaultSymbols.createDefaultTextSymbolizer();
assertEquals(SLDTreeLeafFactory.getInstance().updateStroke(false, textSymbolizer), styleFactory.getDefaultStroke());
assertEquals(SLDTreeLeafFactory.getInstance().updateStroke(true, textSymbolizer), styleFactory.getDefaultStroke());
}
use of org.geotools.styling.PolygonSymbolizer 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.PolygonSymbolizer 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.PolygonSymbolizer 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.PolygonSymbolizer in project sldeditor by robward-scisys.
the class SLDTreeLeafPolygonTest method testCreateFill.
/**
* Test method for {@link com.sldeditor.common.tree.leaf.SLDTreeLeafPolygon#createFill(org.opengis.style.Symbolizer)}.
*/
@Test
public void testCreateFill() {
SLDTreeLeafPolygon leaf = new SLDTreeLeafPolygon();
PolygonSymbolizer polygonSymbolizer = DefaultSymbols.createDefaultPolygonSymbolizer();
polygonSymbolizer.setFill(null);
leaf.createFill(polygonSymbolizer);
assertTrue(polygonSymbolizer.getFill() != null);
}
Aggregations