Search in sources :

Example 1 with VOGeoServerTextSymbolizer2

use of com.sldeditor.ui.detail.vendor.geoserver.text.VOGeoServerTextSymbolizer2 in project sldeditor by robward-scisys.

the class VOGeoServerTextSymbolizer2Test method testPopulateTextSymbolizer.

/**
 * Test method for {@link
 * com.sldeditor.ui.detail.vendor.geoserver.text.VOGeoServerTextSymbolizer2#populate(org.geotools.styling.TextSymbolizer)}.
 */
@Test
public void testPopulateTextSymbolizer() {
    TextSymbolizerDetails panel = new TextSymbolizerDetails();
    VOGeoServerTextSymbolizer2 testObj = new VOGeoServerTextSymbolizer2(panel.getClass());
    TextSymbolizer symbolizer = null;
    testObj.populate(symbolizer);
}
Also used : TextSymbolizer(org.geotools.styling.TextSymbolizer) VOGeoServerTextSymbolizer2(com.sldeditor.ui.detail.vendor.geoserver.text.VOGeoServerTextSymbolizer2) TextSymbolizerDetails(com.sldeditor.ui.detail.TextSymbolizerDetails) Test(org.junit.jupiter.api.Test)

Example 2 with VOGeoServerTextSymbolizer2

use of com.sldeditor.ui.detail.vendor.geoserver.text.VOGeoServerTextSymbolizer2 in project sldeditor by robward-scisys.

the class VOGeoServerTextSymbolizer2Test method testPopulatePolygonSymbolizer.

/**
 * Test method for {@link
 * com.sldeditor.ui.detail.vendor.geoserver.text.VOGeoServerTextSymbolizer2#populate(org.geotools.styling.PolygonSymbolizer)}.
 */
@Test
public void testPopulatePolygonSymbolizer() {
    TextSymbolizerDetails panel = new TextSymbolizerDetails();
    VOGeoServerTextSymbolizer2 testObj = new VOGeoServerTextSymbolizer2(panel.getClass());
    PolygonSymbolizer symbolizer = null;
    testObj.updateSymbol(symbolizer);
}
Also used : PolygonSymbolizer(org.geotools.styling.PolygonSymbolizer) VOGeoServerTextSymbolizer2(com.sldeditor.ui.detail.vendor.geoserver.text.VOGeoServerTextSymbolizer2) TextSymbolizerDetails(com.sldeditor.ui.detail.TextSymbolizerDetails) Test(org.junit.jupiter.api.Test)

Example 3 with VOGeoServerTextSymbolizer2

use of com.sldeditor.ui.detail.vendor.geoserver.text.VOGeoServerTextSymbolizer2 in project sldeditor by robward-scisys.

the class VOGeoServerTextSymbolizer2Test method testVOGeoServerTextSymbolizer2.

/**
 * Test method for {@link
 * com.sldeditor.ui.detail.vendor.geoserver.text.VOGeoServerTextSymbolizer2#VOGeoServerTextSymbolizer2(java.lang.Class,
 * com.sldeditor.filter.v2.function.FunctionNameInterface)}.
 */
@Test
public void testVOGeoServerTextSymbolizer2() {
    TextSymbolizerDetails panel = new TextSymbolizerDetails();
    TextSymbolizer2 textSymbolizer = null;
    VOGeoServerTextSymbolizer2 testObj = new VOGeoServerTextSymbolizer2(panel.getClass());
    testObj.setParentPanel(panel);
    testObj.populate(textSymbolizer);
    testObj.updateSymbol(textSymbolizer);
    StyleFactoryImpl styleFactory = (StyleFactoryImpl) CommonFactoryFinder.getStyleFactory();
    textSymbolizer = (TextSymbolizer2) styleFactory.createTextSymbolizer();
    FilterFactory ff = CommonFactoryFinder.getFilterFactory();
    Literal featureDescription = ff.literal("feature description");
    textSymbolizer.setFeatureDescription(featureDescription);
    OtherText otherText = new OtherTextImpl();
    otherText.setTarget("target");
    Literal otherTextExpression = ff.literal("other text");
    otherText.setText(otherTextExpression);
    textSymbolizer.setOtherText(otherText);
    Literal snippet = ff.literal("snippet");
    textSymbolizer.setSnippet(snippet);
    // Try with marker symbol
    Graphic graphic = styleFactory.createDefaultGraphic();
    graphic.graphicalSymbols().add(styleFactory.createMark());
    textSymbolizer.setGraphic(graphic);
    Controller.getInstance().setPopulating(true);
    testObj.populate(textSymbolizer);
    Controller.getInstance().setPopulating(false);
    testObj.updateSymbol(textSymbolizer);
    // Try with external graphic
    graphic = styleFactory.createDefaultGraphic();
    try {
        graphic.graphicalSymbols().add(styleFactory.createExternalGraphic(new File("test.png").toURI().toURL(), "png"));
    } catch (MalformedURLException e) {
        e.printStackTrace();
    }
    textSymbolizer.setGraphic(graphic);
    Controller.getInstance().setPopulating(true);
    testObj.populate(textSymbolizer);
    Controller.getInstance().setPopulating(false);
    testObj.updateSymbol(textSymbolizer);
    // Find minimum version with textSymbolizer2 values set
    List<VendorOptionPresent> vendorOptionsPresentList = new ArrayList<VendorOptionPresent>();
    testObj.getMinimumVersion(null, textSymbolizer, vendorOptionsPresentList);
    assertEquals(1, vendorOptionsPresentList.size());
    // Find minimum version with no textSymbolizer2 values set
    vendorOptionsPresentList.clear();
    testObj.getMinimumVersion(null, styleFactory.createTextSymbolizer(), vendorOptionsPresentList);
    assertEquals(0, vendorOptionsPresentList.size());
    // Get the code coverage values up
    testObj.populate(SelectedSymbol.getInstance());
    PolygonSymbolizer polygon = null;
    testObj.populate(polygon);
    testObj.updateSymbol(polygon);
    RasterSymbolizer raster = null;
    testObj.populate(raster);
    testObj.updateSymbol(raster);
    testObj.preLoadSymbol();
    assertTrue(testObj.isDataPresent());
}
Also used : VendorOptionPresent(com.sldeditor.common.vendoroption.minversion.VendorOptionPresent) MalformedURLException(java.net.MalformedURLException) PolygonSymbolizer(org.geotools.styling.PolygonSymbolizer) Graphic(org.geotools.styling.Graphic) ArrayList(java.util.ArrayList) OtherText(org.geotools.styling.OtherText) FilterFactory(org.opengis.filter.FilterFactory) RasterSymbolizer(org.geotools.styling.RasterSymbolizer) OtherTextImpl(org.geotools.styling.OtherTextImpl) VOGeoServerTextSymbolizer2(com.sldeditor.ui.detail.vendor.geoserver.text.VOGeoServerTextSymbolizer2) TextSymbolizer2(org.geotools.styling.TextSymbolizer2) StyleFactoryImpl(org.geotools.styling.StyleFactoryImpl) Literal(org.opengis.filter.expression.Literal) VOGeoServerTextSymbolizer2(com.sldeditor.ui.detail.vendor.geoserver.text.VOGeoServerTextSymbolizer2) File(java.io.File) TextSymbolizerDetails(com.sldeditor.ui.detail.TextSymbolizerDetails) Test(org.junit.jupiter.api.Test)

