Search in sources :

Example 6 with SLDTreeLeafPoint

use of com.sldeditor.common.tree.leaf.SLDTreeLeafPoint in project sldeditor by robward-scisys.

the class SLDTreeLeafPointTest method testGetSymbolizer.

/**
 * Test method for {@link com.sldeditor.common.tree.leaf.SLDTreeLeafPoint#getSymbolizer()}.
 */
@Test
public void testGetSymbolizer() {
    SLDTreeLeafPoint leaf = new SLDTreeLeafPoint();
    assertEquals(PointSymbolizerImpl.class, leaf.getSymbolizer());
}
Also used : SLDTreeLeafPoint(com.sldeditor.common.tree.leaf.SLDTreeLeafPoint) Test(org.junit.Test)

Example 7 with SLDTreeLeafPoint

use of com.sldeditor.common.tree.leaf.SLDTreeLeafPoint in project sldeditor by robward-scisys.

the class SLDTreeLeafPointTest method testGetFill.

/**
 * Test method for
 * {@link com.sldeditor.common.tree.leaf.SLDTreeLeafPoint#getFill(org.opengis.style.Symbolizer)}.
 */
@Test
public void testGetFill() {
    SLDTreeLeafPoint leaf = new SLDTreeLeafPoint();
    assertNull(leaf.getFill(null));
    assertNull(leaf.getFill(DefaultSymbols.createDefaultPolygonSymbolizer()));
    PointSymbolizer pointSymbolizer = DefaultSymbols.createDefaultPointSymbolizer();
    Fill expectedFill = null;
    Graphic graphic = pointSymbolizer.getGraphic();
    if (graphic != null) {
        List<GraphicalSymbol> symbolList = graphic.graphicalSymbols();
        if ((symbolList != null) && !symbolList.isEmpty()) {
            GraphicalSymbol obj = symbolList.get(0);
            if (obj != null) {
                if (obj instanceof MarkImpl) {
                    MarkImpl mark = (MarkImpl) obj;
                    expectedFill = mark.getFill();
                }
            }
        }
    }
    assertEquals(expectedFill, leaf.getFill(pointSymbolizer));
}
Also used : PointSymbolizer(org.geotools.styling.PointSymbolizer) Fill(org.geotools.styling.Fill) Graphic(org.geotools.styling.Graphic) GraphicalSymbol(org.opengis.style.GraphicalSymbol) SLDTreeLeafPoint(com.sldeditor.common.tree.leaf.SLDTreeLeafPoint) MarkImpl(org.geotools.styling.MarkImpl) Test(org.junit.Test)

Example 8 with SLDTreeLeafPoint

use of com.sldeditor.common.tree.leaf.SLDTreeLeafPoint in project sldeditor by robward-scisys.

the class SLDTreeLeafPointTest method testCreateFill.

/**
 * Test method for
 * {@link com.sldeditor.common.tree.leaf.SLDTreeLeafPoint#createFill(org.opengis.style.Symbolizer)}.
 */
@Test
public void testCreateFill() {
    SLDTreeLeafPoint leaf = new SLDTreeLeafPoint();
    PointSymbolizer pointSymbolizer = DefaultSymbols.createDefaultPointSymbolizer();
    pointSymbolizer.setGraphic(null);
    leaf.createFill(pointSymbolizer);
    assertTrue(pointSymbolizer.getGraphic() != null);
}
Also used : PointSymbolizer(org.geotools.styling.PointSymbolizer) SLDTreeLeafPoint(com.sldeditor.common.tree.leaf.SLDTreeLeafPoint) Test(org.junit.Test)

Example 9 with SLDTreeLeafPoint

use of com.sldeditor.common.tree.leaf.SLDTreeLeafPoint in project sldeditor by robward-scisys.

the class SLDTreeLeafPointTest method testRemoveFill.

/**
 * Test method for
 * {@link com.sldeditor.common.tree.leaf.SLDTreeLeafPoint#removeFill(org.opengis.style.Symbolizer)}.
 */
@Test
public void testRemoveFill() {
    SLDTreeLeafPoint leaf = new SLDTreeLeafPoint();
    PointSymbolizer pointSymbolizer = DefaultSymbols.createDefaultPointSymbolizer();
    leaf.removeFill(pointSymbolizer);
    assertNull(pointSymbolizer.getGraphic());
}
Also used : PointSymbolizer(org.geotools.styling.PointSymbolizer) SLDTreeLeafPoint(com.sldeditor.common.tree.leaf.SLDTreeLeafPoint) Test(org.junit.Test)

Aggregations

SLDTreeLeafPoint (com.sldeditor.common.tree.leaf.SLDTreeLeafPoint)9 Test (org.junit.Test)9 PointSymbolizer (org.geotools.styling.PointSymbolizer)8 Fill (org.geotools.styling.Fill)1 Graphic (org.geotools.styling.Graphic)1 MarkImpl (org.geotools.styling.MarkImpl)1 GraphicalSymbol (org.opengis.style.GraphicalSymbol)1