Search in sources :

Example 26 with PolygonSymbolizer

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());
}
Also used : PointSymbolizer(org.geotools.styling.PointSymbolizer) PolygonSymbolizer(org.geotools.styling.PolygonSymbolizer) TextSymbolizer(org.geotools.styling.TextSymbolizer) LineSymbolizer(org.geotools.styling.LineSymbolizer) Test(org.junit.Test)

Example 27 with PolygonSymbolizer

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);
}
Also used : PointSymbolizer(org.geotools.styling.PointSymbolizer) PolygonSymbolizer(org.geotools.styling.PolygonSymbolizer) TextSymbolizer(org.geotools.styling.TextSymbolizer) LineSymbolizer(org.geotools.styling.LineSymbolizer) Test(org.junit.Test)

Example 28 with PolygonSymbolizer

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));
}
Also used : PointSymbolizer(org.geotools.styling.PointSymbolizer) PolygonSymbolizer(org.geotools.styling.PolygonSymbolizer) TextSymbolizer(org.geotools.styling.TextSymbolizer) LineSymbolizer(org.geotools.styling.LineSymbolizer) Test(org.junit.Test)

Example 29 with PolygonSymbolizer

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());
}
Also used : SLDTreeLeafLine(com.sldeditor.common.tree.leaf.SLDTreeLeafLine) Stroke(org.geotools.styling.Stroke) PolygonSymbolizer(org.geotools.styling.PolygonSymbolizer) LineSymbolizer(org.geotools.styling.LineSymbolizer) Test(org.junit.Test)

Example 30 with PolygonSymbolizer

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);
}
Also used : PolygonSymbolizer(org.geotools.styling.PolygonSymbolizer) SLDTreeLeafPolygon(com.sldeditor.common.tree.leaf.SLDTreeLeafPolygon) Test(org.junit.Test)

Aggregations

PolygonSymbolizer (org.geotools.styling.PolygonSymbolizer)65 Test (org.junit.Test)28 PointSymbolizer (org.geotools.styling.PointSymbolizer)25 LineSymbolizer (org.geotools.styling.LineSymbolizer)24 FeatureTypeStyle (org.geotools.styling.FeatureTypeStyle)19 Rule (org.geotools.styling.Rule)18 Style (org.geotools.styling.Style)18 Symbolizer (org.geotools.styling.Symbolizer)15 Fill (org.geotools.styling.Fill)14 NamedLayer (org.geotools.styling.NamedLayer)12 StyledLayerDescriptor (org.geotools.styling.StyledLayerDescriptor)12 Stroke (org.geotools.styling.Stroke)10 RasterSymbolizer (org.geotools.styling.RasterSymbolizer)9 TextSymbolizer (org.geotools.styling.TextSymbolizer)9 SLDTreeLeafPolygon (com.sldeditor.common.tree.leaf.SLDTreeLeafPolygon)8 Graphic (org.geotools.styling.Graphic)8 ArrayList (java.util.ArrayList)7 Expression (org.opengis.filter.expression.Expression)7 JsonObject (com.google.gson.JsonObject)5 SelectedSymbol (com.sldeditor.common.data.SelectedSymbol)5