Search in sources :

Example 21 with TextSymbolizer

use of org.geotools.styling.TextSymbolizer in project sldeditor by robward-scisys.

the class SLDTreeLeafFactoryTest method testIsItemSelected.

/**
 * Test method for
 * {@link com.sldeditor.common.tree.leaf.SLDTreeLeafFactory#isItemSelected(java.lang.Object, org.geotools.styling.Symbolizer)}.
 */
@Test
public void testIsItemSelected() {
    assertFalse(SLDTreeLeafFactory.getInstance().isItemSelected(null, null));
    PolygonSymbolizer polygonSymbolizer = DefaultSymbols.createDefaultPolygonSymbolizer();
    assertTrue(SLDTreeLeafFactory.getInstance().isItemSelected(styleFactory.getDefaultFill(), polygonSymbolizer));
    assertTrue(SLDTreeLeafFactory.getInstance().isItemSelected(styleFactory.getDefaultStroke(), polygonSymbolizer));
    PointSymbolizer pointSymbolizer = DefaultSymbols.createDefaultPointSymbolizer();
    assertTrue(SLDTreeLeafFactory.getInstance().isItemSelected(styleFactory.getDefaultFill(), pointSymbolizer));
    assertFalse(SLDTreeLeafFactory.getInstance().isItemSelected(styleFactory.getDefaultStroke(), pointSymbolizer));
    LineSymbolizer lineSymbolizer = DefaultSymbols.createDefaultLineSymbolizer();
    assertFalse(SLDTreeLeafFactory.getInstance().isItemSelected(styleFactory.getDefaultFill(), lineSymbolizer));
    assertTrue(SLDTreeLeafFactory.getInstance().isItemSelected(styleFactory.getDefaultStroke(), lineSymbolizer));
    TextSymbolizer textSymbolizer = DefaultSymbols.createDefaultTextSymbolizer();
    assertFalse(SLDTreeLeafFactory.getInstance().isItemSelected(styleFactory.getDefaultFill(), textSymbolizer));
    assertFalse(SLDTreeLeafFactory.getInstance().isItemSelected(styleFactory.getDefaultStroke(), 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 22 with TextSymbolizer

use of org.geotools.styling.TextSymbolizer in project sldeditor by robward-scisys.

the class SLDTreeLeafFactoryTest method testHasFill.

/**
 * Test method for
 * {@link com.sldeditor.common.tree.leaf.SLDTreeLeafFactory#hasFill(org.opengis.style.Symbolizer)}.
 */
@Test
public void testHasFill() {
    PolygonSymbolizer polygonSymbolizer = DefaultSymbols.createDefaultPolygonSymbolizer();
    PointSymbolizer pointSymbolizer = DefaultSymbols.createDefaultPointSymbolizer();
    // CHECKSTYLE:OFF
    LineSymbolizer lineSymbolizer = DefaultSymbols.createDefaultLineSymbolizer();
    TextSymbolizer textSymbolizer = DefaultSymbols.createDefaultTextSymbolizer();
    // CHECKSTYLE:ON
    assertFalse(SLDTreeLeafFactory.getInstance().hasFill(null));
    assertTrue(SLDTreeLeafFactory.getInstance().hasFill(polygonSymbolizer));
    assertTrue(SLDTreeLeafFactory.getInstance().hasFill(pointSymbolizer));
    assertFalse(SLDTreeLeafFactory.getInstance().hasFill(lineSymbolizer));
    assertFalse(SLDTreeLeafFactory.getInstance().hasFill(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 23 with TextSymbolizer

use of org.geotools.styling.TextSymbolizer in project sldeditor by robward-scisys.

the class SLDTreeLeafFactoryTest method testGetStroke.

/**
 * Test method for
 * {@link com.sldeditor.common.tree.leaf.SLDTreeLeafFactory#getStroke(org.opengis.style.Symbolizer)}.
 */
@Test
public void testGetStroke() {
    PolygonSymbolizer polygonSymbolizer = DefaultSymbols.createDefaultPolygonSymbolizer();
    // CHECKSTYLE:OFF
    PointSymbolizer pointSymbolizer = DefaultSymbols.createDefaultPointSymbolizer();
    LineSymbolizer lineSymbolizer = DefaultSymbols.createDefaultLineSymbolizer();
    TextSymbolizer textSymbolizer = DefaultSymbols.createDefaultTextSymbolizer();
    // CHECKSTYLE:ON
    assertNull(SLDTreeLeafFactory.getInstance().getStroke(null));
    assertTrue(SLDTreeLeafFactory.getInstance().getStroke(polygonSymbolizer) != null);
    assertTrue(SLDTreeLeafFactory.getInstance().getStroke(lineSymbolizer) != null);
    // Returns default stroke
    assertTrue(SLDTreeLeafFactory.getInstance().getStroke(pointSymbolizer) != null);
    assertTrue(SLDTreeLeafFactory.getInstance().getStroke(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 24 with TextSymbolizer

use of org.geotools.styling.TextSymbolizer in project sldeditor by robward-scisys.

the class SLDTreeLeafTextTest method testRemoveFill.

/**
 * Test method for {@link com.sldeditor.common.tree.leaf.SLDTreeLeafText#removeFill(org.opengis.style.Symbolizer)}.
 */
@Test
public void testRemoveFill() {
    SLDTreeLeafText leaf = new SLDTreeLeafText();
    TextSymbolizer textSymbolizer = DefaultSymbols.createDefaultTextSymbolizer();
    leaf.removeFill(textSymbolizer);
// Does nothing
}
Also used : TextSymbolizer(org.geotools.styling.TextSymbolizer) SLDTreeLeafText(com.sldeditor.common.tree.leaf.SLDTreeLeafText) Test(org.junit.Test)

Example 25 with TextSymbolizer

use of org.geotools.styling.TextSymbolizer in project sldeditor by robward-scisys.

the class SLDTreeLeafTextTest method testCreateFill.

/**
 * Test method for {@link com.sldeditor.common.tree.leaf.SLDTreeLeafText#createFill(org.opengis.style.Symbolizer)}.
 */
@Test
public void testCreateFill() {
    SLDTreeLeafText leaf = new SLDTreeLeafText();
    TextSymbolizer textSymbolizer = DefaultSymbols.createDefaultTextSymbolizer();
    leaf.createFill(textSymbolizer);
// Does nothing
}
Also used : TextSymbolizer(org.geotools.styling.TextSymbolizer) SLDTreeLeafText(com.sldeditor.common.tree.leaf.SLDTreeLeafText) Test(org.junit.Test)

Aggregations

TextSymbolizer (org.geotools.styling.TextSymbolizer)33 Test (org.junit.Test)19 Font (org.geotools.styling.Font)9 PointSymbolizer (org.geotools.styling.PointSymbolizer)9 Rule (org.geotools.styling.Rule)9 FeatureTypeStyle (org.geotools.styling.FeatureTypeStyle)8 LineSymbolizer (org.geotools.styling.LineSymbolizer)8 PolygonSymbolizer (org.geotools.styling.PolygonSymbolizer)8 Style (org.geotools.styling.Style)8 StyledLayerDescriptor (org.geotools.styling.StyledLayerDescriptor)6 NamedLayer (org.geotools.styling.NamedLayer)5 SLDTreeLeafText (com.sldeditor.common.tree.leaf.SLDTreeLeafText)4 SLDData (com.sldeditor.common.data.SLDData)3 StyleWrapper (com.sldeditor.common.data.StyleWrapper)3 SLDWriterInterface (com.sldeditor.common.output.SLDWriterInterface)3 VendorOptionPresent (com.sldeditor.common.vendoroption.minversion.VendorOptionPresent)3 FieldIdEnum (com.sldeditor.common.xml.ui.FieldIdEnum)3 BatchUpdateFontData (com.sldeditor.tool.batchupdatefont.BatchUpdateFontData)3 StyleFactoryImpl (org.geotools.styling.StyleFactoryImpl)3 Symbolizer (org.geotools.styling.Symbolizer)3