Example 4 with VOGeoServerTextSymbolizer2

use of com.sldeditor.ui.detail.vendor.geoserver.text.VOGeoServerTextSymbolizer2 in project sldeditor by robward-scisys.

the class VOGeoServerTextSymbolizer2Test method testUpdateSymbolSelectedChannelType.

/**
 * Test method for {@link
 * com.sldeditor.ui.detail.vendor.geoserver.text.VOGeoServerTextSymbolizer2#updateSymbol(org.geotools.styling.SelectedChannelType)}.
 */
@Test
void testUpdateSymbolSelectedChannelType() {
    TextSymbolizerDetails panel = new TextSymbolizerDetails();
    VOGeoServerTextSymbolizer2 testObj = new VOGeoServerTextSymbolizer2(panel.getClass());
    SelectedChannelType channelType = null;
    testObj.updateSymbol(channelType);
}
Also used : SelectedChannelType(org.geotools.styling.SelectedChannelType) VOGeoServerTextSymbolizer2(com.sldeditor.ui.detail.vendor.geoserver.text.VOGeoServerTextSymbolizer2) TextSymbolizerDetails(com.sldeditor.ui.detail.TextSymbolizerDetails) Test(org.junit.jupiter.api.Test)

Example 5 with VOGeoServerTextSymbolizer2

use of com.sldeditor.ui.detail.vendor.geoserver.text.VOGeoServerTextSymbolizer2 in project sldeditor by robward-scisys.

the class VOGeoServerTextSymbolizer2Test method testDataChanged.

/**
 * Test method for {@link
 * com.sldeditor.ui.detail.vendor.geoserver.text.VOGeoServerTextSymbolizer2#dataChanged(com.sldeditor.common.xml.ui.FieldIdEnum)}.
 */
@Test
public void testDataChanged() {
    TextSymbolizerDetails panel = new TextSymbolizerDetails();
    VOGeoServerTextSymbolizer2 testObj = new VOGeoServerTextSymbolizer2(panel.getClass());
    testObj.dataChanged(FieldIdEnum.ANGLE);
}
Also used : VOGeoServerTextSymbolizer2(com.sldeditor.ui.detail.vendor.geoserver.text.VOGeoServerTextSymbolizer2) TextSymbolizerDetails(com.sldeditor.ui.detail.TextSymbolizerDetails) Test(org.junit.jupiter.api.Test)

Aggregations

TextSymbolizerDetails (com.sldeditor.ui.detail.TextSymbolizerDetails)22 VOGeoServerTextSymbolizer2 (com.sldeditor.ui.detail.vendor.geoserver.text.VOGeoServerTextSymbolizer2)22 Test (org.junit.jupiter.api.Test)22 PolygonSymbolizer (org.geotools.styling.PolygonSymbolizer)3 RasterSymbolizer (org.geotools.styling.RasterSymbolizer)3 VendorOptionPresent (com.sldeditor.common.vendoroption.minversion.VendorOptionPresent)2 FeatureTypeStyle (org.geotools.styling.FeatureTypeStyle)2 SelectedChannelType (org.geotools.styling.SelectedChannelType)2 TextSymbolizer (org.geotools.styling.TextSymbolizer)2 TextSymbolizer2 (org.geotools.styling.TextSymbolizer2)2 FilterFactory (org.opengis.filter.FilterFactory)2 SelectedSymbol (com.sldeditor.common.data.SelectedSymbol)1 FieldIdEnum (com.sldeditor.common.xml.ui.FieldIdEnum)1 UpdateSymbolInterface (com.sldeditor.ui.iface.UpdateSymbolInterface)1 File (java.io.File)1 MalformedURLException (java.net.MalformedURLException)1 ArrayList (java.util.ArrayList)1 Graphic (org.geotools.styling.Graphic)1 OtherText (org.geotools.styling.OtherText)1 OtherTextImpl (org.geotools.styling.OtherTextImpl)1